From 9a3327e93770072041e6ea5585dc04d4a5f0d053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Fri, 4 Apr 2025 12:48:43 +0400 Subject: [PATCH] Rename FrameworkPage -> FrameworkLayout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- apps/console/src/pages/organizations/Routes.tsx | 4 ++-- .../{FrameworkPage.tsx => FrameworkLayout.tsx} | 13 ++++++++----- .../{FrameworkView.tsx => FrameworkLayoutView.tsx} | 14 ++++++-------- .../ControlList.tsx | 0 .../__generated__/ControlList_List.graphql.ts | 0 5 files changed, 16 insertions(+), 15 deletions(-) rename apps/console/src/pages/organizations/frameworks/{FrameworkPage.tsx => FrameworkLayout.tsx} (83%) rename apps/console/src/pages/organizations/frameworks/{FrameworkView.tsx => FrameworkLayoutView.tsx} (92%) rename apps/console/src/pages/organizations/frameworks/{FrameworkView => FrameworkLayoutView}/ControlList.tsx (100%) rename apps/console/src/pages/organizations/frameworks/{FrameworkView => FrameworkLayoutView}/__generated__/ControlList_List.graphql.ts (100%) diff --git a/apps/console/src/pages/organizations/Routes.tsx b/apps/console/src/pages/organizations/Routes.tsx index 12296f352..da3ade72e 100644 --- a/apps/console/src/pages/organizations/Routes.tsx +++ b/apps/console/src/pages/organizations/Routes.tsx @@ -7,7 +7,7 @@ import OrganizationLayout from "./OrganizationLayout"; import { SettingsPage } from "./SettingsPage"; import { CreateFrameworkPage } from "./frameworks/CreateFrameworkPage"; import { FrameworkListPage } from "./frameworks/FrameworkListPage"; -import { FrameworkPage } from "./frameworks/FrameworkPage"; +import { FrameworkLayout } from "./frameworks/FrameworkLayout"; import { UpdateFrameworkPage } from "./frameworks/UpdateFrameworkPage"; import { ControlPage } from "./frameworks/controls/ControlPage"; import { EditMitigationPage } from "./mitigations/EditMitigationPage"; @@ -39,7 +39,7 @@ export function OrganizationsRoutes() { } /> } /> - }> + }> } /> diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkPage.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkLayout.tsx similarity index 83% rename from apps/console/src/pages/organizations/frameworks/FrameworkPage.tsx rename to apps/console/src/pages/organizations/frameworks/FrameworkLayout.tsx index a0d39239e..836b57de4 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkPage.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkLayout.tsx @@ -5,9 +5,9 @@ import { useMatch } from "react-router"; import { lazy } from "@probo/react-lazy"; import ErrorBoundary from "@/components/ErrorBoundary"; -const FrameworkView = lazy(() => import("./FrameworkView")); +const FrameworkLayoutView = lazy(() => import("./FrameworkLayoutView")); -export function FrameworkViewSkeleton() { +export function FrameworkLayoutViewSkeleton() { return ( }> + } + > - + ); diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkLayoutView.tsx similarity index 92% rename from apps/console/src/pages/organizations/frameworks/FrameworkView.tsx rename to apps/console/src/pages/organizations/frameworks/FrameworkLayoutView.tsx index ae6c84b3e..44263cfb8 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkView.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkLayoutView.tsx @@ -21,9 +21,8 @@ import { useToast } from "@/hooks/use-toast"; import type { FrameworkViewQuery as FrameworkViewQueryType } from "./__generated__/FrameworkViewQuery.graphql"; import type { FrameworkViewDeleteMutation } from "./__generated__/FrameworkViewDeleteMutation.graphql"; import { PageTemplate } from "@/components/PageTemplate"; -import { FrameworkViewSkeleton } from "./FrameworkPage"; -import { ControlList } from "./FrameworkView/ControlList"; -import ControlView from "./controls/ControlView"; +import { FrameworkLayoutViewSkeleton } from "./FrameworkLayout"; +import { ControlList } from "./FrameworkLayoutView/ControlList"; const FrameworkViewQuery = graphql` query FrameworkViewQuery($frameworkId: ID!) { @@ -68,9 +67,8 @@ function FrameworkViewContent({ }) { const data = usePreloadedQuery(FrameworkViewQuery, queryRef); const framework = data.node; - const control = data.node.firstControl?.edges[0]; const navigate = useNavigate(); - const { organizationId, controlId } = useParams(); + const { organizationId } = useParams(); const { toast } = useToast(); const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false); const [isDeleting, setIsDeleting] = useState(false); @@ -153,7 +151,7 @@ function FrameworkViewContent({ >
- {controlId && } +
{/* Delete Confirmation Dialog */} @@ -198,11 +196,11 @@ export default function FrameworkView() { }, [loadQuery, frameworkId]); if (!queryRef) { - return ; + return ; } return ( - }> + }> ); diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkView/ControlList.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkLayoutView/ControlList.tsx similarity index 100% rename from apps/console/src/pages/organizations/frameworks/FrameworkView/ControlList.tsx rename to apps/console/src/pages/organizations/frameworks/FrameworkLayoutView/ControlList.tsx diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkView/__generated__/ControlList_List.graphql.ts b/apps/console/src/pages/organizations/frameworks/FrameworkLayoutView/__generated__/ControlList_List.graphql.ts similarity index 100% rename from apps/console/src/pages/organizations/frameworks/FrameworkView/__generated__/ControlList_List.graphql.ts rename to apps/console/src/pages/organizations/frameworks/FrameworkLayoutView/__generated__/ControlList_List.graphql.ts