From df6ab7726415757972313f98d606204a36b99dff Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Fri, 13 Nov 2020 15:22:18 -0300 Subject: [PATCH] Adjustments to fix inconsistencies with user prefs settings of displayed metadata. --- src/views/admin/js/event-bus-search.js | 1 - src/views/admin/js/store/modules/search/mutations.js | 2 +- src/views/admin/pages/lists/items-page.vue | 6 +++--- src/views/theme-search/pages/theme-items-page.vue | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/views/admin/js/event-bus-search.js b/src/views/admin/js/event-bus-search.js index 3a40c2f03..362c016f7 100644 --- a/src/views/admin/js/event-bus-search.js +++ b/src/views/admin/js/event-bus-search.js @@ -210,7 +210,6 @@ export default { this.updateURLQueries(); }, addFetchOnly( metadatum, ignorePrefs, metadatumIDs ){ - this.$store.dispatch('search/add_fetch_only', metadatum ); this.$store.dispatch('search/add_fetch_only_meta', metadatumIDs); this.updateURLQueries(); diff --git a/src/views/admin/js/store/modules/search/mutations.js b/src/views/admin/js/store/modules/search/mutations.js index e6e7581d8..409272d1c 100644 --- a/src/views/admin/js/store/modules/search/mutations.js +++ b/src/views/admin/js/store/modules/search/mutations.js @@ -60,7 +60,7 @@ export const addTaxQuery = ( state, filter ) => { }; export const addFetchOnly = ( state, metadatum ) => { - state.postquery.fetch_only = metadatum.replace(/,null/g, ''); + state.postquery.fetch_only = metadatum }; export const addFetchOnlyMeta = ( state, metadatum ) => { state.postquery.fetch_only_meta = metadatum; diff --git a/src/views/admin/pages/lists/items-page.vue b/src/views/admin/pages/lists/items-page.vue index 2dca00eaa..6a82f5276 100644 --- a/src/views/admin/pages/lists/items-page.vue +++ b/src/views/admin/pages/lists/items-page.vue @@ -987,7 +987,7 @@ let prefsFetchOnly = !this.isRepositoryLevel ? `fetch_only_${this.collectionId}` : 'fetch_only'; let prefsFetchOnlyMeta = !this.isRepositoryLevel ? `fetch_only_meta_${this.collectionId}` : 'fetch_only_meta'; - let prefsFetchOnlyObject = this.$userPrefs.get(prefsFetchOnly) ? typeof this.$userPrefs.get(prefsFetchOnly) != 'string' ? this.$userPrefs.get(prefsFetchOnly) : this.$userPrefs.get(prefsFetchOnly).replace(/,null/g, '').split(',') : []; + let prefsFetchOnlyObject = this.$userPrefs.get(prefsFetchOnly) ? typeof this.$userPrefs.get(prefsFetchOnly) != 'string' ? this.$userPrefs.get(prefsFetchOnly) : this.$userPrefs.get(prefsFetchOnly).split(',') : []; let prefsFetchOnlyMetaObject = this.$userPrefs.get(prefsFetchOnlyMeta) ? this.$userPrefs.get(prefsFetchOnlyMeta).split(',') : []; let thumbnailMetadatumDisplay = (!this.isRepositoryLevel && this.collection.hide_items_thumbnail_on_lists == 'yes') ? null : (prefsFetchOnlyObject ? (prefsFetchOnlyObject[0] != 'null') : true); @@ -1072,10 +1072,10 @@ } } - + let creationDateMetadatumDisplay = prefsFetchOnlyObject ? (prefsFetchOnlyObject[1] != 'null') : true; let authorNameMetadatumDisplay = prefsFetchOnlyObject ? (prefsFetchOnlyObject[2] != 'null') : true; - + // Creation date and author name should appear only on admin. metadata.push({ name: this.$i18n.get('label_creation_date'), diff --git a/src/views/theme-search/pages/theme-items-page.vue b/src/views/theme-search/pages/theme-items-page.vue index 808ec6eca..d1424e8c7 100644 --- a/src/views/theme-search/pages/theme-items-page.vue +++ b/src/views/theme-search/pages/theme-items-page.vue @@ -971,7 +971,7 @@ let prefsFetchOnly = !this.isRepositoryLevel ? `fetch_only_${this.collectionId}` : 'fetch_only'; let prefsFetchOnlyMeta = !this.isRepositoryLevel ? `fetch_only_meta_${this.collectionId}` : 'fetch_only_meta'; - let prefsFetchOnlyObject = this.$userPrefs.get(prefsFetchOnly) ? typeof this.$userPrefs.get(prefsFetchOnly) != 'string' ? this.$userPrefs.get(prefsFetchOnly) : this.$userPrefs.get(prefsFetchOnly).replace(/,null/g, '').split(',') : []; + let prefsFetchOnlyObject = this.$userPrefs.get(prefsFetchOnly) ? typeof this.$userPrefs.get(prefsFetchOnly) != 'string' ? this.$userPrefs.get(prefsFetchOnly) : this.$userPrefs.get(prefsFetchOnly).split(',') : []; let prefsFetchOnlyMetaObject = this.$userPrefs.get(prefsFetchOnlyMeta) ? this.$userPrefs.get(prefsFetchOnlyMeta).split(',') : []; let thumbnailMetadatumDisplay = this.hideItemsThumbnail ? null : (prefsFetchOnlyObject ? (prefsFetchOnlyObject[0] != 'null') : true);