diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index 77f824a9..3253440e 100755 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -867,6 +867,15 @@ export default { editor: { createTitle: 'Create Agent', editTitle: 'Edit Agent', + buttons: { + create: 'Create Agent', + saveAndClose: 'Save and Close', + }, + postCreateHint: { + title: 'Created successfully', + footer: 'Keep adjusting settings, configure sharing and publishing, then click "Save and Close".', + integrationDesc: 'Go to Integrations to configure IM, web embed, and other publishing channels', + }, basicInfo: 'Basic Info', basicInfoDesc: 'Configure agent name, description, and run mode', promptsConfig: 'Prompts', @@ -2229,7 +2238,13 @@ export default { }, buttons: { create: 'Create Knowledge Base', - save: 'Save Configuration' + save: 'Save Configuration', + saveAndClose: 'Save and Close', + }, + postCreateHint: { + title: 'Created successfully', + footer: 'Keep adjusting settings, configure sharing and data sources, then click "Save and Close".', + followUpDesc: 'Configure data sources on the left, or use Share Management to publish to spaces', }, share: { description: 'Share the knowledge base with spaces so members can access and use it', diff --git a/frontend/src/i18n/locales/ko-KR.ts b/frontend/src/i18n/locales/ko-KR.ts index a78b2611..5c212c61 100755 --- a/frontend/src/i18n/locales/ko-KR.ts +++ b/frontend/src/i18n/locales/ko-KR.ts @@ -3455,7 +3455,13 @@ export default { }, buttons: { create: '지식베이스 생성', - save: '설정 저장' + save: '설정 저장', + saveAndClose: '저장 후 닫기', + }, + postCreateHint: { + title: '생성 완료', + footer: '설정을 계속 조정하고 공유·데이터 소스를 구성한 뒤 "저장 후 닫기"를 클릭하세요.', + followUpDesc: '왼쪽에서 데이터 소스를 구성하거나 "공유 관리"에서 스페이스에 게시할 수 있습니다', }, wikiBrowser: { editBtn: '편집', @@ -4760,6 +4766,15 @@ export default { editor: { createTitle: '에이전트 만들기', editTitle: '에이전트 편집', + buttons: { + create: '에이전트 만들기', + saveAndClose: '저장 후 닫기', + }, + postCreateHint: { + title: '생성 완료', + footer: '설정을 계속 조정하고 공유·배포 채널을 구성한 뒤 "저장 후 닫기"를 클릭하세요.', + integrationDesc: '통합 센터에서 IM, 웹 임베드 등 배포 채널을 설정하세요', + }, basicInfo: '기본정보', basicInfoDesc: '에이전트 이름, 설명 및 실행 모드 구성', promptsConfig: '프롬프트', diff --git a/frontend/src/i18n/locales/ru-RU.ts b/frontend/src/i18n/locales/ru-RU.ts index 424de631..b5655768 100755 --- a/frontend/src/i18n/locales/ru-RU.ts +++ b/frontend/src/i18n/locales/ru-RU.ts @@ -3455,7 +3455,13 @@ export default { }, buttons: { create: 'Создать базу знаний', - save: 'Сохранить настройки' + save: 'Сохранить настройки', + saveAndClose: 'Сохранить и закрыть', + }, + postCreateHint: { + title: 'База знаний создана', + footer: 'Продолжите настройку, настройте совместное использование и источники данных, затем нажмите «Сохранить и закрыть».', + followUpDesc: 'Настройте источники данных слева или опубликуйте базу в пространствах через «Управление общим доступом»', }, wikiBrowser: { editBtn: 'Редактировать', @@ -4760,6 +4766,15 @@ export default { editor: { createTitle: 'Create Agent', editTitle: 'Edit Agent', + buttons: { + create: 'Создать агента', + saveAndClose: 'Сохранить и закрыть', + }, + postCreateHint: { + title: 'Агент создан', + footer: 'Продолжите настройку, настройте совместное использование и публикацию, затем нажмите «Сохранить и закрыть».', + integrationDesc: 'Перейдите в раздел интеграций, чтобы настроить каналы IM, веб-встраивания и другие каналы публикации', + }, basicInfo: 'Basic Info', basicInfoDesc: 'Настройка имени, описания и режима работы агента', promptsConfig: 'Промпты', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index a7c5618e..e1948910 100755 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -3455,7 +3455,13 @@ export default { }, buttons: { create: '创建知识库', - save: '保存配置' + save: '保存配置', + saveAndClose: '保存并关闭', + }, + postCreateHint: { + title: '创建成功', + footer: '可继续调整配置,设置共享与数据源,完成后点击「保存并关闭」。', + followUpDesc: '可在左侧配置数据源,或在「共享管理」中发布到空间', }, wikiBrowser: { editBtn: '编辑', @@ -4760,6 +4766,15 @@ export default { editor: { createTitle: '创建智能体', editTitle: '编辑智能体', + buttons: { + create: '创建智能体', + saveAndClose: '保存并关闭', + }, + postCreateHint: { + title: '创建成功', + footer: '可继续调整配置,设置共享与发布渠道,完成后点击「保存并关闭」。', + integrationDesc: '前往集成中心配置 IM、网页嵌入等发布渠道', + }, basicInfo: '基本信息', basicInfoDesc: '配置智能体的名称、描述与运行模式', promptsConfig: '提示词', diff --git a/frontend/src/views/agent/AgentEditorModal.test.mjs b/frontend/src/views/agent/AgentEditorModal.test.mjs new file mode 100644 index 00000000..834c402d --- /dev/null +++ b/frontend/src/views/agent/AgentEditorModal.test.mjs @@ -0,0 +1,36 @@ +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import test from 'node:test' + +const source = readFileSync(new URL('./AgentEditorModal.vue', import.meta.url), 'utf8') + +test('editing an agent closes the editor after a successful save', () => { + assert.match( + source, + /await updateAgent\(formData\.value\.id, formData\.value\);\s*MessagePlugin\.success\(t\('agent\.messages\.updated'\)\);\s*emit\('success'\);\s*handleClose\(\);/ + ) +}) + +test('the first successful create stays open for integration setup', () => { + const createBranch = source.match( + /if \(editorMode\.value === 'create'\) \{([\s\S]*?)^\s{4}\} else \{/m + )?.[1] + + assert.ok(createBranch, 'expected to find the create branch') + assert.doesNotMatch(createBranch, /handleClose\(\)/) + assert.match(createBranch, /savedAgent\.value = created;/) +}) + +test('save button labels distinguish create from save-and-close', () => { + assert.match( + source, + /const saveButtonLabel = computed\(\(\) =>\s*editorMode\.value === 'create'\s*\? t\('agent\.editor\.buttons\.create'\)\s*: t\('agent\.editor\.buttons\.saveAndClose'\)\s*\)/ + ) + assert.match(source, /saveButtonLabel/) +}) + +test('shows a post-create hint after the first successful save', () => { + assert.match(source, /const isPostCreateSession = computed\(\(\) => !!savedAgent\.value\)/) + assert.match(source, /settings-footer-note/) + assert.match(source, /agent\.editor\.postCreateHint\.title/) +}) diff --git a/frontend/src/views/agent/AgentEditorModal.vue b/frontend/src/views/agent/AgentEditorModal.vue index 0ebb06e5..2561e9c8 100644 --- a/frontend/src/views/agent/AgentEditorModal.vue +++ b/frontend/src/views/agent/AgentEditorModal.vue @@ -75,7 +75,7 @@
{{ $t('integrations.agentEditor.desc') }}
+{{ isPostCreateSession ? $t('agent.editor.postCreateHint.integrationDesc') : $t('integrations.agentEditor.desc') }}