diff --git a/server/db/pg/schema/schema.ts b/server/db/pg/schema/schema.ts index ca98a03b..f1932c68 100644 --- a/server/db/pg/schema/schema.ts +++ b/server/db/pg/schema/schema.ts @@ -693,9 +693,9 @@ export const clients = pgTable("clients", { maxConnections: integer("maxConnections"), archived: boolean("archived").notNull().default(false), blocked: boolean("blocked").notNull().default(false), - approvalState: varchar("approvalState") - .$type<"pending" | "approved" | "denied">() - .default("approved") + approvalState: varchar("approvalState").$type< + "pending" | "approved" | "denied" + >() }); export const clientSitesAssociationsCache = pgTable( diff --git a/server/db/sqlite/schema/schema.ts b/server/db/sqlite/schema/schema.ts index 64e37667..93881268 100644 --- a/server/db/sqlite/schema/schema.ts +++ b/server/db/sqlite/schema/schema.ts @@ -388,9 +388,9 @@ export const clients = sqliteTable("clients", { lastHolePunch: integer("lastHolePunch"), archived: integer("archived", { mode: "boolean" }).notNull().default(false), blocked: integer("blocked", { mode: "boolean" }).notNull().default(false), - approvalState: text("approvalState") - .$type<"pending" | "approved" | "denied">() - .default("approved") + approvalState: text("approvalState").$type< + "pending" | "approved" | "denied" + >() }); export const clientSitesAssociationsCache = sqliteTable( diff --git a/server/lib/calculateUserClientsForOrgs.ts b/server/lib/calculateUserClientsForOrgs.ts index 2f84dde9..0b4a131a 100644 --- a/server/lib/calculateUserClientsForOrgs.ts +++ b/server/lib/calculateUserClientsForOrgs.ts @@ -204,7 +204,7 @@ export async function calculateUserClientsForOrgs( olmId: olm.olmId, type: "olm", niceId, - approvalState: requireApproval ? "pending" : "approved" + approvalState: requireApproval ? "pending" : null }; // Create the client diff --git a/src/app/[orgId]/settings/clients/user/page.tsx b/src/app/[orgId]/settings/clients/user/page.tsx index bb55d266..dee24532 100644 --- a/src/app/[orgId]/settings/clients/user/page.tsx +++ b/src/app/[orgId]/settings/clients/user/page.tsx @@ -58,7 +58,7 @@ export default async function ClientsPage(props: ClientsPageProps) { agent: client.agent, archived: client.archived || false, blocked: client.blocked || false, - approvalState: client.approvalState ?? "approved" + approvalState: client.approvalState }; }; diff --git a/src/app/navigation.tsx b/src/app/navigation.tsx index 004805ad..4fb5430c 100644 --- a/src/app/navigation.tsx +++ b/src/app/navigation.tsx @@ -141,15 +141,6 @@ export const orgNavSections = (env?: Env): SidebarNavSection[] => [ } ] : []), - ...(build !== "oss" - ? [ - { - title: "sidebarApprovals", - href: "/{orgId}/settings/access/approvals", - icon: - } - ] - : []), { title: "sidebarShareableLinks", href: "/{orgId}/settings/share-links", diff --git a/src/components/UserDevicesTable.tsx b/src/components/UserDevicesTable.tsx index 3d559f46..ef4e016c 100644 --- a/src/components/UserDevicesTable.tsx +++ b/src/components/UserDevicesTable.tsx @@ -45,7 +45,7 @@ export type ClientRow = { userEmail: string | null; niceId: string; agent: string | null; - approvalState: "approved" | "pending" | "denied"; + approvalState: "approved" | "pending" | "denied" | null; archived?: boolean; blocked?: boolean; }; @@ -430,12 +430,18 @@ export default function UserDevicesTable({ userClients }: ClientTableProps) { ); case "denied": return {t("denied")}; - default: + case "pending": return ( {t("pending")} ); + default: + return ( + + N/A + + ); } } });