Skip to content

Commit

Permalink
feat(ui): multiple improvements of no code editor (#7076)
Browse files Browse the repository at this point in the history
* fix(ui): allow creation of multiple tasks from the no code editor

* chore(ui): make input text be of textarea type for resizability

* chore(ui): allow to add task from topology either before or after the target one
  • Loading branch information
MilosPaunovic committed Jan 30, 2025
1 parent c08f4f2 commit e46df06
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
9 changes: 8 additions & 1 deletion ui/src/components/code/components/inputs/InputText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
<span v-if="required" class="me-1 text-danger">*</span>
<span v-if="label" class="label">{{ label }}</span>
<div class="mt-1 mb-2 wrapper" :class="props.class">
<el-input v-model="input" @input="handleInput" :placeholder :disabled />
<el-input
v-model="input"
@input="handleInput"
:placeholder
:disabled
type="textarea"
:autosize="{minRows: 1}"
/>
</div>
</template>

Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/code/segments/Task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@
const action = props.creation
? YamlUtils.insertTask(
source,
YamlUtils.getLastTask(source),
route.query.target ?? YamlUtils.getLastTask(source),
task,
"after",
route.query.position ?? "after",
)
: YamlUtils.replaceTaskInDocument(
source,
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/inputs/EditorView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,8 @@
}
haveChange.value = true;
store.dispatch("core/isUnsaved", true);
if(editorViewType.value === "YAML") store.dispatch("core/isUnsaved", true);
if(!props.isCreating){
store.commit("editor/changeOpenedTabs", {
action: "dirty",
Expand Down
4 changes: 3 additions & 1 deletion ui/src/components/inputs/LowCodeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,12 @@
);
};
const onCreateNewTask = () => {
const onCreateNewTask = (details) => {
emit("openNoCode", {
section: SECTIONS.TASKS.toLowerCase(),
identifier: "new",
target: details[0],
position: details[1],
});
};
Expand Down

0 comments on commit e46df06

Please sign in to comment.