diff --git a/app/javascript/packs/vue/legacy/tags_modal.js b/app/javascript/packs/vue/legacy/tags_modal.js index 176b2305d..7fb0bfc98 100644 --- a/app/javascript/packs/vue/legacy/tags_modal.js +++ b/app/javascript/packs/vue/legacy/tags_modal.js @@ -10,6 +10,7 @@ const app = createApp({ myModuleParams: null, myModuleUrl: null, tagsModalOpen: false, + tagDeleted: false }; }, mounted() { @@ -35,6 +36,10 @@ const app = createApp({ this.myModuleParams = null; this.myModuleUrl = null; this.tagsModalOpen = false; + + if ($('#canvas-container').length && this.tagDeleted) { + window.location.reload(); + } }, syncTags(tags) { // My module page diff --git a/app/javascript/vue/my_modules/modals/tags.vue b/app/javascript/vue/my_modules/modals/tags.vue index 05515daf8..5e69d9f7e 100644 --- a/app/javascript/vue/my_modules/modals/tags.vue +++ b/app/javascript/vue/my_modules/modals/tags.vue @@ -147,7 +147,7 @@ import ConfirmationModal from '../../shared/confirmation_modal.vue'; export default { name: 'TagsModal', - emits: ['close', 'tagsLoaded'], + emits: ['close', 'tagsLoaded', 'tagDeleted'], props: { params: { required: true @@ -288,6 +288,8 @@ export default { color: tag.attributes.color }, my_module_id: this.params.id + }).then(() => { + this.$emit('tagsLoaded', this.allTags); }); }, createTag() { @@ -309,6 +311,7 @@ export default { } }).then(() => { this.loadAlltags(); + this.$emit('tagDeleted', tag); document.body.style.overflow = 'hidden'; }); } else { diff --git a/app/views/canvas/full_zoom/_tags_modal.html.erb b/app/views/canvas/full_zoom/_tags_modal.html.erb index 62d3dae97..82807b1f9 100644 --- a/app/views/canvas/full_zoom/_tags_modal.html.erb +++ b/app/views/canvas/full_zoom/_tags_modal.html.erb @@ -8,6 +8,7 @@ project-tags-url="<%= project_tags_path(@project) %>" @close="close" @tags-loaded="syncTags" + @tag-deleted="tagDeleted = true" />