Unverified Commit 767bca8d authored by gaoyan's avatar gaoyan Committed by GitHub

Fixed the issue that jobs could still be edited after they went online (#2540)

* Optimize the process * fix editor bug * fix bug * fix bug
parent 9dcf9ec6
...@@ -444,8 +444,8 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen ...@@ -444,8 +444,8 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
@Override @Override
public boolean saveOrUpdateTask(Task task) { public boolean saveOrUpdateTask(Task task) {
Task byId = getById(task.getId());
if (JobLifeCycle.PUBLISH.equalsValue(task.getStep())) { if (byId != null && JobLifeCycle.PUBLISH.equalsValue(byId.getStep())) {
throw new BusException(Status.TASK_IS_ONLINE.getMessage()); throw new BusException(Status.TASK_IS_ONLINE.getMessage());
} }
......
...@@ -73,9 +73,7 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -73,9 +73,7 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
height = '100%', // if null or undefined, set default value height = '100%', // if null or undefined, set default value
width = '100%', // if null or undefined, set default value width = '100%', // if null or undefined, set default value
language, // edit language language, // edit language
options = { options,
...MonacoEditorOptions // set default options
},
onChange, // edit change callback onChange, // edit change callback
code, // content code, // content
readOnly = false, // is readOnly readOnly = false, // is readOnly
...@@ -215,7 +213,7 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -215,7 +213,7 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
}; };
const finalEditorOptions = { const finalEditorOptions = {
...options, ...MonacoEditorOptions, // set default options
tabCompletion: 'on', // tab 补全 tabCompletion: 'on', // tab 补全
cursorSmoothCaretAnimation: true, // 光标动画 cursorSmoothCaretAnimation: true, // 光标动画
screenReaderAnnounceInlineSuggestion: true, // 屏幕阅读器提示 screenReaderAnnounceInlineSuggestion: true, // 屏幕阅读器提示
...@@ -293,9 +291,9 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -293,9 +291,9 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
}, },
wordWrap: autoWrap, wordWrap: autoWrap,
autoDetectHighContrast: true, autoDetectHighContrast: true,
lineNumbers lineNumbers,
...options,
}; };
return ( return (
<> <>
<div className={'monaco-float'}> <div className={'monaco-float'}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment