diff --git a/client/src/api/jobs.ts b/client/src/api/jobs.ts index ccc4023e9e66..c6c3d2077a28 100644 --- a/client/src/api/jobs.ts +++ b/client/src/api/jobs.ts @@ -12,6 +12,7 @@ export const fetchJobDestinationParams = fetcher.path("/api/jobs/{job_id}/destin export const jobsFetcher = fetcher.path("/api/jobs").method("get").create(); export type ShowFullJobResponse = components["schemas"]["ShowFullJobResponse"]; +export type JobBaseModel = components["schemas"]["JobBaseModel"]; export type JobDetails = components["schemas"]["ShowFullJobResponse"] | components["schemas"]["EncodedJobDetails"]; export const fetchJobDetails = fetcher.path("/api/jobs/{job_id}").method("get").create(); diff --git a/client/src/components/WorkflowInvocationState/JobStepTabs.vue b/client/src/components/WorkflowInvocationState/JobStepTabs.vue new file mode 100644 index 000000000000..35c1e260282a --- /dev/null +++ b/client/src/components/WorkflowInvocationState/JobStepTabs.vue @@ -0,0 +1,105 @@ + + + + + + + No jobs found for this step. + + + + + + + + + {{ job.state }} + + + + + + run + + + + updated + + + + + + + + + + + diff --git a/client/src/components/WorkflowInvocationState/WorkflowInvocationStep.vue b/client/src/components/WorkflowInvocationState/WorkflowInvocationStep.vue index 449b3dedf26a..e95e19f8957f 100644 --- a/client/src/components/WorkflowInvocationState/WorkflowInvocationStep.vue +++ b/client/src/components/WorkflowInvocationState/WorkflowInvocationStep.vue @@ -51,15 +51,18 @@ class="invocation-step-job-details" :open="inGraphView"> - Jobs (Click on any job to view its details) + {{ jobStepHeading(stepDetails) }} - + + + + This step has no jobs param.workflow_step_id === stepDetails.workflow_step_id ); }, + jobStepHeading(stepDetails) { + if (stepDetails.jobs?.length > 1) { + return "Jobs (Click on any job to view its details)"; + } else if (stepDetails.jobs?.length === 1) { + if (this.inGraphView) { + return "Job"; + } else { + return "Job (Click on the job to view its details)"; + } + } else { + return "No jobs"; + } + }, showJob(id) { this.$emit("show-job", id); }, diff --git a/client/src/composables/useInvocationGraph.ts b/client/src/composables/useInvocationGraph.ts index a7400edabf51..71f1f7b8bc46 100644 --- a/client/src/composables/useInvocationGraph.ts +++ b/client/src/composables/useInvocationGraph.ts @@ -204,10 +204,7 @@ export function useInvocationGraph( } /** Setting the header class for the graph step */ - graphStepFromWfStep.headerClass = { - "node-header-invocation": true, - [`header-${graphStepFromWfStep.state}`]: !!graphStepFromWfStep.state, - }; + graphStepFromWfStep.headerClass = getHeaderClass(graphStepFromWfStep.state as string); // TODO: maybe a different one for inputs? Currently they have no state either. /** Setting the header icon for the graph step */ @@ -279,3 +276,10 @@ export function useInvocationGraph( loadInvocationGraph, }; } + +export function getHeaderClass(state: string) { + return { + "node-header-invocation": true, + [`header-${state}`]: !!state, + }; +}