This is an automated email from the ASF dual-hosted git repository.
huajiang 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 d49dbbaac8 [Improvement-15725][UI] The default option of project
preferences can be clearable. (#15727)
d49dbbaac8 is described below
commit d49dbbaac838e44389f5bab83f84b54c80907283
Author: calvin <[email protected]>
AuthorDate: Sat Mar 16 18:13:43 2024 +0800
[Improvement-15725][UI] The default option of project preferences can be
clearable. (#15727)
* adjust the project preferences
---
dolphinscheduler-ui/src/views/projects/preference/use-form.ts | 8 +++++++-
.../src/views/projects/task/components/node/detail-modal.tsx | 6 +++++-
.../projects/workflow/definition/components/start-modal.tsx | 10 ++++++++++
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/dolphinscheduler-ui/src/views/projects/preference/use-form.ts
b/dolphinscheduler-ui/src/views/projects/preference/use-form.ts
index 992bc007a2..d67a61f96c 100644
--- a/dolphinscheduler-ui/src/views/projects/preference/use-form.ts
+++ b/dolphinscheduler-ui/src/views/projects/preference/use-form.ts
@@ -125,7 +125,13 @@ export function useForm() {
item.validate.required = false
item.span = 12
}
- Object.assign(item, { props: { style: 'width: 250px' } })
+ if (item.type === 'select') {
+ Object.assign(item, {
+ props: { style: 'width: 250px', clearable: true }
+ })
+ } else {
+ Object.assign(item, { props: { style: 'width: 250px' } })
+ }
}
return preferencesItems
}
diff --git
a/dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx
b/dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx
index f609c8d16c..5482b7cb36 100644
---
a/dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx
+++
b/dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx
@@ -130,7 +130,11 @@ const NodeDetailModal = defineComponent({
const restructureNodeData = (data: INodeData) => {
if (!data?.id) {
- Object.assign(data, projectPreferences.value)
+ for (let item in projectPreferences.value) {
+ if (projectPreferences.value[item] !== null && item in data) {
+ Object.assign(data, { item: projectPreferences.value[item] })
+ }
+ }
}
}
diff --git
a/dolphinscheduler-ui/src/views/projects/workflow/definition/components/start-modal.tsx
b/dolphinscheduler-ui/src/views/projects/workflow/definition/components/start-modal.tsx
index 7e7a774658..2f476fd2a1 100644
---
a/dolphinscheduler-ui/src/views/projects/workflow/definition/components/start-modal.tsx
+++
b/dolphinscheduler-ui/src/views/projects/workflow/definition/components/start-modal.tsx
@@ -240,6 +240,16 @@ export default defineComponent({
form.environmentCode = projectPreferences.value.environmentCode
}
}
+ if (projectPreferences.value?.alertGroups && variables?.alertGroups) {
+ if (
+ containValueInOptions(
+ variables.alertGroups,
+ projectPreferences.value.alertGroups
+ )
+ ) {
+ form.warningGroupId = projectPreferences.value.alertGroups
+ }
+ }
}
const updateWorkerGroup = () => {