diff --git a/apps/console/src/__generated__/core/TrustCenterGraphQuery.graphql.ts b/apps/console/src/__generated__/core/TrustCenterGraphQuery.graphql.ts deleted file mode 100644 index f9979f1ae..000000000 --- a/apps/console/src/__generated__/core/TrustCenterGraphQuery.graphql.ts +++ /dev/null @@ -1,316 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type TrustCenterGraphQuery$variables = { - organizationId: string; -}; -export type TrustCenterGraphQuery$data = { - readonly organization: { - readonly canCreateTrustCenterFile?: boolean; - readonly customDomain?: { - readonly domain: string; - readonly id: string; - } | null | undefined; - readonly id?: string; - readonly name?: string; - readonly trustCenter?: { - readonly active: boolean; - readonly canCreateAccess: boolean; - readonly canCreateReference: boolean; - readonly canDeleteNDA: boolean; - readonly canGetNDA: boolean; - readonly canUpdate: boolean; - readonly canUploadNDA: boolean; - readonly createdAt: string; - readonly id: string; - readonly ndaFileName: string | null | undefined; - readonly ndaFileUrl: string | null | undefined; - readonly updatedAt: string; - } | null | undefined; - }; -}; -export type TrustCenterGraphQuery = { - response: TrustCenterGraphQuery$data; - variables: TrustCenterGraphQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "organizationId" - } -], -v1 = [ - { - "kind": "Variable", - "name": "id", - "variableName": "organizationId" - } -], -v2 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}, -v3 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null -}, -v4 = { - "alias": "canCreateTrustCenterFile", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:trust-center-file:create" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:trust-center-file:create\")" -}, -v5 = { - "alias": null, - "args": null, - "concreteType": "CustomDomain", - "kind": "LinkedField", - "name": "customDomain", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "domain", - "storageKey": null - } - ], - "storageKey": null -}, -v6 = { - "alias": null, - "args": null, - "concreteType": "TrustCenter", - "kind": "LinkedField", - "name": "trustCenter", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "active", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "ndaFileName", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "ndaFileUrl", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - }, - { - "alias": "canUpdate", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:trust-center:update" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:trust-center:update\")" - }, - { - "alias": "canGetNDA", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:trust-center:get-nda" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:trust-center:get-nda\")" - }, - { - "alias": "canUploadNDA", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:trust-center:upload-nda" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:trust-center:upload-nda\")" - }, - { - "alias": "canDeleteNDA", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:trust-center:delete-nda" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:trust-center:delete-nda\")" - }, - { - "alias": "canCreateReference", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:trust-center-reference:create" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:trust-center-reference:create\")" - }, - { - "alias": "canCreateAccess", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:trust-center-access:create" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:trust-center-access:create\")" - } - ], - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "TrustCenterGraphQuery", - "selections": [ - { - "alias": "organization", - "args": (v1/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "kind": "InlineFragment", - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/), - (v6/*: any*/) - ], - "type": "Organization", - "abstractKey": null - } - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "TrustCenterGraphQuery", - "selections": [ - { - "alias": "organization", - "args": (v1/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "__typename", - "storageKey": null - }, - (v2/*: any*/), - { - "kind": "InlineFragment", - "selections": [ - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/), - (v6/*: any*/) - ], - "type": "Organization", - "abstractKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "be28b37377c063e9b63304ee7353e845", - "id": null, - "metadata": {}, - "name": "TrustCenterGraphQuery", - "operationKind": "query", - "text": "query TrustCenterGraphQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n name\n canCreateTrustCenterFile: permission(action: \"core:trust-center-file:create\")\n customDomain {\n id\n domain\n }\n trustCenter {\n id\n active\n ndaFileName\n ndaFileUrl\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:trust-center:update\")\n canGetNDA: permission(action: \"core:trust-center:get-nda\")\n canUploadNDA: permission(action: \"core:trust-center:upload-nda\")\n canDeleteNDA: permission(action: \"core:trust-center:delete-nda\")\n canCreateReference: permission(action: \"core:trust-center-reference:create\")\n canCreateAccess: permission(action: \"core:trust-center-access:create\")\n }\n }\n id\n }\n}\n" - } -}; -})(); - -(node as any).hash = "9e6d6626e164fd2e3ea553d3f51eb34c"; - -export default node; diff --git a/apps/console/src/hooks/graph/TrustCenterGraph.ts b/apps/console/src/hooks/graph/TrustCenterGraph.ts index 2f23be7ce..0ed1c7e43 100644 --- a/apps/console/src/hooks/graph/TrustCenterGraph.ts +++ b/apps/console/src/hooks/graph/TrustCenterGraph.ts @@ -3,41 +3,7 @@ import { graphql } from "relay-runtime"; import type { TrustCenterGraphUpdateMutation } from "#/__generated__/core/TrustCenterGraphUpdateMutation.graphql"; import { useMutationWithToasts } from "#/hooks/useMutationWithToasts"; -export const trustCenterQuery = graphql` - query TrustCenterGraphQuery($organizationId: ID!) { - organization: node(id: $organizationId) { - ... on Organization { - id - name - canCreateTrustCenterFile: permission( - action: "core:trust-center-file:create" - ) - customDomain { - id - domain - } - trustCenter { - id - active - ndaFileName - ndaFileUrl - createdAt - updatedAt - canUpdate: permission(action: "core:trust-center:update") - canGetNDA: permission(action: "core:trust-center:get-nda") - canUploadNDA: permission(action: "core:trust-center:upload-nda") - canDeleteNDA: permission(action: "core:trust-center:delete-nda") - canCreateReference: permission( - action: "core:trust-center-reference:create" - ) - canCreateAccess: permission(action: "core:trust-center-access:create") - } - } - } - } -`; - -export const updateTrustCenterMutation = graphql` +const updateTrustCenterMutation = graphql` mutation TrustCenterGraphUpdateMutation($input: UpdateTrustCenterInput!) { updateTrustCenter(input: $input) { trustCenter { @@ -59,7 +25,7 @@ export function useUpdateTrustCenterMutation() { ); } -export const uploadTrustCenterNDAMutation = graphql` +const uploadTrustCenterNDAMutation = graphql` mutation TrustCenterGraphUploadNDAMutation( $input: UploadTrustCenterNDAInput! ) { @@ -80,7 +46,7 @@ export function useUploadTrustCenterNDAMutation() { }); } -export const deleteTrustCenterNDAMutation = graphql` +const deleteTrustCenterNDAMutation = graphql` mutation TrustCenterGraphDeleteNDAMutation( $input: DeleteTrustCenterNDAInput! ) { diff --git a/apps/console/src/pages/iam/organizations/_components/Sidebar.tsx b/apps/console/src/pages/iam/organizations/_components/Sidebar.tsx index 86b5efee6..aa3c45d30 100644 --- a/apps/console/src/pages/iam/organizations/_components/Sidebar.tsx +++ b/apps/console/src/pages/iam/organizations/_components/Sidebar.tsx @@ -198,18 +198,11 @@ export function Sidebar(props: { fKey: SidebarFragment$key }) { /> )} {organization.canGetTrustCenter && ( - <> - - - + )} {organization.canUpdateOrganization && ( ; -}; - -export default function TrustCenterPage({ queryRef }: Props) { - const { __ } = useTranslate(); - const organizationId = useOrganizationId(); - const { organization } = usePreloadedQuery(trustCenterQuery, queryRef); - - usePageTitle(__("Trust Center")); - - const isActive = organization.trustCenter?.active || false; - - return ( -
- - - {isActive ? __("Active") : __("Inactive")} - - - - - - - {__("Overview")} - - - - {__("Trusted by")} - - - - {__("Audits")} - - - - {__("Documents")} - - - - {__("Files")} - - - - {__("Vendors")} - - - - {__("Access")} - - - - -
- ); -} diff --git a/apps/console/src/routes.tsx b/apps/console/src/routes.tsx index ff0280703..3c0379f39 100644 --- a/apps/console/src/routes.tsx +++ b/apps/console/src/routes.tsx @@ -35,7 +35,6 @@ import { riskRoutes } from "./routes/riskRoutes"; import { snapshotsRoutes } from "./routes/snapshotsRoutes"; import { statesOfApplicabilityRoutes } from "./routes/statesOfApplicabilityRoutes"; import { taskRoutes } from "./routes/taskRoutes"; -import { trustCenterRoutes } from "./routes/trustCenterRoutes"; import { vendorRoutes } from "./routes/vendorRoutes"; /** @@ -250,7 +249,6 @@ const routes = [ ...processingActivityRoutes, ...statesOfApplicabilityRoutes, ...compliancePageRoutes, - ...trustCenterRoutes, ...snapshotsRoutes, { path: "*", diff --git a/apps/console/src/routes/trustCenterRoutes.ts b/apps/console/src/routes/trustCenterRoutes.ts deleted file mode 100644 index 4b13bf60b..000000000 --- a/apps/console/src/routes/trustCenterRoutes.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { lazy } from "@probo/react-lazy"; -import { - type AppRoute, - loaderFromQueryLoader, - withQueryRef, -} from "@probo/routes"; -import { loadQuery } from "react-relay"; - -import type { TrustCenterGraphQuery } from "#/__generated__/core/TrustCenterGraphQuery.graphql"; -import { PageSkeleton } from "#/components/skeletons/PageSkeleton"; -import { coreEnvironment } from "#/environments"; - -import { trustCenterQuery } from "../hooks/graph/TrustCenterGraph"; - -export const trustCenterRoutes = [ - { - path: "trust-center", - Fallback: PageSkeleton, - loader: loaderFromQueryLoader(({ organizationId }) => - loadQuery( - coreEnvironment, - trustCenterQuery, - { organizationId }, - { fetchPolicy: "network-only" }, - ), - ), - Component: withQueryRef( - lazy(() => import("#/pages/organizations/trustCenter/TrustCenterPage")), - ), - }, -] satisfies AppRoute[];