Skip to content

Commit

Permalink
Fixed the issue that jobs could still be edited after they went online (
Browse files Browse the repository at this point in the history
#2540)

* Optimize the process

* fix editor bug

* fix bug

* fix bug
  • Loading branch information
gaoyan1998 authored Nov 17, 2023
1 parent 9dcf9ec commit 767bca8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ public boolean changeTaskLifeRecyle(Integer taskId, JobLifeCycle lifeCycle) thro

@Override
public boolean saveOrUpdateTask(Task task) {

if (JobLifeCycle.PUBLISH.equalsValue(task.getStep())) {
Task byId = getById(task.getId());
if (byId != null && JobLifeCycle.PUBLISH.equalsValue(byId.getStep())) {
throw new BusException(Status.TASK_IS_ONLINE.getMessage());
}

Expand Down
10 changes: 4 additions & 6 deletions dinky-web/src/components/CustomEditor/CodeEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
height = '100%', // if null or undefined, set default value
width = '100%', // if null or undefined, set default value
language, // edit language
options = {
...MonacoEditorOptions // set default options
},
options,
onChange, // edit change callback
code, // content
readOnly = false, // is readOnly
Expand Down Expand Up @@ -215,7 +213,7 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
};

const finalEditorOptions = {
...options,
...MonacoEditorOptions, // set default options
tabCompletion: 'on', // tab 补全
cursorSmoothCaretAnimation: true, // 光标动画
screenReaderAnnounceInlineSuggestion: true, // 屏幕阅读器提示
Expand Down Expand Up @@ -293,9 +291,9 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
},
wordWrap: autoWrap,
autoDetectHighContrast: true,
lineNumbers
lineNumbers,
...options,
};

return (
<>
<div className={'monaco-float'}>
Expand Down

0 comments on commit 767bca8

Please sign in to comment.