Merge pull request #7350 from rekonder/aj_SCI_10505

Prevent tags creation on opening tags modal [SCI-10505]
This commit is contained in:
aignatov-bio 2024-03-22 12:11:34 +01:00 committed by GitHub
commit 43e57e7f01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View file

@ -166,7 +166,7 @@
},
onUnSelect: (id) => {
$.post(`${$(myModuleTagsSelector).data('update-module-tags-url')}/${id}/destroy_by_tag_id`)
.success(function() {
.done(() => {
dropdownSelector.closeDropdown(myModuleTagsSelector);
})
.fail(function(r) {

View file

@ -187,7 +187,7 @@ export default {
}
},
created() {
this.loadAlltags();
this.loadAlltags(false);
},
methods: {
startEditMode(tag) {
@ -211,15 +211,15 @@ export default {
this.updateTag(this.tagToUpdate);
}
},
loadAlltags() {
loadAlltags(emitTagsLoaded = true) {
this.loadingTags = true;
axios.get(this.projectTagsUrl).then((response) => {
this.allTags = response.data.data;
this.loadAssignedTags();
this.loadAssignedTags(emitTagsLoaded);
});
},
loadAssignedTags() {
loadAssignedTags(emitTagsLoaded = true) {
axios.get(this.params.urls.assigned_tags).then((response) => {
this.assignedTags = response.data.data;
this.allTags.forEach((tag) => {
@ -231,7 +231,9 @@ export default {
tag.assigned = false;
}
});
this.$emit('tagsLoaded', this.allTags);
if (emitTagsLoaded) {
this.$emit('tagsLoaded', this.allTags);
}
this.loadingTags = false;
});
},