feat: add dataset_id to DSL import responses and update routing logic in CreateFromDSLModal

This commit is contained in:
twwu 2025-05-14 16:00:17 +08:00
parent 5a8f10520f
commit d910770b3c
3 changed files with 8 additions and 7 deletions

View File

@ -103,7 +103,7 @@ const CreateFromDSLModal = ({
if (!response)
return
const { id, status, pipeline_id, imported_dsl_version, current_dsl_version } = response
const { id, status, pipeline_id, dataset_id, imported_dsl_version, current_dsl_version } = response
if (status === DSLImportStatus.COMPLETED || status === DSLImportStatus.COMPLETED_WITH_WARNINGS) {
if (onSuccess)
onSuccess()
@ -117,7 +117,7 @@ const CreateFromDSLModal = ({
})
if (pipeline_id)
await handleCheckPluginDependencies(pipeline_id, true)
push(`datasets/${pipeline_id}/pipeline`)
push(`datasets/${dataset_id}/pipeline`)
}
else if (status === DSLImportStatus.PENDING) {
setVersions({
@ -160,7 +160,7 @@ const CreateFromDSLModal = ({
import_id: importId,
})
const { status, pipeline_id } = response
const { status, pipeline_id, dataset_id } = response
if (status === DSLImportStatus.COMPLETED) {
if (onSuccess)
@ -174,7 +174,7 @@ const CreateFromDSLModal = ({
})
if (pipeline_id)
await handleCheckPluginDependencies(pipeline_id, true)
push(`datasets/${pipeline_id}/pipeline`)
push(`datasets/${dataset_id}/pipeline`)
}
else if (status === DSLImportStatus.FAILED) {
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })

View File

@ -6,6 +6,7 @@ import { RiAddLine, RiCloseLine } from '@remixicon/react'
import Button from '@/app/components/base/button'
import { useTranslation } from 'react-i18next'
import Tooltip from '@/app/components/base/tooltip'
import Loading from '@/app/components/base/loading'
type DetailsProps = {
id: string
@ -31,9 +32,7 @@ const Details = ({
if (!pipelineTemplateInfo) {
return (
<div className='flex h-full items-center justify-center'>
<div className='system-md-medium text-text-secondary'>Loading...</div>
</div>
<Loading type='app' />
)
}

View File

@ -77,6 +77,7 @@ export type ImportPipelineDSLResponse = {
id: string
status: DSLImportStatus
pipeline_id: string
dataset_id: string
current_dsl_version: string
imported_dsl_version: string
error: string
@ -91,6 +92,7 @@ export type ImportPipelineDSLConfirmResponse = {
id: string
status: DSLImportStatus
pipeline_id: string
dataset_id: string
current_dsl_version: string
imported_dsl_version: string
error: string