diff --git a/apps/dashboard/app/(app)/[workspaceSlug]/authorization/permissions/components/table/permissions-list.tsx b/apps/dashboard/app/(app)/[workspaceSlug]/authorization/permissions/components/table/permissions-list.tsx
index cf3255f051..136e0b61f8 100644
--- a/apps/dashboard/app/(app)/[workspaceSlug]/authorization/permissions/components/table/permissions-list.tsx
+++ b/apps/dashboard/app/(app)/[workspaceSlug]/authorization/permissions/components/table/permissions-list.tsx
@@ -6,6 +6,7 @@ import { BookBookmark, Page2 } from "@unkey/icons";
import { Button, Checkbox, Empty } from "@unkey/ui";
import { cn } from "@unkey/ui/src/lib/utils";
import { useCallback, useMemo, useState } from "react";
+import { EditPermission } from "./components/actions/components/edit-permission";
import { PermissionsTableActions } from "./components/actions/keys-table-action.popover.constants";
import { AssignedItemsCell } from "./components/assigned-items-cell";
import { LastUpdated } from "./components/last-updated";
@@ -54,7 +55,7 @@ export const PermissionsList = () => {
const iconContainer = (
{
onMouseLeave={() => setHoveredPermissionName(null)}
>
{!isSelected && !isHovered && (
-
+
)}
{(isSelected || isHovered) && (
e.stopPropagation()}
onCheckedChange={() => toggleSelection(permission.permissionId)}
/>
)}
@@ -162,87 +164,96 @@ export const PermissionsList = () => {
);
return (
- permission.permissionId}
- rowClassName={(permission) => getRowClassName(permission, selectedPermission)}
- loadMoreFooterProps={{
- hide: isLoading,
- buttonText: "Load more permissions",
- hasMore,
- headerContent: (
-
- ),
- countInfoText: (
-
-
Showing {" "}
-
- {new Intl.NumberFormat().format(permissions.length)}
-
-
of
- {new Intl.NumberFormat().format(totalCount)}
-
permissions
+ <>
+
permission.permissionId}
+ rowClassName={(permission) => getRowClassName(permission, selectedPermission)}
+ loadMoreFooterProps={{
+ hide: isLoading,
+ buttonText: "Load more permissions",
+ hasMore,
+ headerContent: (
+
+ ),
+ countInfoText: (
+
+ Showing {" "}
+
+ {new Intl.NumberFormat().format(permissions.length)}
+
+ of
+ {new Intl.NumberFormat().format(totalCount)}
+ permissions
+
+ ),
+ }}
+ emptyState={
+
+
+
+ No Permissions Found
+
+ There are no permissions configured yet. Create your first permission to start
+ managing permissions and access control.
+
+
+
+
+
+ Learn about Permissions
+
+
+
+
- ),
- }}
- emptyState={
-
-
-
- No Permissions Found
-
- There are no permissions configured yet. Create your first permission to start
- managing permissions and access control.
-
-
-
-
-
- Learn about Permissions
-
-
-
-
-
- }
- config={{
- rowHeight: 52,
- layoutMode: "grid",
- rowBorders: true,
- containerPadding: "px-0",
- }}
- renderSkeletonRow={({ columns, rowHeight }) =>
- columns.map((column) => (
-
- {column.key === "permission" && }
- {column.key === "slug" && }
- {column.key === "used_in_roles" && }
- {column.key === "assigned_to_keys" && }
- {column.key === "last_updated" && }
- {column.key === "action" && }
-
- ))
- }
- />
+ }
+ config={{
+ rowHeight: 52,
+ layoutMode: "grid",
+ rowBorders: true,
+ containerPadding: "px-0",
+ }}
+ renderSkeletonRow={({ columns, rowHeight }) =>
+ columns.map((column) => (
+
+ {column.key === "permission" && }
+ {column.key === "slug" && }
+ {column.key === "used_in_roles" && }
+ {column.key === "assigned_to_keys" && }
+ {column.key === "last_updated" && }
+ {column.key === "action" && }
+
+ ))
+ }
+ />
+ {selectedPermission && (
+ setSelectedPermission(null)}
+ />
+ )}
+ >
);
};
diff --git a/apps/dashboard/app/(app)/[workspaceSlug]/authorization/roles/components/table/roles-list.tsx b/apps/dashboard/app/(app)/[workspaceSlug]/authorization/roles/components/table/roles-list.tsx
index 8a1bb8bd83..1d7e11ef3a 100644
--- a/apps/dashboard/app/(app)/[workspaceSlug]/authorization/roles/components/table/roles-list.tsx
+++ b/apps/dashboard/app/(app)/[workspaceSlug]/authorization/roles/components/table/roles-list.tsx
@@ -6,6 +6,7 @@ import { BookBookmark, Tag } from "@unkey/icons";
import { Button, Checkbox, Empty } from "@unkey/ui";
import { cn } from "@unkey/ui/src/lib/utils";
import { useCallback, useMemo, useState } from "react";
+import { EditRole } from "./components/actions/components/edit-role";
import { RolesTableActions } from "./components/actions/keys-table-action.popover.constants";
import { AssignedItemsCell } from "./components/assigned-items-cell";
import { LastUpdated } from "./components/last-updated";
@@ -53,18 +54,24 @@ export const RolesList = () => {
const iconContainer = (
setHoveredRoleName(role.name)}
onMouseLeave={() => setHoveredRoleName(null)}
>
- {!isSelected && !isHovered &&
}
+ {!isSelected && !isHovered && (
+
+ )}
{(isSelected || isHovered) && (
e.stopPropagation()}
onCheckedChange={() => toggleSelection(role.roleId)}
/>
)}
@@ -147,82 +154,91 @@ export const RolesList = () => {
);
return (
- role.roleId}
- rowClassName={(role) => getRowClassName(role, selectedRole)}
- loadMoreFooterProps={{
- hide: isLoading,
- buttonText: "Load more roles",
- hasMore,
- headerContent: (
-
- ),
- countInfoText: (
-
-
Showing {" "}
-
{new Intl.NumberFormat().format(roles.length)}
-
of
- {new Intl.NumberFormat().format(totalCount)}
-
roles
+ <>
+
role.roleId}
+ rowClassName={(role) => getRowClassName(role, selectedRole)}
+ loadMoreFooterProps={{
+ hide: isLoading,
+ buttonText: "Load more roles",
+ hasMore,
+ headerContent: (
+
+ ),
+ countInfoText: (
+
+ Showing {" "}
+ {new Intl.NumberFormat().format(roles.length)}
+ of
+ {new Intl.NumberFormat().format(totalCount)}
+ roles
+
+ ),
+ }}
+ emptyState={
+
+
+
+ No Roles Found
+
+ There are no roles configured yet. Create your first role to start managing
+ permissions and access control.
+
+
+
+
+
+ Learn about Roles
+
+
+
+
- ),
- }}
- emptyState={
-
-
-
- No Roles Found
-
- There are no roles configured yet. Create your first role to start managing
- permissions and access control.
-
-
-
-
-
- Learn about Roles
-
-
-
-
-
- }
- config={{
- rowHeight: 52,
- layoutMode: "grid",
- rowBorders: true,
- containerPadding: "px-0",
- }}
- renderSkeletonRow={({ columns, rowHeight }) =>
- columns.map((column) => (
-
- {column.key === "role" && }
- {column.key === "slug" && }
- {column.key === "assignedKeys" && }
- {column.key === "permissions" && }
- {column.key === "last_updated" && }
- {column.key === "action" && }
-
- ))
- }
- />
+ }
+ config={{
+ rowHeight: 52,
+ layoutMode: "grid",
+ rowBorders: true,
+ containerPadding: "px-0",
+ }}
+ renderSkeletonRow={({ columns, rowHeight }) =>
+ columns.map((column) => (
+
+ {column.key === "role" && }
+ {column.key === "slug" && }
+ {column.key === "assignedKeys" && }
+ {column.key === "permissions" && }
+ {column.key === "last_updated" && }
+ {column.key === "action" && }
+
+ ))
+ }
+ />
+ {selectedRole && (
+ setSelectedRole(null)}
+ />
+ )}
+ >
);
};