Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[charcoal/admin] Add support for searching multiple fields to Selectize controller #85

Closed
mcaskill opened this issue Feb 7, 2024 · 1 comment
Labels

Comments

@mcaskill
Copy link
Collaborator

mcaskill commented Feb 7, 2024

Currently limited to a single field which limits what can be searched.

$query = [
'property' => $searchField,
'operator' => 'LIKE',
'value' => '%' . $this->query() . '%',
];

Selectize's searchField setting is used to:

An array of property names to analyze when filtering options.

For example:

$("select").selectize({
	valueField: "email",
	labelField: "name",
	searchField: ["name", "email"],
	options: [
		{ email: "selectize@risadams.com", name: "Ris Adams" },
		{ email: "someone@gmail.com", name: "Someone" },
		{ email: "someone-else@yahoo.com", name: "Someone Else" },
	],
});

Since Charcoal's Selectize Input Property extends Object Property, the options are already formatted as { value: number|string, label: string }, Selectize's searchField can only ever be at best [ 'value', 'label' ] which makes it incompatible with Charcoal's Selectize Load controller's collection filters which expect a model property name.

One solution is to add a separate input option, for example, searchProperties which would be used by the Selectize Load controller to filter the collection.

Alternatively, have Selectize Input Property and Load controller not be constrained to Object Property's value/label pair.

@mcaskill mcaskill changed the title [charcoal/admin] Add support to Selectize controller for searching multiple fields [charcoal/admin] Add support for searching multiple fields to Selectize controller Feb 13, 2024
JoelAlphonso added a commit that referenced this issue Mar 13, 2024
Add Tabulator Input + Add Translatable Value + Improve Structure Properties

### Admin

* Add support for ES6 in the asset build.
* Add `AbstractPropertyInput::getInputValOptions()` to allow input sub-classes to define their own set of options to parse input values.
* Add input that integrates [Tabulator](https://tabulator.info/) for tabular data editing.
* Improve handling of JSON values with `TabulatorInput`, `JsonEditorInput`, and `TextareaInput`.
* Prioritize `form_group` over `default_form_group` in `StructureFormGroup` to allow for custom one-off form groups.

### Property

* Validate models in `ModelStructureProperty`.

### Translator

* Rework the translation system to standardize translatable values with new `TranslatableInterface` and add a new `TranslatableValue` to dissociate from `Translation` which is tied with the `Translator` and `LocalesManager`.
* Add awareness of `TranslatableValue` to Property package.

-----

## Changes :

### Features

* **admin:** Add custom dialog titles for Selectize input ([ffc3382](ffc3382))
* **admin:** Add JS debounce factory ([7a25409](7a25409))
* **admin:** Add support to customize form widget used by Selectize input ([b407dfb](b407dfb)), closes [#88](#88)
* **admin:** Add validation message to TinyMCE on save ([46af62b](46af62b))
* **admin:** Change default options of TinyMCE Basic Input ([26018e9](26018e9))
* **admin:** Improve Selectize LoadAction controller ([21057b7](21057b7)), closes [#85](#85)
* **admin:** Improve structure property metadata filtering ([8eb96cb](8eb96cb))
* **admin:** Improve Tabulator Input ([fc33ab0](fc33ab0))
* **admin:** Improve validation/requirements in Tabulator Input ([13b33d4](13b33d4))
* **admin:** Sort admin secondary and system menu items ([e6c3493](e6c3493))
* **admin:** Use Bootstrap 4 theme for Tabulator Input ([b93cd5d](b93cd5d))
* **input:** add getInputValOptions to allow input classes to define their own set of options. ([8d3ce52](8d3ce52))
* **model-structure-property:** improve ModelStructureProperty.php ([47c1ae0](47c1ae0))
* **module:** Improve module app config loader ([8871115](8871115))
* **property:** Add support for dynamic type field to Object Property ([d153868](d153868)), closes [#86](#86)
* **structure-form-group:** improve StructureFormGroup.php ([c2f385e](c2f385e))
* **structure:** add TranslatableValue.php awareness to AbstractProperty.php ([ca67612](ca67612))
* **tabulator:** add tabulator front-end lib and templates ([b2cda4a](b2cda4a))
* **tabulator:** add TabulatorInput.php ([bbccfc6](bbccfc6))
* **tabulator:** implement tabulator.js as Charcoal js module ([0626c61](0626c61))
* **translator:** rework the translator and translation systems to standardize translatables with TranslatableInterface.php and add a new TranslatableValue.php enabling dissociating translation from the core translator ([a29d0f3](a29d0f3))


### Bug Fixes

* **abstract-selectable:** add check for `is_object` before calling `method_exists` on potential integer value ([42876e3](42876e3))
* **admin:** Add fallback layout for form group properties ([04169c8](04169c8))
* **admin:** Change Object UpdateAction ([d2aba67](d2aba67))
* **admin:** Fix admin template menu building ([1221167](1221167))
* **admin:** Fix appearance of Selectize List ([6ec39df](6ec39df))
* **admin:** Fix block comments of Tabulator input ([d86a2b7](d86a2b7))
* **admin:** Fix handling of property type metadata in CollectionContainerTrait ([aa465e7](aa465e7))
* **admin:** Fix margins for switch and file inputs ([e582431](e582431))
* **admin:** Fix quick forms, form tabs, and L10N inputs ([cd65f2c](cd65f2c))
* **admin:** Fix referenced version of Tabulator in NPM manifest ([cf506d4](cf506d4))
* **admin:** Improve error handling in ObjectContainerTrait ([5e00185](5e00185))
* **admin:** Improve structure card header ([2e0c6a7](2e0c6a7))
* **admin:** Improve styles and logic of Tabulator Input ([b3971c0](b3971c0))
* **admin:** Localize Tabulator Input ([f7e1666](f7e1666))
* **bin:** Search working directory for Composer autoloader ([4226199](4226199))
* **cache:** Ignore broken cache drivers in tests ([1316be1](1316be1))
* **json-editor:** use inputVal instead of jsonVal for json-editor.mustache since it's no longer needed following changes to TranslatableValue and AbstractProperty/Input([013573b](013573b))
* **property:** Fix handling of `l10nVal()` on Structure Property ([d3c71b9](d3c71b9))
* **translatable:** make TranslatableValue.php ArrayAccess compliant ([4c40ea0](4c40ea0))
* **translatable:** update the `TranslatableInterface` to change the `trans` method signature and update `TranslatableValue` with said method and deprecate `each` and `sanitize` for future version of charcoal ([a728e07](a728e07))
* **translation:** revert construct to use manager and trans method no longer relay to `translator->translate()` ([6723433](6723433))
* **translator:** Revert `trans()` method of `TranslatableInterface` ([81393f6](81393f6))
charcoal-butler bot pushed a commit that referenced this issue Mar 13, 2024
## [5.0.0](v4.1.0...v5.0.0) (2024-03-13)

### ⚠ BREAKING CHANGES

* **admin:** The parent model property now receives both its structure/storage property and the structure's sub-property as a dot-delimited key path: `<storageProperty>.<childProperty>`. This fixes the risk of conflicting property identifiers where a structure's child property inherits the parent model's property mutations and fixes the missing context for the structure's property.

### Features

* **admin:** Add custom dialog titles for Selectize input ([ffc3382](ffc3382))
* **admin:** Add JS debounce factory ([7a25409](7a25409))
* **admin:** Add support to customize form widget used by Selectize input ([b407dfb](b407dfb)), closes [#88](#88)
* **admin:** Add validation message to TinyMCE on save ([46af62b](46af62b))
* **admin:** Change default options of TinyMCE Basic Input ([26018e9](26018e9))
* **admin:** Improve Selectize LoadAction controller ([21057b7](21057b7)), closes [#85](#85)
* **admin:** Improve structure property metadata filtering ([8eb96cb](8eb96cb))
* **admin:** Improve Tabulator Input ([fc33ab0](fc33ab0))
* **admin:** Improve validation/requirements in Tabulator Input ([13b33d4](13b33d4))
* **admin:** Sort admin secondary and system menu items ([e6c3493](e6c3493))
* **admin:** Use Bootstrap 4 theme for Tabulator Input ([b93cd5d](b93cd5d))
* **input:** add getInputValOptions to allow input classes to define their own set of options. ([8d3ce52](8d3ce52))
* **model-structure-property:** improve ModelStructureProperty.php ([47c1ae0](47c1ae0))
* **module:** Improve module app config loader ([8871115](8871115))
* **property:** Add support for dynamic type field to Object Property ([d153868](d153868)), closes [#86](#86)
* **structure-form-group:** improve StructureFormGroup.php ([c2f385e](c2f385e))
* **structure:** add TranslatableValue.php awareness to AbstractProperty.php ([ca67612](ca67612))
* **tabulator:** add tabulator front-end lib and templates ([b2cda4a](b2cda4a))
* **tabulator:** add TabulatorInput.php ([bbccfc6](bbccfc6))
* **tabulator:** implement tabulator.js as Charcoal js module ([0626c61](0626c61))
* **translator:** rework the translator and translation systems to standardize translatables with TranslatableInterface.php and add a new TranslatableValue.php enabling dissociating translation from the core translator ([a29d0f3](a29d0f3))

### Bug Fixes

* **abstract-selectable:** add check for `is_object` before calling `method_exists` on potential integer value ([42876e3](42876e3))
* **admin:** Add fallback layout for form group properties ([04169c8](04169c8))
* **admin:** Change Object UpdateAction ([d2aba67](d2aba67))
* **admin:** Fix admin template menu building ([1221167](1221167))
* **admin:** Fix appearance of Selectize List ([6ec39df](6ec39df))
* **admin:** Fix block comments of Tabulator input ([d86a2b7](d86a2b7))
* **admin:** Fix handling of property type metadata in CollectionContainerTrait ([aa465e7](aa465e7))
* **admin:** Fix margins for switch and file inputs ([e582431](e582431))
* **admin:** Fix quick forms, form tabs, and L10N inputs ([cd65f2c](cd65f2c))
* **admin:** Fix referenced version of Tabulator in NPM manifest ([cf506d4](cf506d4))
* **admin:** Improve error handling in ObjectContainerTrait ([5e00185](5e00185))
* **admin:** Improve structure card header ([2e0c6a7](2e0c6a7))
* **admin:** Improve styles and logic of Tabulator Input ([b3971c0](b3971c0))
* **admin:** Localize Tabulator Input ([f7e1666](f7e1666))
* **bin:** Search working directory for Composer autoloader ([4226199](4226199))
* **cache:** Ignore broken cache drivers in tests ([1316be1](1316be1))
* **json-editor:** use inputVal instead of jsonVal for json-editor.mustache since it's no longer needed following changes to TranslatableValue and AbstractProperty/Input ([013573b](013573b))
* **property:** Fix handling of `l10nVal()` on Structure Property ([d3c71b9](d3c71b9))
* **translatable:** make TranslatableValue.php ArrayAccess compliant ([4c40ea0](4c40ea0))
* **translatable:** update the `TranslatableInterface` to change the `trans` method signature and update `TranslatableValue` with said method and deprecate `each` and `sanitize` for future version of charcoal ([a728e07](a728e07))
* **translation:** revert construct to use manager and trans method no longer relay to `translator->translate()` ([6723433](6723433))
* **translator:** Revert `trans()` method of `TranslatableInterface` ([81393f6](81393f6))
@charcoal-butler
Copy link
Contributor

🎉 This issue has been resolved in version 5.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant