feat(routes): add 'my routes only' filter - #337
Merged
Conversation
Adds a checkbox filter to the Routes page that narrows the list to routes owned by the current user. The filter is URL-driven (?mine=true), cached server-side automatically via the existing key builder, and only shown to operators/admins (members can't own routes). Backend: mine query param on GET /api/v1/routes filters by created_by matching the caller's X-User-Id. Legacy NULL routes are excluded. Tests: - Backend: 6 new TestRouteMineFilter tests (own/other/null/admin/default) - Vitest: 6 new tests (param passing, role gating, checkbox state) - E2E: new seed route owned by pw-operator + mine filter spec
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Adds a checkbox filter to the Routes page that narrows the list to routes owned by the current user. The filter is URL-driven (
?mine=true), cached server-side automatically via the existing key builder, and only shown to operators/admins (members can't own routes).Changes
Backend —
api/routes/routes.pymine: bool = Query(False)onlist_routes; when true, filters tocreated_by == caller_idcreated_byroutes excluded in this mode_routes_key_builderalready namespaces by sorted query stringFrontend —
pages/Routes.tsxuseSearchParamsdrives the filter state from the URLFilterFormpanel withdata-testid="routes-mine-toggle"checkboxcanManage(operator/admin only)i18n —
routes.filter_mineadded toen.jsonandnl.jsonTests
TestRouteMineFilter)Routes.test.tsx)routes-operator.spec.ts)created_by="pw-operator"All: 81 backend / 331 frontend / pre-commit clean / e2e typecheck clean.