diff --git a/messages/en-US.json b/messages/en-US.json
index 05a900ad..75e251ac 100644
--- a/messages/en-US.json
+++ b/messages/en-US.json
@@ -459,6 +459,7 @@
"approve": "Approve",
"approved": "Approved",
"denied": "Denied",
+ "deniedApproval": "Denied Approval",
"all": "All",
"deny": "Deny",
"viewDetails": "View Details",
@@ -1334,6 +1335,7 @@
"refreshError": "Failed to refresh data",
"verified": "Verified",
"pending": "Pending",
+ "pendingApproval": "Pending Approval",
"sidebarBilling": "Billing",
"billing": "Billing",
"orgBillingDescription": "Manage billing information and subscriptions",
diff --git a/server/routers/client/blockClient.ts b/server/routers/client/blockClient.ts
index e1a00ff6..68ae64f8 100644
--- a/server/routers/client/blockClient.ts
+++ b/server/routers/client/blockClient.ts
@@ -73,7 +73,7 @@ export async function blockClient(
// Block the client
await trx
.update(clients)
- .set({ blocked: true })
+ .set({ blocked: true, approvalState: "denied" })
.where(eq(clients.clientId, clientId));
// Send terminate signal if there's an associated OLM and it's connected
diff --git a/src/components/UserDevicesTable.tsx b/src/components/UserDevicesTable.tsx
index ef4e016c..b2a5fd8b 100644
--- a/src/components/UserDevicesTable.tsx
+++ b/src/components/UserDevicesTable.tsx
@@ -65,8 +65,6 @@ export default function UserDevicesTable({ userClients }: ClientTableProps) {
null
);
- const { isPaidUser } = usePaidStatus();
-
const api = createApiClient(useEnvContext());
const [isRefreshing, startTransition] = useTransition();
@@ -222,6 +220,14 @@ export default function UserDevicesTable({ userClients }: ClientTableProps) {
{t("blocked")}
)}
+ {r.approvalState === "pending" && (
+
+ {t("pendingApproval")}
+
+ )}
);
}
@@ -415,38 +421,6 @@ export default function UserDevicesTable({ userClients }: ClientTableProps) {
}
];
- if (build !== "oss" && isPaidUser) {
- // insert as the 3rd item
- baseColumns.splice(3, 0, {
- id: "approvalState",
- enableHiding: false,
- header: () => {t("approvalState")},
- cell: ({ row }) => {
- const { approvalState } = row.original;
- switch (approvalState) {
- case "approved":
- return (
- {t("approved")}
- );
- case "denied":
- return {t("denied")};
- case "pending":
- return (
-
- {t("pending")}
-
- );
- default:
- return (
-
- N/A
-
- );
- }
- }
- });
- }
-
baseColumns.push({
id: "actions",
enableHiding: false,
@@ -592,17 +566,27 @@ export default function UserDevicesTable({ userClients }: ClientTableProps) {
options: [
{
id: "active",
- label: t("active") || "Active",
+ label: t("active"),
value: "active"
},
+ {
+ id: "pending",
+ label: t("pendingApproval"),
+ value: "pending"
+ },
+ {
+ id: "denied",
+ label: t("deniedApproval"),
+ value: "denied"
+ },
{
id: "archived",
- label: t("archived") || "Archived",
+ label: t("archived"),
value: "archived"
},
{
id: "blocked",
- label: t("blocked") || "Blocked",
+ label: t("blocked"),
value: "blocked"
}
],
@@ -611,12 +595,23 @@ export default function UserDevicesTable({ userClients }: ClientTableProps) {
selectedValues: (string | number | boolean)[]
) => {
if (selectedValues.length === 0) return true;
- const rowArchived = row.archived || false;
- const rowBlocked = row.blocked || false;
+ const rowArchived = row.archived;
+ const rowBlocked = row.blocked;
+ const approvalState = row.approvalState;
const isActive = !rowArchived && !rowBlocked;
if (selectedValues.includes("active") && isActive)
return true;
+ if (
+ selectedValues.includes("pending") &&
+ approvalState === "pending"
+ )
+ return true;
+ if (
+ selectedValues.includes("denied") &&
+ approvalState === "denied"
+ )
+ return true;
if (
selectedValues.includes("archived") &&
rowArchived
@@ -629,7 +624,7 @@ export default function UserDevicesTable({ userClients }: ClientTableProps) {
return true;
return false;
},
- defaultValues: ["active"] // Default to showing active clients
+ defaultValues: ["active", "pending"] // Default to showing active clients
}
]}
/>