From 915e5e9f8c88c1d032fda6457e7b9dd013f06a50 Mon Sep 17 00:00:00 2001 From: gearnode Date: Mon, 31 Mar 2025 15:31:00 +0200 Subject: [PATCH] Remove useless modal Signed-off-by: gearnode --- .../frameworks/FrameworkListView.tsx | 63 +++++++------------ 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkListView.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkListView.tsx index bb463193f..d53b9f8e7 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkListView.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkListView.tsx @@ -13,14 +13,6 @@ import type { FrameworkListViewQuery as FrameworkListViewQueryType } from "./__g import { Button } from "@/components/ui/button"; import { Plus, Upload } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; -import { - Dialog, - DialogContent, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/components/ui/dialog"; -import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { FrameworkListViewImportFrameworkMutation as FrameworkListViewImportFrameworkMutationType } from "./__generated__/FrameworkListViewImportFrameworkMutation.graphql"; import { PageTemplate } from "@/components/PageTemplate"; @@ -77,11 +69,16 @@ function FrameworkListViewContent({ useMutation( FrameworkListViewImportFrameworkMutation ); - const [isImportDialogOpen, setIsImportDialogOpen] = useState(false); const [isUploading, setIsUploading] = useState(false); const fileInputRef = useRef(null); const { toast } = useToast(); + const handleImportClick = () => { + if (fileInputRef.current) { + fileInputRef.current.click(); + } + }; + const handleFileChange = (e: React.ChangeEvent) => { const file = e.target.files?.[0]; if (!file) return; @@ -106,7 +103,6 @@ function FrameworkListViewContent({ }, onCompleted: () => { setIsUploading(false); - setIsImportDialogOpen(false); toast({ title: "Framework imported", description: "Framework has been imported successfully.", @@ -133,38 +129,23 @@ function FrameworkListViewContent({ description="Manage your compliance frameworks" actions={
- + - - - - Import Framework - -
-
- - -

- Upload a JSON file containing your framework definition. -

-
-
-
-
+ + Import Framework +