-
Notifications
You must be signed in to change notification settings - Fork 146
Workflows Table Row Density #3285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
873b891
7d3bcf2
2d185ae
eb80116
3e3df40
02595b2
105732d
ffb8faf
ccb427e
3638466
873e969
ad9b314
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,12 +4,14 @@ | |
| import Timestamp from '$lib/components/timestamp.svelte'; | ||
| import WorkflowStatus from '$lib/components/workflow-status.svelte'; | ||
| import Badge from '$lib/holocene/badge.svelte'; | ||
| import Tooltip from '$lib/holocene/tooltip.svelte'; | ||
| import type { ConfigurableTableHeader } from '$lib/stores/configurable-table-columns'; | ||
| import { | ||
| customSearchAttributes, | ||
| isCustomSearchAttribute, | ||
| workflowIncludesSearchAttribute, | ||
| } from '$lib/stores/search-attributes'; | ||
| import { tableDensity } from '$lib/stores/table-density'; | ||
| import { | ||
| SEARCH_ATTRIBUTE_TYPE, | ||
| type WorkflowExecution, | ||
|
|
@@ -22,6 +24,7 @@ | |
| routeForWorkerDeployment, | ||
| routeForWorkflow, | ||
| } from '$lib/utilities/route-for'; | ||
| import { truncateValue } from '$lib/utilities/truncate-value'; | ||
| import { isWorkflowTaskFailure } from '$lib/utilities/workflow-task-failures'; | ||
|
|
||
| import FilterableTableCell from './filterable-table-cell.svelte'; | ||
|
|
@@ -32,6 +35,7 @@ | |
| archival?: boolean; | ||
| }; | ||
| let { column, workflow, archival = false }: Props = $props(); | ||
| let truncate = $derived($tableDensity === 'compact'); | ||
|
Alex-Tideman marked this conversation as resolved.
Outdated
|
||
|
|
||
| const { label } = $derived(column); | ||
| const namespace = $derived(page.params.namespace); | ||
|
|
@@ -69,7 +73,8 @@ | |
|
|
||
| {#if filterableLabels.includes(label) || isCustomKeywordOrTextAttribute} | ||
| <td | ||
| class="workflows-summary-table-body-cell filterable" | ||
| class="workflows-summary-table-body-cell" | ||
| class:filterable={!truncate} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah was thinking about this, but if you don't have many columns, you aren't going to use Dense mode. I don't want to add a bunch of complexity here when its not really the point of the mode to use when you just have a couple of columns. |
||
| data-testid="workflows-summary-table-body-cell" | ||
| onmouseover={showFilterOrCopy} | ||
| onfocus={showFilterOrCopy} | ||
|
|
@@ -89,6 +94,7 @@ | |
| run: workflow.runId, | ||
| archival, | ||
| })} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Workflow ID'} | ||
| <FilterableTableCell | ||
|
|
@@ -101,6 +107,7 @@ | |
| run: workflow.runId, | ||
| archival, | ||
| })} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Run ID'} | ||
| <FilterableTableCell | ||
|
|
@@ -113,6 +120,7 @@ | |
| run: workflow.runId, | ||
| archival, | ||
| })} | ||
| truncate | ||
|
Alex-Tideman marked this conversation as resolved.
Outdated
|
||
| /> | ||
| {:else if label === 'Deployment'} | ||
| {@const deployment = | ||
|
|
@@ -127,6 +135,7 @@ | |
| deployment, | ||
| }) | ||
| : undefined} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Deployment Version'} | ||
| {@const version = | ||
|
|
@@ -136,6 +145,7 @@ | |
| {filterOrCopyButtonsVisible} | ||
| attribute="TemporalWorkerDeploymentVersion" | ||
| value={version && typeof version === 'string' ? version : ''} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Build ID'} | ||
| {@const buildId = | ||
|
|
@@ -148,6 +158,7 @@ | |
| {filterOrCopyButtonsVisible} | ||
| attribute="TemporalWorkerBuildId" | ||
| value={buildId && typeof buildId === 'string' ? buildId : ''} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Versioning Behavior'} | ||
| {@const behavior = | ||
|
|
@@ -157,6 +168,7 @@ | |
| {filterOrCopyButtonsVisible} | ||
| attribute="TemporalWorkflowVersioningBehavior" | ||
| value={behavior && typeof behavior === 'string' ? behavior : ''} | ||
| {truncate} | ||
| /> | ||
| {:else if isCustomKeywordOrTextAttribute} | ||
| {@const content = workflow.searchAttributes?.indexedFields?.[label]} | ||
|
|
@@ -165,6 +177,7 @@ | |
| attribute={label} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| value={content} | ||
| type={$customSearchAttributes[label]} | ||
| {truncate} | ||
| /> | ||
| {:else if label === 'Scheduled By ID'} | ||
| {@const scheduleId = | ||
|
|
@@ -173,13 +186,16 @@ | |
| {filterOrCopyButtonsVisible} | ||
| attribute="TemporalScheduledById" | ||
| value={scheduleId && typeof scheduleId === 'string' ? scheduleId : ''} | ||
| {truncate} | ||
| /> | ||
| {/if} | ||
| </td> | ||
| {:else} | ||
| <td | ||
| class="workflows-summary-table-body-cell" | ||
| data-testid="workflows-summary-table-body-cell" | ||
| class:comfy={!truncate} | ||
| class:dense={truncate} | ||
|
Alex-Tideman marked this conversation as resolved.
Outdated
|
||
| > | ||
| {#if label === 'Status'} | ||
| <WorkflowStatus | ||
|
|
@@ -188,21 +204,41 @@ | |
| taskFailure={isWorkflowTaskFailure(workflow)} | ||
| /> | ||
| {:else if label === 'End'} | ||
| <Timestamp dateTime={workflow.endTime} /> | ||
| <Timestamp | ||
| dateTime={workflow.endTime} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {:else if label === 'Start'} | ||
| <Timestamp dateTime={workflow.startTime} /> | ||
| <Timestamp | ||
| dateTime={workflow.startTime} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {:else if label === 'Task Queue'} | ||
| {workflow.taskQueue} | ||
| <Tooltip text={workflow.taskQueue} top class="min-w-0" hide={!truncate}> | ||
| {truncate ? truncateValue(workflow.taskQueue) : workflow.taskQueue} | ||
| </Tooltip> | ||
| {:else if label === 'Parent Namespace'} | ||
| {workflow?.parentNamespaceId ?? ''} | ||
| <Tooltip | ||
| text={workflow?.parentNamespaceId ?? ''} | ||
| top | ||
| class="min-w-0" | ||
| hide={!truncate} | ||
| > | ||
| {truncate | ||
| ? truncateValue(workflow?.parentNamespaceId ?? '') | ||
| : (workflow?.parentNamespaceId ?? '')} | ||
| </Tooltip> | ||
| {:else if label === 'History Size'} | ||
| {formatBytes(parseInt(workflow.historySizeBytes, 10))} | ||
| {:else if label === 'State Transitions'} | ||
| {parseInt(workflow.stateTransitionCount, 10) > 0 | ||
| ? workflow.stateTransitionCount | ||
| : ''} | ||
| {:else if label === 'Execution Time'} | ||
| <Timestamp dateTime={workflow.executionTime} /> | ||
| <Timestamp | ||
| dateTime={workflow.executionTime} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {:else if label === 'Execution Duration'} | ||
| {formatDistance({ | ||
| start: workflow.startTime, | ||
|
|
@@ -212,34 +248,56 @@ | |
| {:else if label === 'History Length'} | ||
| {parseInt(workflow.historyEvents, 10) > 0 ? workflow.historyEvents : ''} | ||
| {:else if label === 'Scheduled By ID'} | ||
| {workflow.searchAttributes?.indexedFields?.TemporalScheduledById ?? ''} | ||
| <Tooltip | ||
| text={workflow.searchAttributes?.indexedFields?.TemporalScheduledById ?? | ||
| ''} | ||
| top | ||
| class="min-w-0" | ||
| hide={!truncate} | ||
| > | ||
| {truncate | ||
| ? truncateValue( | ||
| workflow.searchAttributes?.indexedFields?.TemporalScheduledById ?? | ||
| '', | ||
| ) | ||
| : (workflow.searchAttributes?.indexedFields?.TemporalScheduledById ?? | ||
| '')} | ||
| </Tooltip> | ||
| {:else if label === 'Scheduled Start Time'} | ||
| {@const content = | ||
| workflow.searchAttributes?.indexedFields?.TemporalScheduledStartTime} | ||
| {#if content && typeof content === 'string'} | ||
| <Timestamp dateTime={content} /> | ||
| <Timestamp | ||
| dateTime={content} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {/if} | ||
| {:else if label === 'Change Version'} | ||
| {workflow.searchAttributes?.indexedFields?.TemporalChangeVersion} | ||
| {:else if isCustomSearchAttribute(label) && workflowIncludesSearchAttribute(workflow, label)} | ||
| {@const content = workflow.searchAttributes?.indexedFields?.[label]} | ||
| {#if $customSearchAttributes[label] === SEARCH_ATTRIBUTE_TYPE.DATETIME && typeof content === 'string'} | ||
| <Timestamp dateTime={content} /> | ||
| <Timestamp | ||
| dateTime={content} | ||
| options={{ format: truncate ? 'short' : 'long' }} | ||
| /> | ||
| {:else if $customSearchAttributes[label] === SEARCH_ATTRIBUTE_TYPE.BOOL} | ||
| <Badge>{content}</Badge> | ||
| {:else} | ||
| {content} | ||
| <Tooltip text={content} top class="min-w-0" hide={!truncate}> | ||
| {truncate ? truncateValue(content) : content} | ||
| </Tooltip> | ||
| {/if} | ||
| {/if} | ||
| </td> | ||
| {/if} | ||
|
|
||
| <style lang="postcss"> | ||
| .workflows-summary-table-body-cell { | ||
| @apply h-8 whitespace-nowrap; | ||
| @apply relative h-8 whitespace-nowrap; | ||
|
|
||
| &.filterable { | ||
| @apply relative pr-24; | ||
| @apply pr-16; | ||
| } | ||
| } | ||
| </style> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| type BatchOperationContext, | ||
| } from '$lib/pages/workflows-with-new-search.svelte'; | ||
| import { supportsBulkActions } from '$lib/stores/bulk-actions'; | ||
| import { tableDensity } from '$lib/stores/table-density'; | ||
| import type { WorkflowExecution } from '$lib/types/workflows'; | ||
| import { workflowCreateDisabled } from '$lib/utilities/workflow-create-disabled'; | ||
|
|
||
|
|
@@ -71,6 +72,7 @@ | |
| workflowId={workflow.id} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| taskQueue={workflow.taskQueue} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| workflowType={workflow.name} | ||
| class={$tableDensity === 'compact' ? 'mt-1 h-5 w-5' : ''} | ||
| /> | ||
| {/if} | ||
| <IsTemporalServerVersionGuard minimumVersion="1.23.0"> | ||
|
|
@@ -79,6 +81,7 @@ | |
| size="xs" | ||
| variant={childrenShown ? 'primary' : 'ghost'} | ||
| on:click={() => viewChildren(workflow)} | ||
| class={$tableDensity === 'compact' ? 'mt-1 h-5 w-5' : ''} | ||
| > | ||
| <Tooltip | ||
| text={childrenShown | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.