Repository navigation
Add search and filters to the RL experiments overview - #76
Merged
Merged
Conversation
/admin/reports/rl gets a Name or ID search plus Source and Activity filters above the list. The filter form redirects to the overview with the values in the URL, so filtered lists can be bookmarked, sorted and paged. The bulk delete confirmation and its cancel link keep the filters. A search for "0" counts as a filter, and unknown or malformed parameters are ignored. The Add experiment button and intro text move from the table form to the page so the filters sit between them and the table.
The inline form layout floated each item, so the search label sat higher than the select labels and the Filter and Reset buttons aligned to the label row instead of the fields. The filter now uses a small flex layout that bottom-aligns every field and button and keeps the rows aligned when the form wraps on narrow screens.
Contributor
Author
|
Pushed The inline form floated each item, so the "Name or ID" label sat higher than the select labels and the Filter and Reset buttons lined up with the label row instead of the fields. The filter now uses a small flex layout ( No PHP behaviour changed. I removed the cosmetic note from the description. |
The changelog file is being removed from the module in a separate change.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/admin/reports/rlnow has a search box and two filters above the experiments table.The filters combine, and a "Showing X of Y experiments" line and a Reset button appear while one is active.
How it works
ExperimentsFilterFormposts and redirects to the overview withsearch,sourceandactivityin the URL (post-redirect-get). Filtered lists can be bookmarked and shared, and the pager and sort links keep them. A new filter starts on page one and keeps the chosen sort.ExperimentsOverviewFormfilters the rows before sorting and paging, so counts, sort order and the 50-per-page pager all stay consistent.destination. Submitted selections are still retained from the full registry, so a checked row cannot be rejected because live statistics moved it out of the filtered set.ReportsController::experimentsOverview()to render the page: Add experiment button and intro text, then the filter form, then the table form. HTML cannot nest forms, so the filters are their own form; the button and intro moved from the table form to the page so the filters sit between them and the table.Edge cases handled
0counts as a real filter (a plainarray_filter()would drop it; caught while testing).sourceoractivityvalues are ignored, and the filter form then shows "- Any -" so it matches the list.?search[]=xdo not break the page.@phpstan-ignore: the new form isfinal, sonew staticneeds no suppression.Testing
Run against the local DXPR CMS sandbox with 62 experiments (five sources, 55 of them in one source to force a second page):
0, no match), source, activity, every combination, paging with a filter, page beyond the end, sort plus filter, malformed and unknown parameters.scripts/e2e/test-experiments-overview.sh(23 assertions in the existing drush e2e style; it renders both forms through a real request with test experiments it creates and deletes). I ran it against the sandbox through theDRUSHvariable and confirmed it fails when the0handling is broken. The Docker e2e job is what runs it in CI.Docs page and changelog are updated.