diff --git a/client/src/components/Workflow/Run/ExportOnCompleteWizard.vue b/client/src/components/Workflow/Run/ExportOnCompleteWizard.vue index 58a5eb42f0f..8a237b27993 100644 --- a/client/src/components/Workflow/Run/ExportOnCompleteWizard.vue +++ b/client/src/components/Workflow/Run/ExportOnCompleteWizard.vue @@ -3,6 +3,7 @@ import { BButton, BCard, BCardGroup, BCardTitle, BFormCheckbox, BFormGroup, BFor import { computed, ref } from "vue"; import type { FilterFileSourcesOptions } from "@/api/remoteFiles"; +import type { components } from "@/api/schema"; import { useWizard } from "@/components/Common/Wizard/useWizard"; import { borderVariant } from "@/components/Common/Wizard/utils"; import { useFileSources } from "@/composables/fileSources"; @@ -15,13 +16,8 @@ import FileSourceNameSpan from "@/components/FileSources/FileSourceNameSpan.vue" const { renderMarkdown } = useMarkdown({ openLinksInNewPage: true }); -export interface ExportOnCompleteConfig { - target_uri: string; - format: string; - include_files: boolean; - include_hidden: boolean; - include_deleted: boolean; -} +export type WriteStoreToPayload = components["schemas"]["WriteStoreToPayload"]; +type ModelStoreFormat = components["schemas"]["ModelStoreFormat"]; interface ExportFormat { id: string; @@ -30,7 +26,7 @@ interface ExportFormat { } interface Props { - initialConfig?: Partial & { fileName?: string; directory?: string }; + initialConfig?: Partial & { fileName?: string; directory?: string }; } const props = withDefaults(defineProps(), { @@ -38,7 +34,7 @@ const props = withDefaults(defineProps(), { }); const emit = defineEmits<{ - (e: "configured", config: ExportOnCompleteConfig): void; + (e: "configured", config: WriteStoreToPayload): void; (e: "cancel"): void; }>(); @@ -48,7 +44,7 @@ const { hasWritable: hasWritableFileSources } = useFileSources(defaultExportFilt // Internal state for the wizard UI const directory = ref(props.initialConfig.directory || ""); const fileName = ref(props.initialConfig.fileName || "galaxy-workflow-export"); -const format = ref(props.initialConfig.format || "rocrate.zip"); +const modelStoreFormat = ref(props.initialConfig.model_store_format || "rocrate.zip"); const includeFiles = ref(props.initialConfig.include_files ?? true); const includeHidden = ref(props.initialConfig.include_hidden ?? false); const includeDeleted = ref(props.initialConfig.include_deleted ?? false); @@ -70,7 +66,7 @@ This is a simple format suitable for backup and transfer.`, }, ]; -const selectedFormat = computed(() => exportFormats.find((f) => f.id === format.value) || exportFormats[0]); +const selectedFormat = computed(() => exportFormats.find((f) => f.id === modelStoreFormat.value) || exportFormats[0]); const directoryDescription = computed(() => localize("Select a 'repository' to export the workflow results to.")); const nameDescription = computed(() => localize("Give the exported file a name.")); @@ -99,11 +95,11 @@ const wizard = useWizard({ function onSubmit() { // Construct full target_uri from directory + filename + format const dir = directory.value.endsWith("/") ? directory.value : `${directory.value}/`; - const fullTargetUri = `${dir}${fileName.value}.${format.value}`; + const fullTargetUri = `${dir}${fileName.value}.${modelStoreFormat.value}`; emit("configured", { target_uri: fullTargetUri, - format: format.value, + model_store_format: modelStoreFormat.value, include_files: includeFiles.value, include_hidden: includeHidden.value, include_deleted: includeDeleted.value, @@ -130,8 +126,8 @@ function onCancel() { :key="fmt.id" :data-export-format="fmt.id" class="wizard-selection-card" - :border-variant="borderVariant(format === fmt.id)" - @click="format = fmt.id"> + :border-variant="borderVariant(modelStoreFormat === fmt.id)" + @click="modelStoreFormat = fmt.id as ModelStoreFormat"> {{ fmt.title }} @@ -167,7 +163,7 @@ function onCancel() { placeholder="Name" required data-test-id="export-file-name-input" /> - .{{ format }} + .{{ modelStoreFormat }} @@ -198,7 +194,7 @@ function onCancel() { Not selected -
File name: {{ fileName }}.{{ format }}
+
File name: {{ fileName }}.{{ modelStoreFormat }}
Options: Include files diff --git a/client/src/components/Workflow/Run/OnCompleteActions.vue b/client/src/components/Workflow/Run/OnCompleteActions.vue index b59cc425bbc..07118a3669e 100644 --- a/client/src/components/Workflow/Run/OnCompleteActions.vue +++ b/client/src/components/Workflow/Run/OnCompleteActions.vue @@ -5,21 +5,13 @@ import { computed, reactive, ref, watch } from "vue"; import { useConfig } from "@/composables/config"; import { useFileSources } from "@/composables/fileSources"; -import ExportOnCompleteWizard from "./ExportOnCompleteWizard.vue"; +import ExportOnCompleteWizard, { type WriteStoreToPayload } from "./ExportOnCompleteWizard.vue"; import FileSourceNameSpan from "@/components/FileSources/FileSourceNameSpan.vue"; import FormCard from "@/components/Form/FormCard.vue"; -interface ExportConfig { - target_uri: string; - format: string; - include_files: boolean; - include_hidden: boolean; - include_deleted: boolean; -} - interface OnCompleteAction { send_notification?: Record; - export_to_file_source?: ExportConfig; + export_to_file_source?: WriteStoreToPayload; } interface Props { @@ -45,11 +37,11 @@ const state = reactive({ exportEnabled: false, exportConfig: { target_uri: "", - format: "rocrate.zip", + model_store_format: "rocrate.zip", include_files: true, include_hidden: false, include_deleted: false, - } as ExportConfig, + } as WriteStoreToPayload, }); // Initialize state from value prop (Vue 2 style v-model) @@ -88,7 +80,7 @@ function emitOnComplete() { emit("input", actions); } -function onExportConfigured(config: ExportConfig) { +function onExportConfigured(config: WriteStoreToPayload) { state.exportConfig = config; state.exportEnabled = true; showExportWizard.value = false; @@ -102,7 +94,7 @@ function clearExport() { state.exportEnabled = false; state.exportConfig = { target_uri: "", - format: "rocrate.zip", + model_store_format: "rocrate.zip", include_files: true, include_hidden: false, include_deleted: false, @@ -152,7 +144,7 @@ const exportSummary = computed(() => {
- Format: {{ exportSummary.format }} + Format: {{ exportSummary.model_store_format }} , with files
diff --git a/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue b/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue index e6bd661b751..118ef04ed0d 100644 --- a/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue +++ b/client/src/components/Workflow/Run/WorkflowRunFormSimple.vue @@ -27,7 +27,7 @@ import { invokeWorkflow } from "./services"; import WorkflowAnnotation from "../WorkflowAnnotation.vue"; import WorkflowNavigationTitle from "../WorkflowNavigationTitle.vue"; -import ExportOnCompleteWizard from "./ExportOnCompleteWizard.vue"; +import ExportOnCompleteWizard, { type WriteStoreToPayload } from "./ExportOnCompleteWizard.vue"; import WorkflowHelpDisplay from "./WorkflowHelpDisplay.vue"; import WorkflowRunGraph from "./WorkflowRunGraph.vue"; import WorkflowStorageConfiguration from "./WorkflowStorageConfiguration.vue"; @@ -88,13 +88,7 @@ const checkInputMatching = ref(props.requestState !== undefined); const sendNotificationOnComplete = ref(false); const showExportWizard = ref(false); const exportCheckboxKey = ref(0); -const exportOnCompleteConfig = ref<{ - target_uri: string; - format: string; - include_files: boolean; - include_hidden: boolean; - include_deleted: boolean; -} | null>(null); +const exportOnCompleteConfig = ref(null); const { hasWritable: hasWritableFileSources } = useFileSources({ exclude: ["rdm"] });