fix: rename pending approval to no access

Member role simply has no UI permissions — not a pending state.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019cce57-c9e1-7732-9709-8288127573a9
This commit is contained in:
Aarnav Tale
2026-03-08 01:55:38 -05:00
parent 270b99f063
commit a1efe36ff1
2 changed files with 6 additions and 14 deletions
+5 -8
View File
@@ -53,7 +53,7 @@ export async function loader({ request, context }: Route.LoaderArgs) {
settings: context.auth.can(principal, Capabilities.read_feature),
},
onboarding: request.url.endsWith("/onboarding"),
pendingApproval: !check && principal.kind === "oidc",
noAccess: !check && principal.kind === "oidc",
healthy: await api.isHealthy(),
};
} catch {
@@ -66,20 +66,17 @@ export async function loader({ request, context }: Route.LoaderArgs) {
}
export default function Shell({ loaderData }: Route.ComponentProps) {
if (loaderData.pendingApproval && !loaderData.onboarding) {
if (loaderData.noAccess && !loaderData.onboarding) {
return (
<>
<Header {...loaderData} />
<main className="container mx-auto mt-4 mb-24 overscroll-contain">
<div className="mx-auto mt-24 max-w-lg">
<Card variant="flat">
<Card.Title className="mb-4">Pending Approval</Card.Title>
<Card.Title className="mb-4">No Access</Card.Title>
<Card.Text>
Your account has been created but you don't have access to the UI yet. An
administrator needs to assign you a role before you can continue.
</Card.Text>
<Card.Text className="mt-2">
If you believe this is a mistake, please contact your administrator.
Your account doesn't have permission to access the dashboard. Contact an
administrator if you need access.
</Card.Text>
<Form action="/logout" className="mt-6" method="POST">
<Button className="w-full" type="submit" variant="light">
+1 -6
View File
@@ -90,12 +90,7 @@ function mapRoleToName(role: string) {
case "auditor":
return "Auditor";
case "member":
return (
<span className="inline-flex items-center gap-1.5">
<span className="h-2 w-2 animate-pulse rounded-full bg-amber-500" />
<span className="text-amber-600 dark:text-amber-400">Pending Approval</span>
</span>
);
return <p className="opacity-50">No Access</p>;
default:
return "Unknown";
}