Skip to content

Commit

Permalink
feat(ui): Edit Tag Modal > Preview > refresh button to refresh with t…
Browse files Browse the repository at this point in the history
…ag trigger enabled
  • Loading branch information
flawiddsouza committed Sep 20, 2024
1 parent 1a36de0 commit d6e237b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/ui/src/components/modals/EditTagModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@
</div>

<div style="margin-top: 1rem">
<label>
<div style="font-weight: 500; margin-bottom: var(--label-margin-bottom)">Live Preview</div>
<textarea class="full-width-input" :value="preview" readonly></textarea>
</label>
<div style="font-weight: 500; margin-bottom: var(--label-margin-bottom); display: flex; align-items: flex-end; justify-content: space-between;">
Live Preview
<button type="button" class="button" @click="generatePreview(true)">Refresh</button>
</div>
<textarea class="full-width-input" :value="preview" readonly></textarea>
</div>

<template #footer>
Expand Down Expand Up @@ -292,9 +293,13 @@ function fillDefaultValues() {
}
}
async function generatePreview() {
async function generatePreview(tagTrigger = false) {
if (tagTrigger === true) {
preview.value = 'Loading...'
}
preview.value = await substituteEnvironmentVariables({}, `{% ${toFunctionString(parsedFuncForEdit.value)} %}`, {
tagTrigger: false,
tagTrigger,
noError: true,
})
}
Expand Down

0 comments on commit d6e237b

Please sign in to comment.