Add trust center configuration

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-07-24 21:11:46 +02:00
parent e85a7b4955
commit 32c47a1988
49 changed files with 4755 additions and 126 deletions

View File

@@ -0,0 +1,175 @@
import { graphql } from "relay-runtime";
import {
Card,
Button,
Tr,
Td,
Table,
Thead,
Tbody,
Th,
IconChevronDown,
IconCheckmark1,
IconCrossLargeX,
Badge,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import { useFragment } from "react-relay";
import { useMemo, useState } from "react";
import { sprintf, getAuditStateVariant, getAuditStateLabel } from "@probo/helpers";
import { useOrganizationId } from "/hooks/useOrganizationId";
import clsx from "clsx";
import type { TrustCenterAuditsCardFragment$key } from "./__generated__/TrustCenterAuditsCardFragment.graphql";
const trustCenterAuditFragment = graphql`
fragment TrustCenterAuditsCardFragment on Audit {
id
framework {
name
}
validFrom
validUntil
state
showOnTrustCenter
createdAt
}
`;
type Mutation<Params> = (p: {
variables: {
input: {
id: string;
showOnTrustCenter: boolean;
} & Params;
};
}) => void;
type Props<Params> = {
audits: TrustCenterAuditsCardFragment$key[];
params: Params;
disabled?: boolean;
onToggleVisibility: Mutation<Params>;
variant?: "card" | "table";
};
export function TrustCenterAuditsCard<Params>(props: Props<Params>) {
const { __ } = useTranslate();
const [limit, setLimit] = useState<number | null>(4);
const audits = useMemo(() => {
return limit ? props.audits.slice(0, limit) : props.audits;
}, [props.audits, limit]);
const showMoreButton = limit !== null && props.audits.length > limit;
const variant = props.variant ?? "table";
const onToggleVisibility = (auditId: string, showOnTrustCenter: boolean) => {
props.onToggleVisibility({
variables: {
input: {
id: auditId,
showOnTrustCenter,
...props.params,
},
},
});
};
const Wrapper = variant === "card" ? Card : "div";
return (
<Wrapper {...(variant === "card" ? { padded: true } : {})} className="space-y-[10px]">
<Table className={clsx(variant === "card" && "bg-invert")}>
<Thead>
<Tr>
<Th>{__("Framework")}</Th>
<Th>{__("Valid Until")}</Th>
<Th>{__("State")}</Th>
<Th>{__("Visibility")}</Th>
<Th></Th>
</Tr>
</Thead>
<Tbody>
{audits.length === 0 && (
<Tr>
<Td colSpan={5} className="text-center text-txt-secondary">
{__("No audits available")}
</Td>
</Tr>
)}
{audits.map((audit, index) => (
<AuditRow
key={index}
audit={audit}
onToggleVisibility={onToggleVisibility}
disabled={props.disabled}
/>
))}
</Tbody>
</Table>
{showMoreButton && (
<Button
variant="tertiary"
onClick={() => setLimit(null)}
className="mt-3 mx-auto"
icon={IconChevronDown}
>
{sprintf(__("Show %s more"), props.audits.length - limit)}
</Button>
)}
</Wrapper>
);
}
function AuditRow(props: {
audit: TrustCenterAuditsCardFragment$key;
onToggleVisibility: (auditId: string, showOnTrustCenter: boolean) => void;
disabled?: boolean;
}) {
const audit = useFragment(trustCenterAuditFragment, props.audit);
const organizationId = useOrganizationId();
const { __ } = useTranslate();
const validUntilFormatted = audit.validUntil
? new Date(audit.validUntil).toLocaleDateString()
: __("No expiry");
return (
<Tr to={`/organizations/${organizationId}/audits/${audit.id}`}>
<Td>
<div className="flex gap-4 items-center">
{audit.framework.name}
</div>
</Td>
<Td>{validUntilFormatted}</Td>
<Td>
<Badge variant={getAuditStateVariant(audit.state)}>
{getAuditStateLabel(__, audit.state)}
</Badge>
</Td>
<Td>
<div className="flex items-center gap-2">
{audit.showOnTrustCenter ? (
<>
<IconCheckmark1 className="w-4 h-4 text-txt-primary" />
<span className="text-txt-primary">{__("Visible")}</span>
</>
) : (
<>
<IconCrossLargeX className="w-4 h-4 text-txt-tertiary" />
<span className="text-txt-tertiary">{__("Hidden")}</span>
</>
)}
</div>
</Td>
<Td noLink width={100} className="text-end">
<Button
variant="secondary"
onClick={() => props.onToggleVisibility(audit.id, !audit.showOnTrustCenter)}
icon={audit.showOnTrustCenter ? IconCrossLargeX : IconCheckmark1}
disabled={props.disabled}
>
{audit.showOnTrustCenter ? __("Hide") : __("Show")}
</Button>
</Td>
</Tr>
);
}

View File

@@ -0,0 +1,99 @@
import { useTranslate } from "@probo/i18n";
import {
Dialog,
DialogContent,
DialogFooter,
Button,
useDialogRef,
} from "@probo/ui";
import { type ReactNode } from "react";
import { useFragment, graphql } from "react-relay";
import type { TrustCenterDocumentsCardFragment$key } from "./__generated__/TrustCenterDocumentsCardFragment.graphql";
const trustCenterDocumentDialogFragment = graphql`
fragment TrustCenterDocumentDialogFragment on Document {
id
title
showOnTrustCenter
}
`;
type Props = {
children: ReactNode;
documents: (TrustCenterDocumentsCardFragment$key & { id: string })[];
onToggleVisibility: (documentId: string, showOnTrustCenter: boolean) => void;
disabled?: boolean;
};
export default function TrustCenterDocumentDialog({
children,
documents,
onToggleVisibility,
disabled,
}: Props) {
const { __ } = useTranslate();
const dialogRef = useDialogRef();
return (
<>
<span onClick={() => !disabled && dialogRef.current?.open()}>
{children}
</span>
<Dialog ref={dialogRef}>
<DialogContent>
<div className="text-lg font-semibold mb-4">
{__("Manage Document Visibility on Trust Center")}
</div>
<div className="py-4">
<p className="text-txt-secondary mb-4">
{__("Control which documents are visible on your public trust center.")}
</p>
<div className="space-y-2 max-h-96 overflow-y-auto">
{documents.map((documentKey) => (
<DocumentDialogRow
key={documentKey.id}
document={documentKey}
onToggleVisibility={onToggleVisibility}
disabled={disabled}
/>
))}
</div>
</div>
<DialogFooter>
<Button onClick={() => dialogRef.current?.close()}>
{__("Close")}
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</>
);
}
function DocumentDialogRow({
document: documentKey,
onToggleVisibility,
disabled,
}: {
document: TrustCenterDocumentsCardFragment$key & { id: string };
onToggleVisibility: (documentId: string, showOnTrustCenter: boolean) => void;
disabled?: boolean;
}) {
const document = useFragment(trustCenterDocumentDialogFragment, documentKey);
const { __ } = useTranslate();
return (
<div className="flex items-center justify-between p-3 border border-border-solid rounded">
<div className="flex-1">
<div className="font-medium">{document.title}</div>
</div>
<Button
variant="secondary"
onClick={() => onToggleVisibility(document.id, !document.showOnTrustCenter)}
disabled={disabled}
>
{document.showOnTrustCenter ? __("Hide") : __("Show")}
</Button>
</div>
);
}

View File

@@ -0,0 +1,177 @@
import { graphql } from "relay-runtime";
import {
Card,
Button,
Tr,
Td,
Table,
Thead,
Tbody,
Th,
IconChevronDown,
IconCheckmark1,
IconCrossLargeX,
DocumentVersionBadge,
DocumentTypeBadge,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import type { TrustCenterDocumentsCardFragment$key } from "./__generated__/TrustCenterDocumentsCardFragment.graphql";
import { useFragment } from "react-relay";
import { useMemo, useState } from "react";
import { sprintf } from "@probo/helpers";
import { useOrganizationId } from "/hooks/useOrganizationId";
import clsx from "clsx";
const trustCenterDocumentFragment = graphql`
fragment TrustCenterDocumentsCardFragment on Document {
id
title
createdAt
documentType
showOnTrustCenter
versions(first: 1) {
edges {
node {
id
status
}
}
}
}
`;
type Mutation<Params> = (p: {
variables: {
input: {
id: string;
showOnTrustCenter: boolean;
} & Params;
};
}) => void;
type Props<Params> = {
documents: TrustCenterDocumentsCardFragment$key[];
params: Params;
disabled?: boolean;
onToggleVisibility: Mutation<Params>;
variant?: "card" | "table";
};
export function TrustCenterDocumentsCard<Params>(props: Props<Params>) {
const { __ } = useTranslate();
const [limit, setLimit] = useState<number | null>(4);
const documents = useMemo(() => {
return limit ? props.documents.slice(0, limit) : props.documents;
}, [props.documents, limit]);
const showMoreButton = limit !== null && props.documents.length > limit;
const variant = props.variant ?? "table";
const onToggleVisibility = (documentId: string, showOnTrustCenter: boolean) => {
props.onToggleVisibility({
variables: {
input: {
id: documentId,
showOnTrustCenter,
...props.params,
},
},
});
};
const Wrapper = variant === "card" ? Card : "div";
return (
<Wrapper padded className="space-y-[10px]">
<Table className={clsx(variant === "card" && "bg-invert")}>
<Thead>
<Tr>
<Th>{__("Name")}</Th>
<Th>{__("Type")}</Th>
<Th>{__("State")}</Th>
<Th>{__("Visibility")}</Th>
<Th></Th>
</Tr>
</Thead>
<Tbody>
{documents.length === 0 && (
<Tr>
<Td colSpan={5} className="text-center text-txt-secondary">
{__("No documents available")}
</Td>
</Tr>
)}
{documents.map((document, index) => (
<DocumentRow
key={index}
document={document}
onToggleVisibility={onToggleVisibility}
disabled={props.disabled}
/>
))}
</Tbody>
</Table>
{showMoreButton && (
<Button
variant="tertiary"
onClick={() => setLimit(null)}
className="mt-3 mx-auto"
icon={IconChevronDown}
>
{sprintf(__("Show %s more"), props.documents.length - limit)}
</Button>
)}
</Wrapper>
);
}
function DocumentRow(props: {
document: TrustCenterDocumentsCardFragment$key;
onToggleVisibility: (documentId: string, showOnTrustCenter: boolean) => void;
disabled?: boolean;
}) {
const document = useFragment(trustCenterDocumentFragment, props.document);
const organizationId = useOrganizationId();
const { __ } = useTranslate();
return (
<Tr to={`/organizations/${organizationId}/documents/${document.id}`}>
<Td>
<div className="flex gap-4 items-center">
{document.title}
</div>
</Td>
<Td>
<DocumentTypeBadge type={document.documentType} />
</Td>
<Td>
<DocumentVersionBadge state={document.versions?.edges?.[0]?.node?.status} />
</Td>
<Td>
<div className="flex items-center gap-2">
{document.showOnTrustCenter ? (
<>
<IconCheckmark1 className="w-4 h-4 text-txt-primary" />
<span className="text-txt-primary">{__("Visible")}</span>
</>
) : (
<>
<IconCrossLargeX className="w-4 h-4 text-txt-tertiary" />
<span className="text-txt-tertiary">{__("Hidden")}</span>
</>
)}
</div>
</Td>
<Td noLink width={100} className="text-end">
<Button
variant="secondary"
onClick={() => props.onToggleVisibility(document.id, !document.showOnTrustCenter)}
icon={document.showOnTrustCenter ? IconCrossLargeX : IconCheckmark1}
disabled={props.disabled}
>
{document.showOnTrustCenter ? __("Hide") : __("Show")}
</Button>
</Td>
</Tr>
);
}

View File

@@ -0,0 +1,166 @@
import { graphql } from "relay-runtime";
import {
Card,
Button,
Tr,
Td,
Table,
Thead,
Tbody,
Th,
IconChevronDown,
IconCheckmark1,
IconCrossLargeX,
Badge,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import { useFragment } from "react-relay";
import { useMemo, useState } from "react";
import { sprintf } from "@probo/helpers";
import { useOrganizationId } from "/hooks/useOrganizationId";
import clsx from "clsx";
import type { TrustCenterVendorsCardFragment$key } from "./__generated__/TrustCenterVendorsCardFragment.graphql";
const trustCenterVendorFragment = graphql`
fragment TrustCenterVendorsCardFragment on Vendor {
id
name
category
description
showOnTrustCenter
createdAt
}
`;
type Mutation<Params> = (p: {
variables: {
input: {
id: string;
showOnTrustCenter: boolean;
} & Params;
};
}) => void;
type Props<Params> = {
vendors: TrustCenterVendorsCardFragment$key[];
params: Params;
disabled?: boolean;
onToggleVisibility: Mutation<Params>;
variant?: "card" | "table";
};
export function TrustCenterVendorsCard<Params>(props: Props<Params>) {
const { __ } = useTranslate();
const [limit, setLimit] = useState<number | null>(4);
const vendors = useMemo(() => {
return limit ? props.vendors.slice(0, limit) : props.vendors;
}, [props.vendors, limit]);
const showMoreButton = limit !== null && props.vendors.length > limit;
const variant = props.variant ?? "table";
const onToggleVisibility = (vendorId: string, showOnTrustCenter: boolean) => {
props.onToggleVisibility({
variables: {
input: {
id: vendorId,
showOnTrustCenter,
...props.params,
},
},
});
};
const Wrapper = variant === "card" ? Card : "div";
return (
<Wrapper padded className="space-y-[10px]">
<Table className={clsx(variant === "card" && "bg-invert")}>
<Thead>
<Tr>
<Th>{__("Name")}</Th>
<Th>{__("Category")}</Th>
<Th>{__("Visibility")}</Th>
<Th></Th>
</Tr>
</Thead>
<Tbody>
{vendors.length === 0 && (
<Tr>
<Td colSpan={4} className="text-center text-txt-secondary">
{__("No vendors available")}
</Td>
</Tr>
)}
{vendors.map((vendor, index) => (
<VendorRow
key={index}
vendor={vendor}
onToggleVisibility={onToggleVisibility}
disabled={props.disabled}
/>
))}
</Tbody>
</Table>
{showMoreButton && (
<Button
variant="tertiary"
onClick={() => setLimit(null)}
className="mt-3 mx-auto"
icon={IconChevronDown}
>
{sprintf(__("Show %s more"), props.vendors.length - limit)}
</Button>
)}
</Wrapper>
);
}
function VendorRow(props: {
vendor: TrustCenterVendorsCardFragment$key;
onToggleVisibility: (vendorId: string, showOnTrustCenter: boolean) => void;
disabled?: boolean;
}) {
const vendor = useFragment(trustCenterVendorFragment, props.vendor);
const organizationId = useOrganizationId();
const { __ } = useTranslate();
return (
<Tr to={`/organizations/${organizationId}/vendors/${vendor.id}`}>
<Td>
<div className="flex gap-4 items-center">
{vendor.name}
</div>
</Td>
<Td>
<Badge variant="neutral">
{vendor.category}
</Badge>
</Td>
<Td>
<div className="flex items-center gap-2">
{vendor.showOnTrustCenter ? (
<>
<IconCheckmark1 className="w-4 h-4 text-txt-primary" />
<span className="text-txt-primary">{__("Visible")}</span>
</>
) : (
<>
<IconCrossLargeX className="w-4 h-4 text-txt-tertiary" />
<span className="text-txt-tertiary">{__("Hidden")}</span>
</>
)}
</div>
</Td>
<Td noLink width={100} className="text-end">
<Button
variant="secondary"
onClick={() => props.onToggleVisibility(vendor.id, !vendor.showOnTrustCenter)}
icon={vendor.showOnTrustCenter ? IconCrossLargeX : IconCheckmark1}
disabled={props.disabled}
>
{vendor.showOnTrustCenter ? __("Hide") : __("Show")}
</Button>
</Td>
</Tr>
);
}

View File

@@ -0,0 +1,104 @@
/**
* @generated SignedSource<<794277d17daabd92807ccfaa5a1c2dbb>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type AuditState = "COMPLETED" | "IN_PROGRESS" | "NOT_STARTED" | "OUTDATED" | "REJECTED";
import { FragmentRefs } from "relay-runtime";
export type TrustCenterAuditsCardFragment$data = {
readonly createdAt: any;
readonly framework: {
readonly name: string;
};
readonly id: string;
readonly showOnTrustCenter: boolean;
readonly state: AuditState;
readonly validFrom: any | null | undefined;
readonly validUntil: any | null | undefined;
readonly " $fragmentType": "TrustCenterAuditsCardFragment";
};
export type TrustCenterAuditsCardFragment$key = {
readonly " $data"?: TrustCenterAuditsCardFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterAuditsCardFragment">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterAuditsCardFragment",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "Framework",
"kind": "LinkedField",
"name": "framework",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "validFrom",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "validUntil",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "state",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
}
],
"type": "Audit",
"abstractKey": null
};
(node as any).hash = "9c9291dffd5c057c0e70e2567a897362";
export default node;

View File

@@ -0,0 +1,58 @@
/**
* @generated SignedSource<<3ff483dcc660e6b45d676db7fc05a30e>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type TrustCenterDocumentDialogFragment$data = {
readonly id: string;
readonly showOnTrustCenter: boolean;
readonly title: string;
readonly " $fragmentType": "TrustCenterDocumentDialogFragment";
};
export type TrustCenterDocumentDialogFragment$key = {
readonly " $data"?: TrustCenterDocumentDialogFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterDocumentDialogFragment">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterDocumentDialogFragment",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "title",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"storageKey": null
}
],
"type": "Document",
"abstractKey": null
};
(node as any).hash = "d886df25fdf197161a91bbc693c9fac8";
export default node;

View File

@@ -0,0 +1,134 @@
/**
* @generated SignedSource<<711a0b67f3e93814ae3297a2578373c6>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type DocumentStatus = "DRAFT" | "PUBLISHED";
export type DocumentType = "ISMS" | "OTHER" | "POLICY";
import { FragmentRefs } from "relay-runtime";
export type TrustCenterDocumentsCardFragment$data = {
readonly createdAt: any;
readonly documentType: DocumentType;
readonly id: string;
readonly showOnTrustCenter: boolean;
readonly title: string;
readonly versions: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly status: DocumentStatus;
};
}>;
};
readonly " $fragmentType": "TrustCenterDocumentsCardFragment";
};
export type TrustCenterDocumentsCardFragment$key = {
readonly " $data"?: TrustCenterDocumentsCardFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterDocumentsCardFragment">;
};
const node: ReaderFragment = (function(){
var v0 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterDocumentsCardFragment",
"selections": [
(v0/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "title",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "documentType",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"storageKey": null
},
{
"alias": null,
"args": [
{
"kind": "Literal",
"name": "first",
"value": 1
}
],
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "versions",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v0/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "versions(first:1)"
}
],
"type": "Document",
"abstractKey": null
};
})();
(node as any).hash = "88d5e5e3a2d9f4b730428efcea644f25";
export default node;

View File

@@ -0,0 +1,83 @@
/**
* @generated SignedSource<<b3d65d827fc901aa002b24df72f79ee2>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type VendorCategory = "ANALYTICS" | "CLOUD_MONITORING" | "CLOUD_PROVIDER" | "COLLABORATION" | "CUSTOMER_SUPPORT" | "DATA_STORAGE_AND_PROCESSING" | "DOCUMENT_MANAGEMENT" | "EMPLOYEE_MANAGEMENT" | "ENGINEERING" | "FINANCE" | "IDENTITY_PROVIDER" | "IT" | "MARKETING" | "OFFICE_OPERATIONS" | "OTHER" | "PASSWORD_MANAGEMENT" | "PRODUCT_AND_DESIGN" | "PROFESSIONAL_SERVICES" | "RECRUITING" | "SALES" | "SECURITY" | "VERSION_CONTROL";
import { FragmentRefs } from "relay-runtime";
export type TrustCenterVendorsCardFragment$data = {
readonly category: VendorCategory;
readonly createdAt: any;
readonly description: string | null | undefined;
readonly id: string;
readonly name: string;
readonly showOnTrustCenter: boolean;
readonly " $fragmentType": "TrustCenterVendorsCardFragment";
};
export type TrustCenterVendorsCardFragment$key = {
readonly " $data"?: TrustCenterVendorsCardFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterVendorsCardFragment">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterVendorsCardFragment",
"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": "category",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
}
],
"type": "Vendor",
"abstractKey": null
};
(node as any).hash = "72b637589fd9299b5e982450fccbfd12";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<95aa70195a3e90acb366441fd037c2f2>>
* @generated SignedSource<<faa26838a242a98d5df14f51ff257950>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -26,6 +26,7 @@ export type UpdateVendorInput = {
securityOwnerId?: string | null | undefined;
securityPageUrl?: string | null | undefined;
serviceLevelAgreementUrl?: string | null | undefined;
showOnTrustCenter?: boolean | null | undefined;
statusPageUrl?: string | null | undefined;
subprocessorsListUrl?: string | null | undefined;
termsOfServiceUrl?: string | null | undefined;

View File

@@ -0,0 +1,28 @@
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
import { useTranslate } from "@probo/i18n";
import type { TrustCenterAuditGraphUpdateMutation } from "./__generated__/TrustCenterAuditGraphUpdateMutation.graphql";
export const trustCenterAuditUpdateMutation = graphql`
mutation TrustCenterAuditGraphUpdateMutation($input: UpdateAuditInput!) {
updateAudit(input: $input) {
audit {
id
showOnTrustCenter
...TrustCenterAuditsCardFragment
}
}
}
`;
export function useTrustCenterAuditUpdate() {
const { __ } = useTranslate();
return useMutationWithToasts<TrustCenterAuditGraphUpdateMutation>(
trustCenterAuditUpdateMutation,
{
successMessage: __("Audit visibility updated successfully."),
errorMessage: __("Failed to update audit visibility. Please try again."),
}
);
}

View File

@@ -0,0 +1,46 @@
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
import { useTranslate } from "@probo/i18n";
import type { TrustCenterDocumentGraphUpdateMutation } from "./__generated__/TrustCenterDocumentGraphUpdateMutation.graphql";
export const trustCenterDocumentsQuery = graphql`
query TrustCenterDocumentGraphQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
... on Organization {
id
documents(first: 100) {
edges {
node {
id
...TrustCenterDocumentsCardFragment
}
}
}
}
}
}
`;
export const updateDocumentVisibilityMutation = graphql`
mutation TrustCenterDocumentGraphUpdateMutation($input: UpdateDocumentInput!) {
updateDocument(input: $input) {
document {
id
showOnTrustCenter
...TrustCenterDocumentsCardFragment
}
}
}
`;
export function useUpdateDocumentVisibilityMutation() {
const { __ } = useTranslate();
return useMutationWithToasts<TrustCenterDocumentGraphUpdateMutation>(
updateDocumentVisibilityMutation,
{
successMessage: __("Document visibility updated successfully."),
errorMessage: __("Failed to update document visibility. Please try again."),
}
);
}

View File

@@ -0,0 +1,68 @@
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
import type { TrustCenterGraphUpdateMutation } from "./__generated__/TrustCenterGraphUpdateMutation.graphql";
export const trustCenterQuery = graphql`
query TrustCenterGraphQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
... on Organization {
id
name
trustCenter {
id
active
slug
createdAt
updatedAt
}
documents(first: 100) {
edges {
node {
id
...TrustCenterDocumentsCardFragment
}
}
}
audits(first: 100) {
edges {
node {
id
...TrustCenterAuditsCardFragment
}
}
}
vendors(first: 100) {
edges {
node {
id
...TrustCenterVendorsCardFragment
}
}
}
}
}
}
`;
export const updateTrustCenterMutation = graphql`
mutation TrustCenterGraphUpdateMutation($input: UpdateTrustCenterInput!) {
updateTrustCenter(input: $input) {
trustCenter {
id
active
slug
updatedAt
}
}
}
`;
export function useUpdateTrustCenterMutation() {
return useMutationWithToasts<TrustCenterGraphUpdateMutation>(
updateTrustCenterMutation,
{
successMessage: "Trust center updated successfully",
errorMessage: "Failed to update trust center",
}
);
}

View File

@@ -0,0 +1,28 @@
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
import { useTranslate } from "@probo/i18n";
import type { TrustCenterVendorGraphUpdateMutation } from "./__generated__/TrustCenterVendorGraphUpdateMutation.graphql";
export const trustCenterVendorUpdateMutation = graphql`
mutation TrustCenterVendorGraphUpdateMutation($input: UpdateVendorInput!) {
updateVendor(input: $input) {
vendor {
id
showOnTrustCenter
...TrustCenterVendorsCardFragment
}
}
}
`;
export function useTrustCenterVendorUpdate() {
const { __ } = useTranslate();
return useMutationWithToasts<TrustCenterVendorGraphUpdateMutation>(
trustCenterVendorUpdateMutation,
{
successMessage: __("Vendor visibility updated successfully."),
errorMessage: __("Failed to update vendor visibility. Please try again."),
}
);
}

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<f55547fed473a026bb7c43be28a2c6dc>>
* @generated SignedSource<<d2c542541d5bfda5464af2b34ccae603>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -12,6 +12,7 @@ import { ConcreteRequest } from 'relay-runtime';
export type AuditState = "COMPLETED" | "IN_PROGRESS" | "NOT_STARTED" | "OUTDATED" | "REJECTED";
export type UpdateAuditInput = {
id: string;
showOnTrustCenter?: boolean | null | undefined;
state?: AuditState | null | undefined;
validFrom?: any | null | undefined;
validUntil?: any | null | undefined;

View File

@@ -0,0 +1,118 @@
/**
* @generated SignedSource<<92803a3585816e3db509c46a86d083e9>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type AuditState = "COMPLETED" | "IN_PROGRESS" | "NOT_STARTED" | "OUTDATED" | "REJECTED";
export type UpdateAuditInput = {
id: string;
showOnTrustCenter?: boolean | null | undefined;
state?: AuditState | null | undefined;
validFrom?: any | null | undefined;
validUntil?: any | null | undefined;
};
export type TrustCenterAuditGraphUpdateMutation$variables = {
input: UpdateAuditInput;
};
export type TrustCenterAuditGraphUpdateMutation$data = {
readonly updateAudit: {
readonly audit: {
readonly id: string;
readonly showOnTrustCenter: boolean;
};
};
};
export type TrustCenterAuditGraphUpdateMutation = {
response: TrustCenterAuditGraphUpdateMutation$data;
variables: TrustCenterAuditGraphUpdateMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "UpdateAuditPayload",
"kind": "LinkedField",
"name": "updateAudit",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Audit",
"kind": "LinkedField",
"name": "audit",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterAuditGraphUpdateMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "TrustCenterAuditGraphUpdateMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "1ecc930abe6daebb184b1e55ccebc65c",
"id": null,
"metadata": {},
"name": "TrustCenterAuditGraphUpdateMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterAuditGraphUpdateMutation(\n $input: UpdateAuditInput!\n) {\n updateAudit(input: $input) {\n audit {\n id\n showOnTrustCenter\n }\n }\n}\n"
}
};
})();
(node as any).hash = "ebf90264b72bb993d60f48d1d3fc4fb7";
export default node;

View File

@@ -0,0 +1,288 @@
/**
* @generated SignedSource<<6676a9b480eeef26f00ff97963b39b86>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type TrustCenterDocumentGraphQuery$variables = {
organizationId: string;
};
export type TrustCenterDocumentGraphQuery$data = {
readonly organization: {
readonly documents?: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterDocumentsCardFragment">;
};
}>;
};
readonly id?: string;
};
};
export type TrustCenterDocumentGraphQuery = {
response: TrustCenterDocumentGraphQuery$data;
variables: TrustCenterDocumentGraphQuery$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 = [
{
"kind": "Literal",
"name": "first",
"value": 100
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterDocumentGraphQuery",
"selections": [
{
"alias": "organization",
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"kind": "InlineFragment",
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": (v3/*: any*/),
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "documents",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Document",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterDocumentsCardFragment"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "documents(first:100)"
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
],
"type": "Query",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "TrustCenterDocumentGraphQuery",
"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": [
{
"alias": null,
"args": (v3/*: any*/),
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "documents",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Document",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "title",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "documentType",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"storageKey": null
},
{
"alias": null,
"args": [
{
"kind": "Literal",
"name": "first",
"value": 1
}
],
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "versions",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "versions(first:1)"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "documents(first:100)"
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "f8e5f4d7adcf1e794bc046ef21317f89",
"id": null,
"metadata": {},
"name": "TrustCenterDocumentGraphQuery",
"operationKind": "query",
"text": "query TrustCenterDocumentGraphQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n documents(first: 100) {\n edges {\n node {\n id\n ...TrustCenterDocumentsCardFragment\n }\n }\n }\n }\n id\n }\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n showOnTrustCenter\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "f4e34ac09a2b56c2298bc319d9701f4d";
export default node;

View File

@@ -0,0 +1,222 @@
/**
* @generated SignedSource<<5b8f324da8c4dc9302cb6f821062757d>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type DocumentType = "ISMS" | "OTHER" | "POLICY";
export type UpdateDocumentInput = {
content?: string | null | undefined;
createdBy?: string | null | undefined;
documentType?: DocumentType | null | undefined;
id: string;
ownerId?: string | null | undefined;
showOnTrustCenter?: boolean | null | undefined;
title?: string | null | undefined;
};
export type TrustCenterDocumentGraphUpdateMutation$variables = {
input: UpdateDocumentInput;
};
export type TrustCenterDocumentGraphUpdateMutation$data = {
readonly updateDocument: {
readonly document: {
readonly id: string;
readonly showOnTrustCenter: boolean;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterDocumentsCardFragment">;
};
};
};
export type TrustCenterDocumentGraphUpdateMutation = {
response: TrustCenterDocumentGraphUpdateMutation$data;
variables: TrustCenterDocumentGraphUpdateMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
v2 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterDocumentGraphUpdateMutation",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": "UpdateDocumentPayload",
"kind": "LinkedField",
"name": "updateDocument",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Document",
"kind": "LinkedField",
"name": "document",
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterDocumentsCardFragment"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "TrustCenterDocumentGraphUpdateMutation",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": "UpdateDocumentPayload",
"kind": "LinkedField",
"name": "updateDocument",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Document",
"kind": "LinkedField",
"name": "document",
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "title",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "documentType",
"storageKey": null
},
{
"alias": null,
"args": [
{
"kind": "Literal",
"name": "first",
"value": 1
}
],
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "versions",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "versions(first:1)"
}
],
"storageKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "b112314d6ef35feebf49bd2f8c636b33",
"id": null,
"metadata": {},
"name": "TrustCenterDocumentGraphUpdateMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterDocumentGraphUpdateMutation(\n $input: UpdateDocumentInput!\n) {\n updateDocument(input: $input) {\n document {\n id\n showOnTrustCenter\n ...TrustCenterDocumentsCardFragment\n }\n }\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n showOnTrustCenter\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "46f72a664d3edb0e5665b1ecea69e31a";
export default node;

View File

@@ -0,0 +1,558 @@
/**
* @generated SignedSource<<46a922efef96e5c7d015bd0f27467bf3>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type TrustCenterGraphQuery$variables = {
organizationId: string;
};
export type TrustCenterGraphQuery$data = {
readonly organization: {
readonly audits?: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterAuditsCardFragment">;
};
}>;
};
readonly documents?: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterDocumentsCardFragment">;
};
}>;
};
readonly id?: string;
readonly name?: string;
readonly trustCenter?: {
readonly active: boolean;
readonly createdAt: any;
readonly id: string;
readonly slug: string;
readonly updatedAt: any;
} | null | undefined;
readonly vendors?: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterVendorsCardFragment">;
};
}>;
};
};
};
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": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
v5 = {
"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": "slug",
"storageKey": null
},
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
},
v6 = [
{
"kind": "Literal",
"name": "first",
"value": 100
}
],
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"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*/),
(v5/*: any*/),
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "documents",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Document",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterDocumentsCardFragment"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "documents(first:100)"
},
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": "AuditConnection",
"kind": "LinkedField",
"name": "audits",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "AuditEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Audit",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterAuditsCardFragment"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "audits(first:100)"
},
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": "VendorConnection",
"kind": "LinkedField",
"name": "vendors",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Vendor",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterVendorsCardFragment"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "vendors(first:100)"
}
],
"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*/),
(v5/*: any*/),
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "documents",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Document",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "title",
"storageKey": null
},
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "documentType",
"storageKey": null
},
(v7/*: any*/),
{
"alias": null,
"args": [
{
"kind": "Literal",
"name": "first",
"value": 1
}
],
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "versions",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "versions(first:1)"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "documents(first:100)"
},
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": "AuditConnection",
"kind": "LinkedField",
"name": "audits",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "AuditEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Audit",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "Framework",
"kind": "LinkedField",
"name": "framework",
"plural": false,
"selections": [
(v3/*: any*/),
(v2/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "validFrom",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "validUntil",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "state",
"storageKey": null
},
(v7/*: any*/),
(v4/*: any*/)
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "audits(first:100)"
},
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": "VendorConnection",
"kind": "LinkedField",
"name": "vendors",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Vendor",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
(v7/*: any*/),
(v4/*: any*/)
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "vendors(first:100)"
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "a22d734ee326d24f3f67ffecf4653b2f",
"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 trustCenter {\n id\n active\n slug\n createdAt\n updatedAt\n }\n documents(first: 100) {\n edges {\n node {\n id\n ...TrustCenterDocumentsCardFragment\n }\n }\n }\n audits(first: 100) {\n edges {\n node {\n id\n ...TrustCenterAuditsCardFragment\n }\n }\n }\n vendors(first: 100) {\n edges {\n node {\n id\n ...TrustCenterVendorsCardFragment\n }\n }\n }\n }\n id\n }\n}\n\nfragment TrustCenterAuditsCardFragment on Audit {\n id\n framework {\n name\n id\n }\n validFrom\n validUntil\n state\n showOnTrustCenter\n createdAt\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n showOnTrustCenter\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment TrustCenterVendorsCardFragment on Vendor {\n id\n name\n category\n description\n showOnTrustCenter\n createdAt\n}\n"
}
};
})();
(node as any).hash = "260529b3ca03240b07989f278bb7a539";
export default node;

View File

@@ -0,0 +1,131 @@
/**
* @generated SignedSource<<c257950f58c4b876a6ff7ef6083f005b>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type UpdateTrustCenterInput = {
active?: boolean | null | undefined;
slug?: string | null | undefined;
trustCenterId: string;
};
export type TrustCenterGraphUpdateMutation$variables = {
input: UpdateTrustCenterInput;
};
export type TrustCenterGraphUpdateMutation$data = {
readonly updateTrustCenter: {
readonly trustCenter: {
readonly active: boolean;
readonly id: string;
readonly slug: string;
readonly updatedAt: any;
};
};
};
export type TrustCenterGraphUpdateMutation = {
response: TrustCenterGraphUpdateMutation$data;
variables: TrustCenterGraphUpdateMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "UpdateTrustCenterPayload",
"kind": "LinkedField",
"name": "updateTrustCenter",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenter",
"kind": "LinkedField",
"name": "trustCenter",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "active",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "slug",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterGraphUpdateMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "TrustCenterGraphUpdateMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "18e80937923185923d9b427819334337",
"id": null,
"metadata": {},
"name": "TrustCenterGraphUpdateMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterGraphUpdateMutation(\n $input: UpdateTrustCenterInput!\n) {\n updateTrustCenter(input: $input) {\n trustCenter {\n id\n active\n slug\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "988f3baf354e729d6cc9482129040898";
export default node;

View File

@@ -0,0 +1,133 @@
/**
* @generated SignedSource<<012c4e605372a38efef4780c63d40888>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type VendorCategory = "ANALYTICS" | "CLOUD_MONITORING" | "CLOUD_PROVIDER" | "COLLABORATION" | "CUSTOMER_SUPPORT" | "DATA_STORAGE_AND_PROCESSING" | "DOCUMENT_MANAGEMENT" | "EMPLOYEE_MANAGEMENT" | "ENGINEERING" | "FINANCE" | "IDENTITY_PROVIDER" | "IT" | "MARKETING" | "OFFICE_OPERATIONS" | "OTHER" | "PASSWORD_MANAGEMENT" | "PRODUCT_AND_DESIGN" | "PROFESSIONAL_SERVICES" | "RECRUITING" | "SALES" | "SECURITY" | "VERSION_CONTROL";
export type UpdateVendorInput = {
businessAssociateAgreementUrl?: string | null | undefined;
businessOwnerId?: string | null | undefined;
category?: VendorCategory | null | undefined;
certifications?: ReadonlyArray<string> | null | undefined;
dataProcessingAgreementUrl?: string | null | undefined;
description?: string | null | undefined;
headquarterAddress?: string | null | undefined;
id: string;
legalName?: string | null | undefined;
name?: string | null | undefined;
privacyPolicyUrl?: string | null | undefined;
securityOwnerId?: string | null | undefined;
securityPageUrl?: string | null | undefined;
serviceLevelAgreementUrl?: string | null | undefined;
showOnTrustCenter?: boolean | null | undefined;
statusPageUrl?: string | null | undefined;
subprocessorsListUrl?: string | null | undefined;
termsOfServiceUrl?: string | null | undefined;
trustPageUrl?: string | null | undefined;
websiteUrl?: string | null | undefined;
};
export type TrustCenterVendorGraphUpdateMutation$variables = {
input: UpdateVendorInput;
};
export type TrustCenterVendorGraphUpdateMutation$data = {
readonly updateVendor: {
readonly vendor: {
readonly id: string;
readonly showOnTrustCenter: boolean;
};
};
};
export type TrustCenterVendorGraphUpdateMutation = {
response: TrustCenterVendorGraphUpdateMutation$data;
variables: TrustCenterVendorGraphUpdateMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "UpdateVendorPayload",
"kind": "LinkedField",
"name": "updateVendor",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Vendor",
"kind": "LinkedField",
"name": "vendor",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "showOnTrustCenter",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterVendorGraphUpdateMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "TrustCenterVendorGraphUpdateMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "44e483af96833ea9efb1567fa5983282",
"id": null,
"metadata": {},
"name": "TrustCenterVendorGraphUpdateMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterVendorGraphUpdateMutation(\n $input: UpdateVendorInput!\n) {\n updateVendor(input: $input) {\n vendor {\n id\n showOnTrustCenter\n }\n }\n}\n"
}
};
})();
(node as any).hash = "e561918e67c08f1e3fae85dfb04591d1";
export default node;

View File

@@ -14,6 +14,7 @@ import {
IconTodo,
IconListStack,
IconBox,
IconShield,
Layout,
SidebarItem,
UserDropdown as UserDropdownRoot,
@@ -137,6 +138,11 @@ export function MainLayout() {
icon={IconCheckmark1}
to={`${prefix}/audits`}
/>
<SidebarItem
label={__("Trust Center")}
icon={IconShield}
to={`${prefix}/trust-center`}
/>
<SidebarItem
label={__("Settings")}
icon={IconSettingsGear2}

View File

@@ -0,0 +1,240 @@
import { useTranslate } from "@probo/i18n";
import { usePageTitle } from "@probo/hooks";
import {
Button,
Card,
Checkbox,
Field,
Input,
PageHeader,
Spinner,
useToast,
Tabs,
TabLink,
TabItem,
} from "@probo/ui";
import { usePreloadedQuery, type PreloadedQuery } from "react-relay";
import { trustCenterQuery, useUpdateTrustCenterMutation } from "/hooks/graph/TrustCenterGraph";
import type { TrustCenterGraphQuery } from "/hooks/graph/__generated__/TrustCenterGraphQuery.graphql";
import { useState } from "react";
import { useOrganizationId } from "/hooks/useOrganizationId";
import { Outlet, useLocation, Link } from "react-router";
type Props = {
queryRef: PreloadedQuery<TrustCenterGraphQuery>;
};
export default function TrustCenterPage({ queryRef }: Props) {
const { __ } = useTranslate();
const { toast } = useToast();
const organizationId = useOrganizationId();
const location = useLocation();
const { organization } = usePreloadedQuery(trustCenterQuery, queryRef);
const [updateTrustCenter, isUpdating] = useUpdateTrustCenterMutation();
const [isActive, setIsActive] = useState(organization.trustCenter?.active || false);
const [slug, setSlug] = useState(organization.trustCenter?.slug || "");
const [isUpdatingSlug, setIsUpdatingSlug] = useState(false);
usePageTitle(__("Trust Center"));
const handleToggleActive = async (active: boolean) => {
if (!organization.trustCenter?.id) {
toast({
title: __("Error"),
description: __("Trust center not found"),
variant: "error",
});
return;
}
setIsActive(active);
updateTrustCenter({
variables: {
input: {
trustCenterId: organization.trustCenter.id,
active,
},
},
onError: () => {
setIsActive(!active);
},
});
};
const handleSlugUpdate = async () => {
if (!organization.trustCenter?.id) {
toast({
title: __("Error"),
description: __("Trust center not found"),
variant: "error",
});
return;
}
if (!slug.trim()) {
toast({
title: __("Error"),
description: __("Slug cannot be empty"),
variant: "error",
});
return;
}
setIsUpdatingSlug(true);
updateTrustCenter({
variables: {
input: {
trustCenterId: organization.trustCenter.id,
slug: slug.trim(),
},
},
onCompleted: () => {
setIsUpdatingSlug(false);
},
onError: () => {
setIsUpdatingSlug(false);
setSlug(organization.trustCenter?.slug || "");
},
});
};
const trustCenterUrl = organization.trustCenter?.slug
? `${window.location.origin}/trust/${organization.trustCenter.slug}`
: null;
return (
<div className="space-y-6">
<PageHeader
title={__("Trust Center")}
description={__(
"Configure your public trust center to showcase your security and compliance posture."
)}
/>
<div className="space-y-4">
<div className="flex items-center justify-between">
<h2 className="text-base font-medium">{__("Trust Center Status")}</h2>
{isUpdating && <Spinner />}
</div>
<Card padded className="space-y-4">
<div className="flex items-center justify-between">
<div className="space-y-1">
<h3 className="font-medium">{__("Activate Trust Center")}</h3>
<p className="text-sm text-txt-tertiary">
{__("Make your trust center publicly accessible to build customer confidence")}
</p>
</div>
<Checkbox
checked={isActive}
onChange={handleToggleActive}
/>
</div>
{isActive && trustCenterUrl && (
<div className="mt-4 p-4 bg-accent-light rounded-lg border border-accent">
<div className="flex items-center justify-between">
<div>
<h4 className="font-medium text-accent-dark">
{__("Your Trust Center is Live!")}
</h4>
<p className="text-sm text-accent-dark mt-1">
{__("Your customers can now access your trust center at:")}
</p>
<a
href={trustCenterUrl}
target="_blank"
rel="noopener noreferrer"
className="text-sm font-mono text-accent underline hover:no-underline"
>
{trustCenterUrl}
</a>
</div>
<Button
variant="secondary"
onClick={() => window.open(trustCenterUrl, '_blank', 'noopener,noreferrer')}
>
{__("View")}
</Button>
</div>
</div>
)}
{!isActive && (
<div className="mt-4 p-4 bg-tertiary rounded-lg border border-border-solid">
<h4 className="font-medium text-txt-secondary">
{__("Trust Center is Inactive")}
</h4>
<p className="text-sm text-txt-tertiary mt-1">
{__("Your trust center is currently not accessible to the public. Enable it to start sharing your compliance status.")}
</p>
</div>
)}
</Card>
</div>
<div className="space-y-4">
<div className="flex items-center justify-between">
<h2 className="text-base font-medium">{__("Configuration")}</h2>
{isUpdatingSlug && <Spinner />}
</div>
<Card padded className="space-y-4">
<div className="space-y-2">
<Field
label={__("Slug")}
help={__("The unique identifier for your trust center URL")}
>
<div className="flex items-center space-x-2">
<div className="flex items-center">
<Input
value={slug}
onChange={(e) => setSlug(e.target.value)}
placeholder={__("your-organization")}
className="min-w-[200px]"
/>
</div>
<Button
variant="secondary"
onClick={handleSlugUpdate}
disabled={
isUpdatingSlug ||
!slug.trim() ||
slug === organization.trustCenter?.slug
}
>
{__("Update")}
</Button>
</div>
</Field>
</div>
</Card>
</div>
<div className="space-y-4">
<h2 className="text-base font-medium">{__("Content")}</h2>
<Tabs>
<TabItem
asChild
active={
location.pathname === `/organizations/${organizationId}/trust-center` ||
location.pathname === `/organizations/${organizationId}/trust-center/audits`
}
>
<Link to={`/organizations/${organizationId}/trust-center/audits`}>
{__("Audits")}
</Link>
</TabItem>
<TabLink to={`/organizations/${organizationId}/trust-center/vendors`}>
{__("Vendors")}
</TabLink>
<TabLink to={`/organizations/${organizationId}/trust-center/documents`}>
{__("Documents")}
</TabLink>
</Tabs>
<Outlet context={{ organization }} />
</div>
</div>
);
}

View File

@@ -0,0 +1,39 @@
import { Card, Spinner } from "@probo/ui";
import { useOutletContext } from "react-router";
import { TrustCenterAuditsCard } from "/components/trustCenter/TrustCenterAuditsCard";
import { useTrustCenterAuditUpdate } from "/hooks/graph/TrustCenterAuditGraph";
import type { TrustCenterAuditsCardFragment$key } from "/components/trustCenter/__generated__/TrustCenterAuditsCardFragment.graphql";
type ContextType = {
organization: {
audits?: {
edges: Array<{
node: TrustCenterAuditsCardFragment$key;
}>;
};
};
};
export default function TrustCenterAuditsTab() {
const { organization } = useOutletContext<ContextType>();
const [updateAuditVisibility, isUpdatingAudits] = useTrustCenterAuditUpdate();
const audits = (organization.audits?.edges ?? []).map((edge) => edge.node);
return (
<div className="space-y-4">
<div className="flex items-center justify-between">
{isUpdatingAudits && <Spinner />}
</div>
<Card padded>
<TrustCenterAuditsCard
audits={audits}
params={{}}
disabled={isUpdatingAudits}
onToggleVisibility={updateAuditVisibility}
variant="table"
/>
</Card>
</div>
);
}

View File

@@ -0,0 +1,39 @@
import { Card, Spinner } from "@probo/ui";
import { useOutletContext } from "react-router";
import { TrustCenterDocumentsCard } from "/components/trustCenter/TrustCenterDocumentsCard";
import { useUpdateDocumentVisibilityMutation } from "/hooks/graph/TrustCenterDocumentGraph";
import type { TrustCenterDocumentsCardFragment$key } from "/components/trustCenter/__generated__/TrustCenterDocumentsCardFragment.graphql";
type ContextType = {
organization: {
documents?: {
edges: Array<{
node: TrustCenterDocumentsCardFragment$key;
}>;
};
};
};
export default function TrustCenterDocumentsTab() {
const { organization } = useOutletContext<ContextType>();
const [updateDocumentVisibility, isUpdatingDocuments] = useUpdateDocumentVisibilityMutation();
const documents = organization.documents?.edges?.map((edge) => edge.node) || [];
return (
<div className="space-y-4">
<div className="flex items-center justify-between">
{isUpdatingDocuments && <Spinner />}
</div>
<Card padded>
<TrustCenterDocumentsCard
documents={documents}
params={{}}
disabled={isUpdatingDocuments}
onToggleVisibility={updateDocumentVisibility}
variant="table"
/>
</Card>
</div>
);
}

View File

@@ -0,0 +1,39 @@
import { Card, Spinner } from "@probo/ui";
import { useOutletContext } from "react-router";
import { TrustCenterVendorsCard } from "/components/trustCenter/TrustCenterVendorsCard";
import { useTrustCenterVendorUpdate } from "/hooks/graph/TrustCenterVendorGraph";
import type { TrustCenterVendorsCardFragment$key } from "/components/trustCenter/__generated__/TrustCenterVendorsCardFragment.graphql";
type ContextType = {
organization: {
vendors?: {
edges: Array<{
node: TrustCenterVendorsCardFragment$key;
}>;
};
};
};
export default function TrustCenterVendorsTab() {
const { organization } = useOutletContext<ContextType>();
const [updateVendorVisibility, isUpdatingVendors] = useTrustCenterVendorUpdate();
const vendors = organization.vendors?.edges?.map((edge) => edge.node) || [];
return (
<div className="space-y-4">
<div className="flex items-center justify-between">
{isUpdatingVendors && <Spinner />}
</div>
<Card padded>
<TrustCenterVendorsCard
vendors={vendors}
params={{}}
disabled={isUpdatingVendors}
onToggleVisibility={updateVendorVisibility}
variant="table"
/>
</Card>
</div>
);
}

View File

@@ -28,6 +28,7 @@ import { taskRoutes } from "./routes/taskRoutes.ts";
import { dataRoutes } from "./routes/dataRoutes.ts";
import { assetRoutes } from "./routes/assetRoutes.ts";
import { auditRoutes } from "./routes/auditRoutes.ts";
import { trustCenterRoutes } from "./routes/trustCenterRoutes.ts";
import { lazy } from "@probo/react-lazy";
/**
@@ -136,6 +137,7 @@ const routes = [
...assetRoutes,
...dataRoutes,
...auditRoutes,
...trustCenterRoutes,
{
path: "*",
Component: PageError,

View File

@@ -0,0 +1,49 @@
import { loadQuery } from "react-relay";
import { relayEnvironment } from "/providers/RelayProviders";
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
import { LinkCardSkeleton } from "/components/skeletons/LinkCardSkeleton";
import { lazy } from "@probo/react-lazy";
import { trustCenterQuery } from "../hooks/graph/TrustCenterGraph";
import type { AppRoute } from "/routes";
export const trustCenterRoutes = [
{
path: "trust-center",
fallback: PageSkeleton,
queryLoader: ({ organizationId }) =>
loadQuery(relayEnvironment, trustCenterQuery, { organizationId }),
Component: lazy(
() => import("/pages/organizations/TrustCenterPage")
),
children: [
{
index: true,
fallback: LinkCardSkeleton,
Component: lazy(
() => import("/pages/organizations/trustCenter/TrustCenterAuditsTab")
),
},
{
path: "audits",
fallback: LinkCardSkeleton,
Component: lazy(
() => import("/pages/organizations/trustCenter/TrustCenterAuditsTab")
),
},
{
path: "vendors",
fallback: LinkCardSkeleton,
Component: lazy(
() => import("/pages/organizations/trustCenter/TrustCenterVendorsTab")
),
},
{
path: "documents",
fallback: LinkCardSkeleton,
Component: lazy(
() => import("/pages/organizations/trustCenter/TrustCenterDocumentsTab")
),
},
],
},
] satisfies AppRoute[];