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 - Filter Header/Footer Duplication & Always-Visible Behaviour #1108

Closed
wants to merge 10 commits into from

Conversation

lrljoe
Copy link
Collaborator

@lrljoe lrljoe commented Mar 18, 2023

Reference #1094

When you have the same filter in both header & footer, it will display on screen despite hiding the column, and will shift to another column, and also cause a duplication of that column's filter.

The issue can be seen on the demo instance by

  1. Having two Columns with Secondary Header & Footer Filters (e.g. as in the Name and E-mail Columns)
  2. Add anything into one of the Secondary Header/Footer filters
  3. Hide that Column.

This appears to be occurring due to there being multiple matching wire:key & ID for the same filter, causing the DOM to become... upset?.

This PR introduces new methods:
setFilterPosition(string $position) // Header or Footer
hasCustomPosition(): bool // Does it Have a filter position set?
getCustomPosition(): string // Retrieves the custom position.

There's a new protected string on the Filter.php to hold the position.

The Custom Position is automatically set by the getSecondaryHeaderContents or getFooterContents functions respectively, the Filter Blades then append either header or footer in an appropriate place in the ID & wire:key respectively, blades have been updated for this.

This allows for the same Filter to exist in multiple places in the page.

There may be a better approach, but this is what I came up with!

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?
  • [NA] Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

lrljoe and others added 7 commits March 18, 2023 02:05
* Amended to removing formatting adjustments

Adding ID to Label

Update toolbar.blade.php

Adding new line at EOF

* Update toolbar.blade.php

Adding ID to Wrapper

* Amended to removing formatting adjustments

Adding ID to Label

Adding ID to Wrapper

Adding new line at EOF

Update toolbar.blade.php

Adding ID to Wrapper

* Update toolbar.blade.php

Adds IDs to Filter Labels
Adds IDs to Filter Wrappers
Restores removed EOF newline

* Restoring New Line at EOF
* Adding childElementOpen attr for all toolbar items.

* Adjusting Toolbar to remove errant formatting

* Fix styling

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>
* Initial Commit

* Add variable to Filter.php
* Restrict AppliedFilters to only return non-empty

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.

* Moving to withValues to make more sense
* Adding Custom Slug option (#21)

Adding new methods & test

Adding documentation

* Filter label (#22)

* Amended to removing formatting adjustments

Adding ID to Label

Update toolbar.blade.php

Adding new line at EOF

* Update toolbar.blade.php

Adding ID to Wrapper

* Amended to removing formatting adjustments

Adding ID to Label

Adding ID to Wrapper

Adding new line at EOF

Update toolbar.blade.php

Adding ID to Wrapper

* Update toolbar.blade.php

Adds IDs to Filter Labels
Adds IDs to Filter Wrappers
Restores removed EOF newline

* Restoring New Line at EOF

* Adding Filter Custom Pills blade option (#23)

* Adding Filter Custom Pills blade option

* Removing formatting changes

* Get applied filters   only non empty (#24)

* Restrict AppliedFilters to only return non-empty

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.

* Moving to withValues to make more sense

* Child open attribute (#25)

* Adding childElementOpen attr for all toolbar items.

* Adjusting Toolbar to remove errant formatting

* Fix styling

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>

* Adding getAdditionalSelectRaws (#26)

Using selectRaw rather than directly using DB

Referencing DB directly rather than a use

Fix styling

Fixing test

Restoring workflows

Removing automated on-push

Setting up configuration elements, documentation

Adding parameterised capability

* Update composer.json

* Update run-tests.yml

* Fix doc types (#27)

* Update toolbar.blade.php

* Update Filter.php

* Update FilterHelpers.php

* Fix styling

* Update FilterConfiguration.php

* Fix styling

* Initial DocType Fixes

* Fix styling

* PHPDoc FIxes

* Toolbar Blade Fixes for Pagination

* Fix styling

* Removing non-nullable return

* Fixing DocType issues

* Reverting minor tweaks due to PHPUnit failures

* Removing PHPStan

* Additional PHPDoc Fixes

* Fixes for PHPDocTypes

* Fix styling

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>

* Update composer.json

* Custom pill views (#29)

* Adding Filter Custom Pills blade option

* Removing formatting changes

* Initial Commit

* Fix styling

* Fix for errant line end

* Fix styling

* Minor Tweaks

* Remove ParaTest for this branch

* Restore Run-tests for this branch

* Remove CustomFilterPil

* Reverting Numerous Changes to Doctypes - Branches

* Fix Mistaken Branch merge

* More remediation to remove branch merges

* Fix styling

* More removals of branch merge

* Adding SlideDownRow and SlideDownColspan Tests

* Fix styling

* Restoring original workflow

* Restoring CS FIxer

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>
@lrljoe lrljoe changed the title Fix Filter Header/Footer Duplication & Always-Visible Behaviour Filters - FIX - Filter Header/Footer Duplication & Always-Visible Behaviour Mar 20, 2023
lrljoe and others added 3 commits March 20, 2023 18:12
* Move Labels to Blades & CustomFilterLabels

* Move Labels to Blades & CustomFilterLabels

* Fix styling

* Add swapping for slidedown/popover for BS4/5

* Fix styling

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>
@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 FixHeaderFooterFilters branch July 15, 2023 22:30
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