Removes proposal of type option from date filter for now.

This commit is contained in:
Mateus Machado Luna 2019-09-04 10:03:54 -03:00
parent ebdfc64a25
commit ce211e5130
3 changed files with 27 additions and 24 deletions

View File

@ -35,7 +35,7 @@ import FilterTaxonomyCheckbox from '../../classes/filter-types/taxonomy/Checkbox
import FilterTaxonomyTaginput from '../../classes/filter-types/taxonomy/Taginput.vue';
import FormNumeric from '../../classes/filter-types/numeric/FormNumeric.vue';
import FormDate from '../../classes/filter-types/date/FormDate.vue';
// import FormDate from '../../classes/filter-types/date/FormDate.vue';
import TainacanFormItem from '../../classes/metadata-types/tainacan-form-item.vue';
import TainacanFiltersList from '../../classes/filter-types/tainacan-filter-item.vue';
@ -91,7 +91,7 @@ Vue.component('tainacan-filter-taxonomy-checkbox', FilterTaxonomyCheckbox);
Vue.component('tainacan-filter-taxonomy-taginput', FilterTaxonomyTaginput);
/* Filter Metadata Option forms */
Vue.component('tainacan-filter-form-numeric', FormNumeric);
Vue.component('tainacan-filter-form-date', FormDate);
// Vue.component('tainacan-filter-form-date', FormDate);
/* Others */
Vue.component('help-button', HelpButton);

View File

@ -58,20 +58,18 @@
≤  {{ $i18n.get('before_or_on_day') }}
</b-dropdown-item>
</b-dropdown>
<b-numberinput
<!-- <b-numberinput
v-if="options.type == 'year'"
:placeholder="$i18n.get('instruction_type_value_year')"
:aria-labelledby="labelId"
size="is-small"
step="1"
@input="emitOnlyYear($event)"
v-model="yearsOnlyValue"/>
v-model="yearsOnlyValue"/> -->
<b-datepicker
v-else
:type="options.type == 'month' ? 'month' : null"
position="is-bottom-left"
:aria-labelledby="labelId"
:placeholder="options.type == 'month' ? $i18n.get('instruction_select_a_date') : $i18n.get('instruction_select_a_month')"
:placeholder="$i18n.get('instruction_select_a_date')"
v-model="value"
@input="emit()"
editable
@ -102,6 +100,11 @@
$i18n.get('datepicker_month_november'),
$i18n.get('datepicker_month_december')
]"/>
<!-- OPTIONS 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')"
-->
</div>
</template>

View File

@ -12,11 +12,11 @@ class Date extends Filter_Type {
function __construct(){
$this->set_supported_types(['date']);
$this->set_component('tainacan-filter-date');
$this->set_form_component('tainacan-filter-form-date');
// $this->set_form_component('tainacan-filter-form-date');
$this->set_use_max_options(false);
$this->set_default_options([
'type' => 'day'
]);
// $this->set_default_options([
// 'type' => 'day'
// ]);
$this->set_preview_template('
<div>
<div>
@ -60,17 +60,17 @@ class Date extends Filter_Type {
');
}
/**
* @inheritdoc
*/
public function get_form_labels(){
return [
'type' => [
'title' => __( 'Type', 'tainacan' ),
'description' => __( 'The type of the date picker, may be for day, month or year.', 'tainacan' ),
]
];
}
// /**
// * @inheritdoc
// */
// public function get_form_labels(){
// return [
// 'type' => [
// 'title' => __( 'Type', 'tainacan' ),
// 'description' => __( 'The type of the date picker, may be for day, month or year.', 'tainacan' ),
// ]
// ];
// }
/**
* @param $filter
@ -78,11 +78,11 @@ class Date extends Filter_Type {
* @internal param $metadatum
*/
public function render( $filter ){
return '<tainacan-filter-date
type="' . $this->get_option('type') . '"
return '<tainacan-filter-date
name="'.$filter->get_name().'"
collection_id="'.$filter->get_collection_id().'"
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-date>';
// type="' . $this->get_option('type') . '"
}
}