Skip to content

Commit

Permalink
refactor: refactor due to code review [WTEL-5054]
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirBeria committed Sep 5, 2024
1 parent 04f189c commit 9aad78c
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/modules/routing/modules/flow/components/create-flow-popup.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<selection-popup
v-bind="$attrs"
:selected="selected"
:title="$t('objects.routing.flow.createFlowSelectionPopup')"
v-bind="$attrs"
@close="close"
@select="create"
>
Expand Down Expand Up @@ -63,12 +63,13 @@ export default {
selected: {},
type: {},
typeOptions: Object.values(EngineRoutingSchemaType)
.filter((type) => type !== EngineRoutingSchemaType.Default)
.map((value) => ({
value,
locale: `objects.flow.type.${value}`,
})),
.filter((type) => type !== EngineRoutingSchemaType.Default)
.map((value) => ({
value,
locale: `objects.flow.type.${value}`,
})),
}),
computed: {
...mapState('appearance', {
theme: (state) => state.theme,
Expand Down Expand Up @@ -122,17 +123,20 @@ export default {
window.open(route.href, '_blank');
this.close();
},
close() {
this.$emit('close');
this.initializeFields();
this.setBasicFields();
},
initializeFields() {
setBasicFields() {
[this.selected] = this.editorOptions;
[this.type] = this.typeOptions;
},
},
mounted() {
this.initializeFields();
this.setBasicFields();
},
};
</script>
Expand Down

0 comments on commit 9aad78c

Please sign in to comment.