Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
weryques 2018-10-16 16:14:00 -03:00
commit 6eaf55b63e
11 changed files with 55 additions and 18 deletions

View File

@ -21,7 +21,6 @@
"vue-masonry-css": "^1.0.3",
"vue-router": "^3.0.1",
"vue-the-mask": "^0.11.1",
"vue2-hammer": "^2.0.1",
"vuedraggable": "^2.16.0",
"vuex": "^3.0.1"
},

View File

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

View File

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

View File

@ -6,7 +6,7 @@
import Vue from 'vue';
import Buefy from 'buefy';
import VTooltip from 'v-tooltip';
import { VueHammer } from 'vue2-hammer';
// import { VueHammer } from 'vue2-hammer';
import VueMasonry from 'vue-masonry-css';
import draggable from 'vuedraggable';
import VueTheMask from 'vue-the-mask';
@ -49,7 +49,7 @@ import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin, UserCap
// Configure and Register Plugins
Vue.use(Buefy);
Vue.use(VTooltip);
Vue.use(VueHammer);
// Vue.use(VueHammer);
Vue.use(VueMasonry);
Vue.use(I18NPlugin);
Vue.use(UserPrefsPlugin);

View File

@ -2,7 +2,7 @@
import Vue from 'vue';
import Buefy from 'buefy';
import VTooltip from 'v-tooltip';
import { VueHammer } from 'vue2-hammer';
// import { VueHammer } from 'vue2-hammer';
import VueMasonry from 'vue-masonry-css';
// Custom elements
@ -48,7 +48,7 @@ import { I18NPlugin, UserPrefsPlugin, RouterHelperPlugin, ConsolePlugin } from '
// Configure and Register Plugins
Vue.use(Buefy);
Vue.use(VTooltip);
Vue.use(VueHammer);
// Vue.use(VueHammer);
Vue.use(VueMasonry);
Vue.use(I18NPlugin);
Vue.use(UserPrefsPlugin);

View File

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

View File

@ -1,6 +1,11 @@
<template>
<div
<!-- <div <IF WE USE HAMMERJS>
v-hammer:swipe="onSwipeFiltersMenu"
:class="{
'repository-level-page': isRepositoryLevel,
'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen
}"> -->
<div
:class="{
'repository-level-page': isRepositoryLevel,
'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen

View File

@ -1,6 +1,11 @@
<template>
<div
<!-- <div <IF WE USE HAMMER JS>
v-hammer:swipe="onSwipeFiltersMenu"
:class="{
'repository-level-page': isRepositoryLevel,
'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen
}"> -->
<div
:class="{
'repository-level-page': isRepositoryLevel,
'is-fullscreen': registeredViewModes[viewMode] != undefined && registeredViewModes[viewMode].full_screen

View File

@ -19,7 +19,12 @@ export const filter_type_mixin = {
},
methods: {
getValuesPlainText(metadatumId, search, isRepositoryLevel, valuesToIgnore, offset, number, isInCheckboxModal, getSelected = '0') {
let query_items = { 'current_query': this.query };
let currentQuery = JSON.parse(JSON.stringify(this.query));
for (let key of Object.keys(currentQuery.fetch_only)) {
if (currentQuery.fetch_only[key] == null)
delete currentQuery.fetch_only[key];
}
let query_items = { 'current_query': currentQuery };
let url = `/collection/${this.collection}/facets/${metadatumId}?getSelected=${getSelected}&`;
@ -36,7 +41,7 @@ export const filter_type_mixin = {
} else if(search){
url += `search=${search}&` + qs.stringify(query_items);
} else {
url += qs.stringify(query_items, { addQueryPrefix: true });
url += qs.stringify(query_items);
}
return axios.get(url)
@ -103,7 +108,12 @@ export const filter_type_mixin = {
});
},
getValuesRelationship(collectionTarget, search, valuesToIgnore, offset, number, isInCheckboxModal, getSelected = '0') {
let query_items = { 'current_query': this.query };
let currentQuery = JSON.parse(JSON.stringify(this.query));
for (let key of Object.keys(currentQuery.fetch_only)) {
if (currentQuery.fetch_only[key] == null)
delete currentQuery.fetch_only[key];
}
let query_items = { 'current_query': currentQuery };
let url = '/collection/' + this.filter.collection_id + '/facets/' + this.filter.metadatum.metadatum_id + `?getSelected=${getSelected}&`;
if(offset != undefined && number != undefined){

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) => {
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;

View File

@ -105,10 +105,11 @@
<icon class="mdi mdi-48px mdi-chevron-left"/>
</span>
</button>
<div
<div
class="slide-main-content">
<!-- <div <IF WE USE HAMMER JS>
class="slide-main-content"
v-hammer:swipe.prevent="onSwipeFiltersMenu">
v-hammer:swipe.prevent="onSwipeFiltersMenu"> -->
<transition
mode="out-in"
:name="goingRight ? 'slide-right' : 'slide-left'" >