diff --git a/src/admin/js/main.js b/src/admin/js/main.js index 270747774..a61c2beb9 100644 --- a/src/admin/js/main.js +++ b/src/admin/js/main.js @@ -33,6 +33,8 @@ import FilterTaginput from '../../classes/filter-types/taginput/Taginput.vue'; import FilterTaxonomyCheckbox from '../../classes/filter-types/taxonomy/Checkbox.vue'; import FilterTaxonomyTaginput from '../../classes/filter-types/taxonomy/Taginput.vue'; +import FormNumeric from '../../classes/filter-types/numeric/FormNumeric.vue'; + import TainacanFormItem from '../../classes/metadata-types/tainacan-form-item.vue'; import TainacanFiltersList from '../../classes/filter-types/tainacan-filter-item.vue'; @@ -65,7 +67,7 @@ Vue.component('tainacan-numeric', Numeric); Vue.component('tainacan-date', Date); Vue.component('tainacan-relationship', Relationship); Vue.component('tainacan-taxonomy', Taxonomy); - +/* Metadata Option forms */ Vue.component('tainacan-form-relationship', FormRelationship); Vue.component('tainacan-form-taxonomy', FormTaxonomy); Vue.component('tainacan-form-selectbox', FormSelectbox); @@ -81,6 +83,8 @@ Vue.component('tainacan-filter-checkbox', FilterCheckbox); Vue.component('tainacan-filter-taginput', FilterTaginput); 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); /* Others */ Vue.component('help-button', HelpButton); diff --git a/src/admin/js/theme-main.js b/src/admin/js/theme-main.js index 4235f0c65..3078c6ad3 100644 --- a/src/admin/js/theme-main.js +++ b/src/admin/js/theme-main.js @@ -5,18 +5,6 @@ import VTooltip from 'v-tooltip'; import VueMasonry from 'vue-masonry-css'; // Custom elements -import Text from '../../classes/metadata-types/text/Text.vue'; -import Textarea from '../../classes/metadata-types/textarea/Textarea.vue'; -import Selectbox from '../../classes/metadata-types/selectbox/Selectbox.vue'; -import Numeric from '../../classes/metadata-types/numeric/Numeric.vue'; -import Date from '../../classes/metadata-types/date/Date.vue'; -import Relationship from '../../classes/metadata-types/relationship/Relationship.vue'; -import Taxonomy from '../../classes/metadata-types/taxonomy/Taxonomy.vue'; - -import FormRelationship from '../../classes/metadata-types/relationship/FormRelationship.vue'; -import FormTaxonomy from '../../classes/metadata-types/taxonomy/FormTaxonomy.vue'; -import FormSelectbox from '../../classes/metadata-types/selectbox/FormSelectbox.vue'; - import FilterCustomInterval from '../../classes/filter-types/custom-interval/CustomInterval.vue'; import FilterNumeric from '../../classes/filter-types/numeric/Numeric.vue'; import FilterSelectbox from '../../classes/filter-types/selectbox/Selectbox.vue'; @@ -27,7 +15,6 @@ import FilterTaginput from '../../classes/filter-types/taginput/Taginput.vue'; import FilterTaxonomyCheckbox from '../../classes/filter-types/taxonomy/Checkbox.vue'; import FilterTaxonomyTaginput from '../../classes/filter-types/taxonomy/Taginput.vue'; -import TaincanFormItem from '../../classes/metadata-types/tainacan-form-item.vue'; import TaincanFiltersList from '../../classes/filter-types/tainacan-filter-item.vue'; import ItemsPage from '../pages/lists/items-page.vue'; import TermItemsPage from '../pages/lists/term-items-page.vue'; @@ -38,8 +25,6 @@ import ViewModeMasonry from '../../theme-helper/view-mode-masonry.vue'; import ViewModeSlideshow from '../../theme-helper/view-mode-slideshow.vue'; // Remaining imports -import HelpButton from '../components/other/help-button.vue'; -import draggable from 'vuedraggable' import store from '../../js/store/store' import routerTheme from './theme-router.js' import eventBusSearch from '../../js/event-bus-search'; @@ -54,19 +39,7 @@ Vue.use(UserPrefsPlugin); Vue.use(RouterHelperPlugin); Vue.use(ConsolePlugin, {visual: false}); -/* Metadata */ -Vue.component('tainacan-text', Text); -Vue.component('tainacan-textarea', Textarea); -Vue.component('tainacan-selectbox', Selectbox); -Vue.component('tainacan-numeric', Numeric); -Vue.component('tainacan-date', Date); -Vue.component('tainacan-relationship', Relationship); -Vue.component('tainacan-taxonomy', Taxonomy); -Vue.component('tainacan-form-relationship', FormRelationship); -Vue.component('tainacan-form-taxonomy', FormTaxonomy); -Vue.component('tainacan-form-selectbox', FormSelectbox); -Vue.component('tainacan-form-item', TaincanFormItem); Vue.component('tainacan-filter-item', TaincanFiltersList); /* Filters */ @@ -80,8 +53,6 @@ Vue.component('tainacan-filter-taxonomy-checkbox', FilterTaxonomyCheckbox); Vue.component('tainacan-filter-taxonomy-taginput', FilterTaxonomyTaginput); /* Others */ -Vue.component('help-button', HelpButton); -Vue.component('draggable', draggable); Vue.component('items-page', ItemsPage); Vue.component('term-items-page', TermItemsPage); diff --git a/src/classes/filter-types/autocomplete/class-tainacan-autocomplete.php b/src/classes/filter-types/autocomplete/class-tainacan-autocomplete.php index 28c150617..5663155ca 100644 --- a/src/classes/filter-types/autocomplete/class-tainacan-autocomplete.php +++ b/src/classes/filter-types/autocomplete/class-tainacan-autocomplete.php @@ -8,12 +8,10 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); */ class Autocomplete extends Filter_Type { - //protected $default_max_options = -1; - protected $use_max_options = false; - function __construct(){ $this->set_supported_types(['string','long_string','item']); $this->set_component('tainacan-filter-autocomplete'); + $this->set_use_max_options(false); $this->set_preview_template('
diff --git a/src/classes/filter-types/custom-interval/class-tainacan-custom-interval.php b/src/classes/filter-types/custom-interval/class-tainacan-custom-interval.php index 236079ba3..3d1574b4c 100644 --- a/src/classes/filter-types/custom-interval/class-tainacan-custom-interval.php +++ b/src/classes/filter-types/custom-interval/class-tainacan-custom-interval.php @@ -12,6 +12,7 @@ class Custom_Interval extends Filter_Type { function __construct(){ $this->set_supported_types(['float','date']); $this->set_component('tainacan-filter-custom-interval'); + $this->set_use_max_options(false); $this->set_preview_template('
diff --git a/src/classes/filter-types/numeric/FormNumeric.vue b/src/classes/filter-types/numeric/FormNumeric.vue new file mode 100644 index 000000000..e741bc7e5 --- /dev/null +++ b/src/classes/filter-types/numeric/FormNumeric.vue @@ -0,0 +1,54 @@ + + + \ No newline at end of file diff --git a/src/classes/filter-types/numeric/class-tainacan-numeric.php b/src/classes/filter-types/numeric/class-tainacan-numeric.php index 20ec8a9bb..f2908e924 100644 --- a/src/classes/filter-types/numeric/class-tainacan-numeric.php +++ b/src/classes/filter-types/numeric/class-tainacan-numeric.php @@ -12,6 +12,8 @@ class Numeric extends Filter_Type { function __construct(){ $this->set_supported_types(['float']); $this->set_component('tainacan-filter-numeric'); + // $this->set_form_component('tainacan-filter-form-numeric'); + $this->set_use_max_options(false); $this->set_preview_template('
@@ -70,7 +72,9 @@ class Numeric extends Filter_Type { * @internal param $metadatum */ public function render( $filter ){ - return 'get_option('options'); + return 'set_supported_types(['string', 'long_string']); $this->set_component('tainacan-filter-selectbox'); + $this->set_use_max_options(false); $this->set_preview_template('
diff --git a/src/classes/filter-types/taginput/class-tainacan-taginput.php b/src/classes/filter-types/taginput/class-tainacan-taginput.php index ba00475d5..e9ba673d2 100644 --- a/src/classes/filter-types/taginput/class-tainacan-taginput.php +++ b/src/classes/filter-types/taginput/class-tainacan-taginput.php @@ -11,6 +11,7 @@ class Taginput extends Filter_Type { function __construct(){ $this->set_supported_types(['string','long_string','item']); $this->set_component('tainacan-filter-taginput'); + $this->set_use_max_options(false); $this->set_preview_template('

'. __('Selected values') . ':

diff --git a/src/classes/filter-types/taxonomy/class-tainacan-taxonomytaginput.php b/src/classes/filter-types/taxonomy/class-tainacan-taxonomytaginput.php index 1e8706fa4..e63ea0097 100644 --- a/src/classes/filter-types/taxonomy/class-tainacan-taxonomytaginput.php +++ b/src/classes/filter-types/taxonomy/class-tainacan-taxonomytaginput.php @@ -11,6 +11,7 @@ class TaxonomyTaginput extends Filter_Type { function __construct(){ $this->set_supported_types(['term']); $this->set_component('tainacan-filter-taxonomy-taginput'); + $this->set_use_max_options(false); $this->set_preview_template('

'. __('Selected values') . ':