diff --git a/web/app/components/app-sidebar/app-info/app-info-detail-panel.tsx b/web/app/components/app-sidebar/app-info/app-info-detail-panel.tsx index e00f610b4d..67f8dd5d5a 100644 --- a/web/app/components/app-sidebar/app-info/app-info-detail-panel.tsx +++ b/web/app/components/app-sidebar/app-info/app-info-detail-panel.tsx @@ -126,7 +126,7 @@ const AppInfoDetailPanel = ({ secondaryOperations={secondaryOperations} /> - {appDetail.type !== AppTypeEnum.EVALUATION && ( + {appDetail.workflow_type !== AppTypeEnum.EVALUATION && ( { - if (!isWorkflowTypeConversionTarget(appDetail?.type)) + if (!appDetail?.workflow_type) + return WORKFLOW_TYPE_SWITCH_CONFIG.workflow + + if (!isWorkflowTypeConversionTarget(appDetail?.workflow_type)) return undefined - return WORKFLOW_TYPE_SWITCH_CONFIG[appDetail.type] - }, [appDetail?.type]) - const isEvaluationWorkflowType = appDetail?.type === AppTypeEnum.EVALUATION + return WORKFLOW_TYPE_SWITCH_CONFIG[appDetail.workflow_type] + }, [appDetail?.workflow_type]) + const isEvaluationWorkflowType = appDetail?.workflow_type === AppTypeEnum.EVALUATION const { refetch: refetchEvaluationWorkflowAssociatedTargets, isFetching: isFetchingEvaluationWorkflowAssociatedTargets, @@ -321,7 +324,7 @@ const AppPublisher = ({ return } - if (appDetail.type === AppTypeEnum.EVALUATION && workflowTypeSwitchConfig.targetType === AppTypeEnum.WORKFLOW) { + if (appDetail.workflow_type === AppTypeEnum.EVALUATION && workflowTypeSwitchConfig.targetType === AppTypeEnum.WORKFLOW) { const associatedTargetsResult = await refetchEvaluationWorkflowAssociatedTargets() if (associatedTargetsResult.isError) { @@ -340,7 +343,7 @@ const AppPublisher = ({ await performWorkflowTypeSwitch() }, [ appDetail?.id, - appDetail?.type, + appDetail?.workflow_type, performWorkflowTypeSwitch, refetchEvaluationWorkflowAssociatedTargets, t, diff --git a/web/app/components/workflow-app/components/workflow-onboarding-modal/start-node-selection-panel.tsx b/web/app/components/workflow-app/components/workflow-onboarding-modal/start-node-selection-panel.tsx index dfb36f5534..30dce87121 100644 --- a/web/app/components/workflow-app/components/workflow-onboarding-modal/start-node-selection-panel.tsx +++ b/web/app/components/workflow-app/components/workflow-onboarding-modal/start-node-selection-panel.tsx @@ -21,7 +21,7 @@ const StartNodeSelectionPanel: FC = ({ onSelectTrigger, }) => { const { t } = useTranslation() - const appType = useAppStore(s => s.appDetail?.type) + const appType = useAppStore(s => s.appDetail?.workflow_type) const [showTriggerSelector, setShowTriggerSelector] = useState(false) const isEvaluationWorkflowType = isEvaluationWorkflow(appType) @@ -62,7 +62,7 @@ const StartNodeSelectionPanel: FC = ({ trigger={() => ( +
)} diff --git a/web/app/components/workflow-app/hooks/use-available-nodes-meta-data.ts b/web/app/components/workflow-app/hooks/use-available-nodes-meta-data.ts index 33edaa2ed5..1e47b82932 100644 --- a/web/app/components/workflow-app/hooks/use-available-nodes-meta-data.ts +++ b/web/app/components/workflow-app/hooks/use-available-nodes-meta-data.ts @@ -18,7 +18,7 @@ import { useIsChatMode } from './use-is-chat-mode' export const useAvailableNodesMetaData = () => { const { t } = useTranslation() const isChatMode = useIsChatMode() - const appType = useAppStore(s => s.appDetail?.type) + const appType = useAppStore(s => s.appDetail?.workflow_type) const docLink = useDocLink() const isEvaluationWorkflowType = isEvaluationWorkflow(appType) diff --git a/web/app/components/workflow/block-selector/all-start-blocks.tsx b/web/app/components/workflow/block-selector/all-start-blocks.tsx index 1c17b4c93a..416c107ed3 100644 --- a/web/app/components/workflow/block-selector/all-start-blocks.tsx +++ b/web/app/components/workflow/block-selector/all-start-blocks.tsx @@ -57,7 +57,7 @@ const AllStartBlocks = ({ const { t } = useTranslation() const [hasStartBlocksContent, setHasStartBlocksContent] = useState(false) const [hasPluginContent, setHasPluginContent] = useState(false) - const appType = useAppStore(s => s.appDetail?.type) + const appType = useAppStore(s => s.appDetail?.workflow_type) const { data: enable_marketplace } = useSuspenseQuery({ ...systemFeaturesQueryOptions(), select: s => s.enable_marketplace, diff --git a/web/app/components/workflow/block-selector/blocks.tsx b/web/app/components/workflow/block-selector/blocks.tsx index b152fd1afa..27e62a0661 100644 --- a/web/app/components/workflow/block-selector/blocks.tsx +++ b/web/app/components/workflow/block-selector/blocks.tsx @@ -31,7 +31,7 @@ const Blocks = ({ }: BlocksProps) => { const { t } = useTranslation() const store = useStoreApi() - const appType = useAppStore(s => s.appDetail?.type) + const appType = useAppStore(s => s.appDetail?.workflow_type) const blocksFromHooks = useBlocks() const filteredAvailableBlocksTypes = useMemo(() => { if (!isEvaluationWorkflow(appType)) diff --git a/web/types/app.ts b/web/types/app.ts index ac4edfbbd2..3d11798f31 100644 --- a/web/types/app.ts +++ b/web/types/app.ts @@ -355,8 +355,6 @@ export type App = { /** Mode */ mode: AppModeEnum - /** Type */ - type?: AppTypeEnum /** Enable web app */ enable_site: boolean /** Enable web API */ @@ -392,6 +390,8 @@ export type App = { max_active_requests?: number | null /** whether workflow trigger has un-published draft */ has_draft_trigger?: boolean + /** Type */ + workflow_type?: AppTypeEnum } export type AppSSO = {