From 7aa13a6ecfb9e6d3a3c9cce628a4ffd81fc083e1 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Tue, 16 Oct 2018 12:17:13 -0300 Subject: [PATCH] Removes context edit query from collection list in repository collection filters. --- src/admin/components/other/collections-modal.vue | 6 +++++- .../repository/collection-filter/collection-filter.vue | 7 ++++++- src/admin/pages/lists/collections-page.vue | 6 +++++- src/admin/pages/lists/items-page.vue | 3 ++- src/admin/pages/lists/term-items-page.vue | 3 ++- src/js/store/modules/collection/actions.js | 8 ++++++-- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/admin/components/other/collections-modal.vue b/src/admin/components/other/collections-modal.vue index 4612068cc..0702294f8 100644 --- a/src/admin/components/other/collections-modal.vue +++ b/src/admin/components/other/collections-modal.vue @@ -52,7 +52,11 @@ export default { }, mounted() { this.isLoading = true; - this.fetchCollections({ page: 1, collectionsPerPage: 96 }) + this.fetchCollections({ + page: 1, + collectionsPerPage: 96, + contextEdit: true + }) .then((res) => { this.collections = res.collections; this.isLoading = false; diff --git a/src/admin/components/repository/collection-filter/collection-filter.vue b/src/admin/components/repository/collection-filter/collection-filter.vue index aa2c8c3a7..f042ce657 100644 --- a/src/admin/components/repository/collection-filter/collection-filter.vue +++ b/src/admin/components/repository/collection-filter/collection-filter.vue @@ -42,7 +42,12 @@ open: false, }, created(){ - this.fetchCollections({page: 1, collectionsPerPage: -1, status: null}); + this.fetchCollections({ + page: 1, + collectionsPerPage: -1, + status: null, + contextEdit: false + }); }, mounted(){ let routeQueries = this.$route.query; diff --git a/src/admin/pages/lists/collections-page.vue b/src/admin/pages/lists/collections-page.vue index 957e5c646..fc221f980 100644 --- a/src/admin/pages/lists/collections-page.vue +++ b/src/admin/pages/lists/collections-page.vue @@ -205,7 +205,11 @@ export default { loadCollections() { this.cleanCollections(); this.isLoading = true; - this.fetchCollections({ 'page': this.page, 'collectionsPerPage': this.collectionsPerPage, 'status': this.status }) + this.fetchCollections({ + 'page': this.page, + 'collectionsPerPage': this.collectionsPerPage, + 'status': this.status, + 'contextEdit': true }) .then((res) => { this.isLoading = false; this.totalCollections = res.total; diff --git a/src/admin/pages/lists/items-page.vue b/src/admin/pages/lists/items-page.vue index 4d3c24e21..f3735bd2e 100644 --- a/src/admin/pages/lists/items-page.vue +++ b/src/admin/pages/lists/items-page.vue @@ -5,7 +5,8 @@ 'repository-level-page': isRepositoryLevel, 'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen }"> --> -
diff --git a/src/admin/pages/lists/term-items-page.vue b/src/admin/pages/lists/term-items-page.vue index ee4e96502..67555d455 100644 --- a/src/admin/pages/lists/term-items-page.vue +++ b/src/admin/pages/lists/term-items-page.vue @@ -5,7 +5,8 @@ 'repository-level-page': isRepositoryLevel, 'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen }"> --> -
diff --git a/src/js/store/modules/collection/actions.js b/src/js/store/modules/collection/actions.js index 8efa679d3..3c8f09082 100644 --- a/src/js/store/modules/collection/actions.js +++ b/src/js/store/modules/collection/actions.js @@ -128,9 +128,13 @@ export const deleteItem = ({ commit }, { itemId, isPermanently }) => { }); }; -export const fetchCollections = ({commit} , { page, collectionsPerPage, status }) => { +export const fetchCollections = ({commit} , { page, collectionsPerPage, status, contextEdit }) => { + return new Promise((resolve, reject) => { - let endpoint = '/collections?paged='+page+'&perpage='+collectionsPerPage+'&context=edit'; + let endpoint = '/collections?paged='+page+'&perpage='+collectionsPerPage; + + if (contextEdit) + endpoint = endpoint + '&context=edit'; if (status != '' && status != undefined) endpoint = endpoint + '&status=' + status;