Unverified Commit d193ba59 authored by Alireza Heidari's avatar Alireza Heidari
Browse files

Updates workflow type and improves null safety

Changes workflow prop type to StoredWorkflowDetailed for better type safety
Adds optional chaining to prevent potential null reference errors
parent 5b384939
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import { BButton, BFormCheckbox, BLink } from "bootstrap-vue";
import { storeToRefs } from "pinia";
import { computed, ref } from "vue";

import { type StoredWorkflowDetailed } from "@/api/workflows";
import { updateWorkflow } from "@/components/Workflow/workflows.services";
import { useUserStore } from "@/stores/userStore";

@@ -16,7 +17,7 @@ import WorkflowIndicators from "@/components/Workflow/List/WorkflowIndicators.vu
import WorkflowInvocationsCount from "@/components/Workflow/WorkflowInvocationsCount.vue";

interface Props {
    workflow: any;
    workflow: StoredWorkflowDetailed;
    gridView?: boolean;
    hideRuns?: boolean;
    filterable?: boolean;
@@ -61,7 +62,7 @@ const shared = computed(() => {

const description = computed(() => {
    if (workflow.value.annotations && workflow.value.annotations.length > 0) {
        return workflow.value.annotations[0].trim();
        return workflow.value.annotations[0]?.trim();
    } else {
        return null;
    }