Unverified Commit 51e3b555 authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #16369 from mvdbeek/workflow_invocation_detail_fix

[23.1] Fix workflow invocation detail reactivity
parents 4ed3199b 50d5ea57
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
<script setup>
<script setup lang="ts">
import { useWorkflowInstance } from "@/composables/useWorkflowInstance";
import ParameterStep from "./ParameterStep";
import GenericHistoryItem from "components/History/Content/GenericItem";
import WorkflowInvocationStep from "./WorkflowInvocationStep";
import ParameterStep from "./ParameterStep.vue";
import GenericHistoryItem from "components/History/Content/GenericItem.vue";
import WorkflowInvocationStep from "./WorkflowInvocationStep.vue";

const props = defineProps({
    invocation: {
@@ -11,9 +11,13 @@ const props = defineProps({
    },
});

interface HasSrc {
    src: string;
}

const { workflow } = useWorkflowInstance(props.invocation.workflow_id);

function dataInputStepLabel(key, input) {
function dataInputStepLabel(key: number, input: HasSrc) {
    const invocationStep = props.invocation.steps[key];
    let label = invocationStep && invocationStep.workflow_step_label;
    if (!label) {
+4 −3
Original line number Diff line number Diff line
import { useWorkflowStore } from "@/stores/workflowStore";
import { ref } from "vue";
import { computed, ref } from "vue";

export function useWorkflowInstance(workflowId: string) {
    const workflowStore = useWorkflowStore();
    const workflow = ref(workflowStore.getStoredWorkflowByInstanceId(workflowId));
    const workflow = computed(() => workflowStore.getStoredWorkflowByInstanceId(workflowId));
    const loading = ref(false);

    async function getWorkflowInstance() {
@@ -12,8 +12,9 @@ export function useWorkflowInstance(workflowId: string) {
            try {
                await workflowStore.fetchWorkflowForInstanceId(workflowId);
            } catch (e) {
                loading.value = false;
                console.error("unable to fetch workflow \n", e);
            } finally {
                loading.value = false;
            }
        }
    }