Add compliance frameworks
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
32
apps/trust/src/components/FrameworkBadge.tsx
Normal file
32
apps/trust/src/components/FrameworkBadge.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { FrameworkLogo } from "@probo/ui";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { FrameworkBadgeFragment$key } from "./__generated__/FrameworkBadgeFragment.graphql";
|
||||
|
||||
const frameworkFragment = graphql`
|
||||
fragment FrameworkBadgeFragment on Framework {
|
||||
id
|
||||
name
|
||||
lightLogoURL
|
||||
darkLogoURL
|
||||
}
|
||||
`;
|
||||
|
||||
export function FrameworkBadge(props: { framework: FrameworkBadgeFragment$key }) {
|
||||
const framework = useFragment(frameworkFragment, props.framework);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2 items-center w-19">
|
||||
<FrameworkLogo
|
||||
className="size-19"
|
||||
lightLogoURL={framework.lightLogoURL}
|
||||
darkLogoURL={framework.darkLogoURL}
|
||||
name={framework.name}
|
||||
/>
|
||||
<div className="txt-primary text-sm max-w-19 overflow-hidden min-w-0 whitespace-nowrap text-ellipsis">
|
||||
{framework.name}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import type { TrustGraphCurrentQuery$data } from "#/queries/__generated__/TrustG
|
||||
import { getPathPrefix } from "#/utils/pathPrefix";
|
||||
|
||||
import type { OrganizationSidebar_requestAllAccessesMutation } from "./__generated__/OrganizationSidebar_requestAllAccessesMutation.graphql";
|
||||
import { AuditRowAvatar } from "./AuditRow";
|
||||
import { FrameworkBadge } from "./FrameworkBadge";
|
||||
|
||||
const requestAllAccessesMutation = graphql`
|
||||
mutation OrganizationSidebar_requestAllAccessesMutation {
|
||||
@@ -154,7 +154,7 @@ export function OrganizationSidebar({
|
||||
<hr className="my-6 -mx-6 h-px bg-border-low border-none" />
|
||||
|
||||
{/* Certifications */}
|
||||
{trustCenter.audits.edges.length > 0 && (
|
||||
{trustCenter.complianceFrameworks.edges.length > 0 && (
|
||||
<>
|
||||
<div className="space-y-4">
|
||||
<h2 className="text-xs text-txt-secondary flex gap-1 items-center">
|
||||
@@ -167,8 +167,8 @@ export function OrganizationSidebar({
|
||||
gridTemplateColumns: "repeat(auto-fit, 75px",
|
||||
}}
|
||||
>
|
||||
{trustCenter.audits.edges.map(audit => (
|
||||
<AuditRowAvatar key={audit.node.id} audit={audit.node} />
|
||||
{trustCenter.complianceFrameworks.edges.map(edge => (
|
||||
<FrameworkBadge key={edge.node.id} framework={edge.node.framework} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
66
apps/trust/src/components/__generated__/FrameworkBadgeFragment.graphql.ts
generated
Normal file
66
apps/trust/src/components/__generated__/FrameworkBadgeFragment.graphql.ts
generated
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* @generated SignedSource<<f13ba91513aa9a472ab62c4c6a93b6bb>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type FrameworkBadgeFragment$data = {
|
||||
readonly darkLogoURL: string | null | undefined;
|
||||
readonly id: string;
|
||||
readonly lightLogoURL: string | null | undefined;
|
||||
readonly name: string;
|
||||
readonly " $fragmentType": "FrameworkBadgeFragment";
|
||||
};
|
||||
export type FrameworkBadgeFragment$key = {
|
||||
readonly " $data"?: FrameworkBadgeFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"FrameworkBadgeFragment">;
|
||||
};
|
||||
|
||||
const node: ReaderFragment = {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "FrameworkBadgeFragment",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "name",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "lightLogoURL",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "darkLogoURL",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Framework",
|
||||
"abstractKey": null
|
||||
};
|
||||
|
||||
(node as any).hash = "cdfaf9a4a0e2cb667a5ef8d3e7db1f99";
|
||||
|
||||
export default node;
|
||||
Reference in New Issue
Block a user