mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 23:12:04 +00:00
Name the admin account and invite cards apart from their pages
The users page card is now "Accounts" and the invites card "Invite links", so neither repeats the page title above it, and the token overview reads "API tokens" in sentence case. The role filter pills stay neutral when selected, and the three icon tools on a phone row wrap as one group instead of leaving the sign-out icon on its own line.
This commit is contained in:
1 parent
161963c82b
commit
c90d28e597
9 files changed
+78
-71
No files matched your search
@@ -102,7 +102,7 @@ describe("admin sections — SSR smoke", () => {
|
||||
|
||||
it("<UserManagementSection> renders with filter pills", () => {
|
||||
const html = render(<UserManagementSection />);
|
||||
expect(html).toContain("User Management");
|
||||
expect(html).toContain("Accounts");
|
||||
// Filter pills painted from i18n
|
||||
expect(html).toContain("All");
|
||||
expect(html).toContain("Admins");
|
||||
@@ -110,7 +110,7 @@ describe("admin sections — SSR smoke", () => {
|
||||
|
||||
it("<ApiTokenOverviewSection> renders", () => {
|
||||
const html = render(<ApiTokenOverviewSection />);
|
||||
expect(html).toContain("API Tokens");
|
||||
expect(html).toContain("API tokens");
|
||||
});
|
||||
|
||||
it("<LoginOverviewSection> renders", () => {
|
||||
|
||||
@@ -231,45 +231,50 @@ export function UserManagementSection() {
|
||||
<ShieldCheck className="h-3 w-3" aria-hidden="true" />
|
||||
{u.mfaEnforced ? t("admin.mfaEnforcedOn") : t("admin.mfaEnforcedOff")}
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="min-h-11 min-w-11 px-2 text-xs"
|
||||
onClick={() => startEdit(u)}
|
||||
title={t("admin.editUser")}
|
||||
aria-label={t("admin.editUser")}
|
||||
>
|
||||
<Pencil className="h-3 w-3" aria-hidden="true" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="min-h-11 min-w-11 px-2 text-xs"
|
||||
onClick={() => startReset(u)}
|
||||
title={t("admin.resetPassword")}
|
||||
aria-label={t("admin.resetPassword")}
|
||||
>
|
||||
<KeyRound className="h-3 w-3" aria-hidden="true" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-muted-foreground hover:text-foreground min-h-11 min-w-11 px-2 text-xs"
|
||||
onClick={() => setLogoutTarget(u)}
|
||||
disabled={u.id === currentUserId}
|
||||
title={
|
||||
u.id === currentUserId
|
||||
? t("admin.section.users.cannotLogoutSelf")
|
||||
: t("admin.section.users.forceLogout")
|
||||
}
|
||||
aria-label={
|
||||
u.id === currentUserId
|
||||
? t("admin.section.users.cannotLogoutSelf")
|
||||
: t("admin.section.users.forceLogout")
|
||||
}
|
||||
>
|
||||
<LogOut className="h-3 w-3" aria-hidden="true" />
|
||||
</Button>
|
||||
{/* The three icon tools travel as one group: on a phone the row wraps
|
||||
between the labelled toggles and the tools, never leaving the
|
||||
sign-out icon alone on a line. */}
|
||||
<span className="ml-auto flex items-center gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="min-h-11 min-w-11 px-2 text-xs"
|
||||
onClick={() => startEdit(u)}
|
||||
title={t("admin.editUser")}
|
||||
aria-label={t("admin.editUser")}
|
||||
>
|
||||
<Pencil className="h-3 w-3" aria-hidden="true" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="min-h-11 min-w-11 px-2 text-xs"
|
||||
onClick={() => startReset(u)}
|
||||
title={t("admin.resetPassword")}
|
||||
aria-label={t("admin.resetPassword")}
|
||||
>
|
||||
<KeyRound className="h-3 w-3" aria-hidden="true" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-muted-foreground hover:text-foreground min-h-11 min-w-11 px-2 text-xs"
|
||||
onClick={() => setLogoutTarget(u)}
|
||||
disabled={u.id === currentUserId}
|
||||
title={
|
||||
u.id === currentUserId
|
||||
? t("admin.section.users.cannotLogoutSelf")
|
||||
: t("admin.section.users.forceLogout")
|
||||
}
|
||||
aria-label={
|
||||
u.id === currentUserId
|
||||
? t("admin.section.users.cannotLogoutSelf")
|
||||
: t("admin.section.users.forceLogout")
|
||||
}
|
||||
>
|
||||
<LogOut className="h-3 w-3" aria-hidden="true" />
|
||||
</Button>
|
||||
</span>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -306,7 +311,9 @@ export function UserManagementSection() {
|
||||
{(["all", "admin", "user"] as const).map((value) => (
|
||||
<Button
|
||||
key={value}
|
||||
variant={filter === value ? "default" : "outline"}
|
||||
// Neutral pills: the selected filter is a state, not a call to
|
||||
// action, so it never takes the primary fill.
|
||||
variant={filter === value ? "secondary" : "outline"}
|
||||
size="sm"
|
||||
className="min-h-11 min-w-11 px-3 text-xs sm:min-h-9"
|
||||
onClick={() => setFilter(value)}
|
||||
|
||||
Reference in new issue
Block a user