Browse Source

[Bug] [ui] fix cannot edit project (#6227)

* fix cannot edit project

* It has been fixed that when editing a project, if you do not modify the projectName, a project already exists error will be thrown.
2.0.7-release
Tandoy 3 years ago committed by GitHub
parent
commit
c1496d8a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java
  2. 2
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/createProject.vue
  3. 2
      dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java

@ -296,7 +296,7 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic
return result;
}
Project tempProject = projectMapper.queryByName(projectName);
if (tempProject != null) {
if (tempProject != null && tempProject.getCode() != project.getCode()) {
putMsg(result, Status.PROJECT_ALREADY_EXISTS, projectName);
return result;
}

2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/createProject.vue

@ -92,7 +92,7 @@
// edit
if (this.item) {
param.projectId = this.item.id
param.projectCode = this.item.code
}
this.$refs.popover.spinnerLoading = true

2
dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js

@ -71,7 +71,7 @@ export default {
*/
updateProjects ({ state }, payload) {
return new Promise((resolve, reject) => {
io.put(`projects/${payload.projectId}`, payload, res => {
io.put(`projects/${payload.projectCode}`, payload, res => {
resolve(res)
}).catch(e => {
reject(e)

Loading…
Cancel
Save