|
|
|
|
@ -86,7 +86,6 @@ const CreateFromDSLModal = ({
|
|
|
|
|
if (isCreatingRef.current)
|
|
|
|
|
return
|
|
|
|
|
isCreatingRef.current = true
|
|
|
|
|
try {
|
|
|
|
|
let response
|
|
|
|
|
if (currentTab === CreateFromDSLModalTab.FROM_FILE) {
|
|
|
|
|
response = await importDSL({
|
|
|
|
|
@ -101,8 +100,11 @@ const CreateFromDSLModal = ({
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!response)
|
|
|
|
|
if (!response) {
|
|
|
|
|
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
|
|
|
|
|
isCreatingRef.current = false
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
@ -117,7 +119,8 @@ const CreateFromDSLModal = ({
|
|
|
|
|
})
|
|
|
|
|
if (pipeline_id)
|
|
|
|
|
await handleCheckPluginDependencies(pipeline_id, true)
|
|
|
|
|
push(`datasets/${dataset_id}/pipeline`)
|
|
|
|
|
push(`/datasets/${dataset_id}/pipeline`)
|
|
|
|
|
isCreatingRef.current = false
|
|
|
|
|
}
|
|
|
|
|
else if (status === DSLImportStatus.PENDING) {
|
|
|
|
|
setVersions({
|
|
|
|
|
@ -130,15 +133,10 @@ const CreateFromDSLModal = ({
|
|
|
|
|
setShowErrorModal(true)
|
|
|
|
|
}, 300)
|
|
|
|
|
setImportId(id)
|
|
|
|
|
isCreatingRef.current = false
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch {
|
|
|
|
|
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
|
|
|
|
|
}
|
|
|
|
|
finally {
|
|
|
|
|
isCreatingRef.current = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -153,11 +151,15 @@ const CreateFromDSLModal = ({
|
|
|
|
|
const { mutateAsync: importDSLConfirm } = useImportPipelineDSLConfirm()
|
|
|
|
|
|
|
|
|
|
const onDSLConfirm = async () => {
|
|
|
|
|
try {
|
|
|
|
|
if (!importId)
|
|
|
|
|
return
|
|
|
|
|
const response = await importDSLConfirm(importId)
|
|
|
|
|
|
|
|
|
|
if (!response) {
|
|
|
|
|
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const { status, pipeline_id, dataset_id } = response
|
|
|
|
|
|
|
|
|
|
if (status === DSLImportStatus.COMPLETED) {
|
|
|
|
|
@ -178,10 +180,6 @@ const CreateFromDSLModal = ({
|
|
|
|
|
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch {
|
|
|
|
|
notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const buttonDisabled = useMemo(() => {
|
|
|
|
|
if (isAppsFull)
|
|
|
|
|
|