Add public trust center documents
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -9,14 +9,14 @@ import {
|
||||
Tbody,
|
||||
Th,
|
||||
IconChevronDown,
|
||||
IconCheckmark1,
|
||||
IconCrossLargeX,
|
||||
Badge,
|
||||
Field,
|
||||
Option,
|
||||
} from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { useFragment } from "react-relay";
|
||||
import { useMemo, useState } from "react";
|
||||
import { sprintf, getAuditStateVariant, getAuditStateLabel, formatDate } from "@probo/helpers";
|
||||
import { useMemo, useState, useCallback, useEffect } from "react";
|
||||
import { sprintf, getAuditStateVariant, getAuditStateLabel, formatDate, getTrustCenterVisibilityOptions } from "@probo/helpers";
|
||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||
import clsx from "clsx";
|
||||
import type { TrustCenterAuditsCardFragment$key } from "./__generated__/TrustCenterAuditsCardFragment.graphql";
|
||||
@@ -31,7 +31,7 @@ const trustCenterAuditFragment = graphql`
|
||||
validFrom
|
||||
validUntil
|
||||
state
|
||||
showOnTrustCenter
|
||||
trustCenterVisibility
|
||||
createdAt
|
||||
}
|
||||
`;
|
||||
@@ -40,7 +40,7 @@ type Mutation<Params> = (p: {
|
||||
variables: {
|
||||
input: {
|
||||
id: string;
|
||||
showOnTrustCenter: boolean;
|
||||
trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC";
|
||||
} & Params;
|
||||
};
|
||||
}) => void;
|
||||
@@ -49,7 +49,7 @@ type Props<Params> = {
|
||||
audits: TrustCenterAuditsCardFragment$key[];
|
||||
params: Params;
|
||||
disabled?: boolean;
|
||||
onToggleVisibility: Mutation<Params>;
|
||||
onChangeVisibility: Mutation<Params>;
|
||||
variant?: "card" | "table";
|
||||
};
|
||||
|
||||
@@ -62,12 +62,12 @@ export function TrustCenterAuditsCard<Params>(props: Props<Params>) {
|
||||
const showMoreButton = limit !== null && props.audits.length > limit;
|
||||
const variant = props.variant ?? "table";
|
||||
|
||||
const onToggleVisibility = (auditId: string, showOnTrustCenter: boolean) => {
|
||||
props.onToggleVisibility({
|
||||
const onChangeVisibility = (auditId: string, trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC") => {
|
||||
props.onChangeVisibility({
|
||||
variables: {
|
||||
input: {
|
||||
id: auditId,
|
||||
showOnTrustCenter,
|
||||
trustCenterVisibility,
|
||||
...props.params,
|
||||
},
|
||||
},
|
||||
@@ -86,7 +86,6 @@ export function TrustCenterAuditsCard<Params>(props: Props<Params>) {
|
||||
<Th>{__("Valid Until")}</Th>
|
||||
<Th>{__("State")}</Th>
|
||||
<Th>{__("Visibility")}</Th>
|
||||
<Th></Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
@@ -101,7 +100,7 @@ export function TrustCenterAuditsCard<Params>(props: Props<Params>) {
|
||||
<AuditRow
|
||||
key={index}
|
||||
audit={audit}
|
||||
onToggleVisibility={onToggleVisibility}
|
||||
onChangeVisibility={onChangeVisibility}
|
||||
disabled={props.disabled}
|
||||
/>
|
||||
))}
|
||||
@@ -123,12 +122,30 @@ export function TrustCenterAuditsCard<Params>(props: Props<Params>) {
|
||||
|
||||
function AuditRow(props: {
|
||||
audit: TrustCenterAuditsCardFragment$key;
|
||||
onToggleVisibility: (auditId: string, showOnTrustCenter: boolean) => void;
|
||||
onChangeVisibility: (auditId: string, trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC") => void;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
const audit = useFragment(trustCenterAuditFragment, props.audit);
|
||||
const organizationId = useOrganizationId();
|
||||
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(audit.id, typedValue);
|
||||
}, [audit.id, props.onChangeVisibility]);
|
||||
|
||||
useEffect(() => {
|
||||
if (optimisticValue && audit.trustCenterVisibility === optimisticValue) {
|
||||
setOptimisticValue(null);
|
||||
}
|
||||
}, [audit.trustCenterVisibility, optimisticValue]);
|
||||
|
||||
const currentValue = optimisticValue || audit.trustCenterVisibility;
|
||||
|
||||
const visibilityOptions = getTrustCenterVisibilityOptions(__);
|
||||
|
||||
const validUntilFormatted = audit.validUntil
|
||||
? formatDate(audit.validUntil)
|
||||
@@ -148,30 +165,24 @@ function AuditRow(props: {
|
||||
{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}
|
||||
<Td noLink width={130} className="pr-0">
|
||||
<Field
|
||||
type="select"
|
||||
value={currentValue}
|
||||
onValueChange={handleValueChange}
|
||||
disabled={props.disabled}
|
||||
className="w-[105px]"
|
||||
>
|
||||
{audit.showOnTrustCenter ? __("Hide") : __("Show")}
|
||||
</Button>
|
||||
{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>
|
||||
</Tr>
|
||||
);
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
@@ -9,16 +9,17 @@ import {
|
||||
Tbody,
|
||||
Th,
|
||||
IconChevronDown,
|
||||
IconCheckmark1,
|
||||
IconCrossLargeX,
|
||||
DocumentVersionBadge,
|
||||
DocumentTypeBadge,
|
||||
Field,
|
||||
Option,
|
||||
Badge,
|
||||
} 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 { useMemo, useState, useCallback, useEffect } from "react";
|
||||
import { sprintf, getTrustCenterVisibilityOptions } from "@probo/helpers";
|
||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||
import clsx from "clsx";
|
||||
|
||||
@@ -28,7 +29,7 @@ const trustCenterDocumentFragment = graphql`
|
||||
title
|
||||
createdAt
|
||||
documentType
|
||||
showOnTrustCenter
|
||||
trustCenterVisibility
|
||||
versions(first: 1) {
|
||||
edges {
|
||||
node {
|
||||
@@ -44,7 +45,7 @@ type Mutation<Params> = (p: {
|
||||
variables: {
|
||||
input: {
|
||||
id: string;
|
||||
showOnTrustCenter: boolean;
|
||||
trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC";
|
||||
} & Params;
|
||||
};
|
||||
}) => void;
|
||||
@@ -53,7 +54,7 @@ type Props<Params> = {
|
||||
documents: TrustCenterDocumentsCardFragment$key[];
|
||||
params: Params;
|
||||
disabled?: boolean;
|
||||
onToggleVisibility: Mutation<Params>;
|
||||
onChangeVisibility: Mutation<Params>;
|
||||
variant?: "card" | "table";
|
||||
};
|
||||
|
||||
@@ -66,12 +67,12 @@ export function TrustCenterDocumentsCard<Params>(props: Props<Params>) {
|
||||
const showMoreButton = limit !== null && props.documents.length > limit;
|
||||
const variant = props.variant ?? "table";
|
||||
|
||||
const onToggleVisibility = (documentId: string, showOnTrustCenter: boolean) => {
|
||||
props.onToggleVisibility({
|
||||
const onChangeVisibility = (documentId: string, trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC") => {
|
||||
props.onChangeVisibility({
|
||||
variables: {
|
||||
input: {
|
||||
id: documentId,
|
||||
showOnTrustCenter,
|
||||
trustCenterVisibility,
|
||||
...props.params,
|
||||
},
|
||||
},
|
||||
@@ -89,7 +90,6 @@ export function TrustCenterDocumentsCard<Params>(props: Props<Params>) {
|
||||
<Th>{__("Type")}</Th>
|
||||
<Th>{__("State")}</Th>
|
||||
<Th>{__("Visibility")}</Th>
|
||||
<Th></Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
@@ -104,7 +104,7 @@ export function TrustCenterDocumentsCard<Params>(props: Props<Params>) {
|
||||
<DocumentRow
|
||||
key={index}
|
||||
document={document}
|
||||
onToggleVisibility={onToggleVisibility}
|
||||
onChangeVisibility={onChangeVisibility}
|
||||
disabled={props.disabled}
|
||||
/>
|
||||
))}
|
||||
@@ -127,12 +127,30 @@ export function TrustCenterDocumentsCard<Params>(props: Props<Params>) {
|
||||
|
||||
function DocumentRow(props: {
|
||||
document: TrustCenterDocumentsCardFragment$key;
|
||||
onToggleVisibility: (documentId: string, showOnTrustCenter: boolean) => void;
|
||||
onChangeVisibility: (documentId: string, trustCenterVisibility: "NONE" | "PRIVATE" | "PUBLIC") => void;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
const document = useFragment(trustCenterDocumentFragment, props.document);
|
||||
const organizationId = useOrganizationId();
|
||||
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(document.id, typedValue);
|
||||
}, [document.id, props.onChangeVisibility]);
|
||||
|
||||
useEffect(() => {
|
||||
if (optimisticValue && document.trustCenterVisibility === optimisticValue) {
|
||||
setOptimisticValue(null);
|
||||
}
|
||||
}, [document.trustCenterVisibility, optimisticValue]);
|
||||
|
||||
const currentValue = optimisticValue || document.trustCenterVisibility;
|
||||
|
||||
const visibilityOptions = getTrustCenterVisibilityOptions(__);
|
||||
|
||||
return (
|
||||
<Tr to={`/organizations/${organizationId}/documents/${document.id}`}>
|
||||
@@ -147,30 +165,24 @@ function DocumentRow(props: {
|
||||
<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}
|
||||
<Td noLink width={130} className="pr-0">
|
||||
<Field
|
||||
type="select"
|
||||
value={currentValue}
|
||||
onValueChange={handleValueChange}
|
||||
disabled={props.disabled}
|
||||
className="w-[105px]"
|
||||
>
|
||||
{document.showOnTrustCenter ? __("Hide") : __("Show")}
|
||||
</Button>
|
||||
{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>
|
||||
</Tr>
|
||||
);
|
||||
|
||||
@@ -137,19 +137,9 @@ function VendorRow(props: {
|
||||
</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>
|
||||
<Badge variant={vendor.showOnTrustCenter ? "success" : "danger"}>
|
||||
{vendor.showOnTrustCenter ? __("Visible") : __("None")}
|
||||
</Badge>
|
||||
</Td>
|
||||
<Td noLink width={100} className="text-end">
|
||||
<Button
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<b29f60aeb151f0b4ded9ebb02829b67f>>
|
||||
* @generated SignedSource<<155c0b8eda88507e66eb65e060ded192>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type AuditState = "COMPLETED" | "IN_PROGRESS" | "NOT_STARTED" | "OUTDATED" | "REJECTED";
|
||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type TrustCenterAuditsCardFragment$data = {
|
||||
readonly createdAt: any;
|
||||
@@ -18,8 +19,8 @@ export type TrustCenterAuditsCardFragment$data = {
|
||||
};
|
||||
readonly id: string;
|
||||
readonly name: string | null | undefined;
|
||||
readonly showOnTrustCenter: boolean;
|
||||
readonly state: AuditState;
|
||||
readonly trustCenterVisibility: TrustCenterVisibility;
|
||||
readonly validFrom: any | null | undefined;
|
||||
readonly validUntil: any | null | undefined;
|
||||
readonly " $fragmentType": "TrustCenterAuditsCardFragment";
|
||||
@@ -88,7 +89,7 @@ return {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "showOnTrustCenter",
|
||||
"name": "trustCenterVisibility",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -104,6 +105,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "1c5db1ae603a40619342702f790adfeb";
|
||||
(node as any).hash = "c0f615fcad79ad39f60b48daacabdbbd";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
/**
|
||||
* @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;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<711a0b67f3e93814ae3297a2578373c6>>
|
||||
* @generated SignedSource<<869852416d522b3851e516a543454edb>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,13 +11,14 @@
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type DocumentStatus = "DRAFT" | "PUBLISHED";
|
||||
export type DocumentType = "ISMS" | "OTHER" | "POLICY";
|
||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||
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 trustCenterVisibility: TrustCenterVisibility;
|
||||
readonly versions: {
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
@@ -73,7 +74,7 @@ return {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "showOnTrustCenter",
|
||||
"name": "trustCenterVisibility",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -129,6 +130,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "88d5e5e3a2d9f4b730428efcea644f25";
|
||||
(node as any).hash = "a90715444be8a289eae6615ce44e244d";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -8,7 +8,7 @@ export const trustCenterAuditUpdateMutation = graphql`
|
||||
updateAudit(input: $input) {
|
||||
audit {
|
||||
id
|
||||
showOnTrustCenter
|
||||
trustCenterVisibility
|
||||
...TrustCenterAuditsCardFragment
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export const updateDocumentVisibilityMutation = graphql`
|
||||
updateDocument(input: $input) {
|
||||
document {
|
||||
id
|
||||
showOnTrustCenter
|
||||
trustCenterVisibility
|
||||
...TrustCenterDocumentsCardFragment
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<a3c134dcea5981e6a45b623ec2905962>>
|
||||
* @generated SignedSource<<b6236fab1ef470add01b9d9cc7527caa>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,11 +10,13 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type AuditState = "COMPLETED" | "IN_PROGRESS" | "NOT_STARTED" | "OUTDATED" | "REJECTED";
|
||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||
export type CreateAuditInput = {
|
||||
frameworkId: string;
|
||||
name?: string | null | undefined;
|
||||
organizationId: string;
|
||||
state?: AuditState | null | undefined;
|
||||
trustCenterVisibility?: TrustCenterVisibility | null | undefined;
|
||||
validFrom?: any | null | undefined;
|
||||
validUntil?: any | null | undefined;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<4255866a0c7fe3c9c3416fe2603b5f63>>
|
||||
* @generated SignedSource<<014a8f33bc7d6674a2a93e8b3dde8edf>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,11 +10,12 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type AuditState = "COMPLETED" | "IN_PROGRESS" | "NOT_STARTED" | "OUTDATED" | "REJECTED";
|
||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||
export type UpdateAuditInput = {
|
||||
id: string;
|
||||
name?: string | null | undefined;
|
||||
showOnTrustCenter?: boolean | null | undefined;
|
||||
state?: AuditState | null | undefined;
|
||||
trustCenterVisibility?: TrustCenterVisibility | null | undefined;
|
||||
validFrom?: any | null | undefined;
|
||||
validUntil?: any | null | undefined;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<5773d0630d11596682d41b4df95716c3>>
|
||||
* @generated SignedSource<<0d25ae690e5016a27d889ed1c4a1667f>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,11 +11,12 @@
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type AuditState = "COMPLETED" | "IN_PROGRESS" | "NOT_STARTED" | "OUTDATED" | "REJECTED";
|
||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||
export type UpdateAuditInput = {
|
||||
id: string;
|
||||
name?: string | null | undefined;
|
||||
showOnTrustCenter?: boolean | null | undefined;
|
||||
state?: AuditState | null | undefined;
|
||||
trustCenterVisibility?: TrustCenterVisibility | null | undefined;
|
||||
validFrom?: any | null | undefined;
|
||||
validUntil?: any | null | undefined;
|
||||
};
|
||||
@@ -26,7 +27,7 @@ export type TrustCenterAuditGraphUpdateMutation$data = {
|
||||
readonly updateAudit: {
|
||||
readonly audit: {
|
||||
readonly id: string;
|
||||
readonly showOnTrustCenter: boolean;
|
||||
readonly trustCenterVisibility: TrustCenterVisibility;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterAuditsCardFragment">;
|
||||
};
|
||||
};
|
||||
@@ -62,7 +63,7 @@ v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "showOnTrustCenter",
|
||||
"name": "trustCenterVisibility",
|
||||
"storageKey": null
|
||||
},
|
||||
v4 = {
|
||||
@@ -187,16 +188,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "d27b79a065314a22dbcbd8216de1268b",
|
||||
"cacheID": "70742901eeb45d5e00e4e61d83b2f828",
|
||||
"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 ...TrustCenterAuditsCardFragment\n }\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 showOnTrustCenter\n createdAt\n}\n"
|
||||
"text": "mutation TrustCenterAuditGraphUpdateMutation(\n $input: UpdateAuditInput!\n) {\n updateAudit(input: $input) {\n audit {\n id\n trustCenterVisibility\n ...TrustCenterAuditsCardFragment\n }\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"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "1e92374989ecf8f439d069eb003e4e4e";
|
||||
(node as any).hash = "c958ccce67f79bb75593e9fcb31ee9d8";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<6676a9b480eeef26f00ff97963b39b86>>
|
||||
* @generated SignedSource<<1135bf3b786a26466e2763cbeecb7b5b>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -204,7 +204,7 @@ return {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "showOnTrustCenter",
|
||||
"name": "trustCenterVisibility",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -273,12 +273,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "f8e5f4d7adcf1e794bc046ef21317f89",
|
||||
"cacheID": "1df18b182ace4562ffa876b7e8073a22",
|
||||
"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"
|
||||
"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 trustCenterVisibility\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<46d46472ea11f58c00df8b8827afab98>>
|
||||
* @generated SignedSource<<64b79a80214710d6c3e4676cd63136e4>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,13 +11,14 @@
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type DocumentType = "ISMS" | "OTHER" | "POLICY";
|
||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||
export type UpdateDocumentInput = {
|
||||
content?: string | null | undefined;
|
||||
documentType?: DocumentType | null | undefined;
|
||||
id: string;
|
||||
ownerId?: string | null | undefined;
|
||||
showOnTrustCenter?: boolean | null | undefined;
|
||||
title?: string | null | undefined;
|
||||
trustCenterVisibility?: TrustCenterVisibility | null | undefined;
|
||||
};
|
||||
export type TrustCenterDocumentGraphUpdateMutation$variables = {
|
||||
input: UpdateDocumentInput;
|
||||
@@ -26,7 +27,7 @@ export type TrustCenterDocumentGraphUpdateMutation$data = {
|
||||
readonly updateDocument: {
|
||||
readonly document: {
|
||||
readonly id: string;
|
||||
readonly showOnTrustCenter: boolean;
|
||||
readonly trustCenterVisibility: TrustCenterVisibility;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterDocumentsCardFragment">;
|
||||
};
|
||||
};
|
||||
@@ -62,7 +63,7 @@ v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "showOnTrustCenter",
|
||||
"name": "trustCenterVisibility",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
@@ -206,16 +207,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "b112314d6ef35feebf49bd2f8c636b33",
|
||||
"cacheID": "04cb2a4e83386dfffce8c12eae320cfe",
|
||||
"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"
|
||||
"text": "mutation TrustCenterDocumentGraphUpdateMutation(\n $input: UpdateDocumentInput!\n) {\n updateDocument(input: $input) {\n document {\n id\n trustCenterVisibility\n ...TrustCenterDocumentsCardFragment\n }\n }\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"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "46f72a664d3edb0e5665b1ecea69e31a";
|
||||
(node as any).hash = "293896dbfec4de53d0fe30a2462f833b";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<241faf24f6f9e1ca0e5f8171e40e5cd3>>
|
||||
* @generated SignedSource<<da6b3823d7bc60f99482bce2b08b9668>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -236,7 +236,7 @@ v10 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "showOnTrustCenter",
|
||||
"name": "trustCenterVisibility",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
@@ -617,7 +617,13 @@ return {
|
||||
"storageKey": null
|
||||
},
|
||||
(v7/*: any*/),
|
||||
(v10/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "showOnTrustCenter",
|
||||
"storageKey": null
|
||||
},
|
||||
(v4/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -638,12 +644,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "d08519f604d27066ddaabb667d234552",
|
||||
"cacheID": "3aed31b283ab7aa8e5ae0549474b449f",
|
||||
"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 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 }\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 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"
|
||||
"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 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 }\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"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<aa94f8d2cc4c6a5c29de3029d5e6d2ca>>
|
||||
* @generated SignedSource<<efe95ef5290fa021d00c7f32922ae801>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,13 +10,14 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DocumentType = "ISMS" | "OTHER" | "POLICY";
|
||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||
export type UpdateDocumentInput = {
|
||||
content?: string | null | undefined;
|
||||
documentType?: DocumentType | null | undefined;
|
||||
id: string;
|
||||
ownerId?: string | null | undefined;
|
||||
showOnTrustCenter?: boolean | null | undefined;
|
||||
title?: string | null | undefined;
|
||||
trustCenterVisibility?: TrustCenterVisibility | null | undefined;
|
||||
};
|
||||
export type DocumentDetailPageUpdateMutation$variables = {
|
||||
input: UpdateDocumentInput;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<ce2f4f138b340f04b4e413ecbfff2ea1>>
|
||||
* @generated SignedSource<<7f9d3e67d06cbf2aaf21c61be65bc7ee>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,12 +11,14 @@
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type DocumentType = "ISMS" | "OTHER" | "POLICY";
|
||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||
export type CreateDocumentInput = {
|
||||
content: string;
|
||||
documentType: DocumentType;
|
||||
organizationId: string;
|
||||
ownerId: string;
|
||||
title: string;
|
||||
trustCenterVisibility?: TrustCenterVisibility | null | undefined;
|
||||
};
|
||||
export type CreateDocumentDialogMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function TrustCenterAuditsTab() {
|
||||
audits={audits}
|
||||
params={{}}
|
||||
disabled={isUpdatingAudits}
|
||||
onToggleVisibility={updateAuditVisibility}
|
||||
onChangeVisibility={updateAuditVisibility}
|
||||
variant="table"
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function TrustCenterDocumentsTab() {
|
||||
documents={documents}
|
||||
params={{}}
|
||||
disabled={isUpdatingDocuments}
|
||||
onToggleVisibility={updateDocumentVisibility}
|
||||
onChangeVisibility={updateDocumentVisibility}
|
||||
variant="table"
|
||||
/>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user