Skip to content

Fix event_id filter being dropped on the deliveries dashboard page - #216

Merged
morcen merged 1 commit into
mainfrom
fix/issue-156-deliveries-event-id-filter
Sep 6, 2026
Merged

Fix event_id filter being dropped on the deliveries dashboard page#216
morcen merged 1 commit into
mainfrom
fix/issue-156-deliveries-event-id-filter

Conversation

@morcen

@morcen morcen commented Sep 5, 2026

Copy link
Copy Markdown
Owner

What was broken

The Events page's "View Deliveries" action (viewDeliveries() in resources/js/Pages/Events/Index.vue) navigates to the deliveries dashboard with an event_id query parameter, but nothing downstream ever read or applied it:

  • DashboardController::deliveries() only read/applied status and endpoint_id filters — event_id was silently ignored.
  • Deliveries/Index.vue's filters ref didn't track event_id at 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-send filters.value, which never contained event_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 reads event_id the same way it already handles status/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: added event_id to the filters state (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 new filteredEvent prop.
  • Added tests/Feature/DashboardDeliveriesEventFilterTest.php covering: filtering to a single event's deliveries, the unfiltered case still returning everything, and that an event_id belonging 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

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
@morcen
morcen merged commit f25d8ad into main Sep 6, 2026
2 checks passed
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.

Events page "View Deliveries" action silently drops the event filter — always shows the full unfiltered list

1 participant