commit d692ba6936695ff615bd0fcd3365502baac2e051
parent a89e4ab8b15a07c21bc70c7473f05fbc677ffba0
Author: MTRNord <mtrnord1@gmail.com>
Date: Fri, 23 May 2025 14:47:59 +0200
Fix CI and disable report feature and fix some dialogs
Signed-off-by: MTRNord <mtrnord1@gmail.com>
Diffstat:
9 files changed, 43 insertions(+), 23 deletions(-)
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
@@ -18,7 +18,6 @@ jobs:
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
- version: 10
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
diff --git a/src/app/dashboard/overview/page.tsx b/src/app/dashboard/overview/page.tsx
@@ -2,7 +2,7 @@ import { AlertTriangle, Ban, CheckCircle } from "lucide-react"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import AddProtectedRoom from "../../../components/modals/add-protected-room"
import ProtectedRomsList from "../../../components/dashboard/protected-rooms-list"
-import { mockPolicyLists, mockReports } from "../mockData"
+import { mockPolicyLists } from "../mockData"
import TabNavigation from "../../../components/dashboard/tab-navigation";
import LayoutWrapper from "@/components/dashboard/layoutWrapper"
import { listBots } from "@/lib/api"
@@ -31,8 +31,6 @@ export default async function OverviewPage({
// TODO: Redirect to register page?
return <div className="flex h-screen w-full items-center justify-center">Loading...</div>
}
- // TODO: get reports and policy lists from the API
- const reports = mockReports;
// TODO: get policy list details from the API
const policyLists = mockPolicyLists;
@@ -53,6 +51,7 @@ export default async function OverviewPage({
</div>
</CardContent>
</Card>
+ {/* Disabled until Druapnir has storage for it
<Card className="border-gray-800 bg-gray-950">
<CardHeader className="pb-2">
<CardTitle className="text-sm font-medium">Active Reports</CardTitle>
@@ -61,7 +60,7 @@ export default async function OverviewPage({
<div className="text-2xl font-bold">{reports.length}</div>
<p className="text-xs text-gray-400">{reports.filter((r) => r.priority === "high").length} high priority</p>
</CardContent>
- </Card>
+ </Card>*/}
<Card className="border-gray-800 bg-gray-950">
<CardHeader className="pb-2">
<CardTitle className="text-sm font-medium">Bans Issued</CardTitle>
diff --git a/src/components/dashboard/dashboard-header.tsx b/src/components/dashboard/dashboard-header.tsx
@@ -75,6 +75,7 @@ export function DashboardHeader({ activeTab, teamIdParam, listData }: DashboardH
Overview
</Button>
</Link>
+ {/* Disabled because of missing draupnir support currently
<Link href="/dashboard/reports">
<Button
variant={activeTab === "reports" ? "secondary" : "ghost"}
@@ -82,7 +83,7 @@ export function DashboardHeader({ activeTab, teamIdParam, listData }: DashboardH
>
Reports
</Button>
- </Link>
+ </Link>*/}
<Link href="/dashboard/bans">
<Button
variant={activeTab === "bans" ? "secondary" : "ghost"}
diff --git a/src/components/modals/add-ban.tsx b/src/components/modals/add-ban.tsx
@@ -1,6 +1,6 @@
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
-import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
+import { Dialog, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
@@ -102,12 +102,11 @@ export default function AddBan({ filled, policyLists, header, buttonClasses }: A
</div>
</div>
<DialogFooter>
- <Button
- variant="outline"
+ <DialogCloseButton
className="border-gray-700 text-gray-400 hover:bg-gray-900 hover:text-gray-300"
>
Cancel
- </Button>
+ </DialogCloseButton>
<Button className="bg-red-600 text-white hover:bg-red-700">Add Ban</Button>
</DialogFooter>
</DialogContent>
diff --git a/src/components/modals/add-protected-room.tsx b/src/components/modals/add-protected-room.tsx
@@ -1,5 +1,5 @@
import { Button } from "@/components/ui/button";
-import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
+import { Dialog, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Plus } from "lucide-react";
@@ -45,12 +45,11 @@ export default function AddProtectedRoom({ filled }: AddProtectedRoomProps) {
</div>
</div>
<DialogFooter>
- <Button
- variant="outline"
+ <DialogCloseButton
className="border-gray-700 text-gray-400 hover:bg-gray-900 hover:text-gray-300"
>
Cancel
- </Button>
+ </DialogCloseButton>
<Button className="bg-purple-600 text-white hover:bg-purple-700">Add Room</Button>
</DialogFooter>
</DialogContent>
diff --git a/src/components/modals/are-you-sure.tsx b/src/components/modals/are-you-sure.tsx
@@ -1,5 +1,5 @@
import { Button } from "@/components/ui/button";
-import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
+import { Dialog, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { Trash2 } from "lucide-react";
interface AreYouSureDialogProps {
@@ -24,12 +24,11 @@ export default function AreYouSureDialog({ description, titlePart }: AreYouSureD
</DialogDescription>
</DialogHeader>
<DialogFooter>
- <Button
- variant="outline"
+ <DialogCloseButton
className="border-gray-700 text-gray-400 hover:bg-gray-900 hover:text-gray-300"
>
Cancel
- </Button>
+ </DialogCloseButton>
<Button className="bg-red-600 text-white hover:bg-red-700">Remove {titlePart}</Button>
</DialogFooter>
</DialogContent>
diff --git a/src/components/modals/create-bot.tsx b/src/components/modals/create-bot.tsx
@@ -1,5 +1,5 @@
import { Button } from "@/components/ui/button";
-import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
+import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DialogCloseButton } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Settings } from "lucide-react";
@@ -30,12 +30,11 @@ export default function CreateBotModal() {
</div>
<DialogFooter>
- <Button
- variant="outline"
+ <DialogCloseButton
className="border-gray-700 text-gray-400 hover:bg-gray-900 hover:text-gray-300"
>
Cancel
- </Button>
+ </DialogCloseButton>
<Button className="bg-purple-600 text-white hover:bg-purple-700">Create Bot</Button>
</DialogFooter>
</DialogContent>
diff --git a/src/components/modals/kick-user.tsx b/src/components/modals/kick-user.tsx
@@ -1,5 +1,5 @@
import { Button } from "@/components/ui/button";
-import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
+import { Dialog, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { UserX } from "lucide-react";
export default function KickUserModal() {
@@ -22,6 +22,14 @@ export default function KickUserModal() {
Remove a user from your Matrix rooms using a kick instead of a ban. This will not prevent them from rejoining the room.
</DialogDescription>
</DialogHeader>
+ <DialogFooter>
+ <DialogCloseButton
+ className="border-gray-700 text-gray-400 hover:bg-gray-900 hover:text-gray-300"
+ >
+ Cancel
+ </DialogCloseButton>
+ <Button className="bg-purple-600 text-white hover:bg-purple-700">Kick User</Button>
+ </DialogFooter>
</DialogContent>
</Dialog>
);
diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx
@@ -108,6 +108,22 @@ const DialogDescription = forwardRef<
))
DialogDescription.displayName = Description.displayName
+// Close Button
+const DialogCloseButton = forwardRef<
+ ComponentRef<typeof Close>,
+ ComponentPropsWithoutRef<typeof Close>
+>(({ className, ...props }, ref) => (
+ <Close
+ ref={ref}
+ className={cn(
+ "p-2 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+))
+DialogCloseButton.displayName = Close.displayName
+
export {
Dialog,
DialogPortal,
@@ -119,4 +135,5 @@ export {
DialogFooter,
DialogTitle,
DialogDescription,
+ DialogCloseButton,
}