Skip to content

Commit

Permalink
feat(ui): multiple improvements of no code editor (#6951)
Browse files Browse the repository at this point in the history
* chore(ui): persist change of editor type on each toggle

* chore(ui): remove topology-only view from editor
  • Loading branch information
MilosPaunovic authored Jan 27, 2025
1 parent adb8d9a commit 1bcc22a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ui/src/components/inputs/EditorView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<el-switch
v-if="!isNamespace"
v-model="editorViewType"
@change="changeEditorViewType"
active-value="NO_CODE"
inactive-value="YAML"
:inactive-text="$t('no_code.labels.no_code')"
Expand Down Expand Up @@ -494,6 +495,9 @@
});
const editorViewType = ref("YAML");
const changeEditorViewType = (value) => {
localStorage.setItem(storageKeys.EDITOR_VIEW_TYPE, value);
}
const handleTopologyEditClick = (params) => {
editorViewType.value = "NO_CODE";
Expand Down
4 changes: 0 additions & 4 deletions ui/src/components/inputs/SwitchView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<el-tooltip :content="!isFlow ? $t('flow_only') : $t('source and topology')" transition="" :hide-after="0" :persistent="false" effect="light">
<el-button :disabled="!isFlow" :type="buttonType(editorViewTypes.SOURCE_TOPOLOGY)" @click="switchView(editorViewTypes.SOURCE_TOPOLOGY)" :icon="FileTableOutline" />
</el-tooltip>
<el-tooltip :content="!isFlow ? $t('flow_only') : $t('topology')" transition="" :hide-after="0" :persistent="false" effect="light">
<el-button :disabled="!isFlow" :type="buttonType(editorViewTypes.TOPOLOGY)" @click="switchView(editorViewTypes.TOPOLOGY)" :icon="FileTreeOutline" />
</el-tooltip>
<el-tooltip :content="!isFlow ? $t('flow_only') : $t('source and blueprints')" transition="" :hide-after="0" :persistent="false" effect="light">
<el-button :disabled="!isFlow" :type="buttonType(editorViewTypes.SOURCE_BLUEPRINTS)" @click="switchView(editorViewTypes.SOURCE_BLUEPRINTS)" :icon="BallotOutline" />
</el-tooltip>
Expand All @@ -22,7 +19,6 @@
import FileDocumentEditOutline from "vue-material-design-icons/FileDocumentEditOutline.vue";
import BookOpenOutline from "vue-material-design-icons/BookOpenOutline.vue";
import FileTableOutline from "vue-material-design-icons/FileTableOutline.vue";
import FileTreeOutline from "vue-material-design-icons/FileTreeOutline.vue";
import BallotOutline from "vue-material-design-icons/BallotOutline.vue";
import {editorViewTypes} from "../../utils/constants";
</script>
Expand Down

0 comments on commit 1bcc22a

Please sign in to comment.