Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: cleanup group permissions

Marc Seitza75da9669343
diff --git a/components/shared/icons/cloud-download-off.tsx b/components/shared/icons/cloud-download-off.tsx
index 1159a289..ee4e398b 100644
--- a/components/shared/icons/cloud-download-off.tsx
+++ b/components/shared/icons/cloud-download-off.tsx
@@ -19,44 +19,44 @@ export default function CloudDownloadOff({
<path
d="M12 17V12"
stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
/>
<path
d="M12 7V3"
stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
/>
<path
d="M6 11L12 17L14.5 14.5"
stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
/>
<path
d="M17 12L18 11"
stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
/>
<path
d="M19 21H5"
stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
/>
<path
d="M2 2L22 22"
stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
/>
</svg>
);
diff --git a/pages/datarooms/[id]/groups/[groupId]/permissions.tsx b/pages/datarooms/[id]/groups/[groupId]/permissions.tsx
index 24da7137..c5e52cd3 100644
--- a/pages/datarooms/[id]/groups/[groupId]/permissions.tsx
+++ b/pages/datarooms/[id]/groups/[groupId]/permissions.tsx
@@ -1,48 +1,17 @@
-import Link from "next/link";
-
-import { useState } from "react";
-
-import { ViewerGroup } from "@prisma/client";
-import {
- ChevronRight,
- ChevronRightIcon,
- CogIcon,
- FileSlidersIcon,
- UsersIcon,
-} from "lucide-react";
-
-import { AddViewerModal } from "@/components/datarooms/add-viewer-modal";
import { DataroomHeader } from "@/components/datarooms/dataroom-header";
import { DataroomNavigation } from "@/components/datarooms/dataroom-navigation";
-import { AddGroupModal } from "@/components/datarooms/groups/add-group-modal";
-import GroupCard from "@/components/datarooms/groups/group-card";
-import GroupMemberTable from "@/components/datarooms/groups/group-member-table";
+import { GroupHeader } from "@/components/datarooms/groups/group-header";
+import { GroupNavigation } from "@/components/datarooms/groups/group-navigation";
import ExpandableTable from "@/components/datarooms/groups/group-permissions";
import AppLayout from "@/components/layouts/app";
-import { BreadcrumbSeparator } from "@/components/ui/breadcrumb";
-import { Button } from "@/components/ui/button";
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/components/ui/select";
-import DataroomViewersTable from "@/components/visitors/dataroom-viewers";
import { useDataroom } from "@/lib/swr/use-dataroom";
import { useDataroomGroup } from "@/lib/swr/use-dataroom-groups";
-export default function DataroomGroupPage({
- groups,
-}: {
- groups: ViewerGroup[];
-}) {
+export default function DataroomGroupPage() {
const { dataroom } = useDataroom();
const { viewerGroup } = useDataroomGroup();
- const [modalOpen, setModalOpen] = useState<boolean>(false);
-
if (!dataroom || !viewerGroup) {
return <div>Loading...</div>;
}
@@ -60,39 +29,12 @@ export default function DataroomGroupPage({
<DataroomNavigation dataroomId={dataroom.id} />
</header>
- <div className="mx-auto flex w-full items-center gap-2">
- <Link href={`/datarooms/${dataroom.id}/groups`}>
- <h2 className="text-lg">All Groups</h2>
- </Link>
- <ChevronRightIcon className="h-4 w-4" />
- <h2 className="text-lg font-semibold text-primary">
- {viewerGroup?.name ?? "Management Team"}
- </h2>
- </div>
+ <GroupHeader dataroomId={dataroom.id} groupName={viewerGroup.name} />
<div className="mx-auto grid w-full items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]">
- <nav className="grid space-y-1 text-sm text-muted-foreground">
- <Link
- href={`/datarooms/${dataroom.id}/groups/${viewerGroup?.id}`}
- className="flex items-center gap-x-2 rounded-md bg-muted p-2 font-medium text-primary"
- >
- <CogIcon className="h-4 w-4" />
- General
- </Link>
- <Link
- href={`/datarooms/${dataroom.id}/groups/${viewerGroup?.id}/members`}
- className="flex items-center gap-x-2 rounded-md p-2 text-primary hover:bg-muted"
- >
- <UsersIcon className="h-4 w-4" />
- Members
- </Link>
- <Link
- href={`/datarooms/${dataroom.id}/groups/${viewerGroup?.id}/permissions`}
- className="flex items-center gap-x-2 rounded-md p-2 text-primary hover:bg-muted"
- >
- <FileSlidersIcon className="h-4 w-4" />
- Permissions
- </Link>
- </nav>
+ <GroupNavigation
+ dataroomId={dataroom.id}
+ viewerGroupId={viewerGroup?.id!}
+ />
<div className="grid gap-6">
<ExpandableTable
dataroomId={dataroom.id}