Makes query fromBreadcrumb force reloading items list event when route path hasn't changed.

This commit is contained in:
Mateus Machado Luna 2018-10-22 14:08:36 -03:00
parent b54bde9ca4
commit 45f7c38ad4
3 changed files with 4 additions and 3 deletions

View File

@ -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'} },
]

View File

@ -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();
}

View File

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