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

Filters - FIX - Restrict AppliedFilters to only return non-empty #1080

Conversation

lrljoe
Copy link
Collaborator

@lrljoe lrljoe commented Mar 3, 2023

At the moment, a filter will be considered "applied" if it has any value, including the default value. This causes the Pills to appear with a blank value. To avoid this, I've added an additional check for "isEmpty" in the getAppliedFiltersWithValues.

I am somewhat in two minds on this, but figured that using the filter Defaults for anything other than setting up the array keys (i.e. array with keys, but no values) shouldn't really be done, especially as you can apply filter values at component boot with:

    $this->setFilter('created_after', date('Y-m-d', strtotime('now -1 month')));

Tested against the Demo instance.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests and did you add any new tests needed for your feature?
  2. Did you update all templates (if applicable)?
  3. Did you add the relevant documentation (if applicable)?
  4. Did you test locally to make sure your feature works as intended?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

At the moment, a filter will be considered "applied" if it has any value, including the default value.  This causes the Pills to appear with a blank value.
@lrljoe
Copy link
Collaborator Author

lrljoe commented Mar 9, 2023

This is the most pressing of my current PRs I believe!

@lrljoe
Copy link
Collaborator Author

lrljoe commented Mar 11, 2023

@rappasoft - appreciate you're a busy man, any idea on when you'll be able to take a look at this one please?

@lrljoe lrljoe changed the title Restrict AppliedFilters to only return non-empty Filters - FIX - Restrict AppliedFilters to only return non-empty Mar 20, 2023
@lrljoe
Copy link
Collaborator Author

lrljoe commented Mar 20, 2023

See #1111

@lrljoe lrljoe closed this Mar 20, 2023
@rappasoft rappasoft mentioned this pull request Apr 8, 2023
@lrljoe lrljoe deleted the getAppliedFilters---Only-Non-Empty branch July 15, 2023 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant