Skip to content
This repository was archived by the owner on Nov 18, 2026. It is now read-only.

Admin page parity with the old UI - #132

Merged
kflemin merged 4 commits into
mainfrom
admin
Nov 18, 2026
Merged

kflemin merged 4 commits into
mainfrom
admin

Conversation

@kflemin

@kflemin kflemin commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

A user couldn't find the Admin page in the new UI, and per-cycle property and tax lot counts were missing.

Changes

  • Navigation: Superusers get an Admin item in the user menu. The Admin profile tab is hidden for everyone else. The user menu's labels are now translated.
  • Organizations table:
    • Adds Parent ID and Cycles columns.
    • Properties and Tax Lots now show totals across all cycles, and show - when the counts aren't available (orgs you aren't a member of).
    • Orgs with cycle data have a caret that expands a row per cycle, aligned under the Cycles, Properties and Tax Lots columns. The caret has a screen-reader label and aria-expanded.
    • The table fits its card without horizontal scrolling.
  • Create User: A superuser can create a new organization while creating a user. The new user becomes its owner, and the form rejects a name that's already taken. This uses the existing POST /api/v3/users/ with org_name; no backend changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved issues allow invalid organization names, misrepresent inventory counts, and cause accessibility and layout problems.

6 open issues
What changed in this PR

Brings the Angular Admin page closer to the legacy UI, improving discoverability, organization inventory summaries, and user creation.

Changes:

  • Adds superuser-only Admin navigation and translated user-menu labels.
  • Adds parent IDs, cycle totals, and expandable per-cycle inventory counts.
  • Supports creating an organization with a new user through the existing v3 API.

Validation was limited to source inspection and backend contract checks; automated tests and live-browser checks were not run.

File Description
src/​app/​modules/​profile/​profile.component.ts Hides the Admin tab from non-superusers.
src/​app/​modules/​profile/​admin/​admin.utils.ts Builds organization totals, cycle rows, and name checks.
src/​app/​modules/​profile/​admin/​admin.utils.spec.ts Tests count calculations, expansion, and name matching.
src/​app/​modules/​profile/​admin/​admin.component.ts Connects expandable rows and new-organization user creation.
src/​app/​modules/​profile/​admin/​admin.component.html Adds count columns, cycle rows, and organization-mode controls.
src/​app/​layout/​common/​user/​user.component.ts Adds Admin navigation and translation support.
src/​app/​layout/​common/​user/​user.component.html Adds the superuser Admin item and translated labels.
src/​@seed/​api/​user/​user.types.ts Defines the create-user response.
src/​@seed/​api/​user/​user.service.ts Supports user creation without an existing organization ID.
src/​@seed/​api/​organization/​organization.types.ts Defines admin organization cycle counts and parent metadata.
public/​i18n/​fr_CA.json Adds French Canadian translations.
public/​i18n/​es.json Adds Spanish translations.
public/​i18n/​en_US.json Adds English translation keys.

Review effort: Balanced

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Duplicate names can bypass validation because existing names are not trimmed and submissions remain enabled during refreshes, while long unbroken names can force horizontal scrolling.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Medium severity Allow long organization names to wrap in table cells

src/​app/​modules/​profile/​admin/​admin.component.html:62

Organization names are user-entered and may contain a long unbroken word. Without a breaking rule, such a name sets the table's minimum width and forces horizontal scrolling even on a wide card. Allow long names to break within the cell.

Medium severity Trim existing organization names before duplicate checks

src/​app/​modules/​profile/​admin/​admin.utils.ts:35

The input is trimmed, but existing organization names are not. If an existing name has surrounding whitespace (the Create Organization form submits its name without trimming), entering the same name without spaces bypasses this duplicate check. Normalize the existing names as well.

6 resolved since last review

Review effort: Balanced

@kflemin
kflemin merged commit 64ba9e8 into main Nov 18, 2026
4 checks passed
@kflemin
kflemin deleted the admin branch November 18, 2026 20:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants