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

Refactor tree filtering in CMSMain/HierarchyModelAdmin #2949

Open
5 tasks done
GuySartorelli opened this issue May 30, 2024 · 0 comments
Open
5 tasks done

Refactor tree filtering in CMSMain/HierarchyModelAdmin #2949

GuySartorelli opened this issue May 30, 2024 · 0 comments

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented May 30, 2024

Form fields for filtering in CMSMain are hardcoded - and some of the functionality is duplicated or else needlessly different between this filter functionality and GridFieldFilterHeader.

Relevant

Acceptance Criteria

  • The fields to use for filtering are pulled from the model in the same way GridFieldFilterHeader does (i.e. it uses searchableFields())
  • SearchContext is used for filtering in CMSMain the same way it is in GridFieldFilterHeader
  • Any CMSSiteTreeFilter logic is either made generic if possible, or else used by the SearchContext for SiteTree wherever filtering pages is used
    • i.e. filtering pages in a gridfield uses the same logic as filtering pages in CMSMain
  • A shared template and shared javascript/css are used for the filter in GridFieldFilter and CMSMain (with the ability to use different custom templates as desired - e.g. by trying to get specific templates by class name first, and falling back to the shared one)
  • As much as feasible, PHP logic for filtering in GridFieldFilterHeader and CMSMain is shared

PRs

Enable WithinRangeFilter in searchable_fields

This set of PRs is required to match the ranged filtering against LastEdited which is currently only possible for SiteTree inside CMSMain.

Avoid filterByCallback() in CMSSiteTreeFilter subclasses

Important

Reassign to Guy if the above are merged but the below sink CI hasn't gone green yet

This set of PRs is required to migrate the SiteTree filtering functionality to primarily use SearchContext, which requires filtering be done by the ORM not in PHP.

Kitchen sink CI run

The main refactoring

The above should be merged before reviewing these, as some of the code from the above PRs is also included in the below.

@GuySartorelli GuySartorelli added this to the Silverstripe CMS 6 milestone May 30, 2024
@GuySartorelli GuySartorelli removed their assignment Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants