Skip to content

Commit

Permalink
fix typing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Nov 7, 2024
1 parent bb96e84 commit a0661a3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
9 changes: 7 additions & 2 deletions client/src/components/Workflow/InvocationsListState.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { onBeforeUnmount, onMounted, toRef } from "vue";
import { computed, onBeforeUnmount, onMounted, toRef } from "vue";
import type { WorkflowInvocationElementView } from "@/api/invocations";
import { useInvocationState } from "@/components/WorkflowInvocationState/usesInvocationState";
import HelpText from "@/components/Help/HelpText.vue";
Expand All @@ -16,7 +17,7 @@ interface Props {
const props = defineProps<Props>();
const {
invocation,
invocation: invocationFromState,
invocationState,
invocationSchedulingTerminal,
invocationAndJobTerminal,
Expand All @@ -25,6 +26,9 @@ const {
clearStateMonitor,
} = useInvocationState(toRef(props, "invocationId"), true);
// TODO: This is a workaround to type invocation; I would've expected it to already be typed
const invocation = computed(() => invocationFromState.value as WorkflowInvocationElementView | undefined);
onMounted(monitorState);
onBeforeUnmount(clearStateMonitor);
</script>
Expand All @@ -41,6 +45,7 @@ onBeforeUnmount(clearStateMonitor);
:invocation-state="invocationState"
:invocation-scheduling-terminal="invocationSchedulingTerminal" />
<InvocationJobsProgressBar
v-if="jobStatesSummary"
:job-states-summary="jobStatesSummary"
:invocation-scheduling-terminal="invocationSchedulingTerminal"
:invocation-and-job-terminal="invocationAndJobTerminal" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from "vue";
import { InvocationJobsSummary } from "@/api/invocations";
import { type InvocationJobsSummary } from "@/api/invocations";
import {
errorCount as jobStatesSummaryErrorCount,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from "vue";
import { InvocationStep, WorkflowInvocationElementView } from "@/api/invocations";
import { type InvocationStep, type WorkflowInvocationElementView } from "@/api/invocations";
import ProgressBar from "@/components/ProgressBar.vue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const {
clearStateMonitor,
} = useInvocationState(toRef(props, "invocationId"));
// TODO: This is a workaround to type invocation; I would've expected it to already be typed
const invocation = computed(() => invocationFromState.value as WorkflowInvocationElementView | undefined);
onMounted(monitorState);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { computed, type Ref } from "vue";

import { InvocationJobsSummary } from "@/api/invocations";
import { type InvocationJobsSummary } from "@/api/invocations";
import { useInvocationStore } from "@/stores/invocationStore";

import { isTerminal, jobCount } from "./util";
Expand Down
2 changes: 1 addition & 1 deletion client/src/stores/invocationStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const useInvocationStore = defineStore("invocationStore", () => {
if (error) {
rethrowSimple(error);
}
return data;
return data as WorkflowInvocationStepStatesView;
}

const { getItemById: getInvocationById, fetchItemById: fetchInvocationForId } =
Expand Down

0 comments on commit a0661a3

Please sign in to comment.