This is an automated email from the ASF dual-hosted git repository.

caishunfeng pushed a commit to branch 3.0.0-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git

commit ebdc34b25fa2ffdde701c4fb6650db6b430c205f
Author: Devosend <[email protected]>
AuthorDate: Tue Jul 26 11:25:33 2022 +0800

    [Fix][UI] Add duplicate of file suffix (#11136)
---
 dolphinscheduler-ui/src/locales/en_US/resource.ts              | 2 ++
 dolphinscheduler-ui/src/locales/zh_CN/resource.ts              | 1 +
 dolphinscheduler-ui/src/views/resource/file/create/use-form.ts | 3 +++
 3 files changed, 6 insertions(+)

diff --git a/dolphinscheduler-ui/src/locales/en_US/resource.ts 
b/dolphinscheduler-ui/src/locales/en_US/resource.ts
index 45e2d16c7f..297a3217ea 100644
--- a/dolphinscheduler-ui/src/locales/en_US/resource.ts
+++ b/dolphinscheduler-ui/src/locales/en_US/resource.ts
@@ -40,6 +40,8 @@ export default {
     enter_name_tips: 'Please enter name',
     enter_description_tips: 'Please enter description',
     enter_content_tips: 'Please enter the resource content',
+    enter_suffix_tips: 'Please enter the suffix',
+    duplicate_suffix_tips: 'Duplicate file suffix',
     file_format: 'File Format',
     file_content: 'File Content',
     delete_confirm: 'Delete?',
diff --git a/dolphinscheduler-ui/src/locales/zh_CN/resource.ts 
b/dolphinscheduler-ui/src/locales/zh_CN/resource.ts
index 0c49060665..5797c6d57b 100644
--- a/dolphinscheduler-ui/src/locales/zh_CN/resource.ts
+++ b/dolphinscheduler-ui/src/locales/zh_CN/resource.ts
@@ -41,6 +41,7 @@ export default {
     enter_description_tips: '请输入描述',
     enter_content_tips: '请输入资源内容',
     enter_suffix_tips: '请输入文件后缀',
+    duplicate_suffix_tips: '文件后缀重复',
     file_format: '文件格式',
     file_content: '文件内容',
     delete_confirm: '确定删除吗?',
diff --git a/dolphinscheduler-ui/src/views/resource/file/create/use-form.ts 
b/dolphinscheduler-ui/src/views/resource/file/create/use-form.ts
index fa132ac5a6..48e63e0fa6 100644
--- a/dolphinscheduler-ui/src/views/resource/file/create/use-form.ts
+++ b/dolphinscheduler-ui/src/views/resource/file/create/use-form.ts
@@ -47,6 +47,9 @@ export function useForm() {
           if (state.fileForm.fileName === '') {
             return new Error(t('resource.file.enter_name_tips'))
           }
+          if (state.fileForm.fileName.endsWith(`.${state.fileForm.suffix}`)) {
+            return new Error(t('resource.file.duplicate_suffix_tips'))
+          }
         }
       },
       suffix: {

Reply via email to