Apply event_name and date-range filters on the deliveries dashboard page - #217
Merged
Merged
Conversation
…ard page The Deliveries index page collects event_name, from_date, and to_date filters in the UI, but DashboardController::deliveries() never read them, so results silently ignored those filters while still showing the empty-state copy suggesting the user adjust their filters. Apply the missing filters server-side (matching the convention already used by the API's DeliveryController::index()) and include them in the filters prop returned to the page so the UI reflects what's actually active. Fixes #81
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 Deliveries dashboard page (
resources/js/Pages/Deliveries/Index.vue) collects five filters from the user:status,endpoint_id,event_name,from_date, andto_date.DashboardController::deliveries()only ever appliedstatusandendpoint_id(andevent_id, used only by the "view this event's deliveries" link) —event_name,from_date, andto_datewere silently ignored server-side.A user typing an event name or picking a date range in the UI got back the full, unfiltered result set with no indication the filter had no effect, even though the empty-state copy suggests "Try adjusting your filters." This is especially misleading for a webhook platform, where filtering deliveries by event/date range is a normal part of investigating a delivery issue.
What changed
app/Http/Controllers/DashboardController.php: applyevent_name(partial match against the related event's name) andfrom_date/to_date(inclusive range againstcreated_at) filters, following the same pattern already used by the API'sDeliveryController::index().event_name,from_date, andto_datein thefiltersprop returned to the page, so the UI reflects what's actually active.tests/Feature/DashboardDeliveriesFilterTest.phpcovering:event_namenarrows results to matching events.from_date/to_datenarrows results to the date range.event_namecannot be used to see another user's deliveries.Testing
vendor/bin/pint --dirty— cleancomposer test— full suite passes (219 passed, 7 pre-existing skips)Fixes #81