From 518b1824b421a6907a0638a5d3b05d41693b742d Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Tue, 20 May 2025 15:37:27 -0700 Subject: [PATCH] Add export Signed-off-by: Bryan Frimin --- .../frameworks/FrameworkLayoutView.tsx | 29 +- ...rkLayoutViewExportAuditMutation.graphql.ts | 92 +++++ pkg/probo/framework_service.go | 159 +++++++++ pkg/server/api/console/v1/schema.graphql | 78 +++-- pkg/server/api/console/v1/schema/schema.go | 322 ++++++++++++++++-- pkg/server/api/console/v1/types/types.go | 8 + pkg/server/api/console/v1/v1_resolver.go | 13 + 7 files changed, 660 insertions(+), 41 deletions(-) create mode 100644 apps/console/src/pages/organizations/frameworks/__generated__/FrameworkLayoutViewExportAuditMutation.graphql.ts diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkLayoutView.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkLayoutView.tsx index f970f01d5..48450282d 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkLayoutView.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkLayoutView.tsx @@ -23,6 +23,7 @@ import type { FrameworkLayoutViewDeleteMutation } from "./__generated__/Framewor import { PageTemplate } from "@/components/PageTemplate"; import { FrameworkLayoutViewSkeleton } from "./FrameworkLayout"; import { ControlList } from "./FrameworkLayoutView/ControlList"; +import { FrameworkLayoutViewExportAuditMutation } from "./__generated__/FrameworkLayoutViewExportAuditMutation.graphql"; const FrameworkLayoutViewQuery = graphql` query FrameworkLayoutViewQuery($frameworkId: ID!) { @@ -60,6 +61,14 @@ const DeleteFrameworkMutation = graphql` } `; +const exportAuditMutation = graphql` + mutation FrameworkLayoutViewExportAuditMutation($input: ExportAuditInput!) { + exportAudit(input: $input) { + success + } + } +`; + function FrameworkLayoutViewContent({ queryRef, }: { @@ -73,17 +82,28 @@ function FrameworkLayoutViewContent({ const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false); const [isDeleting, setIsDeleting] = useState(false); + const [exportAudit, _] = + useMutation(exportAuditMutation); + // Setup delete mutation const [commitDeleteMutation] = useMutation( - DeleteFrameworkMutation, + DeleteFrameworkMutation ); + const handleExportAudit = useCallback(() => { + exportAudit({ + variables: { + input: { frameworkId: framework.id }, + }, + }); + }, [exportAudit, framework.id]); + const handleDeleteFramework = useCallback(() => { setIsDeleting(true); const connectionId = ConnectionHandler.getConnectionID( organizationId!, - "FrameworkListView_frameworks", + "FrameworkListView_frameworks" ); commitDeleteMutation({ @@ -140,6 +160,9 @@ function FrameworkLayoutViewContent({ Edit Framework +