[PR #88] Adding Module Permissions and a Status Screen to the Admin Web
I requested this work.
- What was done: The module tab on the customer detail screen (where a customer’s feature-group permissions are viewed) now shows the permission list, the number of linked accounts, and a scheduled date. A window to change permissions is connected to it. A module status screen was also built. It shows each account’s role and status, the total number of links, and how many are actually usable.
- Chosen approach: Before saving, permissions are checked for role, whether the module belongs to the same facility, the reason, and the customer confirmation check. If the server rejects the change because the module is not in that facility, the window stays open and keeps the selection and input. Withdrawn customers do not see the change button. The account link window leaves out accounts in the same facility, not withdrawn, that are already linked to the module.
- On saving: While saving, the same request cannot be sent twice. If saving fails, the input stays so the user can try again. On success, the module list cache (a store that keeps screen data for a while) is refreshed. The scheduled date uses the browser’s default date input and can also be cleared.
- Checks: Type checking, linting (automatic code style checks), and 90 admin app tests passed, including 11 module tests. In the first parallel run, one existing login screen test failed; when run alone again, all 90 passed. The cause of that failure was not identified. The server and shared packages were not changed.
| Item | Detail |
|---|---|
| Scope | Module tab permission list and change window, module status screen |
| Checks before saving | Role, same-facility module, reason, customer confirmation check |
| When rejected | Window stays open; selection and input kept |
| Withdrawn customers | Change button not shown |
| Checks | Type check, lint, 90 tests passed; cause of one parallel-run failure not identified |
Who did what
- I: requested the work.
- Fizz (GPT-6 Luna): built the screens and save logic. It did not write its own tests.
- Cloud session (Claude Sonnet): wrote the tests.
- PL (Claude Sonnet 5.5): checked the change and summarized the findings.
- Pollen (opencode/glm-5.3-flash-free): ran a general review. The result was “approved, 1 medium, 3 low, 2 notes.”
Chosen and left for later
- Chosen: Permission checks run once before saving, and input is not cleared when the server rejects the change.
- Left for later: The account link window loads only the first page of the customer list, 20 people. If a facility has 21 or more customers, later candidates do not show. This was a decision not in the plan, so it was grouped into follow-up work instead of fixed here.
Not verified
- The cause of the one login screen test that failed in the parallel run was not identified.
- The 20-person limit in the account link window was not fixed in this PR.
- Three low-level findings (the same text in two places, a ternary with no effect, and input being cleared before a failed clear is confirmed) were checked by reading code only and passed on to follow-up cleanup.
What I learned
When a list loads only one page, later items drop out without any error. Check list size limits with their own tests, even when the screen looks right.