Skip to content

Let administrators change a facility's manager and logbooks - #77

Merged
slominskir merged 1 commit into
mainfrom
facility-manager-editable
Nov 16, 2026
Merged

slominskir merged 1 commit into
mainfrom
facility-manager-editable

Conversation

@slominskir-coding-agent

@slominskir-coding-agent slominskir-coding-agent Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Administrators can now change a facility's manager and logbooks from Inventory › Facilities, instead of a developer doing it in a database console.

  • The Facilities page shows an Edit button to jam-admin users (no Add or Remove). Selecting a facility and Edit opens a dialog with the facility's name, its manager's username and its logbooks.
  • Saving posts to a new /ajax/edit-facility endpoint, which calls FacilityFacade.editFacility, restricted to jam-admin.
    • Manager: trimmed, required, at most 32 characters (the MANAGER_USERNAME column's size).
    • Logbooks: comma-separated; each name is trimmed and empty ones dropped (" TLOG , ELOG ,, " is stored as TLOG,ELOG), at most 64 characters (LOGBOOKS_CSV). Empty is stored as null, which, as before, makes no log entries for the facility.
  • The user guide's Inventory page gets a Facilities section, and Administration no longer lists the manager and logbooks among what is changed in the database.

Fixes #71

No deployment steps: no schema change.

Checks

  • ./gradlew spotlessCheck build: passes.
  • zensical build --strict for the user guide: no issues.
  • In the running app (this branch's image, built with build.yaml on its own Compose project and ports, with the stock Oracle, Keycloak, Puppet and MailHog services):
    • Endpoint, scripted through a Keycloak login: anonymous and jsmith (jam-user) get "Not authorized" and nothing changes; jdoe (jam-admin) saves, and the page then shows the new manager and TLOG,ELOG. Blank logbooks clear the column; a blank manager, a 33-character manager, 65 characters of logbooks and an unknown facility ID each return their error. Other facilities are unchanged.
    • Dialog, in headless Chromium as jdoe: only Edit and Unselect show; Edit is disabled until a row is selected; the dialog is titled "Edit Facility" and prefilled with the row's name, manager and logbooks; a server error shows as an alert with the dialog left open; saving reloads the page with the new values; reopening on another row shows that row's values. No JavaScript errors. Anonymous and jsmith see no Edit button.
  • Not checked: that a log entry actually reaches the edited logbooks, since the dev stack has no logbook server.

Decisions

  • Logbooks were added at the reviewer's request after the first version, which made only the manager editable. Name, URL path and order stay database-only.
  • The username is not checked against the user directory, matching how Authorizers and Watchers take usernames.
  • A manager stays required: the entity marks it @NotNull, although the column allows null. Logbooks may be empty, as the column and LogbookFacade already allow.

🤖 Generated with Claude Code

Prepared-by: Anthropic Claude Code:claude-opus-5-5

The Facilities inventory page was read-only, so changing a facility's
manager, who gets its change and expiration emails, or its logbooks,
where its authorization changes are logged, needed a database console.
Administrators now get an Edit button there: select a facility, change
the manager's username or the comma-separated logbooks, and save.

It posts to the new /ajax/edit-facility endpoint, which calls
FacilityFacade.editFacility, restricted to jam-admin. The manager is
trimmed, required, and at most 32 characters; the logbooks are trimmed
around each comma, with empty names dropped, and at most 64 characters,
the columns' sizes. Empty logbooks are stored as null, which, as before,
makes no log entries for the facility. Name, path and order are still
changed in the database. The user guide now describes the page.

Fixes #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slominskir-coding-agent
slominskir-coding-agent Bot force-pushed the facility-manager-editable branch from effcb9c to 2848718 Compare November 16, 2026 13:41
@slominskir-coding-agent slominskir-coding-agent Bot changed the title Let administrators change a facility's manager Let administrators change a facility's manager and logbooks Nov 16, 2026
@slominskir
slominskir merged commit 45d5473 into main Nov 16, 2026
7 checks passed
@slominskir-coding-agent
slominskir-coding-agent Bot deleted the facility-manager-editable branch November 16, 2026 13:55
@slominskir-coding-agent slominskir-coding-agent Bot mentioned this pull request Nov 16, 2026
slominskir pushed a commit that referenced this pull request Nov 16, 2026
Release the facility manager and logbook editing for administrators
(#77) and the new user guide (#76).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Facility Manager not editable by admin

1 participant