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/21 01:22:10 UTC
[dolphinscheduler] branch dev updated: [Fix][UI Next][V1.0.0-Alpha] When creating a new project, the last created project information is not cleared (#9037)
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 16bc226 [Fix][UI Next][V1.0.0-Alpha] When creating a new project, the last created project information is not cleared (#9037)
16bc226 is described below
commit 16bc226bad3d8c6ce43f8f4903453f65d2400a22
Author: zhangxinruu <10...@users.noreply.github.com>
AuthorDate: Mon Mar 21 09:22:05 2022 +0800
[Fix][UI Next][V1.0.0-Alpha] When creating a new project, the last created project information is not cleared (#9037)
---
.../src/views/projects/list/components/project-modal.tsx | 2 ++
.../src/views/projects/list/components/use-form.ts | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx
index 3c66aa1..5cf7258 100644
--- a/dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx
+++ b/dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx
@@ -52,6 +52,8 @@ const ProjectModal = defineComponent({
variables.model.description = ''
} else {
variables.model.userName = props.row.userName
+ variables.model.projectName = props.row.name
+ variables.model.description = props.row.description
}
ctx.emit('cancelModal', props.showModalRef)
}
diff --git a/dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts b/dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts
index fc0e7eb..a3c96c4 100644
--- a/dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/list/components/use-form.ts
@@ -29,6 +29,14 @@ export function useForm(
const { t } = useI18n()
const userStore = useUserStore()
+ const resetForm = () => {
+ variables.model = {
+ projectName: '',
+ description: '',
+ userName: (userStore.getUserInfo as UserInfoRes).userName
+ }
+ }
+
const variables = reactive({
projectFormRef: ref(),
model: {
@@ -75,6 +83,7 @@ export function useForm(
try {
await createProject(variables.model)
variables.saving = false
+ resetForm()
ctx.emit('confirmModal', props.showModalRef)
} catch (err) {
variables.saving = false
@@ -87,6 +96,7 @@ export function useForm(
try {
await updateProject(variables.model, props.row.code)
variables.saving = false
+ resetForm()
ctx.emit('confirmModal', props.showModalRef)
} catch (err) {
variables.saving = false