Skip to content

Commit 2085037

Browse files
remove InvocationStepProvider; refactor the step component
Also adds a `WorkflowStepTyped` type which we can use instead of using the workflowStore's `Step` type in a few places.
1 parent 6685248 commit 2085037

8 files changed

Lines changed: 211 additions & 187 deletions

File tree

client/src/api/workflows.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { GalaxyApi } from "./client";
55

66
export type Creator = components["schemas"]["Person"] | components["schemas"]["galaxy__schema__schema__Organization"];
77
export type StoredWorkflowDetailed = components["schemas"]["StoredWorkflowDetailed"];
8+
export type WorkflowStepTyped = StoredWorkflowDetailed["steps"][number];
89

910
//TODO: replace with generated schema model when available
1011
export type WorkflowSummary = {

client/src/components/Workflow/Invocation/Graph/InvocationGraph.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import type { StoredWorkflowDetailed } from "@/api/workflows";
1919
import { useDatatypesMapper } from "@/composables/datatypesMapper";
2020
import { useInvocationGraph } from "@/composables/useInvocationGraph";
2121
import { useWorkflowStateStore } from "@/stores/workflowEditorStateStore";
22-
import type { Step } from "@/stores/workflowStepStore";
2322
2423
import LoadingSpan from "@/components/LoadingSpan.vue";
2524
import WorkflowGraph from "@/components/Workflow/Editor/WorkflowGraph.vue";
@@ -120,9 +119,7 @@ const initialPosition = computed(() => ({
120119
y: -props.initialY * props.zoom,
121120
}));
122121
123-
function activeStepFor(activeNodeId: number): Step {
124-
return props.workflow.steps[activeNodeId] as unknown as Step;
125-
}
122+
const activeStep = computed(() => (activeNodeId.value !== null ? props.workflow.steps[activeNodeId.value] : undefined));
126123
127124
/** Updates and loads the invocation graph */
128125
async function loadGraph() {
@@ -208,13 +205,13 @@ function stepClicked(nodeId: number | null) {
208205
</BCard>
209206
</div>
210207
</div>
211-
<BCard v-if="activeNodeId !== null" ref="stepCard" class="mt-2" no-body>
208+
<BCard v-if="activeNodeId !== null && activeStep" ref="stepCard" class="mt-2" no-body>
212209
<BCardHeader
213210
class="d-flex justify-content-between align-items-center px-3 py-1"
214211
:class="activeNodeId !== null ? steps[activeNodeId]?.headerClass : ''">
215212
<WorkflowInvocationStepHeader
216213
class="w-100 pr-2"
217-
:workflow-step="activeStepFor(activeNodeId)"
214+
:workflow-step="activeStep"
218215
:graph-step="steps[activeNodeId]"
219216
:invocation-step="props.invocation.steps[activeNodeId]" />
220217
<div class="d-flex flex-gapx-1">
@@ -231,7 +228,7 @@ function stepClicked(nodeId: number | null) {
231228
ref="loadedJobInfo"
232229
:key="activeNodeId"
233230
:invocation="props.invocation"
234-
:workflow-step="props.workflow.steps[activeNodeId]"
231+
:workflow-step="activeStep"
235232
in-graph-view
236233
:graph-step="steps[activeNodeId]"
237234
expanded />

client/src/components/WorkflowInvocationState/WorkflowInvocationFeedback.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { computed } from "vue";
33
44
import { GalaxyApi } from "@/api";
55
import type { InvocationMessage, StepJobSummary, WorkflowInvocationElementView } from "@/api/invocations";
6+
import type { WorkflowStepTyped } from "@/api/workflows";
67
import { useInvocationGraph } from "@/composables/useInvocationGraph";
78
import { useWorkflowInstance } from "@/composables/useWorkflowInstance";
89
import { errorMessageAsString } from "@/utils/simple-error";
@@ -54,7 +55,7 @@ const stepsWithErrors = computed(() => {
5455
}
5556
return false;
5657
})
57-
.map(([_, step]) => step);
58+
.map(([_, step]) => step as unknown as WorkflowStepTyped);
5859
}
5960
return [];
6061
});

0 commit comments

Comments
 (0)