Skip to content

Commit c1117f3

Browse files
authored
Current Details (#2466)
* Add Current Details * Get rid of unnecessary var check * Remove unneeded classes
1 parent f2e7ef5 commit c1117f3

File tree

5 files changed

+32
-18
lines changed

5 files changed

+32
-18
lines changed

src/lib/holocene/accordion/accordion-light.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
id="{id}-trigger"
3434
aria-expanded={open}
3535
aria-controls="{id}-content"
36-
class="w-full cursor-pointer hover:bg-interactive-secondary-hover focus-visible:bg-interactive focus-visible:outline-none"
36+
class="focus-visible:outline-interactive w-full cursor-pointer hover:bg-interactive-secondary-hover"
3737
type="button"
3838
on:click={toggleAccordion}
3939
>

src/lib/i18n/locales/en/workflows.ts

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ export const Strings = {
185185
summary: 'Summary',
186186
details: 'Details',
187187
'summary-and-details': 'Summary & Details',
188+
'current-details': 'Current Details',
188189
'maximum-attempts': 'Maximum Attempts',
189190
'retry-expiration': 'Retry Expiration',
190191
state: 'State',

src/lib/layouts/workflow-header.svelte

+26-12
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@
3838
routeForWorkflows,
3939
} from '$lib/utilities/route-for';
4040
41-
export let namespace: string;
42-
41+
$: ({ namespace, workflow: workflowId, run: runId, id } = $page.params);
4342
$: ({ workflow, workers } = $workflowRun);
44-
$: id = $page.params.id;
4543
4644
$: routeParameters = {
4745
namespace,
48-
workflow: workflow?.id,
49-
run: workflow?.runId,
46+
workflow: workflowId,
47+
run: runId,
5048
};
5149
5250
$: isRunning = $workflowRun?.workflow?.isRunning;
@@ -57,7 +55,7 @@
5755
$workflowRun?.workflow?.status,
5856
$fullEventHistory,
5957
);
60-
$: workflowHasBeenReset = has($resetWorkflows, $workflowRun?.workflow?.runId);
58+
$: workflowHasBeenReset = has($resetWorkflows, runId);
6159
$: workflowUsesVersioning =
6260
workflow?.assignedBuildId ??
6361
workflow?.mostRecentWorkerVersionStamp?.useVersioning;
@@ -70,6 +68,7 @@
7068
$: summary = $workflowRun?.userMetadata?.summary;
7169
$: details = $workflowRun?.userMetadata?.details;
7270
$: hasUserMetadata = summary || details;
71+
$: currentDetails = $workflowRun?.metadata?.currentDetails;
7372
</script>
7473

7574
<div class="flex items-center justify-between pb-4">
@@ -124,13 +123,10 @@
124123
</div>
125124
{#if hasUserMetadata}
126125
<AccordionLight let:open>
127-
<div
128-
slot="title"
129-
class="flex w-full items-center gap-2 rounded p-2 text-xl"
130-
>
126+
<div slot="title" class="flex w-full items-center gap-2 p-2 text-xl">
131127
<Icon
132-
name="flag"
133-
class="text-indigo-600/80"
128+
name="info"
129+
class="text-brand"
134130
width={32}
135131
height={32}
136132
/>{translate('workflows.summary-and-details')}
@@ -145,6 +141,24 @@
145141
{/if}
146142
</AccordionLight>
147143
{/if}
144+
{#if currentDetails}
145+
<AccordionLight let:open>
146+
<div
147+
slot="title"
148+
class="flex w-full items-center gap-2 rounded p-2 text-xl"
149+
>
150+
<Icon
151+
name="flag"
152+
class="text-indigo-600/80"
153+
width={32}
154+
height={32}
155+
/>{translate('workflows.current-details')}
156+
</div>
157+
{#if open}
158+
<Markdown content={currentDetails} />
159+
{/if}
160+
</AccordionLight>
161+
{/if}
148162
<WorkflowDetails />
149163
{#if cancelInProgress}
150164
<div in:fly={{ duration: 200, delay: 100 }}>

src/lib/layouts/workflow-run-layout.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
<Loading class="pt-24" />
228228
{:else}
229229
<div class="border-b border-subtle px-4 pt-8 md:pt-20 xl:px-8">
230-
<WorkflowHeader namespace={$page.params.namespace} />
230+
<WorkflowHeader />
231231
</div>
232232
<slot />
233233
{/if}

src/lib/pages/workflow-query.svelte

+3-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@
3535
$: edited = initialQueryType !== queryType || input !== initialInput;
3636
3737
$: metadataError = $workflowRun.metadata?.error?.message;
38-
$: queryTypes = $workflowRun?.metadata?.definition?.queryDefinitions?.filter(
39-
(query) => {
38+
$: queryTypes =
39+
$workflowRun?.metadata?.definition?.queryDefinitions?.filter((query) => {
4040
return query?.name !== '__stack_trace';
41-
},
42-
);
41+
}) || [];
4342
4443
$: queryType = queryType || queryTypes?.[0]?.name;
4544

0 commit comments

Comments
 (0)