Fixes to select filter.
This commit is contained in:
parent
cf162001c4
commit
02214425c7
|
@ -76,6 +76,16 @@
|
|||
}
|
||||
},
|
||||
mixins: [filter_type_mixin],
|
||||
watch: {
|
||||
selected(value) {
|
||||
if (value) {
|
||||
this.$eventBusSearch.$emit( 'sendValuesToTags', {
|
||||
filterId: this.filter.id,
|
||||
value: value
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selected() {
|
||||
if ( this.query && this.query.metaquery && Array.isArray( this.query.metaquery ) ) {
|
||||
|
@ -109,33 +119,13 @@
|
|||
this.getOptionsValuesCancel = promise.source;
|
||||
},
|
||||
onSelect(value){
|
||||
this.selected = value;
|
||||
//this.selected = value;
|
||||
this.$emit('input', {
|
||||
filter: 'selectbox',
|
||||
metadatum_id: this.metadatum,
|
||||
collection_id: ( this.collection_id ) ? this.collection_id : this.filter.collection_id,
|
||||
value: ( value ) ? value : ''
|
||||
});
|
||||
|
||||
if (value) {
|
||||
this.$eventBusSearch.$emit( 'sendValuesToTags', {
|
||||
filterId: this.filter.id,
|
||||
value: value
|
||||
});
|
||||
}
|
||||
},
|
||||
selectedValues(){
|
||||
if ( !this.query || !this.query.metaquery || !Array.isArray( this.query.metaquery ) )
|
||||
return false;
|
||||
|
||||
let index = this.query.metaquery.findIndex(newMetadatum => newMetadatum.key === this.metadatum );
|
||||
if ( index >= 0){
|
||||
let metadata = this.query.metaquery[ index ];
|
||||
this.selected = metadata.value;
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
cleanSearchFromTags(filterTag) {
|
||||
if (filterTag.filterId == this.filter.id)
|
||||
|
|
|
@ -296,8 +296,10 @@
|
|||
},
|
||||
prepareOptionsForTaxonomy(items, skipSelected) {
|
||||
|
||||
this.taxonomy = items[0].taxonomy;
|
||||
this.taxonomy_id = items[0].taxonomy_id;
|
||||
if (items[0] != undefined) {
|
||||
this.taxonomy = items[0].taxonomy;
|
||||
this.taxonomy_id = items[0].taxonomy_id;
|
||||
}
|
||||
|
||||
this.options = [];
|
||||
this.options = items.slice(); // copy array.
|
||||
|
|
|
@ -102,6 +102,7 @@ export const fetchItems = ({ rootGetters, dispatch, commit }, { collectionId, is
|
|||
dispatch('search/setFacets', res.data.filters, { root: true } );
|
||||
else
|
||||
dispatch('search/setFacets', {}, { root: true } );
|
||||
|
||||
})
|
||||
.catch((thrown) => {
|
||||
if (axios.isCancel(thrown)) {
|
||||
|
|
Loading…
Reference in New Issue