Removal of filter_type attribute from filters, it wasn't being used.

This commit is contained in:
Mateus Machado Luna 2019-06-03 10:51:17 -03:00
parent 77a2101888
commit ad78c1dfd1
10 changed files with 5 additions and 14 deletions

View File

@ -48,7 +48,6 @@ class Autocomplete extends Filter_Type {
public function render( $filter ){ public function render( $filter ){
return '<tainacan-filter-autocomplete name="'.$filter->get_name().'" return '<tainacan-filter-autocomplete name="'.$filter->get_name().'"
collection_id="'.$filter->get_collection_id().'" collection_id="'.$filter->get_collection_id().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-autocomplete>'; metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-autocomplete>';
} }
} }

View File

@ -64,7 +64,6 @@ class Checkbox extends Filter_Type {
public function render( $filter ){ public function render( $filter ){
return '<tainacan-filter-checkbox name="'.$filter->get_name().'" return '<tainacan-filter-checkbox name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'" collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-selectbox>'; metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-selectbox>';
} }

View File

@ -17,7 +17,6 @@ export const filter_type_mixin = {
}, },
metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set
collection_id: [Number], // not required, but overrides the filter metadatum id if is set collection_id: [Number], // not required, but overrides the filter metadatum id if is set
filter_type: [String], // not required, but overrides the filter metadatum type if is set
id: '', id: '',
query: {} query: {}
}, },
@ -25,9 +24,6 @@ export const filter_type_mixin = {
// We listen to event, but reload event if hasFiltered is negative, as // We listen to event, but reload event if hasFiltered is negative, as
// an empty query also demands filters reloading. // an empty query also demands filters reloading.
this.$eventBusSearch.$on('hasFiltered', this.reloadOptionsDueToFiltering); this.$eventBusSearch.$on('hasFiltered', this.reloadOptionsDueToFiltering);
},
mounted() {
}, },
computed: { computed: {
facetsFromItemSearch() { facetsFromItemSearch() {

View File

@ -96,6 +96,9 @@
}); });
this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTags); this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTags);
}, },
mounted() {
this.selectedValues();
},
data(){ data(){
return { return {
value: null, value: null,

View File

@ -32,7 +32,6 @@ class Selectbox extends Filter_Type {
public function render( $filter ){ public function render( $filter ){
return '<tainacan-filter-selectbox name="'.$filter->get_name().'" return '<tainacan-filter-selectbox name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'" collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-selectbox>'; metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-selectbox>';
} }

View File

@ -62,7 +62,6 @@ class Taginput extends Filter_Type {
public function render( $filter ){ public function render( $filter ){
return '<tainacan-filter-taginput name="'.$filter->get_name().'" return '<tainacan-filter-taginput name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'" collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taginput>'; metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taginput>';
} }

View File

@ -55,7 +55,7 @@
created(){ created(){
this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id; this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id;
this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : this.filter.metadatum.metadatum_id ; this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : this.filter.metadatum.metadatum_id ;
this.type = ( this.filter_type ) ? this.filter_type : this.filter.metadatum.metadata_type; this.type = this.filter.metadatum.metadata_type;
this.loadOptions(); this.loadOptions();
this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTag); this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTag);
@ -91,7 +91,6 @@
}, },
metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set
collection_id: [Number], // not required, but overrides the filter metadatum id if is set collection_id: [Number], // not required, but overrides the filter metadatum id if is set
filter_type: [String], // not required, but overrides the filter metadatum type if is set
labelId: '', labelId: '',
query: { query: {
type: Object // concentrate all attributes metadatum id and type type: Object // concentrate all attributes metadatum id and type

View File

@ -42,7 +42,7 @@
created(){ created(){
this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id; this.collection = ( this.collection_id ) ? this.collection_id : this.filter.collection_id;
this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : this.filter.metadatum.metadatum_id ; this.metadatum = ( this.metadatum_id ) ? this.metadatum_id : this.filter.metadatum.metadatum_id ;
this.type = ( this.filter_type ) ? this.filter_type : this.filter.metadatum.metadata_type; this.type = this.filter.metadatum.metadata_type;
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum; let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
@ -77,7 +77,6 @@
}, },
metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set metadatum_id: [Number], // not required, but overrides the filter metadatum id if is set
collection_id: [Number], // not required, but overrides the filter metadatum id if is set collection_id: [Number], // not required, but overrides the filter metadatum id if is set
filter_type: [String], // not required, but overrides the filter metadatum type if is set
labelId: '', labelId: '',
query: { query: {
type: Object // concentrate all attributes metadatum id and type type: Object // concentrate all attributes metadatum id and type

View File

@ -64,7 +64,6 @@ class TaxonomyCheckbox extends Filter_Type {
public function render( $filter ){ public function render( $filter ){
return '<tainacan-filter-taxonomy-checkbox name="'.$filter->get_name().'" return '<tainacan-filter-taxonomy-checkbox name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'" collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taxonomy-checkbox>'; metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taxonomy-checkbox>';
} }

View File

@ -62,7 +62,6 @@ class TaxonomyTaginput extends Filter_Type {
public function render( $filter ){ public function render( $filter ){
return '<tainacan-filter-taxonomy-taginput name="'.$filter->get_name().'" return '<tainacan-filter-taxonomy-taginput name="'.$filter->get_name().'"
filter_type="'.$filter->get_metadatum()->get_metadata_type().'"
collection_id="'.$filter->get_collection_id().'" collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taxonomy-taginput>'; metadatum_id="'.$filter->get_metadatum()->get_id().'"></tainacan-filter-taxonomy-taginput>';
} }