From e1f871fefe8fdff558b0fd5d5aea02086027fd01 Mon Sep 17 00:00:00 2001 From: "Krito." Date: Mon, 8 Sep 2025 09:41:51 +0800 Subject: [PATCH] fix: ensure consistent DSL export behavior across UI entry (#25317) Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> --- web/app/components/app-sidebar/app-info.tsx | 19 +++++++++++++++++++ web/i18n/en-US/workflow.ts | 4 ++++ web/i18n/ja-JP/workflow.ts | 4 ++++ web/i18n/zh-Hans/workflow.ts | 4 ++++ 4 files changed, 31 insertions(+) diff --git a/web/app/components/app-sidebar/app-info.tsx b/web/app/components/app-sidebar/app-info.tsx index cf55c0d68..2037647b9 100644 --- a/web/app/components/app-sidebar/app-info.tsx +++ b/web/app/components/app-sidebar/app-info.tsx @@ -72,6 +72,7 @@ const AppInfo = ({ expand, onlyShowDetail = false, openState = false, onDetailEx const [showSwitchModal, setShowSwitchModal] = useState(false) const [showImportDSLModal, setShowImportDSLModal] = useState(false) const [secretEnvList, setSecretEnvList] = useState([]) + const [showExportWarning, setShowExportWarning] = useState(false) const onEdit: CreateAppModalProps['onConfirm'] = useCallback(async ({ name, @@ -159,6 +160,14 @@ const AppInfo = ({ expand, onlyShowDetail = false, openState = false, onDetailEx onExport() return } + + setShowExportWarning(true) + } + + const handleConfirmExport = async () => { + if (!appDetail) + return + setShowExportWarning(false) try { const workflowDraft = await fetchWorkflowDraft(`/apps/${appDetail.id}/workflows/draft`) const list = (workflowDraft.environment_variables || []).filter(env => env.value_type === 'secret') @@ -407,6 +416,16 @@ const AppInfo = ({ expand, onlyShowDetail = false, openState = false, onDetailEx onClose={() => setSecretEnvList([])} /> )} + {showExportWarning && ( + setShowExportWarning(false)} + /> + )} ) } diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index eae63e9c2..5da97a769 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -140,6 +140,10 @@ const translation = { export: 'Export DSL with secret values ', }, }, + sidebar: { + exportWarning: 'Export Current Saved Version', + exportWarningDesc: 'This will export the current saved version of your workflow. If you have unsaved changes in the editor, please save them first by using the export option in the workflow canvas.', + }, chatVariable: { panelTitle: 'Conversation Variables', panelDescription: 'Conversation Variables are used to store interactive information that LLM needs to remember, including conversation history, uploaded files, user preferences. They are read-write. ', diff --git a/web/i18n/ja-JP/workflow.ts b/web/i18n/ja-JP/workflow.ts index 2a3ee304f..707a119c4 100644 --- a/web/i18n/ja-JP/workflow.ts +++ b/web/i18n/ja-JP/workflow.ts @@ -140,6 +140,10 @@ const translation = { export: 'シークレット値付きでエクスポート', }, }, + sidebar: { + exportWarning: '現在保存されているバージョンをエクスポート', + exportWarningDesc: 'これは現在保存されているワークフローのバージョンをエクスポートします。エディターで未保存の変更がある場合は、まずワークフローキャンバスのエクスポートオプションを使用して保存してください。', + }, chatVariable: { panelTitle: '会話変数', panelDescription: '対話情報を保存・管理(会話履歴/ファイル/ユーザー設定など)。書き換えができます。', diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index 4573fa7bd..60c65a080 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -140,6 +140,10 @@ const translation = { export: '导出包含 Secret 值的 DSL', }, }, + sidebar: { + exportWarning: '导出当前已保存版本', + exportWarningDesc: '这将导出您工作流的当前已保存版本。如果您在编辑器中有未保存的更改,请先使用工作流画布中的导出选项保存它们。', + }, chatVariable: { panelTitle: '会话变量', panelDescription: '会话变量用于存储 LLM 需要的上下文信息,如用户偏好、对话历史等。它是可读写的。',