Merge pull request #7858 from aignatov-bio/ai-sci-10933-fixs-tags-interaction-on-canvas-and-task

Fix tags interaction on canvas and task page [SCI-10933]
This commit is contained in:
Martin Artnik 2024-09-17 11:05:13 +02:00 committed by GitHub
commit 4f9f48de23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View file

@ -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

View file

@ -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 {

View file

@ -8,6 +8,7 @@
project-tags-url="<%= project_tags_path(@project) %>"
@close="close"
@tags-loaded="syncTags"
@tag-deleted="tagDeleted = true"
/>
</teleport>
</div>