diff --git a/frontend/src/concepts/pipelines/content/createRun/contentSections/PipelineSection.tsx b/frontend/src/concepts/pipelines/content/createRun/contentSections/PipelineSection.tsx index 0dc454d57e..5a4cf10639 100644 --- a/frontend/src/concepts/pipelines/content/createRun/contentSections/PipelineSection.tsx +++ b/frontend/src/concepts/pipelines/content/createRun/contentSections/PipelineSection.tsx @@ -60,6 +60,7 @@ const PipelineSection: React.FC = ({ variant="link" icon={} onCreate={onPipelineChange} + redirectAfterImport={false} > Create new pipeline diff --git a/frontend/src/concepts/pipelines/content/import/ImportPipelineButton.tsx b/frontend/src/concepts/pipelines/content/import/ImportPipelineButton.tsx index 3975a19bc8..b1136975f3 100644 --- a/frontend/src/concepts/pipelines/content/import/ImportPipelineButton.tsx +++ b/frontend/src/concepts/pipelines/content/import/ImportPipelineButton.tsx @@ -6,11 +6,13 @@ import { PipelineKFv2 } from '~/concepts/pipelines/kfTypes'; type ImportPipelineButtonProps = { onCreate?: (pipeline: PipelineKFv2) => void; + redirectAfterImport?: boolean; } & Omit, 'onClick'>; const ImportPipelineButton: React.FC = ({ onCreate, children, + redirectAfterImport, ...buttonProps }) => { const { apiAvailable, refreshAllAPI, pipelinesServer } = usePipelinesAPI(); @@ -28,6 +30,7 @@ const ImportPipelineButton: React.FC = ({ { setOpen(false); if (pipeline) { diff --git a/frontend/src/concepts/pipelines/content/import/PipelineImportModal.tsx b/frontend/src/concepts/pipelines/content/import/PipelineImportModal.tsx index c17a6ad390..dbcc61d840 100644 --- a/frontend/src/concepts/pipelines/content/import/PipelineImportModal.tsx +++ b/frontend/src/concepts/pipelines/content/import/PipelineImportModal.tsx @@ -31,9 +31,14 @@ import { PipelineUploadOption, extractKindFromPipelineYAML } from './utils'; type PipelineImportModalProps = { isOpen: boolean; onClose: (pipeline?: PipelineKFv2) => void; + redirectAfterImport?: boolean; }; -const PipelineImportModal: React.FC = ({ isOpen, onClose }) => { +const PipelineImportModal: React.FC = ({ + isOpen, + redirectAfterImport = true, + onClose, +}) => { const navigate = useNavigate(); const { project, api, apiAvailable, namespace } = usePipelinesAPI(); const [importing, setImporting] = React.useState(false); @@ -73,11 +78,11 @@ const PipelineImportModal: React.FC = ({ isOpen, onClo ); const versionId = versions?.[0].pipeline_version_id; - if (versionId) { + if (redirectAfterImport && versionId) { navigate(pipelineVersionDetailsRoute(namespace, pipeline.pipeline_id, versionId)); } }, - [api, namespace, navigate, onBeforeClose], + [api, namespace, redirectAfterImport, navigate, onBeforeClose], ); const checkForDuplicateName = useDebounceCallback(