Fixes legacy usage of $root.$emit in favor of $emitter.emit. #794.

This commit is contained in:
mateuswetah 2024-02-22 09:37:51 -03:00
parent 62c1e178c9
commit 91c47add90
9 changed files with 13 additions and 13 deletions

View File

@ -1035,7 +1035,7 @@ export default {
}
},
mounted(){
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('settings') }]);
this.$emitter.emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('settings') }]);
if (this.$route.query.fromImporter != undefined)

View File

@ -223,7 +223,7 @@ export default {
this.cleanFiles();
// Updates Collection BreadCrumb
this.$root.$emit('onCollectionBreadCrumbUpdate', [
this.$emitter.emit('onCollectionBreadCrumbUpdate', [
{ path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') },
{ path: '', label: this.$i18n.get('add_items_bulk') }
]);

View File

@ -1284,7 +1284,7 @@ export default {
this.isLoading = true;
// Updates Collection BreadCrumb
this.$root.$emit('onCollectionBreadCrumbUpdate', [
this.$emitter.emit('onCollectionBreadCrumbUpdate', [
{ path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') },
{ path: '', label: this.$i18n.get('new') }
]);
@ -1722,14 +1722,14 @@ export default {
// Updates Collection BreadCrumb
if (this.isOnSequenceEdit) {
this.$root.$emit('onCollectionBreadCrumbUpdate', [
this.$emitter.emit('onCollectionBreadCrumbUpdate', [
{ path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') },
{ path: '', label: this.$i18n.get('sequence') },
{ path: '', label: this.item.title },
{ path: '', label: this.$i18n.get('edit') }
]);
} else {
this.$root.$emit('onCollectionBreadCrumbUpdate', [
this.$emitter.emit('onCollectionBreadCrumbUpdate', [
{ path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items') },
{ path: this.$routerHelper.getItemPath(this.form.collectionId, this.itemId), label: this.item.title },
{ path: '', label: this.$i18n.get('edit') }

View File

@ -2460,7 +2460,7 @@ export default {
groupId: groupId
}).then(() => {
this.$eventBusSearch.loadItems();
this.$root.$emit('openProcessesPopup');
this.$emitter.emit('openProcessesPopup');
});
});
}
@ -2493,7 +2493,7 @@ export default {
groupId: groupId
}).then(() => {
this.$eventBusSearch.loadItems();
this.$root.$emit('openProcessesPopup');
this.$emitter.emit('openProcessesPopup');
});
} else {
this.trashItemsInBulk({
@ -2501,7 +2501,7 @@ export default {
groupId: groupId
}).then(() => {
this.$eventBusSearch.loadItems();
this.$root.$emit('openProcessesPopup');
this.$emitter.emit('openProcessesPopup');
});
}
});

View File

@ -413,7 +413,7 @@
},
mounted(){
if (!this.isRepositoryLevel)
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('activities') }]);
this.$emitter.emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('activities') }]);
if (this.$route.query.tab == 'processes' && this.isRepositoryLevel)
this.tab = 'processes';

View File

@ -568,7 +568,7 @@ export default {
mounted() {
if (!this.isRepositoryLevel)
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('filter') }]);
this.$emitter.emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('filter') }]);
nextTick(() => {
this.columnsTopY = this.$refs.filterEditionPageColumns ? this.$refs.filterEditionPageColumns.getBoundingClientRect().top : 0;

View File

@ -994,7 +994,7 @@
this.localDisplayedMetadata = JSON.parse(JSON.stringify(this.displayedMetadata));
// Updates Collection Header Breadcrumb
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('items') }]);
this.$emitter.emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('items') }]);
// Setting initial view mode
let prefsAdminViewMode = !this.isRepositoryLevel ? 'admin_view_mode_' + this.collectionId : 'admin_view_mode';

View File

@ -112,7 +112,7 @@ export default {
},
mounted() {
if (!this.isRepositoryLevel)
this.$root.$emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('metadata') }]);
this.$emitter.emit('onCollectionBreadCrumbUpdate', [{ path: '', label: this.$i18n.get('metadata') }]);
},
methods: {
...mapGetters('collection',[

View File

@ -574,7 +574,7 @@
})
.then((resp) => {
resp.request.then((item) => {
this.$root.$emit('onCollectionBreadCrumbUpdate', [
this.$emitter.emit('onCollectionBreadCrumbUpdate', [
{path: this.$routerHelper.getCollectionPath(this.collectionId), label: this.$i18n.get('items')},
{path: '', label: item.title}
]);