diff --git a/.changeset/user-management-projects.md b/.changeset/user-management-projects.md deleted file mode 100644 index e4d5f61..0000000 --- a/.changeset/user-management-projects.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gabriel20xx/web-ui": minor ---- - -`UserManagement` accepts an optional `projects` prop (`KnownProject[]`): when present, each account gets a per-project login-access picker (checkboxes in the edit row, a summary in the read-only row) and `onUpdate` receives a `projects: string[]` field. Only AuthGuard's own admin UI passes this prop today; every other consumer is unaffected. diff --git a/.changeset/user-management-roles.md b/.changeset/user-management-roles.md new file mode 100644 index 0000000..fea0f60 --- /dev/null +++ b/.changeset/user-management-roles.md @@ -0,0 +1,5 @@ +--- +"@gabriel20xx/web-ui": minor +--- + +`UserManagement` accepts an optional `roles` prop (`KnownRole[]`) in place of the `projects` prop it replaces: when present, each account gets a role picker (checkboxes in the add and edit rows, the role names in the read-only row), and `onCreate`/`onUpdate` receive a `roleIds: number[]` field. An account's projects now come from its roles, so per-account project checkboxes are gone. `ManagedUser` carries `roleIds` instead of `projects`. Only AuthGuard's own admin UI passes this prop today; every other consumer is unaffected. diff --git a/README.md b/README.md index aef1431..d195268 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ These are the complete Svelte component exports from `packages/web-ui/src/lib/in | `StatusDialog` | Detailed service health/readiness status modal with refresh support. | | `StatusWidget` | Header-friendly health/readiness indicator that polls `/healthz` and `/ready` and opens `StatusDialog`. | | `TotpSettings` | TOTP status, setup, enable, and disable controls. | -| `UserManagement` | Role-aware user administration with listing, creation, editing, deletion, project scopes, and pagination. | +| `UserManagement` | Role-aware user administration with listing, creation, editing, deletion, role assignment, and pagination. | This inventory describes the public component API only; the package also exports notification helpers, primary-color helpers, and TypeScript types. When a public component is added, removed, renamed, or materially changes responsibility, update this table in the same change as `packages/web-ui/src/lib/index.ts`. Keep the table aligned with that barrel file, and do not add internal or generated components to it. diff --git a/packages/web-ui/src/lib/components/UserManagement.svelte b/packages/web-ui/src/lib/components/UserManagement.svelte index 557fab2..ae3a5c4 100644 --- a/packages/web-ui/src/lib/components/UserManagement.svelte +++ b/packages/web-ui/src/lib/components/UserManagement.svelte @@ -1,6 +1,6 @@