From 28a839dd19a94b005aaca9966f73ee9780cfc995 Mon Sep 17 00:00:00 2001 From: Alex Tideman Date: Fri, 6 Dec 2024 12:45:38 -0600 Subject: [PATCH 1/3] Add Current Details --- .../holocene/accordion/accordion-light.svelte | 2 +- src/lib/i18n/locales/en/workflows.ts | 1 + src/lib/layouts/workflow-header.svelte | 31 ++++++++++++++----- src/lib/layouts/workflow-run-layout.svelte | 2 +- src/lib/pages/workflow-query.svelte | 7 ++--- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/lib/holocene/accordion/accordion-light.svelte b/src/lib/holocene/accordion/accordion-light.svelte index 0a2b540b4..4ade8a220 100644 --- a/src/lib/holocene/accordion/accordion-light.svelte +++ b/src/lib/holocene/accordion/accordion-light.svelte @@ -33,7 +33,7 @@ id="{id}-trigger" aria-expanded={open} aria-controls="{id}-content" - class="w-full cursor-pointer hover:bg-interactive-secondary-hover focus-visible:bg-interactive focus-visible:outline-none" + class="focus-visible:outline-interactive w-full cursor-pointer hover:bg-interactive-secondary-hover" type="button" on:click={toggleAccordion} > diff --git a/src/lib/i18n/locales/en/workflows.ts b/src/lib/i18n/locales/en/workflows.ts index f79018e84..af59dbff4 100644 --- a/src/lib/i18n/locales/en/workflows.ts +++ b/src/lib/i18n/locales/en/workflows.ts @@ -185,6 +185,7 @@ export const Strings = { summary: 'Summary', details: 'Details', 'summary-and-details': 'Summary & Details', + 'current-details': 'Current Details', 'maximum-attempts': 'Maximum Attempts', 'retry-expiration': 'Retry Expiration', state: 'State', diff --git a/src/lib/layouts/workflow-header.svelte b/src/lib/layouts/workflow-header.svelte index f3f3fe0bb..b18f8fdb1 100644 --- a/src/lib/layouts/workflow-header.svelte +++ b/src/lib/layouts/workflow-header.svelte @@ -38,15 +38,13 @@ routeForWorkflows, } from '$lib/utilities/route-for'; - export let namespace: string; - + $: ({ namespace, workflow: workflowId, run: runId, id } = $page.params); $: ({ workflow, workers } = $workflowRun); - $: id = $page.params.id; $: routeParameters = { namespace, - workflow: workflow?.id, - run: workflow?.runId, + workflow: workflowId, + run: runId, }; $: isRunning = $workflowRun?.workflow?.isRunning; @@ -57,7 +55,7 @@ $workflowRun?.workflow?.status, $fullEventHistory, ); - $: workflowHasBeenReset = has($resetWorkflows, $workflowRun?.workflow?.runId); + $: workflowHasBeenReset = has($resetWorkflows, runId); $: workflowUsesVersioning = workflow?.assignedBuildId ?? workflow?.mostRecentWorkerVersionStamp?.useVersioning; @@ -70,6 +68,7 @@ $: summary = $workflowRun?.userMetadata?.summary; $: details = $workflowRun?.userMetadata?.details; $: hasUserMetadata = summary || details; + $: currentDetails = $workflowRun?.metadata?.currentDetails;
@@ -129,7 +128,7 @@ class="flex w-full items-center gap-2 rounded p-2 text-xl" > {/if} + {#if currentDetails} + +
+ {translate('workflows.current-details')} +
+ {#if open && currentDetails} + + {/if} +
+ {/if} {#if cancelInProgress}
diff --git a/src/lib/layouts/workflow-run-layout.svelte b/src/lib/layouts/workflow-run-layout.svelte index 803082aa7..8571fd44e 100644 --- a/src/lib/layouts/workflow-run-layout.svelte +++ b/src/lib/layouts/workflow-run-layout.svelte @@ -227,7 +227,7 @@ {:else}
- +
{/if} diff --git a/src/lib/pages/workflow-query.svelte b/src/lib/pages/workflow-query.svelte index 6d6471e1b..16adbd540 100644 --- a/src/lib/pages/workflow-query.svelte +++ b/src/lib/pages/workflow-query.svelte @@ -35,11 +35,10 @@ $: edited = initialQueryType !== queryType || input !== initialInput; $: metadataError = $workflowRun.metadata?.error?.message; - $: queryTypes = $workflowRun?.metadata?.definition?.queryDefinitions?.filter( - (query) => { + $: queryTypes = + $workflowRun?.metadata?.definition?.queryDefinitions?.filter((query) => { return query?.name !== '__stack_trace'; - }, - ); + }) || []; $: queryType = queryType || queryTypes?.[0]?.name; From 6074b9ca284c6a31b236a2531fc8579b107c9782 Mon Sep 17 00:00:00 2001 From: Alex Tideman Date: Fri, 6 Dec 2024 13:12:40 -0600 Subject: [PATCH 2/3] Get rid of unnecessary var check --- src/lib/layouts/workflow-header.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/layouts/workflow-header.svelte b/src/lib/layouts/workflow-header.svelte index b18f8fdb1..8e064cb7e 100644 --- a/src/lib/layouts/workflow-header.svelte +++ b/src/lib/layouts/workflow-header.svelte @@ -157,7 +157,7 @@ height={32} />{translate('workflows.current-details')}
- {#if open && currentDetails} + {#if open} {/if} From 73ac4551e57a61220140ebad257d3638d3bb0c86 Mon Sep 17 00:00:00 2001 From: Alex Tideman Date: Mon, 9 Dec 2024 11:59:35 -0600 Subject: [PATCH 3/3] Remove unneeded classes --- src/lib/layouts/workflow-header.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/layouts/workflow-header.svelte b/src/lib/layouts/workflow-header.svelte index 8e064cb7e..03d853ad7 100644 --- a/src/lib/layouts/workflow-header.svelte +++ b/src/lib/layouts/workflow-header.svelte @@ -123,13 +123,10 @@
{#if hasUserMetadata} -
+
{translate('workflows.summary-and-details')}