Skip to content

Improve RL reports with bulk deletion and sortable columns - #74

Merged
jjroelofs merged 3 commits into
1.xfrom
jur/1.x/reports-bulk-operations-sorting
Oct 27, 2026
Merged

jjroelofs merged 3 commits into
1.xfrom
jur/1.x/reports-bulk-operations-sorting

Conversation

@jjroelofs

@jjroelofs jjroelofs commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #73.

/admin/reports/rl now supports selecting experiments and deleting them together after a confirmation page lists their names and IDs. The overview uses Drupal's standard checkbox table and action controls, shows 50 rows per page, and checks the existing administration permission again on submission. Selected experiments remain selected if live statistics move them to another page before submission. Private temporary storage keeps each user's selections separate, with independent tokens for separate tabs. Single and bulk deletion share the same transactional cleanup of registry entries, arm data, totals, and snapshots. A destination parameter is deferred until after confirmation.

All seven data headings now sort in both directions using Drupal's TableSort, with numeric counts, timestamps, displayed-name/activity fallbacks, and stable ties. Sorting precedes pagination. Experiment names link to their reports, and individual Delete actions sit beneath the names so every column heading represents sortable data. Core responsive-column priorities expose a Show all columns control on narrow screens. Confirmation and cancellation preserve the sort and page.

Drupal 11 core references

  • CommentAdminOverview: tableselect, bulk action selector, private tempstore, and confirmation redirect.
  • DeleteMultipleForm: separate confirmation listing the selection. RL uses ConfirmFormBase because its experiment registry is stored in custom tables rather than entities.
  • TableSort: standard sort links, direction indicators, and aria-sort.

Validation

  • Local browser validation on Drupal 11.4.6 / PHP 8.3: 7 tests, 152 assertions passed. Covers every column in both directions, numeric/date ordering, fallback names/activity, empty state, pagination, no selection, cancellation, complete deletion, stale confirmations, another administrator's private selection, report-only access, HTML escaping, and IDs containing 0 or brackets (including accessible checkbox labels). Also checked live statistics reordering between display and submission, destination handling, revoked permissions, and independent selections in separate tabs. The validation code is kept outside this PR.
  • Interactive browser review in Claro: numeric sorting, select-all, selection and confirmation contents, cancellation with retained sort, narrow-screen layout, and Show all columns. Adjusted responsive priorities and row-action layout based on the visual review.
  • Drupal and DrupalPractice coding standards pass for changed PHP/YAML; PHPStan level 5 passes for changed production PHP; git diff --check passes.
  • The test run reports two existing module deprecations in rl_requirements() and CacheResponseSubscriber::getSubscribedEvents(); there are no failing assertions.
  • CI on 3b0fbe4 passed Drupal lint and E2E tests. Its compatibility check against Drupal 11.5 development core reports four existing drupal_static() deprecations in unchanged code. Those are addressed separately in Replace deprecated static storage for Drupal 11.5 compatibility #75; merge that fix and update this branch to clear the compatibility failure.

@jjroelofs jjroelofs self-assigned this Oct 26, 2026
@jjroelofs

Copy link
Copy Markdown
Contributor Author

Reviewed the routing, services, ReportsController, ExperimentDeleteForm, the new ExperimentDeleteMultipleForm, ExperimentsOverviewForm and the ExperimentDeletion service.

No correctness issues found:

  • Deletion runs inside a transaction and rethrows on failure.
  • The tempstore token is re-validated on submit.
  • Tableselect keys are hashed, so numeric or bracketed IDs cannot break the form.
  • The pager slice and the POST re-inclusion of submitted keys are consistent.

LGTM.

@jjroelofs
jjroelofs merged commit f0a9585 into 1.x Oct 27, 2026
4 of 5 checks passed
@jjroelofs
jjroelofs deleted the jur/1.x/reports-bulk-operations-sorting branch October 27, 2026 10:02
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.

Improve the RL reports overview with bulk operations and sortable columns

1 participant