From 604868fddc87879b92aa9964599fe8064ecddc4f Mon Sep 17 00:00:00 2001 From: gearnode Date: Wed, 12 Feb 2025 09:14:24 -0800 Subject: [PATCH] Add vendor overview Signed-off-by: gearnode --- apps/console/src/App.tsx | 11 + apps/console/src/pages/VendorOverviewPage.tsx | 258 ++++++++++++++++++ ...phql.ts => VendorListPageQuery.graphql.ts} | 24 +- .../VendorOverviewPageQuery.graphql.ts | 154 +++++++++++ package-lock.json | 103 +++++++ 5 files changed, 538 insertions(+), 12 deletions(-) create mode 100644 apps/console/src/pages/VendorOverviewPage.tsx rename apps/console/src/pages/__generated__/{VendorListQuery.graphql.ts => VendorListPageQuery.graphql.ts} (81%) create mode 100644 apps/console/src/pages/__generated__/VendorOverviewPageQuery.graphql.ts diff --git a/apps/console/src/App.tsx b/apps/console/src/App.tsx index 237657395..fa41346e4 100644 --- a/apps/console/src/App.tsx +++ b/apps/console/src/App.tsx @@ -27,6 +27,7 @@ const PeoplesPage = lazy(() => import("./pages/PeoplesPage")); const VendorList = lazy(() => import("./pages/VendorList")); const FrameworksPage = lazy(() => import("./pages/FrameworksPage")); const FrameworkOverviewPage = lazy(() => import("./pages/FrameworkOverviewPage")); +const VendorOverviewPage = lazy(() => import("./pages/VendorOverviewPage")); function App() { return ( @@ -95,6 +96,16 @@ function App() { } /> + + + + + + } + /> ; +}) { + const data = usePreloadedQuery(VendorOverviewPageQuery, queryRef); + const [riskLevel, setRiskLevel] = useState("medium") + + return ( +
+
+ {/* Header */} +
+
+ Google Cloud +

{data.node?.name}

+
+

Use this form to assess the risk of using Google Workspace as a vendor.

+
+ + {/* Asset Storage Type */} + +
+
+

Asset Storage Type

+

Questions related to the type of assets stored by the vendor.

+
+ +
+
+ + +
+
+ + +
+
+
+
+ + {/* Data Storage and Handling */} + +
+
+

Data Storage and Handling

+

+ Questions related to the vendor's data storage and handling practices. +

+
+ +
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+ + {/* Vendor Reliability and Continuity */} + +
+
+

Vendor Reliability and Continuity

+

+ Evaluating the vendor's reliability and plans for business continuity. +

+
+ +
+
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + + +
+
+
+
+
+ + {/* Risk Level */} + +
+
+

Risk level

+

Based on the responses, the suggested risk level is medium.

+
+
+ + + +
+
+
+
+
+ ) +} + +function VendorOverviewPageFallback() { + return ( +
+
+
+
+
+
+ {[1, 2, 3].map((i) => ( +
+ ))} +
+
+ ); +} + +export default function VendorOverviewPage() { + const { vendorId } = useParams(); + const [queryRef, loadQuery] = useQueryLoader(VendorOverviewPageQuery); + + useEffect(() => { + loadQuery({ vendorId: vendorId }); + }, [loadQuery]); + + if (!queryRef) { + return ; + } + + return ( + }> + + + ); +} \ No newline at end of file diff --git a/apps/console/src/pages/__generated__/VendorListQuery.graphql.ts b/apps/console/src/pages/__generated__/VendorListPageQuery.graphql.ts similarity index 81% rename from apps/console/src/pages/__generated__/VendorListQuery.graphql.ts rename to apps/console/src/pages/__generated__/VendorListPageQuery.graphql.ts index 3a02eb58a..fdc3fa6b2 100644 --- a/apps/console/src/pages/__generated__/VendorListQuery.graphql.ts +++ b/apps/console/src/pages/__generated__/VendorListPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<825817de2398615779403c0817995f9f>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -9,8 +9,8 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type VendorListQuery$variables = Record; -export type VendorListQuery$data = { +export type VendorListPageQuery$variables = Record; +export type VendorListPageQuery$data = { readonly node: { readonly id: string; readonly vendors?: { @@ -25,9 +25,9 @@ export type VendorListQuery$data = { }; }; }; -export type VendorListQuery = { - response: VendorListQuery$data; - variables: VendorListQuery$variables; +export type VendorListPageQuery = { + response: VendorListPageQuery$data; + variables: VendorListPageQuery$variables; }; const node: ConcreteRequest = (function(){ @@ -112,7 +112,7 @@ return { "argumentDefinitions": [], "kind": "Fragment", "metadata": null, - "name": "VendorListQuery", + "name": "VendorListPageQuery", "selections": [ { "alias": null, @@ -135,7 +135,7 @@ return { "operation": { "argumentDefinitions": [], "kind": "Operation", - "name": "VendorListQuery", + "name": "VendorListPageQuery", "selections": [ { "alias": null, @@ -160,16 +160,16 @@ return { ] }, "params": { - "cacheID": "ced04a7cfd00f4525d09d6bf5303167b", + "cacheID": "1661d7e75c833a569efafa55c204d894", "id": null, "metadata": {}, - "name": "VendorListQuery", + "name": "VendorListPageQuery", "operationKind": "query", - "text": "query VendorListQuery {\n node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n vendors {\n edges {\n node {\n id\n name\n createdAt\n updatedAt\n }\n }\n }\n }\n }\n}\n" + "text": "query VendorListPageQuery {\n node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n vendors {\n edges {\n node {\n id\n name\n createdAt\n updatedAt\n }\n }\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "4f125111c515f868693b33e5209d05fd"; +(node as any).hash = "e869cdf6203c1a7f42c4c697f574b0c0"; export default node; diff --git a/apps/console/src/pages/__generated__/VendorOverviewPageQuery.graphql.ts b/apps/console/src/pages/__generated__/VendorOverviewPageQuery.graphql.ts new file mode 100644 index 000000000..a22243711 --- /dev/null +++ b/apps/console/src/pages/__generated__/VendorOverviewPageQuery.graphql.ts @@ -0,0 +1,154 @@ +/** + * @generated SignedSource<> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type VendorOverviewPageQuery$variables = { + vendorId: string; +}; +export type VendorOverviewPageQuery$data = { + readonly node: { + readonly createdAt?: any; + readonly id?: string; + readonly name?: string; + readonly updatedAt?: any; + }; +}; +export type VendorOverviewPageQuery = { + response: VendorOverviewPageQuery$data; + variables: VendorOverviewPageQuery$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "vendorId" + } +], +v1 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "vendorId" + } +], +v2 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v3 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}, +v4 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null +}, +v5 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "updatedAt", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "VendorOverviewPageQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "kind": "InlineFragment", + "selections": [ + (v2/*: any*/), + (v3/*: any*/), + (v4/*: any*/), + (v5/*: any*/) + ], + "type": "Vendor", + "abstractKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "VendorOverviewPageQuery", + "selections": [ + { + "alias": null, + "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*/) + ], + "type": "Vendor", + "abstractKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "93086ca61d518fce9c6ed49fa9bd841e", + "id": null, + "metadata": {}, + "name": "VendorOverviewPageQuery", + "operationKind": "query", + "text": "query VendorOverviewPageQuery(\n $vendorId: ID!\n) {\n node(id: $vendorId) {\n __typename\n ... on Vendor {\n id\n name\n createdAt\n updatedAt\n }\n id\n }\n}\n" + } +}; +})(); + +(node as any).hash = "7959720cf1a6376d406ac5f478f6d9c3"; + +export default node; diff --git a/package-lock.json b/package-lock.json index 5c2be3682..c0fad8c73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,10 +19,13 @@ "version": "0.0.1", "dependencies": { "@radix-ui/react-avatar": "^1.1.3", + "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-collapsible": "^1.1.3", "@radix-ui/react-dialog": "^1.1.6", "@radix-ui/react-dropdown-menu": "^2.1.6", + "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-progress": "^1.1.2", + "@radix-ui/react-radio-group": "^1.1.3", "@radix-ui/react-separator": "^1.1.2", "@radix-ui/react-slot": "^1.1.2", "@radix-ui/react-tooltip": "^1.1.8", @@ -2307,6 +2310,36 @@ } } }, + "node_modules/@radix-ui/react-checkbox": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.1.4.tgz", + "integrity": "sha512-wP0CPAHq+P5I4INKe3hJrIa1WoNqqrejzW+zoU0rOvo1b9gDEJJFl2rYfO1PYJUQCc2H1WZxIJmyv9BS8i5fLw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-presence": "1.1.2", + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-use-controllable-state": "1.1.0", + "@radix-ui/react-use-previous": "1.1.0", + "@radix-ui/react-use-size": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-collapsible": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.3.tgz", @@ -2558,6 +2591,29 @@ } } }, + "node_modules/@radix-ui/react-label": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.2.tgz", + "integrity": "sha512-zo1uGMTaNlHehDyFQcDZXRJhUPDuukcnHz0/jnrup0JA6qL+AFpAnty+7VKa9esuU5xTblAZzTGYJKSKaBxBhw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.0.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-menu": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.6.tgz", @@ -2725,6 +2781,38 @@ } } }, + "node_modules/@radix-ui/react-radio-group": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.2.3.tgz", + "integrity": "sha512-xtCsqt8Rp09FK50ItqEqTJ7Sxanz8EM8dnkVIhJrc/wkMMomSmXHvYbhv3E7Zx4oXh98aaLt9W679SUYXg4IDA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-direction": "1.1.0", + "@radix-ui/react-presence": "1.1.2", + "@radix-ui/react-primitive": "2.0.2", + "@radix-ui/react-roving-focus": "1.1.2", + "@radix-ui/react-use-controllable-state": "1.1.0", + "@radix-ui/react-use-previous": "1.1.0", + "@radix-ui/react-use-size": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-roving-focus": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.2.tgz", @@ -2897,6 +2985,21 @@ } } }, + "node_modules/@radix-ui/react-use-previous": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.0.tgz", + "integrity": "sha512-Z/e78qg2YFnnXcW88A4JmTtm4ADckLno6F7OXotmkQfeuCVaKuYzqAATPhVzl3delXE7CxIV8shofPn3jPc5Og==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-use-rect": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.0.tgz",