Skip to content

Migrate user/all admin page to Vue + /api/v2/users (Group 2.1)#866

Open
edwh wants to merge 4 commits into
developfrom
RES-USER-ALL-vue
Open

Migrate user/all admin page to Vue + /api/v2/users (Group 2.1)#866
edwh wants to merge 4 commits into
developfrom
RES-USER-ALL-vue

Conversation

@edwh
Copy link
Copy Markdown
Collaborator

@edwh edwh commented May 30, 2026

Summary

  • First sub-task of plans/active/blade-to-vue-migration.md Group 2 (user management)
  • Introduces GET /api/v2/users with auth/admin gating, filters, sort, pagination
  • OpenAPI annotations + UserAdmin resource
  • PHPUnit tests for the new endpoint (auth/forbidden/shape/filters/sort)
  • Vue page lands in a follow-up commit

Test plan

  • PHPUnit: tests/Feature/Users/APIv2UsersTest passes on CI
  • Follow-up: Vue admin user list page consumes this endpoint
  • Follow-up: Playwright smoke for /user/all

edwh added 3 commits May 30, 2026 23:12
First sub-task of the Group 2 (user management) blade-to-vue migration.
Introduces:
- GET /api/v2/users (admin only, paginated, filters: name/email/location/country/role; sort by name/email/role/location/country/created_at/updated_at)
- App\Http\Resources\UserAdmin
- tests/Feature/Users/APIv2UsersTest covering auth (401), forbidden (403),
  pagination shape, name/email/role filters, asc sort.

OpenAPI annotations included per plan convention. Vue page lands in a
follow-up commit.
Replaces the legacy blade table/search form with a Vue SPA that consumes
GET /api/v2/users for filtering, sorting and pagination.

- resources/js/components/UsersPage.vue: filter form (name/email/location
  /country/role), sortable b-table, b-pagination, debounced via submit
- resources/views/user/all.blade.php: now just mounts <UsersPage>
- lang/{en,fr,fr-BE}/users.php: i18n keys for the page
- app.js: register userspage component
- tests/Feature/Admin/Users/ViewUsersTest, UserAdminTest: rewritten as
  smoke tests (admin reaches page, non-admin redirected). The detailed
  filter/sort behaviour moves to APIv2UsersTest (covered) and Playwright
  (follow-up commit).
@edwh edwh marked this pull request as ready for review May 30, 2026 22:19
The old user/all blade allowed sorting by last login (users.updated_at).
The migrated Vue column lacked sortable, and its key (last_login_at)
didn't match the API sortMap. Add sortable + sortKey: 'updated_at'.

Found by adversarial review of PR #866.
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant