Removes older collection filter. #114

This commit is contained in:
mateuswetah 2020-11-03 16:45:10 -03:00
parent a10f1cd48b
commit e798750e43
2 changed files with 0 additions and 125 deletions

View File

@ -1,117 +0,0 @@
<template>
<b-field
v-if="collections && collections.length"
class="filter-item-forms">
<b-collapse
aria-id="collection-filters-collapse"
class="show"
:open="collections.length != 1 ? open : false"
animation="filter-item">
<label
class="label"
slot="trigger"
slot-scope="props">
<span class="icon is-right">
<i
:class="{ 'tainacan-icon-arrowdown': props.open, 'tainacan-icon-arrowright': !props.open }"
class="tainacan-icon tainacan-icon-1-25em" />
</span>
{{ $i18n.get('collections') }}
</label>
<div
v-if="collections.length > 1"
class="block">
<div
v-for="(collection, key) in collections"
:key="key"
class="control">
<b-checkbox
v-model="collectionsIdsToFilter"
:native-value="collection.id"
@input="applyFilter">
{{ collection.name }}
</b-checkbox>
</div>
</div>
<div
v-else
class="block">
<div
v-for="(collection, key) in collections"
:key="key"
class="control">
<b-checkbox
v-model="fakeTrueValue"
:disabled="true"
:native-value="true">
{{ collection.name }}
</b-checkbox>
</div>
</div>
</b-collapse>
</b-field>
</template>
<script>
import { mapActions, mapGetters } from 'vuex';
export default {
name: 'CollectionFilter',
props: {
query: Object,
open: false,
},
data(){
return {
inputs: [],
collectionsIdsToFilter: [],
fakeTrueValue: true
}
},
computed: {
collections(){
return this.getCollections();
},
},
created(){
this.fetchCollections({
page: 1,
collectionsPerPage: -1,
status: null,
contextEdit: false
});
},
mounted(){
let routeQueries = this.$route.query;
if(routeQueries.metaquery &&
routeQueries.metaquery[0] &&
Array.isArray(routeQueries.metaquery[0].value)){
this.collectionsIdsToFilter = routeQueries.metaquery[0].value;
this.applyFilter();
}
},
methods: {
...mapActions('search', [
'setPage'
]),
...mapActions('collection', [
'fetchCollections'
]),
...mapGetters('collection', [
'getCollections',
]),
applyFilter(){
this.$eventBusSearch.$emit( 'input', {
filter: 'checkbox',
metadatum_id: 'collection_id',
value: this.collectionsIdsToFilter,
compare: 'IN',
collection_id: this.collectionsIdsToFilter,
});
}
}
}
</script>

View File

@ -45,9 +45,6 @@
<!-- TERM ITEMS PAGE FILTERS --> <!-- TERM ITEMS PAGE FILTERS -->
<template v-if="taxonomy && taxonomyFilters"> <template v-if="taxonomy && taxonomyFilters">
<collections-filter
:open="!collapseAll"
:query="getQuery"/>
<div <div
v-if="key == 'repository-filters'" v-if="key == 'repository-filters'"
:key="index" :key="index"
@ -148,9 +145,6 @@
<!-- REPOSITORY ITEMS PAGE FILTERS --> <!-- REPOSITORY ITEMS PAGE FILTERS -->
<template v-else-if="isRepositoryLevel && !taxonomy"> <template v-else-if="isRepositoryLevel && !taxonomy">
<collections-filter
:open="!collapseAll"
:query="getQuery"/>
<div <div
v-if="key == 'repository-filters'" v-if="key == 'repository-filters'"
:key="index" :key="index"
@ -290,11 +284,9 @@
<script> <script>
import { mapGetters, mapActions } from 'vuex'; import { mapGetters, mapActions } from 'vuex';
import FiltersTagsList from './filters-tags-list.vue'; import FiltersTagsList from './filters-tags-list.vue';
import CollectionsFilter from '../other/collection-filter.vue';
export default { export default {
components: { components: {
CollectionsFilter,
FiltersTagsList FiltersTagsList
}, },
props: { props: {