From 642b3a6fd7be084457a4e17d9ec129c5e9c9be4a Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Fri, 20 Sep 2024 18:04:31 -0500 Subject: [PATCH] move progress bars to header, shorten `WorkflowRunSuccess` - The progress bars are in `WorkflowInvocationHeader` now, giving more space to the step header being visible below the graph - `WorkflowRunSuccess` is a one line header (refactored), and it uses `GridInvocation` to show batch invocations. --- client/src/components/Grid/GridInvocation.vue | 16 +- .../Grid/configs/invocationsBatch.ts | 80 +++++++ .../Workflow/Run/WorkflowRunSuccess.vue | 141 +++++------- .../WorkflowInvocationHeader.vue | 142 +++++++++++- .../WorkflowInvocationOverview.vue | 202 +----------------- .../WorkflowInvocationState.vue | 71 +++++- 6 files changed, 353 insertions(+), 299 deletions(-) create mode 100644 client/src/components/Grid/configs/invocationsBatch.ts diff --git a/client/src/components/Grid/GridInvocation.vue b/client/src/components/Grid/GridInvocation.vue index d8997096096f..847127cfa0b7 100644 --- a/client/src/components/Grid/GridInvocation.vue +++ b/client/src/components/Grid/GridInvocation.vue @@ -2,7 +2,9 @@ import { storeToRefs } from "pinia"; import { computed } from "vue"; +import type { WorkflowInvocation } from "@/api/invocations"; import invocationsGridConfig from "@/components/Grid/configs/invocations"; +import invocationsBatchConfig from "@/components/Grid/configs/invocationsBatch"; import invocationsHistoryGridConfig from "@/components/Grid/configs/invocationsHistory"; import invocationsWorkflowGridConfig from "@/components/Grid/configs/invocationsWorkflow"; import { useUserStore } from "@/stores/userStore"; @@ -19,6 +21,7 @@ interface Props { headerMessage?: string; ownerGrid?: boolean; filteredFor?: { type: "History" | "StoredWorkflow"; id: string; name: string }; + invocationsList?: WorkflowInvocation[]; } const props = withDefaults(defineProps(), { @@ -26,12 +29,14 @@ const props = withDefaults(defineProps(), { headerMessage: "", ownerGrid: true, filteredFor: undefined, + invocationsList: undefined, }); const { currentUser } = storeToRefs(useUserStore()); const forStoredWorkflow = computed(() => props.filteredFor?.type === "StoredWorkflow"); const forHistory = computed(() => props.filteredFor?.type === "History"); +const forBatch = computed(() => !!props.invocationsList?.length); const effectiveNoInvocationsMessage = computed(() => { let message = props.noInvocationsMessage; @@ -51,6 +56,9 @@ const effectiveTitle = computed(() => { }); const extraProps = computed(() => { + if (forBatch.value) { + return Object.fromEntries(props.invocationsList.map((invocation) => [invocation.id, invocation])); + } const params: { workflow_id?: string; history_id?: string; @@ -72,7 +80,9 @@ const extraProps = computed(() => { }); let gridConfig: GridConfig; -if (forStoredWorkflow.value) { +if (forBatch.value) { + gridConfig = invocationsBatchConfig; +} else if (forStoredWorkflow.value) { gridConfig = invocationsWorkflowGridConfig; } else if (forHistory.value) { gridConfig = invocationsHistoryGridConfig; @@ -97,9 +107,9 @@ function refreshTable() { :grid-message="props.headerMessage" :no-data-message="effectiveNoInvocationsMessage" :extra-props="extraProps" - :embedded="forStoredWorkflow || forHistory"> + :embedded="forStoredWorkflow || forHistory || forBatch">