Skip to content

fix: admin dashboard renders end-to-end + wider pages - #38

Merged
vishu221b merged 1 commit into
mainfrom
feat/admin-profile-width
Jul 23, 2026
Merged

fix: admin dashboard renders end-to-end + wider pages#38
vishu221b merged 1 commit into
mainfrom
feat/admin-profile-width

Conversation

@vishu221b

Copy link
Copy Markdown
Owner

Admin dashboard now works end-to-end

The admin login didn't render admin features, and the Users/Roles tabs (and Profile) showed nothing. Three root causes:

  1. Response-unwrapping mismatch — the API wraps bodies as { payload, message } (and pages as { results, page, size, totalPages } via @JsonProperty), but useAuth, Profile, and Admin read data.data / payload.content. So useAuth.roles was always empty → isAdmin false → Admin link hidden + AdminRoute bounced admins; Roles/Users tabs empty; Profile never prefilled. Fixed all four to read data.payload.
  2. GET /user/all 500'dNo property '_id' found for type 'User': the default pagination sort field was still the Mongo _id (removed in the Postgres migration). Changed to id.
  3. Bootstrap admin hardeningCliRunner gave the seeded mtm_admin only the roles created that run, so it could end up with zero roles. Now resolves the full seed-role id set from the DB and self-heals an existing admin missing any seed role.

Verified live against the running stack: admin login shows the Admin link, Roles and Users tabs both populate (14 users with roles resolved), and Profile prefills. Bootstrap admin: mtm_admin / mtm_password.

Wider pages

.ui-page max-width 1600 → 1920px (+ roomier ≥1280px side padding) so Activity / Projects / History / Trash (and Dashboard/Gantt) cover more screen; removed Trash's extra max-w-4xl cap. Reminders/Admin/Profile keep their own inner caps.

Backend 106 tests green; frontend build + tests green.

The admin experience was broken by response-unwrapping mismatches plus a
migration-leftover 500:

- useAuth / Profile / Admin read data.data (and payload.content), but the
  API wraps bodies as { payload, message } and pages as
  { results, page, size, totalPages }. So roles were always empty ->
  isAdmin false -> Admin link hidden and AdminRoute bounced admins; the
  Roles/Users tabs were empty; and the Profile page never prefilled.
  Fixed all four to read data.payload (+ results/page/totalPages).
- GET /user/all threw 500 'No property _id found for type User' — the
  default pagination sort field was still the Mongo _id. Changed to id.
- CliRunner: the bootstrap admin took roles only from the subset created
  that run, so it could be created with zero roles. Now resolves the full
  seed-role id set from the DB and self-heals an existing admin missing
  any seed role.

Also widen .ui-page 1600 -> 1920px (+ roomier large-screen padding) so
Activity/Projects/History/Trash cover more screen; drop Trash's max-w-4xl
cap. Verified the admin flow live: link shows, roles + users tabs load,
profile prefills. Backend 106 tests green; frontend build + tests green.
@vishu221b
vishu221b merged commit ec8802f into main Jul 23, 2026
4 checks passed
@vishu221b
vishu221b deleted the feat/admin-profile-width branch July 23, 2026 12:37
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