fix: admin dashboard renders end-to-end + wider pages - #38
Merged
Conversation
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.
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.
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:
{ payload, message }(and pages as{ results, page, size, totalPages }via@JsonProperty), butuseAuth,Profile, andAdminreaddata.data/payload.content. SouseAuth.roleswas always empty →isAdminfalse → Admin link hidden +AdminRoutebounced admins; Roles/Users tabs empty; Profile never prefilled. Fixed all four to readdata.payload.GET /user/all500'd —No property '_id' found for type 'User': the default pagination sort field was still the Mongo_id(removed in the Postgres migration). Changed toid.CliRunnergave the seededmtm_adminonly 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-pagemax-width1600 → 1920px(+ roomier ≥1280px side padding) so Activity / Projects / History / Trash (and Dashboard/Gantt) cover more screen; removed Trash's extramax-w-4xlcap. Reminders/Admin/Profile keep their own inner caps.Backend 106 tests green; frontend build + tests green.