Renames 'options' object as 'filterTypeOptions to prevent conflicts with mixin.'

This commit is contained in:
Mateus Machado Luna 2019-10-07 11:19:22 -03:00
parent 09316b89b5
commit 78223b3e38
4 changed files with 21 additions and 21 deletions

View File

@ -60,7 +60,7 @@
</b-dropdown-item>
</b-dropdown>
<!-- <b-numberinput
v-if="options.type == 'year'"
v-if="filterTypeOptions.type == 'year'"
:placeholder="$i18n.get('instruction_type_value_year')"
:aria-labelledby="labelId"
size="is-small"
@ -101,10 +101,10 @@
$i18n.get('datepicker_month_november'),
$i18n.get('datepicker_month_december')
]"/>
<!-- OPTIONS FOR TYPE
<!-- filterTypeOptions FOR TYPE
v-else
:type="options.type == 'month' ? 'month' : null"
:placeholder="options.type == 'month' ? $i18n.get('instruction_select_a_date') : $i18n.get('instruction_select_a_month')"
:type="filterTypeOptions.type == 'month' ? 'month' : null"
:placeholder="filterTypeOptions.type == 'month' ? $i18n.get('instruction_select_a_date') : $i18n.get('instruction_select_a_month')"
-->
</div>
</template>
@ -119,7 +119,7 @@
created() {
this.collection = this.filter.collection_id;
this.metadatum = (typeof this.filter.metadatum.metadatum_id == 'object' ? this.filter.metadatum.metadatum_id.metadatum_id : this.filter.metadatum.metadatum_id);
this.options = this.filter.filter_type_options;
this.filterTypeOptions = this.filter.filter_type_options;
let endpoint = '/collection/' + this.collection + '/metadata/' + this.metadatum;
@ -146,7 +146,7 @@
return {
value: null,
clear: false,
options: [],
filterTypeOptions: [],
collection: '',
metadatum: '',
metadatum_object: {},

View File

@ -4,7 +4,7 @@
:aria-labelledby="labelId"
size="is-small"
@input="validate_values()"
:step="options.step"
:step="filterTypeOptions.step"
v-model="valueInit"
/>
<p class="is-size-7 has-text-centered is-marginless">{{ $i18n.get('label_until') }}</p>
@ -12,7 +12,7 @@
:aria-labelledby="labelId"
size="is-small"
@input="validate_values()"
:step="options.step"
:step="filterTypeOptions.step"
v-model="valueEnd"/>
</div>
@ -24,7 +24,7 @@
created() {
this.collectionId = this.filter.collection_id;
this.metadatumId = this.filter.metadatum.metadatum_id;
this.options = this.filter.filter_type_options;
this.filterTypeOptions = this.filter.filter_type_options;
this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTags);
},
@ -35,7 +35,7 @@
isValid: false,
collectionId: '',
metadatum: '',
options: [],
filterTypeOptions: [],
withError: false
}
},

View File

@ -8,7 +8,7 @@
{{ $i18n.get('label_clean') }}
</option>
<option
v-for="(interval, index) in options.intervals"
v-for="(interval, index) in filterTypeOptions.intervals"
:value="index"
:key="index">
{{ interval.label }}
@ -23,7 +23,7 @@
created() {
this.collectionId = this.filter.collection_id;
this.metadatumId = this.filter.metadatum.metadatum_id;
this.options = this.filter.filter_type_options;
this.filterTypeOptions = this.filter.filter_type_options;
this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTags);
},
data() {
@ -33,7 +33,7 @@
isValid: false,
collectionId: '',
metadatumId: '',
options: [],
filterTypeOptions: [],
selectedInterval: ''
}
},
@ -52,8 +52,8 @@
},
changeInterval() {
if (this.selectedInterval !== '') {
this.valueInit = this.options.intervals[this.selectedInterval].from;
this.valueEnd = this.options.intervals[this.selectedInterval].to;
this.valueInit = this.filterTypeOptions.intervals[this.selectedInterval].from;
this.valueEnd = this.filterTypeOptions.intervals[this.selectedInterval].to;
this.emit();
} else {
this.clearSearch();
@ -84,7 +84,7 @@
});
if (values[0] != undefined && values[1] != undefined) {
let labelValue = this.options.intervals[this.selectedInterval].label + (this.options.showIntervalOnTag ? `(${values[0]}-${values[1]})` : '');
let labelValue = this.filterTypeOptions.intervals[this.selectedInterval].label + (this.filterTypeOptions.showIntervalOnTag ? `(${values[0]}-${values[1]})` : '');
this.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: this.filter.id,
value: labelValue
@ -108,11 +108,11 @@
this.valueInit = metaquery.value[0];
this.valueEnd = metaquery.value[1];
this.selectedInterval = this.options.intervals.findIndex(
this.selectedInterval = this.filterTypeOptions.intervals.findIndex(
anInterval => anInterval.from == this.valueInit && anInterval.to == this.valueEnd
);
let labelValue = this.options.intervals[this.selectedInterval].label + (this.options.showIntervalOnTag ? `(${this.valueInit}-${this.valueEnd})` : '');
let labelValue = this.filterTypeOptions.intervals[this.selectedInterval].label + (this.filterTypeOptions.showIntervalOnTag ? `(${this.valueInit}-${this.valueEnd})` : '');
this.$eventBusSearch.$emit( 'sendValuesToTags', {
filterId: this.filter.id,
value: labelValue

View File

@ -63,7 +63,7 @@
<b-numberinput
:aria-labelledby="labelId"
size="is-small"
:step="Number(options.step)"
:step="Number(filterTypeOptions.step)"
@input="emit()"
v-model="value"/>
</div>
@ -78,7 +78,7 @@
created() {
this.collection = this.filter.collection_id;
this.metadatum = (typeof this.filter.metadatum.metadatum_id == 'object' ? this.filter.metadatum.metadatum_id.metadatum_id : this.filter.metadatum.metadatum_id);
this.options = this.filter.filter_type_options;
this.filterTypeOptions = this.filter.filter_type_options;
let endpoint = '/collection/' + this.collection + '/metadata/' + this.metadatum;
@ -105,7 +105,7 @@
return {
value: null,
clear: false,
options: [],
filterTypeOptions: [],
collection: '',
metadatum: '',
metadatum_object: {},