From 45f7c38ad4ec93c0bd6967e26a77d6794ec18dd1 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Mon, 22 Oct 2018 14:08:36 -0300 Subject: [PATCH] Makes query fromBreadcrumb force reloading items list event when route path hasn't changed. --- src/admin/js/router.js | 2 +- src/admin/pages/lists/items-page.vue | 4 ++-- src/js/event-bus-search.js | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/admin/js/router.js b/src/admin/js/router.js index d92cf696f..9515518ca 100644 --- a/src/admin/js/router.js +++ b/src/admin/js/router.js @@ -55,7 +55,7 @@ const routes = [ { path: 'metadata', component: MetadataList, name: 'MetadataList', meta: {title: i18nGet('title_collection_metadata_edition'), icon: 'folder-multiple'} }, { path: 'filters', component: FiltersList, name: 'FiltersList', meta: {title: i18nGet('title_collection_filters_edition'), icon: 'folder-multiple'} }, { path: 'events', component: EventsPage, name: 'CollectionEventsPage', meta: {title: i18nGet('title_collection_events'), icon: 'flash'} }, - { path: 'events/:eventId', name: 'EventPage', component: EventPage, meta: {title: i18nGet('title_event_page'), icon: 'flash'} }, + { path: 'events/:eventId', name: 'CollectionEventPage', component: EventPage, meta: {title: i18nGet('title_event_page'), icon: 'flash'} }, { path: 'sequence/:sequenceId', name: 'SavedSequenceEditionForm', component: ItemEditionForm, meta: {title: i18nGet('title_edit_item'), icon: 'folder-multiple'} }, { path: 'sequence/:sequenceId/:itemPosition', name: 'SequenceEditionForm', component: ItemEditionForm, meta: {title: i18nGet('title_edit_item'), icon: 'folder-multiple'} }, ] diff --git a/src/admin/pages/lists/items-page.vue b/src/admin/pages/lists/items-page.vue index 384a74e05..aebbb15bf 100644 --- a/src/admin/pages/lists/items-page.vue +++ b/src/admin/pages/lists/items-page.vue @@ -1074,7 +1074,7 @@ '3': (this.isRepositoryLevel ? 'title' : null), '4': (this.isRepositoryLevel ? 'description' : null), }); - + // Sorting metadata if (this.isRepositoryLevel) { this.sortingMetadata.push({ @@ -1193,7 +1193,7 @@ * at collection level to items page at repository level */ - if (this.isOnTheme || this.collectionId === to.params.collectionId) { + if (this.isOnTheme || this.collectionId === to.params.collectionId || to.query.fromBreadcrumb) { this.prepareMetadata(); this.prepareFilters(); } diff --git a/src/js/event-bus-search.js b/src/js/event-bus-search.js index d15823f8b..8558cb7e5 100644 --- a/src/js/event-bus-search.js +++ b/src/js/event-bus-search.js @@ -47,6 +47,7 @@ export default { }, watch: { '$route' (to, from) { + // Should set Collection ID from URL only when in admin. if (this.$route.name == 'CollectionItemsPage' || this.$route.name == 'ItemsPage') this.collectionId = !this.$route.params.collectionId ? this.$route.params.collectionId : parseInt(this.$route.params.collectionId);