Skip to content

Commit ad9b314

Browse files
committed
Hide tooltip on all other cells if length is less than TRUNCATE_LENGTH
1 parent 873e969 commit ad9b314

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

src/lib/components/workflow/workflows-summary-configurable-table/table-body-cell.svelte

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
routeForWorkerDeployment,
2424
routeForWorkflow,
2525
} from '$lib/utilities/route-for';
26-
import { truncateValue } from '$lib/utilities/truncate-value';
26+
import {
27+
TRUNCATE_LENGTH,
28+
truncateValue,
29+
} from '$lib/utilities/truncate-value';
2730
import { isWorkflowTaskFailure } from '$lib/utilities/workflow-task-failures';
2831
2932
import FilterableTableCell from './filterable-table-cell.svelte';
@@ -73,6 +76,12 @@
7376
'Build ID',
7477
'Scheduled By ID',
7578
];
79+
80+
const hideTooltip = (value: string | undefined) => {
81+
return (
82+
!truncate || (truncate && truncateValue(value).length <= TRUNCATE_LENGTH)
83+
);
84+
};
7685
</script>
7786

7887
{#if filterableLabels.includes(label) || isCustomKeywordOrTextAttribute}
@@ -216,15 +225,20 @@
216225
options={{ format: truncate ? 'short' : 'long' }}
217226
/>
218227
{:else if label === 'Task Queue'}
219-
<Tooltip text={workflow.taskQueue} top class="min-w-0" hide={!truncate}>
228+
<Tooltip
229+
text={workflow.taskQueue}
230+
top
231+
class="min-w-0"
232+
hide={hideTooltip(workflow.taskQueue)}
233+
>
220234
{truncate ? truncateValue(workflow.taskQueue) : workflow.taskQueue}
221235
</Tooltip>
222236
{:else if label === 'Parent Namespace'}
223237
<Tooltip
224238
text={workflow?.parentNamespaceId ?? ''}
225239
top
226240
class="min-w-0"
227-
hide={!truncate}
241+
hide={hideTooltip(workflow?.parentNamespaceId)}
228242
>
229243
{truncate
230244
? truncateValue(workflow?.parentNamespaceId ?? '')
@@ -255,7 +269,9 @@
255269
''}
256270
top
257271
class="min-w-0"
258-
hide={!truncate}
272+
hide={hideTooltip(
273+
workflow.searchAttributes?.indexedFields?.TemporalScheduledById,
274+
)}
259275
>
260276
{truncate
261277
? truncateValue(
@@ -286,7 +302,7 @@
286302
{:else if $customSearchAttributes[label] === SEARCH_ATTRIBUTE_TYPE.BOOL}
287303
<Badge>{content}</Badge>
288304
{:else}
289-
<Tooltip text={content} top class="min-w-0" hide={!truncate}>
305+
<Tooltip text={content} top class="min-w-0" hide={hideTooltip(content)}>
290306
{truncate ? truncateValue(content) : content}
291307
</Tooltip>
292308
{/if}

0 commit comments

Comments
 (0)