Add trust center files

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-10-24 10:04:54 +02:00
parent e53b1239db
commit 1bd6f7c1c9
55 changed files with 9074 additions and 394 deletions

View File

@@ -0,0 +1,228 @@
import { graphql } from "relay-runtime";
import {
Card,
Button,
Tr,
Td,
Table,
Thead,
Tbody,
Th,
IconChevronDown,
Field,
Option,
Badge,
IconPencil,
IconTrashCan,
IconArrowLink,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import type { TrustCenterFilesCardFragment$key, TrustCenterFilesCardFragment$data } from "./__generated__/TrustCenterFilesCardFragment.graphql";
import { useFragment } from "react-relay";
import { useMemo, useState, useCallback, useEffect } from "react";
import { sprintf, getTrustCenterVisibilityOptions } from "@probo/helpers";
import { formatDate } from "@probo/helpers";
import clsx from "clsx";
const trustCenterFileFragment = graphql`
fragment TrustCenterFilesCardFragment on TrustCenterFile {
id
name
category
fileUrl
trustCenterVisibility
createdAt
updatedAt
}
`;
type Mutation<Params> = (p: {
variables: {
input: {
id: string;
trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC";
} & Params;
};
}) => void;
type Props<Params> = {
files: TrustCenterFilesCardFragment$key[];
params: Params;
disabled?: boolean;
onChangeVisibility: Mutation<Params>;
onEdit: (file: { id: string; name: string; category: string }) => void;
onDelete: (id: string) => void;
variant?: "card" | "table";
};
export function TrustCenterFilesCard<Params>(props: Props<Params>) {
const { __ } = useTranslate();
const [limit, setLimit] = useState<number | null>(4);
const files = useMemo(() => {
return limit ? props.files.slice(0, limit) : props.files;
}, [props.files, limit]);
const showMoreButton = limit !== null && props.files.length > limit;
const variant = props.variant ?? "table";
const onChangeVisibility = (fileId: string, trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC") => {
props.onChangeVisibility({
variables: {
input: {
id: fileId,
trustCenterVisibility,
...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>{__("Upload Date")}</Th>
<Th>{__("Visibility")}</Th>
<Th></Th>
</Tr>
</Thead>
<Tbody>
{files.length === 0 && (
<Tr>
<Td colSpan={5} className="text-center text-txt-secondary">
{__("No files available")}
</Td>
</Tr>
)}
{files.map((fileFragmentRef, index) => (
<FileRowWrapper
key={index}
fileFragmentRef={fileFragmentRef}
onChangeVisibility={onChangeVisibility}
onEdit={props.onEdit}
onDelete={props.onDelete}
disabled={props.disabled}
/>
))}
</Tbody>
</Table>
{showMoreButton && (
<Button
variant="tertiary"
onClick={() => setLimit(null)}
className="mt-3 mx-auto"
icon={IconChevronDown}
>
{sprintf(__("Show %s more"), props.files.length - limit)}
</Button>
)}
</Wrapper>
);
}
function FileRowWrapper(props: {
fileFragmentRef: TrustCenterFilesCardFragment$key;
onChangeVisibility: (fileId: string, trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC") => void;
onEdit: (file: { id: string; name: string; category: string }) => void;
onDelete: (id: string) => void;
disabled?: boolean;
}) {
const file = useFragment(trustCenterFileFragment, props.fileFragmentRef);
return (
<FileRow
file={file}
onChangeVisibility={props.onChangeVisibility}
onEdit={props.onEdit}
onDelete={props.onDelete}
disabled={props.disabled}
/>
);
}
function FileRow(props: {
file: TrustCenterFilesCardFragment$data;
onChangeVisibility: (fileId: string, trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC") => void;
onEdit: (file: { id: string; name: string; category: string }) => void;
onDelete: (id: string) => void;
disabled?: boolean;
}) {
const file = props.file;
const { __ } = useTranslate();
const [optimisticValue, setOptimisticValue] = useState<string | null>(null);
const handleValueChange = useCallback((value: string | {}) => {
const stringValue = typeof value === 'string' ? value : '';
const typedValue = stringValue as "NONE" | "PRIVATE" | "PUBLIC";
setOptimisticValue(typedValue);
props.onChangeVisibility(file.id, typedValue);
}, [file.id, props.onChangeVisibility]);
useEffect(() => {
if (optimisticValue && file.trustCenterVisibility === optimisticValue) {
setOptimisticValue(null);
}
}, [file.trustCenterVisibility, optimisticValue]);
const currentValue = optimisticValue || file.trustCenterVisibility;
const visibilityOptions = getTrustCenterVisibilityOptions(__);
return (
<Tr>
<Td>
<div className="flex gap-4 items-center">
{file.name}
</div>
</Td>
<Td>{file.category}</Td>
<Td>{formatDate(file.createdAt)}</Td>
<Td noLink width={130} className="pr-0">
<Field
type="select"
value={currentValue}
onValueChange={handleValueChange}
disabled={props.disabled}
className="w-[105px]"
>
{visibilityOptions.map((option) => (
<Option key={option.value} value={option.value}>
<div className="flex items-center justify-between w-full">
<Badge variant={option.variant}>
{option.label}
</Badge>
</div>
</Option>
))}
</Field>
</Td>
<Td noLink width={120}>
<div className="flex gap-2">
<Button
variant="secondary"
icon={IconArrowLink}
onClick={() => window.open(file.fileUrl, '_blank', 'noopener,noreferrer')}
title={__("Download")}
/>
<Button
variant="secondary"
icon={IconPencil}
onClick={() => props.onEdit({ id: file.id, name: file.name, category: file.category })}
disabled={props.disabled}
title={__("Edit")}
/>
<Button
variant="secondary"
icon={IconTrashCan}
onClick={() => props.onDelete(file.id)}
disabled={props.disabled}
title={__("Delete")}
/>
</div>
</Td>
</Tr>
);
}

View File

@@ -0,0 +1,91 @@
/**
* @generated SignedSource<<0defaaf1ce3544420e8fbd9c9f3af139>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
import { FragmentRefs } from "relay-runtime";
export type TrustCenterFilesCardFragment$data = {
readonly category: string;
readonly createdAt: any;
readonly fileUrl: string;
readonly id: string;
readonly name: string;
readonly trustCenterVisibility: TrustCenterVisibility;
readonly updatedAt: any;
readonly " $fragmentType": "TrustCenterFilesCardFragment";
};
export type TrustCenterFilesCardFragment$key = {
readonly " $data"?: TrustCenterFilesCardFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterFilesCardFragment">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterFilesCardFragment",
"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": "fileUrl",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "trustCenterVisibility",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"type": "TrustCenterFile",
"abstractKey": null
};
(node as any).hash = "33cb01782ca37fc776cd8e5dfde20f76";
export default node;

View File

@@ -47,6 +47,11 @@ export const trustCenterAccessesPaginationFragment = graphql`
}
}
}
trustCenterFile {
id
name
category
}
}
}
}
@@ -94,16 +99,21 @@ export const createTrustCenterAccessMutation = graphql`
title
documentType
}
report {
id
filename
audit {
id
framework {
name
report {
id
filename
audit {
id
framework {
name
}
}
}
trustCenterFile {
id
name
category
}
}
}
}
}
}
@@ -138,16 +148,21 @@ export const updateTrustCenterAccessMutation = graphql`
title
documentType
}
report {
id
filename
audit {
report {
id
framework {
name
filename
audit {
id
framework {
name
}
}
}
}
trustCenterFile {
id
name
category
}
}
}
}

View File

@@ -0,0 +1,78 @@
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
export const createTrustCenterFileMutation = graphql`
mutation TrustCenterFileGraphCreateMutation(
$input: CreateTrustCenterFileInput!
$connections: [ID!]!
) {
createTrustCenterFile(input: $input) {
trustCenterFileEdge @prependEdge(connections: $connections) {
node {
id
name
category
fileUrl
trustCenterVisibility
createdAt
updatedAt
}
}
}
}
`;
export function useCreateTrustCenterFileMutation() {
return useMutationWithToasts(
createTrustCenterFileMutation,
{
successMessage: "File uploaded successfully",
errorMessage: "Failed to upload file",
}
);
}
export const updateTrustCenterFileMutation = graphql`
mutation TrustCenterFileGraphUpdateMutation($input: UpdateTrustCenterFileInput!) {
updateTrustCenterFile(input: $input) {
trustCenterFile {
id
name
category
trustCenterVisibility
updatedAt
}
}
}
`;
export function useUpdateTrustCenterFileMutation() {
return useMutationWithToasts(
updateTrustCenterFileMutation,
{
successMessage: "File updated successfully",
errorMessage: "Failed to update file",
}
);
}
export const deleteTrustCenterFileMutation = graphql`
mutation TrustCenterFileGraphDeleteMutation(
$input: DeleteTrustCenterFileInput!
$connections: [ID!]!
) {
deleteTrustCenterFile(input: $input) {
deletedTrustCenterFileId @deleteEdge(connections: $connections)
}
}
`;
export function useDeleteTrustCenterFileMutation() {
return useMutationWithToasts(
deleteTrustCenterFileMutation,
{
successMessage: "File deleted successfully",
errorMessage: "Failed to delete file",
}
);
}

View File

@@ -57,6 +57,15 @@ export const trustCenterQuery = graphql`
}
}
}
trustCenterFiles(first: 100) @connection(key: "TrustCenterPage_trustCenterFiles") {
__id
edges {
node {
id
...TrustCenterFilesCardFragment
}
}
}
slackConnections(first: 100) {
edges {
node {

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<5c208d2afc4eb2968b59215d3e79231b>>
* @generated SignedSource<<d527603a814e765a1a2be0900d1c59e1>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -48,6 +48,11 @@ export type TrustCenterAccessGraphCreateMutation$data = {
readonly filename: string;
readonly id: string;
} | null | undefined;
readonly trustCenterFile: {
readonly category: string;
readonly id: string;
readonly name: string;
} | null | undefined;
readonly updatedAt: any;
};
}>;
@@ -186,6 +191,26 @@ v13 = {
"kind": "ScalarField",
"name": "filename",
"storageKey": null
},
v14 = {
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "trustCenterFile",
"plural": false,
"selections": [
(v4/*: any*/),
(v6/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
}
],
"storageKey": null
};
return {
"fragment": {
@@ -293,7 +318,8 @@ return {
}
],
"storageKey": null
}
},
(v14/*: any*/)
],
"storageKey": null
}
@@ -422,7 +448,8 @@ return {
}
],
"storageKey": null
}
},
(v14/*: any*/)
],
"storageKey": null
}
@@ -460,16 +487,16 @@ return {
]
},
"params": {
"cacheID": "a27b7cdf2a4cadf8cc22a95f39c3c6b0",
"cacheID": "4422a02632b77f81f3b5048b5acbac98",
"id": null,
"metadata": {},
"name": "TrustCenterAccessGraphCreateMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterAccessGraphCreateMutation(\n $input: CreateTrustCenterAccessInput!\n) {\n createTrustCenterAccess(input: $input) {\n trustCenterAccessEdge {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n documentAccesses(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n active\n createdAt\n updatedAt\n document {\n id\n title\n documentType\n }\n report {\n id\n filename\n audit {\n id\n framework {\n name\n id\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n"
"text": "mutation TrustCenterAccessGraphCreateMutation(\n $input: CreateTrustCenterAccessInput!\n) {\n createTrustCenterAccess(input: $input) {\n trustCenterAccessEdge {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n documentAccesses(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n active\n createdAt\n updatedAt\n document {\n id\n title\n documentType\n }\n report {\n id\n filename\n audit {\n id\n framework {\n name\n id\n }\n }\n }\n trustCenterFile {\n id\n name\n category\n }\n }\n }\n }\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "091432e335b8fe3a97ac06d3765f172b";
(node as any).hash = "c09c8a22a45226949a08f2262ddd0b1c";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<bf8e5a74bfd588ad123f628009b6440e>>
* @generated SignedSource<<8c2482b7d32c42396e4645bd309e7cc2>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -350,6 +350,26 @@ return {
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "trustCenterFile",
"plural": false,
"selections": [
(v3/*: any*/),
(v6/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
@@ -403,16 +423,16 @@ return {
]
},
"params": {
"cacheID": "96e9906815501bb22bca79bb63a4a149",
"cacheID": "12322ab403d03a821d2228ff68c3d191",
"id": null,
"metadata": {},
"name": "TrustCenterAccessGraphPaginationQuery",
"operationKind": "query",
"text": "query TrustCenterAccessGraphPaginationQuery(\n $count: Int\n $cursor: CursorKey\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...TrustCenterAccessGraph_accesses\n id\n }\n}\n\nfragment TrustCenterAccessGraph_accesses on TrustCenter {\n accesses(first: $count, after: $cursor, orderBy: {field: CREATED_AT, direction: DESC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n documentAccesses(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n active\n createdAt\n updatedAt\n document {\n id\n title\n documentType\n }\n report {\n id\n filename\n audit {\n id\n framework {\n name\n id\n }\n }\n }\n }\n }\n }\n __typename\n }\n }\n }\n id\n}\n"
"text": "query TrustCenterAccessGraphPaginationQuery(\n $count: Int\n $cursor: CursorKey\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...TrustCenterAccessGraph_accesses\n id\n }\n}\n\nfragment TrustCenterAccessGraph_accesses on TrustCenter {\n accesses(first: $count, after: $cursor, orderBy: {field: CREATED_AT, direction: DESC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n documentAccesses(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n active\n createdAt\n updatedAt\n document {\n id\n title\n documentType\n }\n report {\n id\n filename\n audit {\n id\n framework {\n name\n id\n }\n }\n }\n trustCenterFile {\n id\n name\n category\n }\n }\n }\n }\n __typename\n }\n }\n }\n id\n}\n"
}
};
})();
(node as any).hash = "9e29aa4a382ca2d4bb9d1b014d8d81fd";
(node as any).hash = "9c7f3e866e2593c169b1f98d0e637667";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<4fcca19ac1edb0d607a9682090e0cc3e>>
* @generated SignedSource<<e0c9c25c78bb6c8cf63eb9437947a013>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -365,6 +365,26 @@ return {
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "trustCenterFile",
"plural": false,
"selections": [
(v4/*: any*/),
(v8/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
@@ -418,12 +438,12 @@ return {
]
},
"params": {
"cacheID": "4ca52668a68c0789aa73c0d680ec0abe",
"cacheID": "37deb80fc3ff8892d2e68f7588da4e55",
"id": null,
"metadata": {},
"name": "TrustCenterAccessGraphQuery",
"operationKind": "query",
"text": "query TrustCenterAccessGraphQuery(\n $trustCenterId: ID!\n $count: Int!\n $cursor: CursorKey\n) {\n node(id: $trustCenterId) {\n __typename\n ... on TrustCenter {\n id\n ...TrustCenterAccessGraph_accesses\n }\n id\n }\n}\n\nfragment TrustCenterAccessGraph_accesses on TrustCenter {\n accesses(first: $count, after: $cursor, orderBy: {field: CREATED_AT, direction: DESC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n documentAccesses(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n active\n createdAt\n updatedAt\n document {\n id\n title\n documentType\n }\n report {\n id\n filename\n audit {\n id\n framework {\n name\n id\n }\n }\n }\n }\n }\n }\n __typename\n }\n }\n }\n id\n}\n"
"text": "query TrustCenterAccessGraphQuery(\n $trustCenterId: ID!\n $count: Int!\n $cursor: CursorKey\n) {\n node(id: $trustCenterId) {\n __typename\n ... on TrustCenter {\n id\n ...TrustCenterAccessGraph_accesses\n }\n id\n }\n}\n\nfragment TrustCenterAccessGraph_accesses on TrustCenter {\n accesses(first: $count, after: $cursor, orderBy: {field: CREATED_AT, direction: DESC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n documentAccesses(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n active\n createdAt\n updatedAt\n document {\n id\n title\n documentType\n }\n report {\n id\n filename\n audit {\n id\n framework {\n name\n id\n }\n }\n }\n trustCenterFile {\n id\n name\n category\n }\n }\n }\n }\n __typename\n }\n }\n }\n id\n}\n"
}
};
})();

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<395567ba680d0a9e1bad1cdef52bc2e1>>
* @generated SignedSource<<8ecf71138aa0165738506f5e589d3181>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,6 +16,7 @@ export type UpdateTrustCenterAccessInput = {
id: string;
name?: string | null | undefined;
reportIds?: ReadonlyArray<string> | null | undefined;
trustCenterFileIds?: ReadonlyArray<string> | null | undefined;
};
export type TrustCenterAccessGraphUpdateMutation$variables = {
input: UpdateTrustCenterAccessInput;
@@ -46,6 +47,11 @@ export type TrustCenterAccessGraphUpdateMutation$data = {
readonly filename: string;
readonly id: string;
} | null | undefined;
readonly trustCenterFile: {
readonly category: string;
readonly id: string;
readonly name: string;
} | null | undefined;
readonly updatedAt: any;
};
}>;
@@ -174,6 +180,26 @@ v11 = {
"kind": "ScalarField",
"name": "filename",
"storageKey": null
},
v12 = {
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "trustCenterFile",
"plural": false,
"selections": [
(v2/*: any*/),
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
}
],
"storageKey": null
};
return {
"fragment": {
@@ -270,7 +296,8 @@ return {
}
],
"storageKey": null
}
},
(v12/*: any*/)
],
"storageKey": null
}
@@ -385,7 +412,8 @@ return {
}
],
"storageKey": null
}
},
(v12/*: any*/)
],
"storageKey": null
}
@@ -404,16 +432,16 @@ return {
]
},
"params": {
"cacheID": "de3ddd0058b8881667e47e2bf32c8b73",
"cacheID": "b66da9236d9f81563608b3aa5f730908",
"id": null,
"metadata": {},
"name": "TrustCenterAccessGraphUpdateMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterAccessGraphUpdateMutation(\n $input: UpdateTrustCenterAccessInput!\n) {\n updateTrustCenterAccess(input: $input) {\n trustCenterAccess {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n updatedAt\n documentAccesses(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n active\n createdAt\n updatedAt\n document {\n id\n title\n documentType\n }\n report {\n id\n filename\n audit {\n id\n framework {\n name\n id\n }\n }\n }\n }\n }\n }\n }\n }\n}\n"
"text": "mutation TrustCenterAccessGraphUpdateMutation(\n $input: UpdateTrustCenterAccessInput!\n) {\n updateTrustCenterAccess(input: $input) {\n trustCenterAccess {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n updatedAt\n documentAccesses(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n active\n createdAt\n updatedAt\n document {\n id\n title\n documentType\n }\n report {\n id\n filename\n audit {\n id\n framework {\n name\n id\n }\n }\n }\n trustCenterFile {\n id\n name\n category\n }\n }\n }\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "723058aacc2e04bd2df4cf04c6df0a3c";
(node as any).hash = "43e73cc9d80e898f1ba2a92eaf4646f5";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<ef0d644a344dbab40145e3f4128cd0ec>>
* @generated SignedSource<<d572a906e6afd89e4a3f1dcffa5c0528>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -40,6 +40,11 @@ export type TrustCenterAccessGraph_accesses$data = {
readonly filename: string;
readonly id: string;
} | null | undefined;
readonly trustCenterFile: {
readonly category: string;
readonly id: string;
readonly name: string;
} | null | undefined;
readonly updatedAt: any;
};
}>;
@@ -348,6 +353,26 @@ return {
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "trustCenterFile",
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
@@ -393,6 +418,6 @@ return {
};
})();
(node as any).hash = "9e29aa4a382ca2d4bb9d1b014d8d81fd";
(node as any).hash = "9c7f3e866e2593c169b1f98d0e637667";
export default node;

View File

@@ -0,0 +1,211 @@
/**
* @generated SignedSource<<e70731a64db78c30ad662330d2ec2099>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
export type CreateTrustCenterFileInput = {
category: string;
file: any;
name: string;
organizationId: string;
trustCenterVisibility: TrustCenterVisibility;
};
export type TrustCenterFileGraphCreateMutation$variables = {
connections: ReadonlyArray<string>;
input: CreateTrustCenterFileInput;
};
export type TrustCenterFileGraphCreateMutation$data = {
readonly createTrustCenterFile: {
readonly trustCenterFileEdge: {
readonly node: {
readonly category: string;
readonly createdAt: any;
readonly fileUrl: string;
readonly id: string;
readonly name: string;
readonly trustCenterVisibility: TrustCenterVisibility;
readonly updatedAt: any;
};
};
};
};
export type TrustCenterFileGraphCreateMutation = {
response: TrustCenterFileGraphCreateMutation$data;
variables: TrustCenterFileGraphCreateMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "connections"
},
v1 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
},
v2 = [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
v3 = {
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "trustCenterFileEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"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": "fileUrl",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "trustCenterVisibility",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": [
(v0/*: any*/),
(v1/*: any*/)
],
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterFileGraphCreateMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreateTrustCenterFilePayload",
"kind": "LinkedField",
"name": "createTrustCenterFile",
"plural": false,
"selections": [
(v3/*: any*/)
],
"storageKey": null
}
],
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": [
(v1/*: any*/),
(v0/*: any*/)
],
"kind": "Operation",
"name": "TrustCenterFileGraphCreateMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreateTrustCenterFilePayload",
"kind": "LinkedField",
"name": "createTrustCenterFile",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"filters": null,
"handle": "prependEdge",
"key": "",
"kind": "LinkedHandle",
"name": "trustCenterFileEdge",
"handleArgs": [
{
"kind": "Variable",
"name": "connections",
"variableName": "connections"
}
]
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "57c42327b83556d36745cf8218eb01b1",
"id": null,
"metadata": {},
"name": "TrustCenterFileGraphCreateMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterFileGraphCreateMutation(\n $input: CreateTrustCenterFileInput!\n) {\n createTrustCenterFile(input: $input) {\n trustCenterFileEdge {\n node {\n id\n name\n category\n fileUrl\n trustCenterVisibility\n createdAt\n updatedAt\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "fa3851bf4f5e38bc26d8a063d6afab4e";
export default node;

View File

@@ -0,0 +1,132 @@
/**
* @generated SignedSource<<f788919caaf846a6a1bdc81f19841823>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type DeleteTrustCenterFileInput = {
id: string;
};
export type TrustCenterFileGraphDeleteMutation$variables = {
connections: ReadonlyArray<string>;
input: DeleteTrustCenterFileInput;
};
export type TrustCenterFileGraphDeleteMutation$data = {
readonly deleteTrustCenterFile: {
readonly deletedTrustCenterFileId: string;
};
};
export type TrustCenterFileGraphDeleteMutation = {
response: TrustCenterFileGraphDeleteMutation$data;
variables: TrustCenterFileGraphDeleteMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "connections"
},
v1 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
},
v2 = [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "deletedTrustCenterFileId",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": [
(v0/*: any*/),
(v1/*: any*/)
],
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterFileGraphDeleteMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "DeleteTrustCenterFilePayload",
"kind": "LinkedField",
"name": "deleteTrustCenterFile",
"plural": false,
"selections": [
(v3/*: any*/)
],
"storageKey": null
}
],
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": [
(v1/*: any*/),
(v0/*: any*/)
],
"kind": "Operation",
"name": "TrustCenterFileGraphDeleteMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "DeleteTrustCenterFilePayload",
"kind": "LinkedField",
"name": "deleteTrustCenterFile",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"filters": null,
"handle": "deleteEdge",
"key": "",
"kind": "ScalarHandle",
"name": "deletedTrustCenterFileId",
"handleArgs": [
{
"kind": "Variable",
"name": "connections",
"variableName": "connections"
}
]
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "ad78a064da9b58291653f8283012ffc6",
"id": null,
"metadata": {},
"name": "TrustCenterFileGraphDeleteMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterFileGraphDeleteMutation(\n $input: DeleteTrustCenterFileInput!\n) {\n deleteTrustCenterFile(input: $input) {\n deletedTrustCenterFileId\n }\n}\n"
}
};
})();
(node as any).hash = "26c1ce69e74f3a4a39d060b38afbe3e0";
export default node;

View File

@@ -0,0 +1,141 @@
/**
* @generated SignedSource<<b78cfbea93f3bccdba56cd29900ab724>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
export type UpdateTrustCenterFileInput = {
category?: string | null | undefined;
id: string;
name?: string | null | undefined;
trustCenterVisibility?: TrustCenterVisibility | null | undefined;
};
export type TrustCenterFileGraphUpdateMutation$variables = {
input: UpdateTrustCenterFileInput;
};
export type TrustCenterFileGraphUpdateMutation$data = {
readonly updateTrustCenterFile: {
readonly trustCenterFile: {
readonly category: string;
readonly id: string;
readonly name: string;
readonly trustCenterVisibility: TrustCenterVisibility;
readonly updatedAt: any;
};
};
};
export type TrustCenterFileGraphUpdateMutation = {
response: TrustCenterFileGraphUpdateMutation$data;
variables: TrustCenterFileGraphUpdateMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "UpdateTrustCenterFilePayload",
"kind": "LinkedField",
"name": "updateTrustCenterFile",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "trustCenterFile",
"plural": false,
"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": "trustCenterVisibility",
"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": "TrustCenterFileGraphUpdateMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "TrustCenterFileGraphUpdateMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "9ad761d91cfe34e7fa905a3f6a4d9e37",
"id": null,
"metadata": {},
"name": "TrustCenterFileGraphUpdateMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterFileGraphUpdateMutation(\n $input: UpdateTrustCenterFileInput!\n) {\n updateTrustCenterFile(input: $input) {\n trustCenterFile {\n id\n name\n category\n trustCenterVisibility\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "7306c3f9530a7636adc0b6a0cf28b67e";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<6d55d37aa2ddfae16f8fc829840113d4>>
* @generated SignedSource<<285497dfb150c3f02c055a091769f301>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -69,6 +69,15 @@ export type TrustCenterGraphQuery$data = {
};
readonly updatedAt: any;
} | null | undefined;
readonly trustCenterFiles?: {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterFilesCardFragment">;
};
}>;
};
readonly vendors?: {
readonly edges: ReadonlyArray<{
readonly node: {
@@ -259,6 +268,57 @@ v10 = [
(v7/*: any*/)
],
v11 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v12 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
},
v13 = {
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
}
],
"storageKey": null
},
v14 = {
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
},
v15 = {
"alias": null,
"args": (v10/*: any*/),
"concreteType": "SlackConnectionConnection",
@@ -308,12 +368,19 @@ v11 = {
],
"storageKey": "slackConnections(first:100)"
},
v12 = {
v16 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "trustCenterVisibility",
"storageKey": null
},
v17 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
};
return {
"fragment": {
@@ -454,7 +521,50 @@ return {
],
"storageKey": "vendors(first:100)"
},
(v11/*: any*/)
{
"alias": "trustCenterFiles",
"args": null,
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "__TrustCenterPage_trustCenterFiles_connection",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterFilesCardFragment"
},
(v11/*: any*/)
],
"storageKey": null
},
(v12/*: any*/)
],
"storageKey": null
},
(v13/*: any*/),
(v14/*: any*/)
],
"storageKey": null
},
(v15/*: any*/)
],
"type": "Organization",
"abstractKey": null
@@ -480,13 +590,7 @@ return {
"name": "node",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
(v11/*: any*/),
(v2/*: any*/),
{
"kind": "InlineFragment",
@@ -534,7 +638,7 @@ return {
"name": "documentType",
"storageKey": null
},
(v12/*: any*/),
(v16/*: any*/),
{
"alias": null,
"args": [
@@ -651,7 +755,7 @@ return {
"name": "state",
"storageKey": null
},
(v12/*: any*/),
(v16/*: any*/),
(v5/*: any*/)
],
"storageKey": null
@@ -688,13 +792,7 @@ return {
"selections": [
(v2/*: any*/),
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
(v17/*: any*/),
(v8/*: any*/),
{
"alias": null,
@@ -713,7 +811,66 @@ return {
],
"storageKey": "vendors(first:100)"
},
(v11/*: any*/)
{
"alias": null,
"args": (v10/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/),
(v17/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fileUrl",
"storageKey": null
},
(v16/*: any*/),
(v5/*: any*/),
(v6/*: any*/),
(v11/*: any*/)
],
"storageKey": null
},
(v12/*: any*/)
],
"storageKey": null
},
(v13/*: any*/),
(v14/*: any*/)
],
"storageKey": "trustCenterFiles(first:100)"
},
{
"alias": null,
"args": (v10/*: any*/),
"filters": null,
"handle": "connection",
"key": "TrustCenterPage_trustCenterFiles",
"kind": "LinkedHandle",
"name": "trustCenterFiles"
},
(v15/*: any*/)
],
"type": "Organization",
"abstractKey": null
@@ -724,16 +881,28 @@ return {
]
},
"params": {
"cacheID": "06cd2015e9fc2e65d35ae3153e587c58",
"cacheID": "45a68d6b8fc3128a695529daa40eba3a",
"id": null,
"metadata": {},
"metadata": {
"connection": [
{
"count": null,
"cursor": null,
"direction": "forward",
"path": [
"organization",
"trustCenterFiles"
]
}
]
},
"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 customDomain {\n id\n domain\n }\n trustCenter {\n id\n active\n ndaFileName\n ndaFileUrl\n createdAt\n updatedAt\n references(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n createdAt\n updatedAt\n }\n }\n }\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 slackConnections(first: 100) {\n edges {\n node {\n id\n channel\n channelId\n createdAt\n updatedAt\n }\n }\n }\n }\n id\n }\n}\n\nfragment TrustCenterAuditsCardFragment on Audit {\n id\n name\n framework {\n name\n id\n }\n validFrom\n validUntil\n state\n trustCenterVisibility\n createdAt\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n trustCenterVisibility\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"
"text": "query TrustCenterGraphQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n name\n customDomain {\n id\n domain\n }\n trustCenter {\n id\n active\n ndaFileName\n ndaFileUrl\n createdAt\n updatedAt\n references(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n createdAt\n updatedAt\n }\n }\n }\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 trustCenterFiles(first: 100) {\n edges {\n node {\n id\n ...TrustCenterFilesCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n slackConnections(first: 100) {\n edges {\n node {\n id\n channel\n channelId\n createdAt\n updatedAt\n }\n }\n }\n }\n id\n }\n}\n\nfragment TrustCenterAuditsCardFragment on Audit {\n id\n name\n framework {\n name\n id\n }\n validFrom\n validUntil\n state\n trustCenterVisibility\n createdAt\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n trustCenterVisibility\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment TrustCenterFilesCardFragment on TrustCenterFile {\n id\n name\n category\n fileUrl\n trustCenterVisibility\n createdAt\n updatedAt\n}\n\nfragment TrustCenterVendorsCardFragment on Vendor {\n id\n name\n category\n description\n showOnTrustCenter\n createdAt\n}\n"
}
};
})();
(node as any).hash = "7ef9a5adc70dff604a149ea156e52edc";
(node as any).hash = "1ee50612da47b187cb55b2e228ba5945";
export default node;

View File

@@ -1,4 +1,5 @@
import {
Badge,
Button,
Card,
Checkbox,
@@ -31,6 +32,7 @@ import {
updateTrustCenterAccessMutation,
deleteTrustCenterAccessMutation
} from "/hooks/graph/TrustCenterAccessGraph";
import type { TrustCenterAccessGraph_accesses$data } from "/hooks/graph/__generated__/TrustCenterAccessGraph_accesses.graphql";
import { useFormWithSchema } from "/hooks/useFormWithSchema";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
@@ -76,6 +78,10 @@ export default function TrustCenterAccessTab() {
const [selectedDocumentAccesses, setSelectedDocumentAccesses] = useState<Set<string>>(new Set());
const [pendingEditEmail, setPendingEditEmail] = useState<string | null>(null);
const formattedDocumentAccesses = editingAccess?.documentAccesses
?.map((docAccess) => getDocumentAccessInfo(docAccess, __))
?.filter((info) => info !== null) ?? [];
const inviteForm = useFormWithSchema(inviteSchema, {
defaultValues: { name: "", email: "" },
});
@@ -102,8 +108,48 @@ export default function TrustCenterAccessTab() {
};
};
} | null;
trustCenterFile?: {
id: string;
name: string;
category: string;
} | null;
};
function getDocumentAccessInfo(
docAccess: DocumentAccessType,
__: (key: string) => string
) {
if (!!docAccess.document) {
return {
variant: "info" as const,
name: docAccess.document?.title,
type: __("Document"),
category: docAccess.document?.documentType,
id: docAccess.document?.id,
};
}
if (!!docAccess.report) {
return {
variant: "success" as const,
name: docAccess.report?.filename,
type: __("Report"),
category: docAccess.report?.audit?.framework?.name,
id: docAccess.report?.id,
};
}
if (!!docAccess.trustCenterFile) {
return {
variant: "highlight" as const,
name: docAccess.trustCenterFile?.name,
type: __("File"),
category: docAccess.trustCenterFile?.category,
id: docAccess.trustCenterFile?.id,
};
}
return null;
}
type AccessType = {
id: string;
email: string;
@@ -116,18 +162,22 @@ export default function TrustCenterAccessTab() {
const { data: trustCenterData, loadMore, hasNext, isLoadingNext } = useTrustCenterAccesses(organization.trustCenter?.id || "");
const accesses: AccessType[] = trustCenterData?.node?.accesses?.edges?.map((edge: any) => ({
type AccessEdge = NonNullable<NonNullable<TrustCenterAccessGraph_accesses$data['accesses']>['edges']>[number];
type DocumentAccessEdge = NonNullable<NonNullable<NonNullable<AccessEdge>['node']['documentAccesses']>['edges']>[number];
const accesses: AccessType[] = trustCenterData?.node?.accesses?.edges?.map((edge: AccessEdge) => ({
id: edge.node.id,
email: edge.node.email,
name: edge.node.name,
active: edge.node.active,
hasAcceptedNonDisclosureAgreement: edge.node.hasAcceptedNonDisclosureAgreement,
createdAt: edge.node.createdAt,
documentAccesses: edge.node.documentAccesses?.edges?.map((docEdge: any) => ({
documentAccesses: edge.node.documentAccesses?.edges?.map((docEdge: DocumentAccessEdge) => ({
id: docEdge.node.id,
active: docEdge.node.active,
document: docEdge.node.document,
report: docEdge.node.report
report: docEdge.node.report,
trustCenterFile: docEdge.node.trustCenterFile
})) ?? []
})) ?? [];
@@ -173,7 +223,7 @@ export default function TrustCenterAccessTab() {
const getActiveDocumentIds = useCallback((access: AccessType) => {
return access.documentAccesses
.filter(docAccess => docAccess.active)
.map(docAccess => docAccess.document?.id || docAccess.report?.id)
.map(docAccess => docAccess.document?.id || docAccess.report?.id || docAccess.trustCenterFile?.id)
.filter((id): id is string => id !== undefined);
}, []);
@@ -212,19 +262,21 @@ export default function TrustCenterAccessTab() {
const handleUpdateName = editForm.handleSubmit(async (data) => {
if (!editingAccess) return;
const { documentIds, reportIds } = editingAccess.documentAccesses.reduce(
const { documentIds, reportIds, trustCenterFileIds } = editingAccess.documentAccesses.reduce(
(acc, docAccess) => {
const id = docAccess.document?.id || docAccess.report?.id;
const id = docAccess.document?.id || docAccess.report?.id || docAccess.trustCenterFile?.id;
if (id && selectedDocumentAccesses.has(id)) {
if (docAccess.document?.id) {
acc.documentIds.push(docAccess.document.id);
} else if (docAccess.report?.id) {
acc.reportIds.push(docAccess.report.id);
} else if (docAccess.trustCenterFile?.id) {
acc.trustCenterFileIds.push(docAccess.trustCenterFile.id);
}
}
return acc;
},
{ documentIds: [] as string[], reportIds: [] as string[] }
{ documentIds: [] as string[], reportIds: [] as string[], trustCenterFileIds: [] as string[] }
);
await updateInvitation({
@@ -235,6 +287,7 @@ export default function TrustCenterAccessTab() {
active: data.active,
documentIds,
reportIds,
trustCenterFileIds,
},
},
onSuccess: () => {
@@ -431,7 +484,7 @@ export default function TrustCenterAccessTab() {
</div>
</div>
{editingAccess && editingAccess.documentAccesses.length > 0 && (
{formattedDocumentAccesses.length > 0 && (
<div>
<h4 className="font-medium text-txt-primary mb-4">
{__("Document Access Permissions")}
@@ -451,39 +504,20 @@ export default function TrustCenterAccessTab() {
</Tr>
</Thead>
<Tbody>
{editingAccess.documentAccesses.map((docAccess) => {
const getDocumentInfo = () => {
const isDocument = !!docAccess.document;
return {
isDocument,
name: docAccess.document?.title || docAccess.report?.filename || __("Unknown Item"),
type: isDocument ? __("Document") : __("Report"),
category: isDocument
? docAccess.document?.documentType
: docAccess.report?.audit?.framework?.name || __("Compliance Report"),
id: docAccess.document?.id || docAccess.report?.id || ''
};
};
const { isDocument, name, type, category, id } = getDocumentInfo();
{formattedDocumentAccesses.map((info) => {
const { variant, name, type, category, id } = info;
return (
<Tr key={docAccess.id}>
<Tr key={id}>
<Td>
<div className="font-medium text-txt-primary">
{name}
</div>
</Td>
<Td>
<div className="flex items-center space-x-2">
<div className={`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${
isDocument
? 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200'
: 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200'
}`}>
{type}
</div>
</div>
<Badge variant={variant}>
{type}
</Badge>
</Td>
<Td>
<div className="text-txt-secondary">

View File

@@ -0,0 +1,331 @@
import {
Button,
Card,
Dialog,
DialogContent,
DialogFooter,
Field,
Spinner,
useDialogRef,
Dropzone,
Option,
Badge,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import { useOutletContext } from "react-router";
import { useState, useCallback } from "react";
import z from "zod";
import { getTrustCenterVisibilityOptions } from "@probo/helpers";
import {
useCreateTrustCenterFileMutation,
useUpdateTrustCenterFileMutation,
useDeleteTrustCenterFileMutation,
} from "/hooks/graph/TrustCenterFileGraph";
import { useFormWithSchema } from "/hooks/useFormWithSchema";
import { TrustCenterFilesCard } from "/components/trustCenter/TrustCenterFilesCard";
import type { TrustCenterFilesCardFragment$key } from "/components/trustCenter/__generated__/TrustCenterFilesCardFragment.graphql";
type ContextType = {
organization: {
id: string;
trustCenterFiles?: {
__id?: string;
edges: Array<{
node: TrustCenterFilesCardFragment$key;
}>;
};
};
};
export default function TrustCenterFilesTab() {
const { __ } = useTranslate();
const { organization } = useOutletContext<ContextType>();
const createSchema = z.object({
name: z.string().min(1, __("Name is required")),
category: z.string().min(1, __("Category is required")),
trustCenterVisibility: z.enum(["NONE", "PRIVATE", "PUBLIC"]),
});
const editSchema = z.object({
name: z.string().min(1, __("Name is required")),
category: z.string().min(1, __("Category is required")),
});
const [createFile, isCreating] = useCreateTrustCenterFileMutation();
const [updateFile, isUpdating] = useUpdateTrustCenterFileMutation();
const [deleteFile, isDeleting] = useDeleteTrustCenterFileMutation();
const createDialogRef = useDialogRef();
const editDialogRef = useDialogRef();
const deleteDialogRef = useDialogRef();
const [editingFile, setEditingFile] = useState<{ id: string; name: string; category: string } | null>(null);
const [deletingFileId, setDeletingFileId] = useState<string | null>(null);
const [uploadedFile, setUploadedFile] = useState<File | null>(null);
const [isUploading, setIsUploading] = useState(false);
const createForm = useFormWithSchema(createSchema, {
defaultValues: { name: "", category: "", trustCenterVisibility: "NONE" },
});
const editForm = useFormWithSchema(editSchema, {
defaultValues: { name: "", category: "" },
});
const files = organization.trustCenterFiles?.edges?.map((edge) => edge.node) || [];
const handleFileUpload = useCallback((acceptedFiles: File[]) => {
if (acceptedFiles.length > 0) {
const file = acceptedFiles[0];
if (file.type !== "application/pdf") {
createForm.setError("root", {
type: "manual",
message: __("Only PDF files are allowed"),
});
return;
}
setUploadedFile(file);
createForm.clearErrors("root");
if (!createForm.getValues().name) {
createForm.setValue("name", file.name.replace(/\.[^/.]+$/, ""));
}
}
}, [createForm, __]);
const handleCreate = createForm.handleSubmit(async (data) => {
if (!uploadedFile) {
return;
}
setIsUploading(true);
const connectionId = organization.trustCenterFiles?.__id;
try {
await createFile({
variables: {
input: {
organizationId: organization.id,
name: data.name,
category: data.category,
trustCenterVisibility: data.trustCenterVisibility,
file: null,
},
connections: connectionId ? [connectionId] : [],
},
uploadables: {
"input.file": uploadedFile,
},
onSuccess: () => {
createDialogRef.current?.close();
createForm.reset();
setUploadedFile(null);
},
});
} finally {
setIsUploading(false);
}
});
const handleEdit = useCallback((file: { id: string; name: string; category: string }) => {
setEditingFile(file);
editForm.reset({ name: file.name, category: file.category });
editDialogRef.current?.open();
}, [editDialogRef, editForm]);
const handleUpdate = editForm.handleSubmit(async (data) => {
if (!editingFile) {
return;
}
await updateFile({
variables: {
input: {
id: editingFile.id,
name: data.name,
category: data.category,
},
},
onSuccess: () => {
editDialogRef.current?.close();
setEditingFile(null);
},
});
});
const handleDeleteClick = useCallback((id: string) => {
setDeletingFileId(id);
deleteDialogRef.current?.open();
}, [deleteDialogRef]);
const handleDeleteConfirm = useCallback(async () => {
if (!deletingFileId) {
return;
}
const connectionId = organization.trustCenterFiles?.__id;
await deleteFile({
variables: {
input: { id: deletingFileId },
connections: connectionId ? [connectionId] : [],
},
onSuccess: () => {
deleteDialogRef.current?.close();
setDeletingFileId(null);
},
});
}, [deletingFileId, deleteFile, deleteDialogRef, organization.trustCenterFiles?.__id]);
const handleChangeVisibility = useCallback((params: {
variables: {
input: {
id: string;
trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC";
};
};
}) => {
updateFile(params);
}, [updateFile]);
return (
<div className="space-y-4">
<div className="flex items-center justify-between">
<div>
<h3 className="text-base font-medium">{__("Files")}</h3>
<p className="text-sm text-txt-tertiary">
{__("Upload and manage files for your trust center")}
</p>
</div>
<Button onClick={() => createDialogRef.current?.open()}>
{__("Add File")}
</Button>
</div>
{(isUpdating || isDeleting) && (
<div className="flex items-center justify-center">
<Spinner />
</div>
)}
<Card padded>
<TrustCenterFilesCard
files={files}
params={{}}
disabled={isUpdating || isDeleting}
onChangeVisibility={handleChangeVisibility}
onEdit={handleEdit}
onDelete={handleDeleteClick}
variant="table"
/>
</Card>
<Dialog ref={createDialogRef} title={__("Add File")}>
<form onSubmit={handleCreate}>
<DialogContent padded className="space-y-4">
<Dropzone
description={__("Upload PDF file (max 10MB)")}
isUploading={isUploading}
onDrop={handleFileUpload}
maxSize={10}
accept={{ "application/pdf": [".pdf"] }}
/>
{uploadedFile && (
<div className="text-sm text-txt-secondary">
{__("Selected file")}: {uploadedFile.name}
</div>
)}
{createForm.formState.errors.root && (
<p className="text-sm text-txt-danger">
{createForm.formState.errors.root.message}
</p>
)}
<Field
label={__("Name")}
type="text"
{...createForm.register("name")}
error={createForm.formState.errors.name?.message}
/>
<Field
label={__("Category")}
type="text"
{...createForm.register("category")}
error={createForm.formState.errors.category?.message}
/>
<Field
label={__("Visibility")}
type="select"
value={createForm.watch("trustCenterVisibility")}
onValueChange={(value) => createForm.setValue("trustCenterVisibility", value as "NONE" | "PRIVATE" | "PUBLIC")}
error={createForm.formState.errors.trustCenterVisibility?.message}
>
{getTrustCenterVisibilityOptions(__).map((option) => (
<Option key={option.value} value={option.value}>
<div className="flex items-center justify-between w-full">
<Badge variant={option.variant}>
{option.label}
</Badge>
</div>
</Option>
))}
</Field>
</DialogContent>
<DialogFooter>
<Button
type="submit"
disabled={isCreating || isUploading || !uploadedFile}
>
{(isCreating || isUploading) && <Spinner />}
{__("Add File")}
</Button>
</DialogFooter>
</form>
</Dialog>
<Dialog ref={editDialogRef} title={__("Edit File")}>
<form onSubmit={handleUpdate}>
<DialogContent padded className="space-y-4">
<Field
label={__("Name")}
type="text"
{...editForm.register("name")}
error={editForm.formState.errors.name?.message}
/>
<Field
label={__("Category")}
type="text"
{...editForm.register("category")}
error={editForm.formState.errors.category?.message}
/>
</DialogContent>
<DialogFooter>
<Button
type="submit"
disabled={isUpdating}
>
{isUpdating && <Spinner />}
{__("Save")}
</Button>
</DialogFooter>
</form>
</Dialog>
<Dialog ref={deleteDialogRef} title={__("Delete File")}>
<DialogContent padded>
<p>{__("Are you sure you want to delete this file? This action cannot be undone.")}</p>
</DialogContent>
<DialogFooter>
<Button
variant="danger"
onClick={handleDeleteConfirm}
disabled={isDeleting}
>
{isDeleting && <Spinner />}
{__("Delete")}
</Button>
</DialogFooter>
</Dialog>
</div>
);
}

View File

@@ -287,6 +287,9 @@ export default function TrustCenterPage({ queryRef }: Props) {
<TabLink to={`/organizations/${organizationId}/trust-center/documents`}>
{__("Documents")}
</TabLink>
<TabLink to={`/organizations/${organizationId}/trust-center/files`}>
{__("Files")}
</TabLink>
<TabLink to={`/organizations/${organizationId}/trust-center/access`}>
{__("Access")}
</TabLink>

View File

@@ -44,6 +44,13 @@ export const trustCenterRoutes = [
() => import("/pages/organizations/trustCenter/TrustCenterDocumentsTab")
),
},
{
path: "files",
fallback: LinkCardSkeleton,
Component: lazy(
() => import("/pages/organizations/trustCenter/TrustCenterFilesTab")
),
},
{
path: "access",
fallback: LinkCardSkeleton,

View File

@@ -21,6 +21,7 @@ import { useIsAuthenticated } from "/hooks/useIsAuthenticated.ts";
type Props = PropsWithChildren<{
documentId?: string;
reportId?: string;
trustCenterFileId?: string;
onSuccess?: () => void;
}>;
@@ -33,6 +34,7 @@ export function RequestAccessDialog({
children,
documentId,
reportId,
trustCenterFileId,
onSuccess,
}: Props) {
const trustCenter = useTrustCenter();
@@ -46,7 +48,7 @@ export function RequestAccessDialog({
});
const isAuthenticated = useIsAuthenticated();
const dialogRef = useDialogRef();
const [commitMutation, isMutating] = useMutation({ documentId, reportId });
const [commitMutation, isMutating] = useMutation({ documentId, reportId, trustCenterFileId });
const submitCallback = (data: z.infer<typeof schema> | null) => {
commitMutation(data)
@@ -155,13 +157,26 @@ const requestReportAccessMutation = graphql`
}
`;
const requestTrustCenterFileAccessMutation = graphql`
mutation RequestAccessDialogTrustCenterFileMutation(
$input: RequestTrustCenterFileAccessInput!
) {
requestTrustCenterFileAccess(input: $input) {
trustCenterAccess {
id
}
}
}
`;
/**
* Use the correct mutation using the shape
*/
function useMutation({
documentId,
reportId,
}: Pick<Props, "documentId" | "reportId">): [
trustCenterFileId,
}: Pick<Props, "documentId" | "reportId" | "trustCenterFileId">): [
(data: z.infer<typeof schema> | null) => Promise<unknown>,
boolean,
] {
@@ -173,8 +188,25 @@ function useMutation({
useMutationWithToasts(requestDocumentAccessMutation);
const [commitRequestReportAccess, isRequestingReportAccess] =
useMutationWithToasts(requestReportAccessMutation);
const [commitRequestTrustCenterFileAccess, isRequestingTrustCenterFileAccess] =
useMutationWithToasts(requestTrustCenterFileAccessMutation);
if (reportId) {
if (trustCenterFileId) {
return [
(data) => {
return commitRequestTrustCenterFileAccess({
variables: {
input: {
trustCenterId: trustCenter.id,
trustCenterFileId: trustCenterFileId,
...data,
},
},
});
},
isRequestingTrustCenterFileAccess,
];
} else if (reportId) {
return [
(data) => {
return commitRequestReportAccess({

View File

@@ -0,0 +1,88 @@
import { graphql } from "relay-runtime";
import type { TrustCenterFileRowFragment$key } from "./__generated__/TrustCenterFileRowFragment.graphql";
import { useFragment } from "react-relay";
import {
Button,
IconArrowInbox,
IconLock,
IconPageTextLine,
Spinner,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import type { TrustCenterFileRowDownloadMutation } from "./__generated__/TrustCenterFileRowDownloadMutation.graphql";
import { useMutationWithToasts } from "/hooks/useMutationWithToast";
import { downloadFile } from "@probo/helpers";
import { RequestAccessDialog } from "/components/RequestAccessDialog.tsx";
import { useState } from "react";
const downloadMutation = graphql`
mutation TrustCenterFileRowDownloadMutation($input: ExportTrustCenterFileInput!) {
exportTrustCenterFile(input: $input) {
data
}
}
`;
const trustCenterFileRowFragment = graphql`
fragment TrustCenterFileRowFragment on TrustCenterFile {
id
name
isUserAuthorized
hasUserRequestedAccess
}
`;
export function TrustCenterFileRow(props: { file: TrustCenterFileRowFragment$key }) {
const file = useFragment(trustCenterFileRowFragment, props.file);
const { __ } = useTranslate();
const [commitDownload, downloading] =
useMutationWithToasts<TrustCenterFileRowDownloadMutation>(downloadMutation);
const handleDownload = () => {
commitDownload({
variables: {
input: {
trustCenterFileId: file.id,
},
},
onSuccess(response) {
downloadFile(response.exportTrustCenterFile.data, file.name);
},
});
};
const [hasRequested, setHasRequested] = useState(
file.hasUserRequestedAccess,
);
return (
<div className="text-sm border-1 border-border-solid -mt-[1px] flex gap-3 flex-col md:flex-row md:justify-between px-6 py-3">
<div className="flex items-center gap-2">
<IconPageTextLine size={16} className=" flex-none text-txt-tertiary" />
{file.name}
</div>
{file.isUserAuthorized ? (
<Button
className="w-full md:w-max"
variant="secondary"
disabled={downloading}
icon={downloading ? Spinner : IconArrowInbox}
onClick={handleDownload}
>
{__("Download")}
</Button>
) : (
<RequestAccessDialog
trustCenterFileId={file.id}
onSuccess={() => setHasRequested(true)}
>
<Button
disabled={hasRequested}
className="w-full md:w-max"
variant="secondary"
icon={IconLock}
>
{hasRequested ? __("Access requested") : __("Request access")}
</Button>
</RequestAccessDialog>
)}
</div>
);
}

View File

@@ -0,0 +1,108 @@
/**
* @generated SignedSource<<4c07d5c8e345a8e3015f512403927890>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type RequestTrustCenterFileAccessInput = {
email?: string | null | undefined;
name?: string | null | undefined;
trustCenterFileId: string;
trustCenterId: string;
};
export type RequestAccessDialogTrustCenterFileMutation$variables = {
input: RequestTrustCenterFileAccessInput;
};
export type RequestAccessDialogTrustCenterFileMutation$data = {
readonly requestTrustCenterFileAccess: {
readonly trustCenterAccess: {
readonly id: string;
};
};
};
export type RequestAccessDialogTrustCenterFileMutation = {
response: RequestAccessDialogTrustCenterFileMutation$data;
variables: RequestAccessDialogTrustCenterFileMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "RequestAccessesPayload",
"kind": "LinkedField",
"name": "requestTrustCenterFileAccess",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterAccess",
"kind": "LinkedField",
"name": "trustCenterAccess",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "RequestAccessDialogTrustCenterFileMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "RequestAccessDialogTrustCenterFileMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "73b3007ef1a45f6dc6d31be0c627e482",
"id": null,
"metadata": {},
"name": "RequestAccessDialogTrustCenterFileMutation",
"operationKind": "mutation",
"text": "mutation RequestAccessDialogTrustCenterFileMutation(\n $input: RequestTrustCenterFileAccessInput!\n) {\n requestTrustCenterFileAccess(input: $input) {\n trustCenterAccess {\n id\n }\n }\n}\n"
}
};
})();
(node as any).hash = "a97eb6c4ec94c79a293d1cc51bf18e66";
export default node;

View File

@@ -0,0 +1,92 @@
/**
* @generated SignedSource<<8d608da0bcff489887f71f6e69f1bfe3>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type ExportTrustCenterFileInput = {
trustCenterFileId: string;
};
export type TrustCenterFileRowDownloadMutation$variables = {
input: ExportTrustCenterFileInput;
};
export type TrustCenterFileRowDownloadMutation$data = {
readonly exportTrustCenterFile: {
readonly data: string;
};
};
export type TrustCenterFileRowDownloadMutation = {
response: TrustCenterFileRowDownloadMutation$data;
variables: TrustCenterFileRowDownloadMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "ExportTrustCenterFilePayload",
"kind": "LinkedField",
"name": "exportTrustCenterFile",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "data",
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterFileRowDownloadMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "TrustCenterFileRowDownloadMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "8a97b9e7ac44deea6da6e79f1d0c662f",
"id": null,
"metadata": {},
"name": "TrustCenterFileRowDownloadMutation",
"operationKind": "mutation",
"text": "mutation TrustCenterFileRowDownloadMutation(\n $input: ExportTrustCenterFileInput!\n) {\n exportTrustCenterFile(input: $input) {\n data\n }\n}\n"
}
};
})();
(node as any).hash = "e6d74e96e929cf1aa79711b8315a8b85";
export default node;

View File

@@ -0,0 +1,66 @@
/**
* @generated SignedSource<<0261adc72d21035b906b6156ea9d0b40>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type TrustCenterFileRowFragment$data = {
readonly hasUserRequestedAccess: boolean;
readonly id: string;
readonly isUserAuthorized: boolean;
readonly name: string;
readonly " $fragmentType": "TrustCenterFileRowFragment";
};
export type TrustCenterFileRowFragment$key = {
readonly " $data"?: TrustCenterFileRowFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterFileRowFragment">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "TrustCenterFileRowFragment",
"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": "isUserAuthorized",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasUserRequestedAccess",
"storageKey": null
}
],
"type": "TrustCenterFile",
"abstractKey": null
};
(node as any).hash = "4ff11c14e65566f0dfe3a77ea73903e8";
export default node;

View File

@@ -6,6 +6,7 @@ import { documentTypeLabel } from "/helpers/documents";
import { useTranslate } from "@probo/i18n";
import { Fragment } from "react";
import { DocumentRow } from "/components/DocumentRow";
import { TrustCenterFileRow } from "/components/TrustCenterFileRow";
import { Rows } from "/components/Rows.tsx";
import { RowHeader } from "/components/RowHeader.tsx";
@@ -21,9 +22,12 @@ export function DocumentsPage({ queryRef }: Props) {
);
const documents =
data.currentTrustCenter?.documents.edges.map((edge) => edge.node) ?? [];
const files =
data.currentTrustCenter?.trustCenterFiles.edges.map((edge) => edge.node) ?? [];
const documentsPerType = groupBy(documents, (document) =>
documentTypeLabel(document.documentType, __)
);
const filesPerCategory = groupBy(files, (file) => file.category);
return (
<div>
<h2 className="font-medium mb-1">{__("Documents")}</h2>
@@ -39,6 +43,14 @@ export function DocumentsPage({ queryRef }: Props) {
))}
</Fragment>
))}
{objectEntries(filesPerCategory).map(([category, files]) => (
<Fragment key={category}>
<RowHeader>{category}</RowHeader>
{files.map((file) => (
<TrustCenterFileRow key={file.id} file={file} />
))}
</Fragment>
))}
</Rows>
</div>
);

View File

@@ -18,6 +18,7 @@ import { AuditRow } from "/components/AuditRow";
import { documentTypeLabel } from "/helpers/documents";
import { Fragment } from "react";
import { DocumentRow } from "/components/DocumentRow";
import { TrustCenterFileRow } from "/components/TrustCenterFileRow";
import { VendorRow } from "/components/VendorRow";
import { RowHeader } from "/components/RowHeader.tsx";
import { Rows } from "/components/Rows.tsx";
@@ -52,6 +53,15 @@ const overviewFragment = graphql`
}
}
}
trustCenterFiles(first: 5) {
edges {
node {
id
category
...TrustCenterFileRowFragment
}
}
}
}
`;
@@ -69,6 +79,7 @@ export function OverviewPage() {
<Documents
audits={trustCenter.audits.edges}
documents={fragment.documents.edges}
files={fragment.trustCenterFiles.edges}
url={getTrustCenterUrl("documents")}
/>
<Subprocessors
@@ -82,10 +93,12 @@ export function OverviewPage() {
function Documents({
documents,
files,
audits,
url,
}: {
documents: OverviewPageFragment$data["documents"]["edges"];
files: OverviewPageFragment$data["trustCenterFiles"]["edges"];
audits: NonNullable<
TrustGraphQuery$data["trustCenterBySlug"]
>["audits"]["edges"];
@@ -96,8 +109,12 @@ function Documents({
documents.map((edge) => edge.node),
(node) => documentTypeLabel(node.documentType, __)
);
const filesPerCategory = groupBy(
files.map((edge) => edge.node),
(node) => node.category
);
const hasAudits = audits.length > 0;
const hasDocuments = hasAudits || documents.length > 0;
const hasDocuments = hasAudits || documents.length > 0 || files.length > 0;
if (!hasDocuments) {
return null;
@@ -126,6 +143,14 @@ function Documents({
))}
</Fragment>
))}
{objectEntries(filesPerCategory).map(([category, files]) => (
<Fragment key={category}>
<RowHeader>{category}</RowHeader>
{files.map((file) => (
<TrustCenterFileRow key={file.id} file={file} />
))}
</Fragment>
))}
<Link to={url} className="text-sm font-medium flex gap-2 items-center">
{__("See all documents")}
<IconChevronRight size={16} />

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<7b1972657d83c7bb17b997e287f575d8>>
* @generated SignedSource<<cde79d7c929ba1be8e0d033c90e7eeb7>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -32,6 +32,15 @@ export type OverviewPageFragment$data = {
};
}>;
};
readonly trustCenterFiles: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly category: string;
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterFileRowFragment">;
};
}>;
};
readonly vendors: {
readonly edges: ReadonlyArray<{
readonly node: {
@@ -55,7 +64,14 @@ var v0 = {
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
},
v1 = [
{
"kind": "Literal",
"name": "first",
"value": 5
}
];
return {
"argumentDefinitions": [],
"kind": "Fragment",
@@ -177,13 +193,7 @@ return {
},
{
"alias": null,
"args": [
{
"kind": "Literal",
"name": "first",
"value": 5
}
],
"args": (v1/*: any*/),
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "documents",
@@ -226,6 +236,52 @@ return {
}
],
"storageKey": "documents(first:5)"
},
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v0/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterFileRowFragment"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "trustCenterFiles(first:5)"
}
],
"type": "TrustCenter",
@@ -233,6 +289,6 @@ return {
};
})();
(node as any).hash = "0bda7993ef3be4cfe86083658fc77813";
(node as any).hash = "0f4e9ac02d068ba971bb1f5be5fdaccf";
export default node;

View File

@@ -46,6 +46,15 @@ export const trustDocumentsQuery = graphql`
}
}
}
trustCenterFiles(first: 50) {
edges {
node {
id
category
...TrustCenterFileRowFragment
}
}
}
}
}
`;
@@ -117,6 +126,15 @@ export const currentTrustDocumentsQuery = graphql`
}
}
}
trustCenterFiles(first: 50) {
edges {
node {
id
category
...TrustCenterFileRowFragment
}
}
}
}
}
`;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<091d468e321f2cd6cdead063c35c6a45>>
* @generated SignedSource<<dabe16493c003a98ed8fd555efc85ddc>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -27,6 +27,15 @@ export type TrustGraphCurrentDocumentsQuery$data = {
readonly organization: {
readonly name: string;
};
readonly trustCenterFiles: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly category: string;
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterFileRowFragment">;
};
}>;
};
} | null | undefined;
};
export type TrustGraphCurrentDocumentsQuery = {
@@ -62,6 +71,27 @@ v3 = {
"kind": "ScalarField",
"name": "documentType",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
v5 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "isUserAuthorized",
"storageKey": null
},
v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasUserRequestedAccess",
"storageKey": null
};
return {
"fragment": {
@@ -130,6 +160,46 @@ return {
}
],
"storageKey": "documents(first:50)"
},
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v0/*: any*/),
(v4/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterFileRowFragment"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "trustCenterFiles(first:50)"
}
],
"storageKey": null
@@ -199,20 +269,8 @@ return {
"name": "title",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "isUserAuthorized",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasUserRequestedAccess",
"storageKey": null
}
(v5/*: any*/),
(v6/*: any*/)
],
"storageKey": null
}
@@ -221,6 +279,44 @@ return {
}
],
"storageKey": "documents(first:50)"
},
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v0/*: any*/),
(v4/*: any*/),
(v1/*: any*/),
(v5/*: any*/),
(v6/*: any*/)
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "trustCenterFiles(first:50)"
}
],
"storageKey": null
@@ -228,16 +324,16 @@ return {
]
},
"params": {
"cacheID": "9e99faf40ba87ee06df5ddd64431586e",
"cacheID": "c9c4cb18da98c40646fbbe21c2c5b46f",
"id": null,
"metadata": {},
"name": "TrustGraphCurrentDocumentsQuery",
"operationKind": "query",
"text": "query TrustGraphCurrentDocumentsQuery {\n currentTrustCenter {\n id\n organization {\n name\n id\n }\n documents(first: 50) {\n edges {\n node {\n id\n documentType\n ...DocumentRowFragment\n }\n }\n }\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n hasUserRequestedAccess\n}\n"
"text": "query TrustGraphCurrentDocumentsQuery {\n currentTrustCenter {\n id\n organization {\n name\n id\n }\n documents(first: 50) {\n edges {\n node {\n id\n documentType\n ...DocumentRowFragment\n }\n }\n }\n trustCenterFiles(first: 50) {\n edges {\n node {\n id\n category\n ...TrustCenterFileRowFragment\n }\n }\n }\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n hasUserRequestedAccess\n}\n\nfragment TrustCenterFileRowFragment on TrustCenterFile {\n id\n name\n isUserAuthorized\n hasUserRequestedAccess\n}\n"
}
};
})();
(node as any).hash = "73636da5c06a16813a57b92f30ab93d2";
(node as any).hash = "0900835ad8e59a40a2907fb787b936ef";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<fe440b5c7a8a8ed54723161632320857>>
* @generated SignedSource<<fe9ca4e5a2ddb60ea7a7f353d431d18c>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -136,13 +136,27 @@ v12 = [
}
],
v13 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
v14 = [
{
"kind": "Literal",
"name": "first",
"value": 5
}
],
v15 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "isUserAuthorized",
"storageKey": null
},
v14 = {
v16 = {
"alias": null,
"args": null,
"kind": "ScalarField",
@@ -358,13 +372,7 @@ return {
"storageKey": null
},
(v6/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
(v13/*: any*/),
(v8/*: any*/),
{
"alias": null,
@@ -384,13 +392,7 @@ return {
},
{
"alias": null,
"args": [
{
"kind": "Literal",
"name": "first",
"value": 5
}
],
"args": (v14/*: any*/),
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "documents",
@@ -420,8 +422,8 @@ return {
"name": "title",
"storageKey": null
},
(v13/*: any*/),
(v14/*: any*/),
(v15/*: any*/),
(v16/*: any*/),
{
"alias": null,
"args": null,
@@ -438,6 +440,44 @@ return {
],
"storageKey": "documents(first:5)"
},
{
"alias": null,
"args": (v14/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v0/*: any*/),
(v13/*: any*/),
(v6/*: any*/),
(v15/*: any*/),
(v16/*: any*/)
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "trustCenterFiles(first:5)"
},
{
"alias": null,
"args": (v12/*: any*/),
@@ -479,8 +519,8 @@ return {
"name": "filename",
"storageKey": null
},
(v13/*: any*/),
(v14/*: any*/)
(v15/*: any*/),
(v16/*: any*/)
],
"storageKey": null
},
@@ -512,12 +552,12 @@ return {
]
},
"params": {
"cacheID": "d2c9b2a457cd3840f4b23d71cd399c84",
"cacheID": "da8080ccbc08adb03fbf360f1e472f84",
"id": null,
"metadata": {},
"name": "TrustGraphCurrentQuery",
"operationKind": "query",
"text": "query TrustGraphCurrentQuery {\n currentTrustCenter {\n id\n slug\n isUserAuthenticated\n hasAcceptedNonDisclosureAgreement\n ndaFileName\n ndaFileUrl\n organization {\n name\n description\n websiteUrl\n logoUrl\n email\n headquarterAddress\n id\n }\n ...OverviewPageFragment\n audits(first: 50) {\n edges {\n node {\n id\n ...AuditRowFragment\n }\n }\n }\n }\n}\n\nfragment AuditRowFragment on Audit {\n report {\n id\n filename\n isUserAuthorized\n hasUserRequestedAccess\n }\n framework {\n id\n name\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n hasUserRequestedAccess\n}\n\nfragment OverviewPageFragment on TrustCenter {\n references(first: 14) {\n edges {\n node {\n id\n name\n logoUrl\n websiteUrl\n }\n }\n }\n vendors(first: 3) {\n edges {\n node {\n id\n countries\n ...VendorRowFragment\n }\n }\n }\n documents(first: 5) {\n edges {\n node {\n id\n ...DocumentRowFragment\n documentType\n }\n }\n }\n}\n\nfragment VendorRowFragment on Vendor {\n id\n name\n category\n websiteUrl\n privacyPolicyUrl\n countries\n}\n"
"text": "query TrustGraphCurrentQuery {\n currentTrustCenter {\n id\n slug\n isUserAuthenticated\n hasAcceptedNonDisclosureAgreement\n ndaFileName\n ndaFileUrl\n organization {\n name\n description\n websiteUrl\n logoUrl\n email\n headquarterAddress\n id\n }\n ...OverviewPageFragment\n audits(first: 50) {\n edges {\n node {\n id\n ...AuditRowFragment\n }\n }\n }\n }\n}\n\nfragment AuditRowFragment on Audit {\n report {\n id\n filename\n isUserAuthorized\n hasUserRequestedAccess\n }\n framework {\n id\n name\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n hasUserRequestedAccess\n}\n\nfragment OverviewPageFragment on TrustCenter {\n references(first: 14) {\n edges {\n node {\n id\n name\n logoUrl\n websiteUrl\n }\n }\n }\n vendors(first: 3) {\n edges {\n node {\n id\n countries\n ...VendorRowFragment\n }\n }\n }\n documents(first: 5) {\n edges {\n node {\n id\n ...DocumentRowFragment\n documentType\n }\n }\n }\n trustCenterFiles(first: 5) {\n edges {\n node {\n id\n category\n ...TrustCenterFileRowFragment\n }\n }\n }\n}\n\nfragment TrustCenterFileRowFragment on TrustCenterFile {\n id\n name\n isUserAuthorized\n hasUserRequestedAccess\n}\n\nfragment VendorRowFragment on Vendor {\n id\n name\n category\n websiteUrl\n privacyPolicyUrl\n countries\n}\n"
}
};
})();

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<922757406dbc7a2c20b502ef6dd4c0d8>>
* @generated SignedSource<<0faaebe3baf4c750825599985210137d>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -29,6 +29,15 @@ export type TrustGraphDocumentsQuery$data = {
readonly organization: {
readonly name: string;
};
readonly trustCenterFiles: {
readonly edges: ReadonlyArray<{
readonly node: {
readonly category: string;
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterFileRowFragment">;
};
}>;
};
} | null | undefined;
};
export type TrustGraphDocumentsQuery = {
@@ -78,6 +87,27 @@ v5 = {
"kind": "ScalarField",
"name": "documentType",
"storageKey": null
},
v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "isUserAuthorized",
"storageKey": null
},
v8 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasUserRequestedAccess",
"storageKey": null
};
return {
"fragment": {
@@ -146,6 +176,46 @@ return {
}
],
"storageKey": "documents(first:50)"
},
{
"alias": null,
"args": (v4/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
(v6/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "TrustCenterFileRowFragment"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "trustCenterFiles(first:50)"
}
],
"storageKey": null
@@ -215,20 +285,8 @@ return {
"name": "title",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "isUserAuthorized",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasUserRequestedAccess",
"storageKey": null
}
(v7/*: any*/),
(v8/*: any*/)
],
"storageKey": null
}
@@ -237,6 +295,44 @@ return {
}
],
"storageKey": "documents(first:50)"
},
{
"alias": null,
"args": (v4/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
(v6/*: any*/),
(v3/*: any*/),
(v7/*: any*/),
(v8/*: any*/)
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "trustCenterFiles(first:50)"
}
],
"storageKey": null
@@ -244,16 +340,16 @@ return {
]
},
"params": {
"cacheID": "8a333723782b24714393e89240704cf2",
"cacheID": "151fc8b1cf3becb2a69d87ce978fb71b",
"id": null,
"metadata": {},
"name": "TrustGraphDocumentsQuery",
"operationKind": "query",
"text": "query TrustGraphDocumentsQuery(\n $slug: String!\n) {\n trustCenterBySlug(slug: $slug) {\n id\n organization {\n name\n id\n }\n documents(first: 50) {\n edges {\n node {\n id\n documentType\n ...DocumentRowFragment\n }\n }\n }\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n hasUserRequestedAccess\n}\n"
"text": "query TrustGraphDocumentsQuery(\n $slug: String!\n) {\n trustCenterBySlug(slug: $slug) {\n id\n organization {\n name\n id\n }\n documents(first: 50) {\n edges {\n node {\n id\n documentType\n ...DocumentRowFragment\n }\n }\n }\n trustCenterFiles(first: 50) {\n edges {\n node {\n id\n category\n ...TrustCenterFileRowFragment\n }\n }\n }\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n hasUserRequestedAccess\n}\n\nfragment TrustCenterFileRowFragment on TrustCenterFile {\n id\n name\n isUserAuthorized\n hasUserRequestedAccess\n}\n"
}
};
})();
(node as any).hash = "9c56f70fca2afb316f4fd38d646ec545";
(node as any).hash = "79e21d586ec18a0977c37df27aa9bdea";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<e1f3b93147b9e72d9cfc41e8e0befd6e>>
* @generated SignedSource<<8b9ec6ee6f688ae6f6d1463104c72df4>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -152,13 +152,27 @@ v14 = [
}
],
v15 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
v16 = [
{
"kind": "Literal",
"name": "first",
"value": 5
}
],
v17 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "isUserAuthorized",
"storageKey": null
},
v16 = {
v18 = {
"alias": null,
"args": null,
"kind": "ScalarField",
@@ -374,13 +388,7 @@ return {
"storageKey": null
},
(v8/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "category",
"storageKey": null
},
(v15/*: any*/),
(v10/*: any*/),
{
"alias": null,
@@ -400,13 +408,7 @@ return {
},
{
"alias": null,
"args": [
{
"kind": "Literal",
"name": "first",
"value": 5
}
],
"args": (v16/*: any*/),
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "documents",
@@ -436,8 +438,8 @@ return {
"name": "title",
"storageKey": null
},
(v15/*: any*/),
(v16/*: any*/),
(v17/*: any*/),
(v18/*: any*/),
{
"alias": null,
"args": null,
@@ -454,6 +456,44 @@ return {
],
"storageKey": "documents(first:5)"
},
{
"alias": null,
"args": (v16/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFileEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "TrustCenterFile",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
(v15/*: any*/),
(v8/*: any*/),
(v17/*: any*/),
(v18/*: any*/)
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": "trustCenterFiles(first:5)"
},
{
"alias": null,
"args": (v14/*: any*/),
@@ -495,8 +535,8 @@ return {
"name": "filename",
"storageKey": null
},
(v15/*: any*/),
(v16/*: any*/)
(v17/*: any*/),
(v18/*: any*/)
],
"storageKey": null
},
@@ -528,12 +568,12 @@ return {
]
},
"params": {
"cacheID": "c3cb244842768ef771ea209a51a06c4a",
"cacheID": "f3ac933cf00a798d12b1a8e1fedcaee9",
"id": null,
"metadata": {},
"name": "TrustGraphQuery",
"operationKind": "query",
"text": "query TrustGraphQuery(\n $slug: String!\n) {\n trustCenterBySlug(slug: $slug) {\n id\n slug\n isUserAuthenticated\n hasAcceptedNonDisclosureAgreement\n ndaFileName\n ndaFileUrl\n organization {\n name\n description\n websiteUrl\n logoUrl\n email\n headquarterAddress\n id\n }\n ...OverviewPageFragment\n audits(first: 50) {\n edges {\n node {\n id\n ...AuditRowFragment\n }\n }\n }\n }\n}\n\nfragment AuditRowFragment on Audit {\n report {\n id\n filename\n isUserAuthorized\n hasUserRequestedAccess\n }\n framework {\n id\n name\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n hasUserRequestedAccess\n}\n\nfragment OverviewPageFragment on TrustCenter {\n references(first: 14) {\n edges {\n node {\n id\n name\n logoUrl\n websiteUrl\n }\n }\n }\n vendors(first: 3) {\n edges {\n node {\n id\n countries\n ...VendorRowFragment\n }\n }\n }\n documents(first: 5) {\n edges {\n node {\n id\n ...DocumentRowFragment\n documentType\n }\n }\n }\n}\n\nfragment VendorRowFragment on Vendor {\n id\n name\n category\n websiteUrl\n privacyPolicyUrl\n countries\n}\n"
"text": "query TrustGraphQuery(\n $slug: String!\n) {\n trustCenterBySlug(slug: $slug) {\n id\n slug\n isUserAuthenticated\n hasAcceptedNonDisclosureAgreement\n ndaFileName\n ndaFileUrl\n organization {\n name\n description\n websiteUrl\n logoUrl\n email\n headquarterAddress\n id\n }\n ...OverviewPageFragment\n audits(first: 50) {\n edges {\n node {\n id\n ...AuditRowFragment\n }\n }\n }\n }\n}\n\nfragment AuditRowFragment on Audit {\n report {\n id\n filename\n isUserAuthorized\n hasUserRequestedAccess\n }\n framework {\n id\n name\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n hasUserRequestedAccess\n}\n\nfragment OverviewPageFragment on TrustCenter {\n references(first: 14) {\n edges {\n node {\n id\n name\n logoUrl\n websiteUrl\n }\n }\n }\n vendors(first: 3) {\n edges {\n node {\n id\n countries\n ...VendorRowFragment\n }\n }\n }\n documents(first: 5) {\n edges {\n node {\n id\n ...DocumentRowFragment\n documentType\n }\n }\n }\n trustCenterFiles(first: 5) {\n edges {\n node {\n id\n category\n ...TrustCenterFileRowFragment\n }\n }\n }\n}\n\nfragment TrustCenterFileRowFragment on TrustCenterFile {\n id\n name\n isUserAuthorized\n hasUserRequestedAccess\n}\n\nfragment VendorRowFragment on Vendor {\n id\n name\n category\n websiteUrl\n privacyPolicyUrl\n countries\n}\n"
}
};
})();