Removes context edit query from collection list in repository collection filters.

This commit is contained in:
Mateus Machado Luna 2018-10-16 12:17:13 -03:00
parent 2e3aa04b6c
commit c1b3d7ca82
6 changed files with 26 additions and 7 deletions

View File

@ -52,7 +52,11 @@ export default {
}, },
mounted() { mounted() {
this.isLoading = true; this.isLoading = true;
this.fetchCollections({ page: 1, collectionsPerPage: 96 }) this.fetchCollections({
page: 1,
collectionsPerPage: 96,
contextEdit: true
})
.then((res) => { .then((res) => {
this.collections = res.collections; this.collections = res.collections;
this.isLoading = false; this.isLoading = false;

View File

@ -42,7 +42,12 @@
open: false, open: false,
}, },
created(){ created(){
this.fetchCollections({page: 1, collectionsPerPage: -1, status: null}); this.fetchCollections({
page: 1,
collectionsPerPage: -1,
status: null,
contextEdit: false
});
}, },
mounted(){ mounted(){
let routeQueries = this.$route.query; let routeQueries = this.$route.query;

View File

@ -205,7 +205,11 @@ export default {
loadCollections() { loadCollections() {
this.cleanCollections(); this.cleanCollections();
this.isLoading = true; 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) => { .then((res) => {
this.isLoading = false; this.isLoading = false;
this.totalCollections = res.total; this.totalCollections = res.total;

View File

@ -5,7 +5,8 @@
'repository-level-page': isRepositoryLevel, 'repository-level-page': isRepositoryLevel,
'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen 'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen
}"> --> }"> -->
<div :class="{ <div
:class="{
'repository-level-page': isRepositoryLevel, 'repository-level-page': isRepositoryLevel,
'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen 'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen
}"> }">

View File

@ -5,7 +5,8 @@
'repository-level-page': isRepositoryLevel, 'repository-level-page': isRepositoryLevel,
'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen 'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen
}"> --> }"> -->
<div :class="{ <div
:class="{
'repository-level-page': isRepositoryLevel, 'repository-level-page': isRepositoryLevel,
'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen 'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen
}"> }">

View File

@ -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) => { 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) if (status != '' && status != undefined)
endpoint = endpoint + '&status=' + status; endpoint = endpoint + '&status=' + status;