Removes proposal of type option from date filter for now.
This commit is contained in:
parent
ebdfc64a25
commit
ce211e5130
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -79,10 +79,10 @@ class Date extends Filter_Type {
|
|||
*/
|
||||
public function render( $filter ){
|
||||
return '<tainacan-filter-date
|
||||
type="' . $this->get_option('type') . '"
|
||||
name="'.$filter->get_name().'"
|
||||
collection_id="'.$filter->get_collection_id().'"
|
||||
metadatum_id="'.$filter->get_metadatum_id().'"></tainacan-filter-date>';
|
||||
// type="' . $this->get_option('type') . '"
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue