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

Add data-attributes to publish filtering interface #2577

Merged
merged 6 commits into from
May 31, 2016

Conversation

twiro
Copy link
Contributor

@twiro twiro commented Mar 18, 2016

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.

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.
@nitriques
Copy link
Member

At first glance, it seems ligit. I'll test ASAP. Thanks!

@nitriques nitriques added this to the 2.7.0 milestone Apr 12, 2016
@nitriques nitriques self-assigned this Apr 12, 2016
@nitriques
Copy link
Member

Did you tested it with some of the most used extensions ?

@twiro
Copy link
Contributor Author

twiro commented Apr 12, 2016

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!)

@nitriques
Copy link
Member

You bet I did :)

👍

I posted about this here and documented my filtering results in an own repo.

This is really nice thanks.

I'll test ASAP.

@nitriques nitriques merged commit 51ba356 into symphonycms:2.7.x May 31, 2016
@michael-e michael-e mentioned this pull request Jul 19, 2016
@twiro twiro deleted the publish-filter-data-attributes branch March 14, 2017 19:03
jensscherbl pushed a commit that referenced this pull request May 28, 2017
* 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
nitriques pushed a commit that referenced this pull request Jun 16, 2017
* 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
nitriques pushed a commit that referenced this pull request Jun 16, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants