mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-08 05:56:38 +00:00
♻️ set approval state nullable
This commit is contained in:
@@ -693,9 +693,9 @@ export const clients = pgTable("clients", {
|
|||||||
maxConnections: integer("maxConnections"),
|
maxConnections: integer("maxConnections"),
|
||||||
archived: boolean("archived").notNull().default(false),
|
archived: boolean("archived").notNull().default(false),
|
||||||
blocked: boolean("blocked").notNull().default(false),
|
blocked: boolean("blocked").notNull().default(false),
|
||||||
approvalState: varchar("approvalState")
|
approvalState: varchar("approvalState").$type<
|
||||||
.$type<"pending" | "approved" | "denied">()
|
"pending" | "approved" | "denied"
|
||||||
.default("approved")
|
>()
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clientSitesAssociationsCache = pgTable(
|
export const clientSitesAssociationsCache = pgTable(
|
||||||
|
|||||||
@@ -388,9 +388,9 @@ export const clients = sqliteTable("clients", {
|
|||||||
lastHolePunch: integer("lastHolePunch"),
|
lastHolePunch: integer("lastHolePunch"),
|
||||||
archived: integer("archived", { mode: "boolean" }).notNull().default(false),
|
archived: integer("archived", { mode: "boolean" }).notNull().default(false),
|
||||||
blocked: integer("blocked", { mode: "boolean" }).notNull().default(false),
|
blocked: integer("blocked", { mode: "boolean" }).notNull().default(false),
|
||||||
approvalState: text("approvalState")
|
approvalState: text("approvalState").$type<
|
||||||
.$type<"pending" | "approved" | "denied">()
|
"pending" | "approved" | "denied"
|
||||||
.default("approved")
|
>()
|
||||||
});
|
});
|
||||||
|
|
||||||
export const clientSitesAssociationsCache = sqliteTable(
|
export const clientSitesAssociationsCache = sqliteTable(
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ export async function calculateUserClientsForOrgs(
|
|||||||
olmId: olm.olmId,
|
olmId: olm.olmId,
|
||||||
type: "olm",
|
type: "olm",
|
||||||
niceId,
|
niceId,
|
||||||
approvalState: requireApproval ? "pending" : "approved"
|
approvalState: requireApproval ? "pending" : null
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create the client
|
// Create the client
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default async function ClientsPage(props: ClientsPageProps) {
|
|||||||
agent: client.agent,
|
agent: client.agent,
|
||||||
archived: client.archived || false,
|
archived: client.archived || false,
|
||||||
blocked: client.blocked || false,
|
blocked: client.blocked || false,
|
||||||
approvalState: client.approvalState ?? "approved"
|
approvalState: client.approvalState
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -141,15 +141,6 @@ export const orgNavSections = (env?: Env): SidebarNavSection[] => [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
...(build !== "oss"
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
title: "sidebarApprovals",
|
|
||||||
href: "/{orgId}/settings/access/approvals",
|
|
||||||
icon: <UserCog className="size-4 flex-none" />
|
|
||||||
}
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
title: "sidebarShareableLinks",
|
title: "sidebarShareableLinks",
|
||||||
href: "/{orgId}/settings/share-links",
|
href: "/{orgId}/settings/share-links",
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export type ClientRow = {
|
|||||||
userEmail: string | null;
|
userEmail: string | null;
|
||||||
niceId: string;
|
niceId: string;
|
||||||
agent: string | null;
|
agent: string | null;
|
||||||
approvalState: "approved" | "pending" | "denied";
|
approvalState: "approved" | "pending" | "denied" | null;
|
||||||
archived?: boolean;
|
archived?: boolean;
|
||||||
blocked?: boolean;
|
blocked?: boolean;
|
||||||
};
|
};
|
||||||
@@ -430,12 +430,18 @@ export default function UserDevicesTable({ userClients }: ClientTableProps) {
|
|||||||
);
|
);
|
||||||
case "denied":
|
case "denied":
|
||||||
return <Badge variant="red">{t("denied")}</Badge>;
|
return <Badge variant="red">{t("denied")}</Badge>;
|
||||||
default:
|
case "pending":
|
||||||
return (
|
return (
|
||||||
<Badge variant="secondary">
|
<Badge variant="secondary">
|
||||||
{t("pending")}
|
{t("pending")}
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
|
default:
|
||||||
|
return (
|
||||||
|
<span className="text-muted-foreground">
|
||||||
|
N/A
|
||||||
|
</span>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user