Fix event_id filter being dropped on the deliveries dashboard page - #216
Merged
Conversation
The Events page's "View Deliveries" action navigates to the deliveries dashboard with an event_id query parameter, but DashboardController::deliveries() never read or applied it and the Vue page's filter state didn't track it either. Users clicking that action always saw the full, unfiltered delivery list instead of the selected event's deliveries. Read and apply event_id the same way status/endpoint_id already are, scoped to the current user's own events, and pass the matching event back to the page so it can track the filter across subsequent filter changes/pagination and show a dismissible "Filtered by event" chip. Fixes #156
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.
What was broken
The Events page's "View Deliveries" action (
viewDeliveries()inresources/js/Pages/Events/Index.vue) navigates to the deliveries dashboard with anevent_idquery parameter, but nothing downstream ever read or applied it:DashboardController::deliveries()only read/appliedstatusandendpoint_idfilters —event_idwas silently ignored.Deliveries/Index.vue'sfiltersref didn't trackevent_idat all, so even if the backend had applied it once, the filter would be lost the moment the user changed another filter or paginated (since those actions re-sendfilters.value, which never containedevent_id).The net effect: a user clicking "View Deliveries" from a specific event always saw the full, unfiltered delivery list, with no indication the filter was dropped.
What changed
app/Http/Controllers/DashboardController.php:deliveries()now readsevent_idthe same way it already handlesstatus/endpoint_id, applies it to the query, and looks up the matching event (scoped to the current user, so this can't be used to probe another user's events) to pass back to the page.resources/js/Pages/Deliveries/Index.vue: addedevent_idto thefiltersstate (so it survives subsequent filter/pagination requests and is included in "has active filters" detection and "Clear Filters"), and added a dismissible "Filtered by event: {name}" chip driven by the newfilteredEventprop.tests/Feature/DashboardDeliveriesEventFilterTest.phpcovering: filtering to a single event's deliveries, the unfiltered case still returning everything, and that anevent_idbelonging to another user cannot be used to view or reveal that user's deliveries/event.Testing
vendor/bin/pint --dirty— clean, no changes needed.php artisan test— full suite passes: 216 passed, 7 pre-existing skips (699 assertions).Fixes #156