Milestone 18f: Admin UI (Users / User Groups / Jobs / AppInfo) + Grants tab#34
Merged
Merged
Conversation
…ts tab Co-Authored-By: Bryce Anglin <brycemanglin@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Replaces the M18f stubs with real implementations across the admin surface and ships the Collection-detail Grants tab.
New routes / pages
/adminshell (<AdminLayout/>) — sub-nav across Users / User Groups / Jobs / App info; scope-gated tab visibility./admin/users— list + filter (usernamecontains) + create / edit dialog (rename, status). Read-only when the caller only holdsstig-manager:user:read./admin/user-groups— list + create / edit dialog with membership multi-select over the existing User list./admin/jobs— task registry (left), job list (right), per-job run history + 3-second-poll output tail for the latest run, ad-hoc run + delete affordances forstig-manager:op./admin/app-info— Build / Counts / Runtime / Postgres / Requests cards + AppData tables list. Refreshes every 15 s.New Collection-detail tab
<GrantsTab/>(Manage+) — lists every user / user-group grant on the collection with an inline add-grant form (subject kind ↔ subject ↔ role 1–4) and per-row delete for Manage role and above. The "Coming in M18f" stub is gone.API client (
web/src/lib/api/index.ts)fetchUsers / fetchUser / createUser / updateUser / deleteUser+ types (UserSummary,UserCreateInput,UserPatchInput,UsersFilter,UserStatus).fetchUserGroups / fetchUserGroup / createUserGroup / updateUserGroup / deleteUserGroup+ types.fetchJobs / fetchJob / fetchJobTasks / fetchJobRuns / fetchJobRunOutput / createJob / startJobRun / deleteJob+Job / JobTask / JobRun / JobRunOutput / JobEventtypes.fetchAppInfoDetail / fetchAppDataTableswith a typedAppInfoDetailshape mirroring the API's stable subset (Build / Counts / Postgres / Runtime / Requests) plus anAppDataTablelist.fetchCollectionGrants / postCollectionGrants / putCollectionGrant / deleteCollectionGrant+CollectionGrant/GrantPostInput.elevate=trueso the API permits cross-collection visibility.TanStack Query hooks (
web/src/lib/api/hooks.ts)QUERY_KEYSextended withusers / userAdmin / userGroups / userGroup / jobs / job / jobTasks / jobRuns / jobRunOutput / appInfoDetail / appDataTables / collectionGrants.useUsers / useUser / useCreateUser / useUpdateUser / useDeleteUser,useUserGroups / useUserGroup / useCreateUserGroup / useUpdateUserGroup / useDeleteUserGroup,useJobs / useJob / useJobTasks / useJobRuns / useJobRunOutput / useCreateJob / useStartJobRun / useDeleteJob,useAppInfoDetail / useAppDataTables,useCollectionGrants / usePostCollectionGrants / usePutCollectionGrant / useDeleteCollectionGrant. Invalidation wired through the canonical query keys so list/detail caches stay coherent.Navigation
ADMIN_NAVnow has Users / User Groups / Jobs / App info (Jobs moved off the primary nav).Playwright (e2e/tests/web.spec.ts)
Roadmap: M18e → Merged (PR #33). M18f → In Review. Next on a separate branch: M18g (STIG Library — benchmarks / rules / CCIs browse + XCCDF import).
Review & Testing Checklist for Human
admin; the sidebar shows the Admin section with all four entries./admin/userslists the demo users; create a new user, verify it appears in the table, edit its status tounavailable, then delete it./admin/user-groups: create a group with at least one member, verify membership round-trips through PATCH./admin/jobs: create a Job over thenooptask, click the run button, confirm the runs list populates and the output card shows lines within ~5s./admin/app-info: all five cards (Build / Counts / Runtime / Postgres / Requests) render, plus the AppData tables list.evaluator; confirm the admin section is hidden (nostig-manager:user:reador:op:readscopes).Notes
POST /jobs/{jobId}/runs. The data layer already supports schedules; UI for it will come alongside the cron scheduler in a follow-up.useUserGroupEditDialogalways sends the membership snapshot on save (PATCH semantics on the API side replace the list), even if it's unchanged from the loaded value. This is intentional so the user always sees the same outcome as a fresh form submission.useJobRunOutputdefaults to a 3 s interval; consumers can override via therefetchIntervalMsoption.Link to Devin session: https://app.devin.ai/sessions/022810763c4643c0848ba894c1512b92
Requested by: @Exonical