Browse Source

[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
3.0.0/version-upgrade
calvin 3 years ago committed by GitHub
parent
commit
9b163249d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java
  2. 8
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts
  3. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts

11
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 @Override
public Map<String, Object> queryTaskGroupByProjectCode(User loginUser, int pageNo, int pageSize, Long projectCode) { public Map<String, Object> queryTaskGroupByProjectCode(User loginUser, int pageNo, int pageSize, Long projectCode) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
Page<TaskGroup> page = new Page<>(pageNo, pageSize); Page<TaskGroup> page = new Page<>(pageNo, pageSize);
IPage<TaskGroup> taskGroupPaging = taskGroupMapper.queryTaskGroupPagingByProjectCode(page, projectCode); IPage<TaskGroup> taskGroupPaging = taskGroupMapper.queryTaskGroupPagingByProjectCode(page, projectCode);
@ -230,9 +227,6 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe
@Override @Override
public Map<String, Object> queryTaskGroupById(User loginUser, int id) { public Map<String, Object> queryTaskGroupById(User loginUser, int id) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
TaskGroup taskGroup = taskGroupMapper.selectById(id); TaskGroup taskGroup = taskGroupMapper.selectById(id);
result.put(Constants.DATA_LIST, taskGroup); result.put(Constants.DATA_LIST, taskGroup);
putMsg(result, Status.SUCCESS); putMsg(result, Status.SUCCESS);
@ -249,13 +243,9 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe
* @param status status * @param status status
* @return the result code and msg * @return the result code and msg
*/ */
@Override @Override
public Map<String, Object> doQuery(User loginUser, int pageNo, int pageSize, int userId, String name, Integer status) { public Map<String, Object> doQuery(User loginUser, int pageNo, int pageSize, int userId, String name, Integer status) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
Page<TaskGroup> page = new Page<>(pageNo, pageSize); Page<TaskGroup> page = new Page<>(pageNo, pageSize);
IPage<TaskGroup> taskGroupPaging = taskGroupMapper.queryTaskGroupPaging(page, userId, name, status); IPage<TaskGroup> taskGroupPaging = taskGroupMapper.queryTaskGroupPaging(page, userId, name, status);
@ -269,7 +259,6 @@ public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupSe
* @param id task group id * @param id task group id
* @return the result code and msg * @return the result code and msg
*/ */
@Override @Override
public Map<String, Object> closeTaskGroup(User loginUser, int id) { public Map<String, Object> closeTaskGroup(User loginUser, int id) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();

8
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts

@ -52,7 +52,10 @@ export function useTaskGroup(
watch( watch(
() => model.taskGroupId, () => model.taskGroupId,
(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, max: Math.pow(10, 60) - 1,
disabled: priorityDisabled disabled: priorityDisabled
}, },
span: 12, span: 12
value: 0
} }
] ]
} }

2
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', failRetryTimes: data.failRetryTimes ? String(data.failRetryTimes) : '0',
flag: data.flag, flag: data.flag,
name: data.name, name: data.name,
taskGroupId: data.taskGroupId || 0, taskGroupId: data.taskGroupId,
taskGroupPriority: data.taskGroupPriority, taskGroupPriority: data.taskGroupPriority,
taskParams: { taskParams: {
localParams: data.localParams, localParams: data.localParams,

Loading…
Cancel
Save