-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Add data-attributes to publish filtering interface #2577
Add data-attributes to publish filtering interface #2577
Conversation
The current markup of the „comparison mode“-selectboxes in the publish filtering interface doesn’t allow for multiple modes that don’t have a filter prefix (like „regexp:“, „greater than:“, etc.) as it uses the prefix as unique identifier (option value). The default comparison mode „is“ is expected as the only mode without a filter prefix. But filter modes like „between“ („$x to $y“) as included in Number Field (and possibly date fields too) don’t have a prefix either and therefore won’t work with the current code. This PR changes that behavior by shifting to the filter title as unique identifier and adding the filter prefix as optional data-attribute that’s only used for building the actual filtering-url-parameters. Old Behavior: - Filter title is used as option title - Filter prefix is used as value-attribute New Behavior: - Filter title is used as option title - Filter title is used as value-attribute - Filter prefix is included as data-attribute
Use the „data-comparison“-attribute as unique identifier for the chosen comparison mode of a filtering instance - both in the selectbox and the list of context help texts. The „value“-attribute of the comparison mode selectbox now again is used for serving the actual filter prefix used to construct the filtering-parameters in the url.
At first glance, it seems ligit. I'll test ASAP. Thanks! |
Did you tested it with some of the most used extensions ? |
You bet I did :) As I noticed lots of little quirks and bugs in Publish Filtering (mostly related to special charactes and umlauts) while testing my changes I had to reassure that they weren't caused by anything I did - so I started testing really intensely and documented my results for both cases - before my changes and after - they both were exactly the same except for the one scenario I wanted to fix (the "between"-filter in the Publish Filtering Interface). I posted about this here and documented my filtering results in an own repo. My changes won't do much to fix most of the issues Publish Filtering has, but nonetheless they're fixing a basic conceptual flaw and at least will make the last four failed test cases in number field disappear! (Though the number field extensions needs to be fixed for that too - will do so after this change has been released!) |
👍
This is really nice thanks. I'll test ASAP. |
* Publish Filtering : Increase flexibility of comparison modes 6e764d1 The current markup of the „comparison mode“-selectboxes in the publish filtering interface doesn’t allow for multiple modes that don’t have a filter prefix (like „regexp:“, „greater than:“, etc.) as it uses the prefix as unique identifier (option value). The default comparison mode „is“ is expected as the only mode without a filter prefix. But filter modes like „between“ („$x to $y“) as included in Number Field (and possibly date fields too) don’t have a prefix either and therefore won’t work with the current code. This PR changes that behavior by shifting to the filter title as unique identifier and adding the filter prefix as optional data-attribute that’s only used for building the actual filtering-url-parameters. Old Behavior: - Filter title is used as option title - Filter prefix is used as value-attribute New Behavior: - Filter title is used as option title - Filter title is used as value-attribute - Filter prefix is included as data-attribute * Fix code indenting 4a7db7a * Improve construction of comparison array ccc5e9e * Fix code indenting e56bdde * Use „data-comparison“ as unique identifier of the chosen comparison mode d37e0b8 Use the „data-comparison“-attribute as unique identifier for the chosen comparison mode of a filtering instance - both in the selectbox and the list of context help texts. The „value“-attribute of the comparison mode selectbox now again is used for serving the actual filter prefix used to construct the filtering-parameters in the url. * Remove leading whitespace from filter value input field ac61c11
* Publish Filtering : Increase flexibility of comparison modes 6e764d1 The current markup of the „comparison mode“-selectboxes in the publish filtering interface doesn’t allow for multiple modes that don’t have a filter prefix (like „regexp:“, „greater than:“, etc.) as it uses the prefix as unique identifier (option value). The default comparison mode „is“ is expected as the only mode without a filter prefix. But filter modes like „between“ („$x to $y“) as included in Number Field (and possibly date fields too) don’t have a prefix either and therefore won’t work with the current code. This PR changes that behavior by shifting to the filter title as unique identifier and adding the filter prefix as optional data-attribute that’s only used for building the actual filtering-url-parameters. Old Behavior: - Filter title is used as option title - Filter prefix is used as value-attribute New Behavior: - Filter title is used as option title - Filter title is used as value-attribute - Filter prefix is included as data-attribute * Fix code indenting 4a7db7a * Improve construction of comparison array ccc5e9e * Fix code indenting e56bdde * Use „data-comparison“ as unique identifier of the chosen comparison mode d37e0b8 Use the „data-comparison“-attribute as unique identifier for the chosen comparison mode of a filtering instance - both in the selectbox and the list of context help texts. The „value“-attribute of the comparison mode selectbox now again is used for serving the actual filter prefix used to construct the filtering-parameters in the url. * Remove leading whitespace from filter value input field ac61c11 Picked from 51ba356
* Publish Filtering : Increase flexibility of comparison modes 6e764d1 The current markup of the „comparison mode“-selectboxes in the publish filtering interface doesn’t allow for multiple modes that don’t have a filter prefix (like „regexp:“, „greater than:“, etc.) as it uses the prefix as unique identifier (option value). The default comparison mode „is“ is expected as the only mode without a filter prefix. But filter modes like „between“ („$x to $y“) as included in Number Field (and possibly date fields too) don’t have a prefix either and therefore won’t work with the current code. This PR changes that behavior by shifting to the filter title as unique identifier and adding the filter prefix as optional data-attribute that’s only used for building the actual filtering-url-parameters. Old Behavior: - Filter title is used as option title - Filter prefix is used as value-attribute New Behavior: - Filter title is used as option title - Filter title is used as value-attribute - Filter prefix is included as data-attribute * Fix code indenting 4a7db7a * Improve construction of comparison array ccc5e9e * Fix code indenting e56bdde * Use „data-comparison“ as unique identifier of the chosen comparison mode d37e0b8 Use the „data-comparison“-attribute as unique identifier for the chosen comparison mode of a filtering instance - both in the selectbox and the list of context help texts. The „value“-attribute of the comparison mode selectbox now again is used for serving the actual filter prefix used to construct the filtering-parameters in the url. * Remove leading whitespace from filter value input field ac61c11 Picked from 51ba356
This PR introduces data-attributes to the publish filtering interface. This allows for better and more precise and flexible handling of comparison modes and their help texts.
It also removes the (annoying) leading whitespace in the input fields of publish filtering interface.
See #2499 for details.