Skip to content

Commit

Permalink
feat(ui): Environment Modal > support using response tags in environm…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
flawiddsouza committed Oct 13, 2024
1 parent f4a3e35 commit 5a87bcf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/modals/EditTagModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const props = defineProps({
},
activeTab: {
type: Object as PropType<CollectionItem>,
required: true
default: { _id: '' },

Check failure on line 91 in packages/ui/src/components/modals/EditTagModal.vue

View workflow job for this annotation

GitHub Actions / test

Type of the default value for 'activeTab' prop must be a function
},
})
Expand Down
25 changes: 23 additions & 2 deletions packages/ui/src/components/modals/EnvironmentModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
v-model="environment"
lang="json"
:env-variables="envVariables"
:autocompletions="tagAutocompletions"
@tagClick="onTagClick"
style="overflow: auto;"
:key="currentEnvironment"
></CodeMirrorEditor>
Expand Down Expand Up @@ -61,11 +63,18 @@
</div>
</template>
</form>
<EditTagModal
v-if="editTagModalShow"
v-model:showModal="editTagModalShow"
:parsed-func="editTagParsedFunc"
:update-func="editTagUpdateFunc"
/>
</template>

<script>
import Modal from '@/components/Modal.vue'
import CodeMirrorEditor from '@/components/CodeMirrorEditor.vue'
import EditTagModal from '@/components/modals/EditTagModal.vue'
import { nextTick } from 'vue'
import { emitter } from '@/event-bus'
import constants from '@/constants'
Expand All @@ -79,7 +88,8 @@ export default {
},
components: {
Modal,
CodeMirrorEditor
CodeMirrorEditor,
EditTagModal,
},
data() {
return {
Expand All @@ -93,6 +103,9 @@ export default {
y: ''
},
envVariables: {},
editTagModalShow: false,
editTagParsedFunc: null,
editTagUpdateFunc: null,
}
},
computed: {
Expand Down Expand Up @@ -137,6 +150,9 @@ export default {
}
return undefined
},
tagAutocompletions() {
return constants.AUTOCOMPLETIONS.TAGS
}
},
watch: {
Expand Down Expand Up @@ -514,7 +530,12 @@ export default {
if(event === 'reloaded') {
this.loadEnvVariables()
}
}
},
onTagClick(parsedFunc, updateFunc) {
this.editTagParsedFunc = parsedFunc
this.editTagUpdateFunc = updateFunc
this.editTagModalShow = true
},
},
created() {
emitter.on('collectionItem', this.handleCollectionItemEvent)
Expand Down

0 comments on commit 5a87bcf

Please sign in to comment.