You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by so...@apache.org on 2022/03/08 04:25:44 UTC

[dolphinscheduler] branch dev updated: [Fix][UI Next][V1.0.0-Alpha] Fix time alert validate of workflow (#8750)

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

songjian pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 080a237  [Fix][UI Next][V1.0.0-Alpha] Fix time alert validate of workflow (#8750)
080a237 is described below

commit 080a237b0d8f0adefde22c922ad2c52fa26c133e
Author: Devosend <de...@gmail.com>
AuthorDate: Tue Mar 8 12:25:31 2022 +0800

    [Fix][UI Next][V1.0.0-Alpha] Fix time alert validate of workflow (#8750)
---
 dolphinscheduler-ui-next/src/utils/regex.ts                         | 2 ++
 .../src/views/projects/workflow/components/dag/dag-save-modal.tsx   | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/dolphinscheduler-ui-next/src/utils/regex.ts b/dolphinscheduler-ui-next/src/utils/regex.ts
index 0a0de4f..eb0ff18 100644
--- a/dolphinscheduler-ui-next/src/utils/regex.ts
+++ b/dolphinscheduler-ui-next/src/utils/regex.ts
@@ -21,4 +21,6 @@ const regex = {
   password: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/
 }
 
+export const positiveIntegerRegex = /^\+?[0-9]*$/
+
 export default regex
diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
index 8962fcc..8c83650 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
@@ -33,6 +33,7 @@ import { SaveForm, WorkflowDefinition } from './types'
 import { useRoute } from 'vue-router'
 import { verifyName } from '@/service/modules/process-definition'
 import './x6-style.scss'
+import { positiveIntegerRegex } from '@/utils/regex'
 
 const props = {
   visible: {
@@ -95,7 +96,10 @@ export default defineComponent({
       },
       timeout: {
         validator() {
-          if (formValue.value.timeoutFlag && formValue.value.timeout <= 0) {
+          if (
+            formValue.value.timeoutFlag &&
+            !positiveIntegerRegex.test(String(formValue.value.timeout))
+          ) {
             return new Error(t('project.dag.positive_integer'))
           }
         }