Fixes filters due to changes on Draggable library and other tweaks for #794.

This commit is contained in:
mateuswetah 2024-01-30 16:42:46 -03:00
parent e963a9acd3
commit 95d58e5055
4 changed files with 25 additions and 6 deletions

View File

@ -56,7 +56,7 @@
export default {
name: 'AvailableExportersModal',
props: {
sourceCollection: String,
sourceCollection: [Number,String],
hideWhenManualCollection: false
},
emits: [

View File

@ -66,7 +66,7 @@ export const sendFilter = ( { commit }, { collectionId, metadatumId, name, filte
})
.then( res => {
let filter = res.data;
commit('setSingleFilter', { filter: filter , index: newIndex});
commit('addSingleFilter', { filter: filter , index: newIndex});
resolve( filter );
})
.catch(error => {
@ -92,8 +92,8 @@ export const updateFilter = ( { commit }, { filterId, index, options }) => {
commit('setSingleFilter', { filter: filter, index: index });
resolve( filter );
})
.catch(error => {
console.log(error);
.catch( (error) => {
console.log(JSON.parse(JSON.stringify(error)));
reject({ error_message: error['response']['data'].error_message, errors: error['response']['data'].errors });
});
});

View File

@ -20,6 +20,10 @@ export const setSingleFilter = (state, { filter, index}) => {
Object.assign(state.filters, { [index]: filter });
}
export const addSingleFilter = (state, { filter, index}) => {
state.filters.splice( index, 0, filter );
}
export const setFilters = (state, filters) => {
state.filters = filters;
}

View File

@ -310,6 +310,17 @@
style="font-size: 0.875em;">
<em>{{ '(' + $i18n.get('info_child_of') + ' ' + metadatum.parent_name + ')' }}</em>
</span>
<span
v-if="metadatum.status === 'private'"
v-tooltip="{
content: $i18n.get('status_private'),
autoHide: true,
popperClass: ['tainacan-tooltip', 'tooltip'],
placement: 'auto-start'
}"
class="icon">
<i class="tainacan-icon tainacan-icon-private" />
</span>
</span>
<span
v-tooltip="{
@ -767,7 +778,7 @@ export default {
})
.then((filter) => {
if (!this.isRepositoryLevel)
if ( !this.isRepositoryLevel )
this.updateFiltersOrder();
this.newFilterIndex = 0;
@ -815,7 +826,7 @@ export default {
},
toggleFilterEdition(filterId) {
// Closing collapse
if (this.openedFilterId == filterId) {
if ( this.openedFilterId == filterId ) {
this.openedFilterId = '';
this.$router.push({ query: {}});
@ -1173,6 +1184,10 @@ export default {
}
}
.available-metadatum-item:not(.sortable-ghost):not(.disabled-metadatum) {
display: none;
visibility: hidden;
}
.sortable-ghost {
border: 1px dashed var(--tainacan-gray2);
background: var(--tainacan-white);