From 9b163249d60a3abaf63c834da173dbaa58ebb606 Mon Sep 17 00:00:00 2001 From: calvin Date: Mon, 21 Mar 2022 21:52:07 +0800 Subject: [PATCH] [Fix-9025] [UI Next] Rectify this issue about failing to save a process when the user is ordinary user. (#9063) * modify the back-edn api * fix this issue --- .../api/service/impl/TaskGroupServiceImpl.java | 11 ----------- .../task/components/node/fields/use-task-group.ts | 8 +++++--- .../projects/task/components/node/format-data.ts | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java index 8bd96b5dd6..74d902c23c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java @@ -199,9 +199,6 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe @Override public Map queryTaskGroupByProjectCode(User loginUser, int pageNo, int pageSize, Long projectCode) { Map result = new HashMap<>(); - if (isNotAdmin(loginUser, result)) { - return result; - } Page page = new Page<>(pageNo, pageSize); IPage taskGroupPaging = taskGroupMapper.queryTaskGroupPagingByProjectCode(page, projectCode); @@ -230,9 +227,6 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe @Override public Map queryTaskGroupById(User loginUser, int id) { Map result = new HashMap<>(); - if (isNotAdmin(loginUser, result)) { - return result; - } TaskGroup taskGroup = taskGroupMapper.selectById(id); result.put(Constants.DATA_LIST, taskGroup); putMsg(result, Status.SUCCESS); @@ -249,13 +243,9 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe * @param status status * @return the result code and msg */ - @Override public Map doQuery(User loginUser, int pageNo, int pageSize, int userId, String name, Integer status) { Map result = new HashMap<>(); - if (isNotAdmin(loginUser, result)) { - return result; - } Page page = new Page<>(pageNo, pageSize); IPage taskGroupPaging = taskGroupMapper.queryTaskGroupPaging(page, userId, name, status); @@ -269,7 +259,6 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe * @param id task group id * @return the result code and msg */ - @Override public Map closeTaskGroup(User loginUser, int id) { Map result = new HashMap<>(); diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts index f22dba5523..76d4fe57fb 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts @@ -52,7 +52,10 @@ export function useTaskGroup( watch( () => model.taskGroupId, (taskGroupId) => { - if (!taskGroupId) model.taskGroupPriority = 0 + if (!taskGroupId) { + model.taskGroupId = null + model.taskGroupPriority = null + } } ) @@ -75,8 +78,7 @@ export function useTaskGroup( max: Math.pow(10, 60) - 1, disabled: priorityDisabled }, - span: 12, - value: 0 + span: 12 } ] } diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts index 728a4ec2da..e06617fe98 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts @@ -305,7 +305,7 @@ export function formatParams(data: INodeData): { failRetryTimes: data.failRetryTimes ? String(data.failRetryTimes) : '0', flag: data.flag, name: data.name, - taskGroupId: data.taskGroupId || 0, + taskGroupId: data.taskGroupId, taskGroupPriority: data.taskGroupPriority, taskParams: { localParams: data.localParams,