Rename portal and trust frontends
Update visitor-facing apps to Compliance Portal types, hooks, and resolvers so they match the backend GraphQL rename. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -25,14 +25,14 @@ import { graphql, useFragment } from "react-relay";
|
||||
import { InlineErrorCard } from "#/components/errors/InlineErrorCard";
|
||||
import { HomeSection } from "#/components/HomeSection/HomeSection";
|
||||
|
||||
import type { ComplianceFrameworksSection_trustCenter$key } from "./__generated__/ComplianceFrameworksSection_trustCenter.graphql";
|
||||
import type { ComplianceFrameworksSection_compliancePortal$key } from "./__generated__/ComplianceFrameworksSection_compliancePortal.graphql";
|
||||
import { ComplianceFrameworkListItem } from "./ComplianceFrameworkListItem";
|
||||
|
||||
// @throwOnFieldError makes a field error in this fragment throw at the read
|
||||
// below, where the section's ErrorBoundary contains it. See
|
||||
// contrib/claude/error-handling.md.
|
||||
const complianceFrameworksSectionFragment = graphql`
|
||||
fragment ComplianceFrameworksSection_trustCenter on TrustCenter @throwOnFieldError {
|
||||
fragment ComplianceFrameworksSection_compliancePortal on CompliancePortal @throwOnFieldError {
|
||||
complianceFrameworks(first: 8) {
|
||||
edges {
|
||||
node {
|
||||
@@ -45,13 +45,13 @@ const complianceFrameworksSectionFragment = graphql`
|
||||
`;
|
||||
|
||||
interface ComplianceFrameworksSectionProps {
|
||||
trustCenterKey: ComplianceFrameworksSection_trustCenter$key;
|
||||
compliancePortalKey: ComplianceFrameworksSection_compliancePortal$key;
|
||||
}
|
||||
|
||||
// "Compliance" section: the grid of certification frameworks the trust center
|
||||
// "Compliance" section: the grid of certification frameworks the compliance portal
|
||||
// covers. Wraps its data-reading content in a boundary so a load failure
|
||||
// degrades to an inline error instead of taking down the page.
|
||||
export function ComplianceFrameworksSection({ trustCenterKey }: ComplianceFrameworksSectionProps) {
|
||||
export function ComplianceFrameworksSection({ compliancePortalKey }: ComplianceFrameworksSectionProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
@@ -64,14 +64,14 @@ export function ComplianceFrameworksSection({ trustCenterKey }: ComplianceFramew
|
||||
</HomeSection>
|
||||
)}
|
||||
>
|
||||
<ComplianceFrameworksSectionContent trustCenterKey={trustCenterKey} />
|
||||
<ComplianceFrameworksSectionContent compliancePortalKey={compliancePortalKey} />
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
function ComplianceFrameworksSectionContent({ trustCenterKey }: ComplianceFrameworksSectionProps) {
|
||||
function ComplianceFrameworksSectionContent({ compliancePortalKey }: ComplianceFrameworksSectionProps) {
|
||||
const { t } = useTranslation();
|
||||
const data = useFragment(complianceFrameworksSectionFragment, trustCenterKey);
|
||||
const data = useFragment(complianceFrameworksSectionFragment, compliancePortalKey);
|
||||
const frameworks = data.complianceFrameworks.edges.map(edge => edge.node);
|
||||
|
||||
if (frameworks.length === 0) {
|
||||
|
||||
@@ -24,29 +24,29 @@ import { graphql, useFragment } from "react-relay";
|
||||
|
||||
import { externalHref, hostnameOf } from "#/lib/url/hostname";
|
||||
|
||||
import type { TrustCenterContactInfo_trustCenter$key } from "./__generated__/TrustCenterContactInfo_trustCenter.graphql";
|
||||
import type { CompliancePortalContactInfo_compliancePortal$key } from "./__generated__/CompliancePortalContactInfo_compliancePortal.graphql";
|
||||
import { organizationContactInfo } from "./variants";
|
||||
|
||||
const trustCenterContactInfoFragment = graphql`
|
||||
fragment TrustCenterContactInfo_trustCenter on TrustCenter {
|
||||
const compliancePortalContactInfoFragment = graphql`
|
||||
fragment CompliancePortalContactInfo_compliancePortal on CompliancePortal {
|
||||
websiteUrl
|
||||
email
|
||||
headquarterAddress
|
||||
}
|
||||
`;
|
||||
|
||||
interface TrustCenterContactInfoProps {
|
||||
trustCenterKey: TrustCenterContactInfo_trustCenter$key;
|
||||
interface CompliancePortalContactInfoProps {
|
||||
compliancePortalKey: CompliancePortalContactInfo_compliancePortal$key;
|
||||
}
|
||||
|
||||
// Trust center contact details (website, email, HQ) rendered as an icon + label
|
||||
// row. Owns its fragment so it can be reused wherever the trust center is in scope.
|
||||
export function TrustCenterContactInfo({ trustCenterKey }: TrustCenterContactInfoProps) {
|
||||
const trustCenter = useFragment(trustCenterContactInfoFragment, trustCenterKey);
|
||||
// Compliance portal contact details (website, email, HQ) rendered as an icon +
|
||||
// label row. Owns its fragment so it can be reused wherever the portal is in scope.
|
||||
export function CompliancePortalContactInfo({ compliancePortalKey }: CompliancePortalContactInfoProps) {
|
||||
const compliancePortal = useFragment(compliancePortalContactInfoFragment, compliancePortalKey);
|
||||
|
||||
const hasWebsite = trustCenter.websiteUrl != null && trustCenter.websiteUrl !== "";
|
||||
const hasEmail = trustCenter.email != null && trustCenter.email !== "";
|
||||
const hasAddress = trustCenter.headquarterAddress != null && trustCenter.headquarterAddress !== "";
|
||||
const hasWebsite = compliancePortal.websiteUrl != null && compliancePortal.websiteUrl !== "";
|
||||
const hasEmail = compliancePortal.email != null && compliancePortal.email !== "";
|
||||
const hasAddress = compliancePortal.headquarterAddress != null && compliancePortal.headquarterAddress !== "";
|
||||
|
||||
// Nothing to show — render no row (and therefore no divider) at all.
|
||||
if (!hasWebsite && !hasEmail && !hasAddress) {
|
||||
@@ -60,21 +60,21 @@ export function TrustCenterContactInfo({ trustCenterKey }: TrustCenterContactInf
|
||||
{hasWebsite && (
|
||||
<a
|
||||
className={link()}
|
||||
href={externalHref(trustCenter.websiteUrl)}
|
||||
href={externalHref(compliancePortal.websiteUrl)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<GlobeSimpleIcon />
|
||||
<Text size={2} color="neutral">
|
||||
{hostnameOf(trustCenter.websiteUrl)}
|
||||
{hostnameOf(compliancePortal.websiteUrl)}
|
||||
</Text>
|
||||
</a>
|
||||
)}
|
||||
{hasEmail && (
|
||||
<a className={link()} href={`mailto:${trustCenter.email}`}>
|
||||
<a className={link()} href={`mailto:${compliancePortal.email}`}>
|
||||
<EnvelopeIcon />
|
||||
<Text size={2} color="neutral">
|
||||
{trustCenter.email}
|
||||
{compliancePortal.email}
|
||||
</Text>
|
||||
</a>
|
||||
)}
|
||||
@@ -82,7 +82,7 @@ export function TrustCenterContactInfo({ trustCenterKey }: TrustCenterContactInf
|
||||
<div className={item()}>
|
||||
<MapPinSimpleIcon />
|
||||
<Text size={2} color="neutral">
|
||||
{trustCenter.headquarterAddress}
|
||||
{compliancePortal.headquarterAddress}
|
||||
</Text>
|
||||
</div>
|
||||
)}
|
||||
@@ -38,7 +38,7 @@ export interface PageHeaderProps {
|
||||
flushBottomSpace?: boolean;
|
||||
}
|
||||
|
||||
// Page header for the Trust Center nav pages: a size-7 title in the shared white
|
||||
// Page header for the Compliance Portal nav pages: a size-7 title in the shared white
|
||||
// band, with an optional count, inline actions, and a toolbar slot below.
|
||||
export function PageHeader({ title, count, actions, children, flushBottomSpace }: PageHeaderProps) {
|
||||
const { content, titleRow, count: countSlot } = pageHeader();
|
||||
|
||||
@@ -28,12 +28,12 @@ import { HomeSection } from "#/components/HomeSection/HomeSection";
|
||||
import { MailingListUpdateListItem } from "#/components/MailingListUpdateListItem/MailingListUpdateListItem";
|
||||
import { dotPatternStyle } from "#/components/MediaTile/variants";
|
||||
|
||||
import type { RecentUpdatesSection_trustCenter$key } from "./__generated__/RecentUpdatesSection_trustCenter.graphql";
|
||||
import type { RecentUpdatesSection_compliancePortal$key } from "./__generated__/RecentUpdatesSection_compliancePortal.graphql";
|
||||
|
||||
// @throwOnFieldError surfaces a field error at the read below so the section
|
||||
// ErrorBoundary contains it. See contrib/claude/error-handling.md.
|
||||
const recentUpdatesSectionFragment = graphql`
|
||||
fragment RecentUpdatesSection_trustCenter on TrustCenter @throwOnFieldError {
|
||||
fragment RecentUpdatesSection_compliancePortal on CompliancePortal @throwOnFieldError {
|
||||
updates(first: 5) {
|
||||
edges {
|
||||
node {
|
||||
@@ -46,12 +46,12 @@ const recentUpdatesSectionFragment = graphql`
|
||||
`;
|
||||
|
||||
interface RecentUpdatesSectionProps {
|
||||
trustCenterKey: RecentUpdatesSection_trustCenter$key;
|
||||
compliancePortalKey: RecentUpdatesSection_compliancePortal$key;
|
||||
}
|
||||
|
||||
// "Recent updates" section: the latest mailing-list updates as a list, with a
|
||||
// link to the full updates page. A load failure degrades to an inline error.
|
||||
export function RecentUpdatesSection({ trustCenterKey }: RecentUpdatesSectionProps) {
|
||||
export function RecentUpdatesSection({ compliancePortalKey }: RecentUpdatesSectionProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
@@ -64,14 +64,14 @@ export function RecentUpdatesSection({ trustCenterKey }: RecentUpdatesSectionPro
|
||||
</HomeSection>
|
||||
)}
|
||||
>
|
||||
<RecentUpdatesSectionContent trustCenterKey={trustCenterKey} />
|
||||
<RecentUpdatesSectionContent compliancePortalKey={compliancePortalKey} />
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
function RecentUpdatesSectionContent({ trustCenterKey }: RecentUpdatesSectionProps) {
|
||||
function RecentUpdatesSectionContent({ compliancePortalKey }: RecentUpdatesSectionProps) {
|
||||
const { t } = useTranslation();
|
||||
const data = useFragment(recentUpdatesSectionFragment, trustCenterKey);
|
||||
const data = useFragment(recentUpdatesSectionFragment, compliancePortalKey);
|
||||
const updates = data.updates.edges.map(edge => edge.node);
|
||||
|
||||
if (updates.length === 0) {
|
||||
|
||||
@@ -23,7 +23,7 @@ import { graphql, useFragment } from "react-relay";
|
||||
|
||||
import { InlineErrorCard } from "#/components/errors/InlineErrorCard";
|
||||
|
||||
import type { SecurityCommitmentsSection_trustCenter$key } from "./__generated__/SecurityCommitmentsSection_trustCenter.graphql";
|
||||
import type { SecurityCommitmentsSection_compliancePortal$key } from "./__generated__/SecurityCommitmentsSection_compliancePortal.graphql";
|
||||
import { SecurityCommitmentGroupListItem } from "./SecurityCommitmentGroupListItem";
|
||||
import { securityCommitments } from "./variants";
|
||||
|
||||
@@ -31,7 +31,7 @@ import { securityCommitments } from "./variants";
|
||||
// below, where the section's ErrorBoundary contains it. See
|
||||
// contrib/claude/error-handling.md.
|
||||
const securityCommitmentsSectionFragment = graphql`
|
||||
fragment SecurityCommitmentsSection_trustCenter on TrustCenter @throwOnFieldError {
|
||||
fragment SecurityCommitmentsSection_compliancePortal on CompliancePortal @throwOnFieldError {
|
||||
commitmentGroups(first: 100) {
|
||||
edges {
|
||||
node {
|
||||
@@ -53,13 +53,13 @@ const securityCommitmentsSectionFragment = graphql`
|
||||
`;
|
||||
|
||||
interface SecurityCommitmentsSectionProps {
|
||||
trustCenterKey: SecurityCommitmentsSection_trustCenter$key;
|
||||
compliancePortalKey: SecurityCommitmentsSection_compliancePortal$key;
|
||||
}
|
||||
|
||||
// "Security Commitments" section: stacked groups, each a header above a grid of
|
||||
// commitment cards. Wraps its data-reading content in a boundary so a load
|
||||
// failure degrades to an inline error instead of taking down the page.
|
||||
export function SecurityCommitmentsSection({ trustCenterKey }: SecurityCommitmentsSectionProps) {
|
||||
export function SecurityCommitmentsSection({ compliancePortalKey }: SecurityCommitmentsSectionProps) {
|
||||
return (
|
||||
<ErrorBoundary
|
||||
fallback={(
|
||||
@@ -68,13 +68,13 @@ export function SecurityCommitmentsSection({ trustCenterKey }: SecurityCommitmen
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
<SecurityCommitmentsSectionContent trustCenterKey={trustCenterKey} />
|
||||
<SecurityCommitmentsSectionContent compliancePortalKey={compliancePortalKey} />
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
function SecurityCommitmentsSectionContent({ trustCenterKey }: SecurityCommitmentsSectionProps) {
|
||||
const data = useFragment(securityCommitmentsSectionFragment, trustCenterKey);
|
||||
function SecurityCommitmentsSectionContent({ compliancePortalKey }: SecurityCommitmentsSectionProps) {
|
||||
const data = useFragment(securityCommitmentsSectionFragment, compliancePortalKey);
|
||||
const slots = securityCommitments();
|
||||
|
||||
// Groups with no cards render nothing, so filter them out here to keep the
|
||||
|
||||
@@ -41,7 +41,7 @@ const topBarFragment = graphql`
|
||||
...TopBarUserMenu_identity
|
||||
...TopBarMobileNav_identity
|
||||
}
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
themedLogoUrl
|
||||
title
|
||||
}
|
||||
@@ -62,9 +62,9 @@ export function TopBar({ queryKey }: TopBarProps) {
|
||||
const location = useLocation();
|
||||
const { pathname } = location;
|
||||
|
||||
const { currentTrustCenter } = data;
|
||||
const title = currentTrustCenter.title;
|
||||
const logoUrl = currentTrustCenter.themedLogoUrl ?? undefined;
|
||||
const { currentCompliancePortal } = data;
|
||||
const title = currentCompliancePortal.title;
|
||||
const logoUrl = currentCompliancePortal.themedLogoUrl ?? undefined;
|
||||
|
||||
const slots = topBar();
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
import { tv } from "tailwind-variants/lite";
|
||||
|
||||
// Trust Center top navigation bar. Slots are shared by the live TopBar and its
|
||||
// Compliance Portal top navigation bar. Slots are shared by the live TopBar and its
|
||||
// skeleton so the loading placeholder is structurally identical. Desktop-first:
|
||||
// unprefixed classes are the desktop layout; max-md: collapses into the burger.
|
||||
export const topBar = tv({
|
||||
|
||||
@@ -24,10 +24,10 @@ import { graphql, useFragment } from "react-relay";
|
||||
import { MediaTile } from "#/components/MediaTile/MediaTile";
|
||||
import { externalHref } from "#/lib/url/hostname";
|
||||
|
||||
import type { TrustCenterReferenceListItem_reference$key } from "./__generated__/TrustCenterReferenceListItem_reference.graphql";
|
||||
import type { CompliancePortalReferenceListItem_reference$key } from "./__generated__/CompliancePortalReferenceListItem_reference.graphql";
|
||||
|
||||
const trustCenterReferenceListItemFragment = graphql`
|
||||
fragment TrustCenterReferenceListItem_reference on TrustCenterReference @throwOnFieldError {
|
||||
const compliancePortalReferenceListItemFragment = graphql`
|
||||
fragment CompliancePortalReferenceListItem_reference on CompliancePortalReference @throwOnFieldError {
|
||||
name
|
||||
websiteUrl
|
||||
logo {
|
||||
@@ -36,13 +36,13 @@ const trustCenterReferenceListItemFragment = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
interface TrustCenterReferenceListItemProps {
|
||||
referenceKey: TrustCenterReferenceListItem_reference$key;
|
||||
interface CompliancePortalReferenceListItemProps {
|
||||
referenceKey: CompliancePortalReferenceListItem_reference$key;
|
||||
}
|
||||
|
||||
// A single "Trusted by" logo tile, linking to the reference's website.
|
||||
export function TrustCenterReferenceListItem({ referenceKey }: TrustCenterReferenceListItemProps) {
|
||||
const reference = useFragment(trustCenterReferenceListItemFragment, referenceKey);
|
||||
export function CompliancePortalReferenceListItem({ referenceKey }: CompliancePortalReferenceListItemProps) {
|
||||
const reference = useFragment(compliancePortalReferenceListItemFragment, referenceKey);
|
||||
|
||||
return (
|
||||
<a
|
||||
@@ -25,18 +25,18 @@ import { graphql, useFragment } from "react-relay";
|
||||
import { InlineErrorCard } from "#/components/errors/InlineErrorCard";
|
||||
import { HomeSection } from "#/components/HomeSection/HomeSection";
|
||||
|
||||
import type { TrustedBySection_trustCenter$key } from "./__generated__/TrustedBySection_trustCenter.graphql";
|
||||
import { TrustCenterReferenceListItem } from "./TrustCenterReferenceListItem";
|
||||
import type { TrustedBySection_compliancePortal$key } from "./__generated__/TrustedBySection_compliancePortal.graphql";
|
||||
import { CompliancePortalReferenceListItem } from "./CompliancePortalReferenceListItem";
|
||||
|
||||
// @throwOnFieldError surfaces a field error at the read below so the section
|
||||
// ErrorBoundary contains it. See contrib/claude/error-handling.md.
|
||||
const trustedBySectionFragment = graphql`
|
||||
fragment TrustedBySection_trustCenter on TrustCenter @throwOnFieldError {
|
||||
fragment TrustedBySection_compliancePortal on CompliancePortal @throwOnFieldError {
|
||||
references(first: 12) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
...TrustCenterReferenceListItem_reference
|
||||
...CompliancePortalReferenceListItem_reference
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,12 +44,12 @@ const trustedBySectionFragment = graphql`
|
||||
`;
|
||||
|
||||
interface TrustedBySectionProps {
|
||||
trustCenterKey: TrustedBySection_trustCenter$key;
|
||||
compliancePortalKey: TrustedBySection_compliancePortal$key;
|
||||
}
|
||||
|
||||
// "Trusted by" section: a grid of customer / reference logos. A load failure
|
||||
// degrades to an inline error instead of taking down the page.
|
||||
export function TrustedBySection({ trustCenterKey }: TrustedBySectionProps) {
|
||||
export function TrustedBySection({ compliancePortalKey }: TrustedBySectionProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
@@ -62,14 +62,14 @@ export function TrustedBySection({ trustCenterKey }: TrustedBySectionProps) {
|
||||
</HomeSection>
|
||||
)}
|
||||
>
|
||||
<TrustedBySectionContent trustCenterKey={trustCenterKey} />
|
||||
<TrustedBySectionContent compliancePortalKey={compliancePortalKey} />
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
function TrustedBySectionContent({ trustCenterKey }: TrustedBySectionProps) {
|
||||
function TrustedBySectionContent({ compliancePortalKey }: TrustedBySectionProps) {
|
||||
const { t } = useTranslation();
|
||||
const data = useFragment(trustedBySectionFragment, trustCenterKey);
|
||||
const data = useFragment(trustedBySectionFragment, compliancePortalKey);
|
||||
const references = data.references.edges.map(edge => edge.node);
|
||||
|
||||
if (references.length === 0) {
|
||||
@@ -80,7 +80,7 @@ function TrustedBySectionContent({ trustCenterKey }: TrustedBySectionProps) {
|
||||
<HomeSection title={t("home.sections.trustedBy")}>
|
||||
<div className="grid grid-cols-6 gap-4 max-lg:grid-cols-3 max-sm:grid-cols-2">
|
||||
{references.map(reference => (
|
||||
<TrustCenterReferenceListItem key={reference.id} referenceKey={reference} />
|
||||
<CompliancePortalReferenceListItem key={reference.id} referenceKey={reference} />
|
||||
))}
|
||||
</div>
|
||||
</HomeSection>
|
||||
|
||||
@@ -44,7 +44,7 @@ import type { useResumeAccessRequestMutation } from "./__generated__/useResumeAc
|
||||
const requestAllAccessesMutation = graphql`
|
||||
mutation useResumeAccessRequestMutation {
|
||||
requestAllAccesses {
|
||||
trustCenterAccess {
|
||||
compliancePortalAccess {
|
||||
id
|
||||
}
|
||||
}
|
||||
@@ -83,8 +83,8 @@ const requestReportMutation = graphql`
|
||||
`;
|
||||
|
||||
const requestFileMutation = graphql`
|
||||
mutation useResumeAccessRequest_fileMutation($input: RequestTrustCenterFileAccessInput!) {
|
||||
requestTrustCenterFileAccess(input: $input) {
|
||||
mutation useResumeAccessRequest_fileMutation($input: RequestCompliancePortalFileAccessInput!) {
|
||||
requestCompliancePortalFileAccess(input: $input) {
|
||||
file {
|
||||
id
|
||||
access {
|
||||
@@ -194,7 +194,7 @@ export function useResumeAccessRequest(isAuthenticated: boolean) {
|
||||
const continueUrl = buildRequestAccessContinueUrl(REQUEST_FILE_PARAM, fileId);
|
||||
clear(REQUEST_FILE_PARAM);
|
||||
void requestFileAccess({
|
||||
variables: { input: { trustCenterFileId: fileId } },
|
||||
variables: { input: { compliancePortalFileId: fileId } },
|
||||
...makeHandlers(continueUrl),
|
||||
}).catch(() => {});
|
||||
return;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
import { graphql } from "react-relay";
|
||||
import { type LiveState, readFragment } from "relay-runtime";
|
||||
|
||||
import type { TrustCenterLogoResolverFragment$key } from "./__generated__/TrustCenterLogoResolverFragment.graphql";
|
||||
import type { CompliancePortalLogoResolverFragment$key } from "./__generated__/CompliancePortalLogoResolverFragment.graphql";
|
||||
|
||||
function prefersDark(): boolean {
|
||||
return typeof window !== "undefined"
|
||||
@@ -30,21 +30,21 @@ function prefersDark(): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* @relayField TrustCenter.themedLogoUrl: String
|
||||
* @rootFragment TrustCenterLogoResolverFragment
|
||||
* @relayField CompliancePortal.themedLogoUrl: String
|
||||
* @rootFragment CompliancePortalLogoResolverFragment
|
||||
* @live
|
||||
*
|
||||
* Resolves the trust center logo download URL for the current system color
|
||||
* Resolves the compliance portal logo download URL for the current system color
|
||||
* scheme: the dark logo (falling back to the light one) when the OS prefers
|
||||
* dark, otherwise the light logo. Lives in the graph so consumers select a
|
||||
* single field instead of threading `useSystemTheme` through URL selection.
|
||||
*/
|
||||
export function themedLogoUrl(
|
||||
key: TrustCenterLogoResolverFragment$key,
|
||||
key: CompliancePortalLogoResolverFragment$key,
|
||||
): LiveState<string | null> {
|
||||
const data = readFragment(
|
||||
graphql`
|
||||
fragment TrustCenterLogoResolverFragment on TrustCenter {
|
||||
fragment CompliancePortalLogoResolverFragment on CompliancePortal {
|
||||
logo {
|
||||
downloadUrl
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import { graphql, usePreloadedQuery } from "react-relay";
|
||||
|
||||
import { ComplianceFrameworksSection } from "#/components/ComplianceFrameworks/ComplianceFrameworksSection";
|
||||
import { Hero } from "#/components/Hero/Hero";
|
||||
import { TrustCenterContactInfo } from "#/components/Hero/TrustCenterContactInfo";
|
||||
import { CompliancePortalContactInfo } from "#/components/Hero/CompliancePortalContactInfo";
|
||||
import { RecentUpdatesSection } from "#/components/RecentUpdates/RecentUpdatesSection";
|
||||
import { SecurityCommitmentsSection } from "#/components/SecurityCommitments/SecurityCommitmentsSection";
|
||||
import { TrustedBySection } from "#/components/TrustedBy/TrustedBySection";
|
||||
@@ -33,13 +33,13 @@ import type { HomePageQuery } from "./__generated__/HomePageQuery.graphql";
|
||||
|
||||
export const homePageQuery = graphql`
|
||||
query HomePageQuery @throwOnFieldError {
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
title
|
||||
...TrustCenterContactInfo_trustCenter
|
||||
...ComplianceFrameworksSection_trustCenter
|
||||
...SecurityCommitmentsSection_trustCenter
|
||||
...TrustedBySection_trustCenter
|
||||
...RecentUpdatesSection_trustCenter
|
||||
...CompliancePortalContactInfo_compliancePortal
|
||||
...ComplianceFrameworksSection_compliancePortal
|
||||
...SecurityCommitmentsSection_compliancePortal
|
||||
...TrustedBySection_compliancePortal
|
||||
...RecentUpdatesSection_compliancePortal
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -51,8 +51,8 @@ interface HomePageProps {
|
||||
export function HomePage({ queryRef }: HomePageProps) {
|
||||
const { t } = useTranslation();
|
||||
const data = usePreloadedQuery<HomePageQuery>(homePageQuery, queryRef);
|
||||
const { currentTrustCenter } = data;
|
||||
const { title } = currentTrustCenter;
|
||||
const { currentCompliancePortal } = data;
|
||||
const { title } = currentCompliancePortal;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -60,14 +60,14 @@ export function HomePage({ queryRef }: HomePageProps) {
|
||||
title={t("home.heroTitle", { name: title })}
|
||||
description={t("home.heroDescription")}
|
||||
>
|
||||
<TrustCenterContactInfo trustCenterKey={currentTrustCenter} />
|
||||
<CompliancePortalContactInfo compliancePortalKey={currentCompliancePortal} />
|
||||
</Hero>
|
||||
<div className="flex w-full flex-col items-center px-8 max-md:px-4">
|
||||
<div className="flex w-full max-w-5xl flex-col">
|
||||
<ComplianceFrameworksSection trustCenterKey={currentTrustCenter} />
|
||||
<SecurityCommitmentsSection trustCenterKey={currentTrustCenter} />
|
||||
<TrustedBySection trustCenterKey={currentTrustCenter} />
|
||||
<RecentUpdatesSection trustCenterKey={currentTrustCenter} />
|
||||
<ComplianceFrameworksSection compliancePortalKey={currentCompliancePortal} />
|
||||
<SecurityCommitmentsSection compliancePortalKey={currentCompliancePortal} />
|
||||
<TrustedBySection compliancePortalKey={currentCompliancePortal} />
|
||||
<RecentUpdatesSection compliancePortalKey={currentCompliancePortal} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -37,7 +37,7 @@ export const documentViewerPageQuery = graphql`
|
||||
title
|
||||
isUserAuthorized
|
||||
}
|
||||
... on TrustCenterFile {
|
||||
... on CompliancePortalFile {
|
||||
id
|
||||
name
|
||||
isUserAuthorized
|
||||
@@ -66,8 +66,8 @@ function resolveNode(node: DocumentViewerPageQuery["response"]["aliasedNode"]):
|
||||
switch (node.__typename) {
|
||||
case "Document":
|
||||
return { kind: "Document", id: node.id, title: node.title, isAuthorized: node.isUserAuthorized };
|
||||
case "TrustCenterFile":
|
||||
return { kind: "TrustCenterFile", id: node.id, title: node.name, isAuthorized: node.isUserAuthorized };
|
||||
case "CompliancePortalFile":
|
||||
return { kind: "CompliancePortalFile", id: node.id, title: node.name, isAuthorized: node.isUserAuthorized };
|
||||
case "AuditReport":
|
||||
return { kind: "AuditReport", id: node.id, title: node.fileName, isAuthorized: node.isUserAuthorized };
|
||||
default:
|
||||
|
||||
@@ -35,13 +35,13 @@ import { DocumentListItem } from "./_components/DocumentListItem";
|
||||
import { DocumentSection } from "./_components/DocumentSection";
|
||||
import { DocumentsEmpty } from "./_components/DocumentsEmpty";
|
||||
import { DocumentsToolbar } from "./_components/DocumentsToolbar";
|
||||
import { TrustCenterFileListItem } from "./_components/TrustCenterFileListItem";
|
||||
import { CompliancePortalFileListItem } from "./_components/CompliancePortalFileListItem";
|
||||
import { toQueryVariables } from "./_lib/toQueryVariables";
|
||||
import { useDocumentTab } from "./_lib/useDocumentTab";
|
||||
import { documentsLayout } from "./variants";
|
||||
|
||||
export const documentsPageQuery = graphql`
|
||||
query DocumentsPageQuery($visibility: TrustCenterVisibility) {
|
||||
query DocumentsPageQuery($visibility: CompliancePortalVisibility) {
|
||||
...DocumentsPage_query @arguments(visibility: $visibility)
|
||||
}
|
||||
`;
|
||||
@@ -49,8 +49,8 @@ export const documentsPageQuery = graphql`
|
||||
const documentsPageFragment = graphql`
|
||||
fragment DocumentsPage_query on Query
|
||||
@refetchable(queryName: "DocumentsPageRefetchQuery")
|
||||
@argumentDefinitions(visibility: { type: "TrustCenterVisibility" }) {
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
@argumentDefinitions(visibility: { type: "CompliancePortalVisibility" }) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
documents(first: 250, filter: { visibility: $visibility }) {
|
||||
edges {
|
||||
node {
|
||||
@@ -71,12 +71,12 @@ const documentsPageFragment = graphql`
|
||||
}
|
||||
}
|
||||
}
|
||||
trustCenterFiles(first: 250, filter: { visibility: $visibility }) {
|
||||
compliancePortalFiles(first: 250, filter: { visibility: $visibility }) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
category
|
||||
...TrustCenterFileListItem_file
|
||||
...CompliancePortalFileListItem_file
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ interface DocumentsPageProps {
|
||||
queryRef: PreloadedQuery<DocumentsPageQuery>;
|
||||
}
|
||||
|
||||
// Trust Center documents page: a unified list of published documents, uploaded
|
||||
// Compliance Portal documents page: a unified list of published documents, uploaded
|
||||
// files, and audit reports, grouped into category sections. The All/Public/
|
||||
// Private tabs are backed by a server-side visibility filter.
|
||||
export function DocumentsPage({ queryRef }: DocumentsPageProps) {
|
||||
@@ -140,10 +140,10 @@ export function DocumentsPage({ queryRef }: DocumentsPageProps) {
|
||||
});
|
||||
}, [refetch, tab]);
|
||||
|
||||
const { currentTrustCenter } = data;
|
||||
const documentNodes = currentTrustCenter.documents.edges.map(edge => edge.node);
|
||||
const fileNodes = currentTrustCenter.trustCenterFiles.edges.map(edge => edge.node);
|
||||
const auditNodes = currentTrustCenter.audits.edges
|
||||
const { currentCompliancePortal } = data;
|
||||
const documentNodes = currentCompliancePortal.documents.edges.map(edge => edge.node);
|
||||
const fileNodes = currentCompliancePortal.compliancePortalFiles.edges.map(edge => edge.node);
|
||||
const auditNodes = currentCompliancePortal.audits.edges
|
||||
.map(edge => edge.node)
|
||||
.filter(node => node.reportFile != null);
|
||||
|
||||
@@ -191,7 +191,7 @@ export function DocumentsPage({ queryRef }: DocumentsPageProps) {
|
||||
{fileGroups.map(group => (
|
||||
<DocumentSection key={`category:${group.key}`} title={group.key}>
|
||||
{group.nodes.map(node => (
|
||||
<TrustCenterFileListItem key={node.id} fileKey={node} />
|
||||
<CompliancePortalFileListItem key={node.id} fileKey={node} />
|
||||
))}
|
||||
</DocumentSection>
|
||||
))}
|
||||
|
||||
@@ -22,11 +22,11 @@ import { graphql, useFragment } from "react-relay";
|
||||
|
||||
import { useRequestFileAccess } from "../_lib/useAccessRequest";
|
||||
|
||||
import type { TrustCenterFileListItem_file$key } from "./__generated__/TrustCenterFileListItem_file.graphql";
|
||||
import type { CompliancePortalFileListItem_file$key } from "./__generated__/CompliancePortalFileListItem_file.graphql";
|
||||
import { DocumentEntry } from "./DocumentEntry";
|
||||
|
||||
const trustCenterFileListItemFragment = graphql`
|
||||
fragment TrustCenterFileListItem_file on TrustCenterFile @throwOnFieldError {
|
||||
const compliancePortalFileListItemFragment = graphql`
|
||||
fragment CompliancePortalFileListItem_file on CompliancePortalFile @throwOnFieldError {
|
||||
id
|
||||
alias
|
||||
name
|
||||
@@ -38,14 +38,14 @@ const trustCenterFileListItemFragment = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
interface TrustCenterFileListItemProps {
|
||||
fileKey: TrustCenterFileListItem_file$key;
|
||||
interface CompliancePortalFileListItemProps {
|
||||
fileKey: CompliancePortalFileListItem_file$key;
|
||||
}
|
||||
|
||||
// A single uploaded trust-center file entry: name, its category, and an access
|
||||
// action linking to the viewer when authorized.
|
||||
export function TrustCenterFileListItem({ fileKey }: TrustCenterFileListItemProps) {
|
||||
const file = useFragment(trustCenterFileListItemFragment, fileKey);
|
||||
export function CompliancePortalFileListItem({ fileKey }: CompliancePortalFileListItemProps) {
|
||||
const file = useFragment(compliancePortalFileListItemFragment, fileKey);
|
||||
const { requestAccess, isRequesting } = useRequestFileAccess(file.id);
|
||||
|
||||
return (
|
||||
@@ -26,7 +26,7 @@ import { EmptyState } from "#/components/EmptyState/EmptyState";
|
||||
import { useDocumentTab } from "../_lib/useDocumentTab";
|
||||
|
||||
// Empty state for the documents list. When a Public/Private tab is active it
|
||||
// notes the filter; otherwise it states the trust center publishes no documents.
|
||||
// notes the filter; otherwise it states the compliance portal publishes no documents.
|
||||
export function DocumentsEmpty() {
|
||||
const { t } = useTranslation("documents");
|
||||
const { tab } = useDocumentTab();
|
||||
|
||||
@@ -80,8 +80,8 @@ const reportMutation = graphql`
|
||||
`;
|
||||
|
||||
const fileMutation = graphql`
|
||||
mutation useAccessRequestFileMutation($input: RequestTrustCenterFileAccessInput!) {
|
||||
requestTrustCenterFileAccess(input: $input) {
|
||||
mutation useAccessRequestFileMutation($input: RequestCompliancePortalFileAccessInput!) {
|
||||
requestCompliancePortalFileAccess(input: $input) {
|
||||
file {
|
||||
id
|
||||
access {
|
||||
@@ -171,7 +171,7 @@ export function useRequestFileAccess(id: string): AccessRequest {
|
||||
);
|
||||
|
||||
const requestAccess = useCallback(() => {
|
||||
void mutate({ variables: { input: { trustCenterFileId: id } }, ...handlers }).catch(() => {});
|
||||
void mutate({ variables: { input: { compliancePortalFileId: id } }, ...handlers }).catch(() => {});
|
||||
}, [mutate, id, handlers]);
|
||||
|
||||
return { requestAccess, isRequesting };
|
||||
@@ -189,7 +189,7 @@ export function useAccessRequest(kind: DocumentKind, id: string): AccessRequest
|
||||
return document;
|
||||
case "AuditReport":
|
||||
return report;
|
||||
case "TrustCenterFile":
|
||||
case "CompliancePortalFile":
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import type { useDocumentExportDocumentMutation } from "./__generated__/useDocum
|
||||
import type { useDocumentExportFileMutation } from "./__generated__/useDocumentExportFileMutation.graphql";
|
||||
import type { useDocumentExportReportMutation } from "./__generated__/useDocumentExportReportMutation.graphql";
|
||||
|
||||
export type DocumentKind = "Document" | "TrustCenterFile" | "AuditReport";
|
||||
export type DocumentKind = "Document" | "CompliancePortalFile" | "AuditReport";
|
||||
|
||||
const exportDocumentMutation = graphql`
|
||||
mutation useDocumentExportDocumentMutation($input: ExportDocumentPDFInput!) {
|
||||
@@ -38,8 +38,8 @@ const exportDocumentMutation = graphql`
|
||||
`;
|
||||
|
||||
const exportFileMutation = graphql`
|
||||
mutation useDocumentExportFileMutation($input: ExportTrustCenterFileInput!) {
|
||||
exportTrustCenterFile(input: $input) {
|
||||
mutation useDocumentExportFileMutation($input: ExportCompliancePortalFileInput!) {
|
||||
exportCompliancePortalFile(input: $input) {
|
||||
data
|
||||
}
|
||||
}
|
||||
@@ -102,10 +102,10 @@ export function useDocumentExport(kind: DocumentKind, id: string, enabled: boole
|
||||
onCompleted: response => apply(id, response.exportDocumentPDF.data),
|
||||
}).catch(() => {});
|
||||
break;
|
||||
case "TrustCenterFile":
|
||||
case "CompliancePortalFile":
|
||||
exportFile({
|
||||
variables: { input: { trustCenterFileId: id } },
|
||||
onCompleted: response => apply(id, response.exportTrustCenterFile.data),
|
||||
variables: { input: { compliancePortalFileId: id } },
|
||||
onCompleted: response => apply(id, response.exportCompliancePortalFile.data),
|
||||
}).catch(() => {});
|
||||
break;
|
||||
case "AuditReport":
|
||||
|
||||
@@ -61,7 +61,7 @@ export const ndaPageQuery = graphql`
|
||||
viewer {
|
||||
id
|
||||
}
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
title
|
||||
nonDisclosureAgreement {
|
||||
fileUrl
|
||||
@@ -72,7 +72,7 @@ export const ndaPageQuery = graphql`
|
||||
`;
|
||||
|
||||
const ndaPageFragment = graphql`
|
||||
fragment NDAPageFragment on TrustCenter
|
||||
fragment NDAPageFragment on CompliancePortal
|
||||
@refetchable(queryName: "NDAPageRefetchQuery") {
|
||||
nonDisclosureAgreement @required(action: THROW) {
|
||||
viewerSignature {
|
||||
@@ -122,13 +122,13 @@ export function NDAPage({ queryRef }: NDAPageProps) {
|
||||
const [scale, setScale] = useState(1);
|
||||
|
||||
const data = usePreloadedQuery<NDAPageQueryType>(ndaPageQuery, queryRef);
|
||||
const trustCenter = data.currentTrustCenter;
|
||||
const compliancePortal = data.currentCompliancePortal;
|
||||
const [fragment, refetch] = useRefetchableFragment<NDAPageRefetchQuery, NDAPageFragment$key>(
|
||||
ndaPageFragment,
|
||||
trustCenter,
|
||||
compliancePortal,
|
||||
);
|
||||
|
||||
const nda = trustCenter.nonDisclosureAgreement;
|
||||
const nda = compliancePortal.nonDisclosureAgreement;
|
||||
const signature = fragment.nonDisclosureAgreement.viewerSignature;
|
||||
|
||||
const safeContinueUrl = getSafeContinueUrl(searchParams.get("continue"));
|
||||
@@ -236,7 +236,7 @@ export function NDAPage({ queryRef }: NDAPageProps) {
|
||||
{t("title")}
|
||||
</Heading>
|
||||
<Text size={2} color="neutral">
|
||||
{t("subtitle", { name: trustCenter.title })}
|
||||
{t("subtitle", { name: compliancePortal.title })}
|
||||
</Text>
|
||||
{signature.consentText != null && (
|
||||
<Text size={1} color="faint" className={slots.consent()}>
|
||||
|
||||
@@ -52,7 +52,7 @@ const subprocessorsPageFragment = graphql`
|
||||
category: { type: "SubprocessorCategory" }
|
||||
country: { type: "CountryCode" }
|
||||
) {
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
subprocessors(first: 250, filter: { query: $query, category: $category, country: $country }) {
|
||||
totalCount
|
||||
edges {
|
||||
@@ -98,7 +98,7 @@ export function SubprocessorsPage({ queryRef }: SubprocessorsPageProps) {
|
||||
});
|
||||
}, [refetch, query, category, country]);
|
||||
|
||||
const { subprocessors } = data.currentTrustCenter;
|
||||
const { subprocessors } = data.currentCompliancePortal;
|
||||
const nodes: SubprocessorNode[] = subprocessors.edges.map(edge => edge.node);
|
||||
const groups = groupByCategory(nodes, value => t(`categories.${value}.label`));
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import { EmptyState } from "#/components/EmptyState/EmptyState";
|
||||
import { useSubprocessorFilters } from "../_lib/useSubprocessorFilters";
|
||||
|
||||
// Empty state for the subprocessor list. When filters are active it offers to
|
||||
// clear them; otherwise it states the trust center lists no subprocessors.
|
||||
// clear them; otherwise it states the compliance portal lists no subprocessors.
|
||||
export function SubprocessorsEmpty() {
|
||||
const { t } = useTranslation("subprocessors");
|
||||
const { hasActiveFilters, clear } = useSubprocessorFilters();
|
||||
|
||||
@@ -34,11 +34,11 @@ import { useSubprocessorSearch } from "../_lib/useSubprocessorSearch";
|
||||
import type { SubprocessorsToolbar_query$key } from "./__generated__/SubprocessorsToolbar_query.graphql";
|
||||
|
||||
// Facet data: the distinct categories and countries actually present across the
|
||||
// trust center's published subprocessors, used to populate the filter dropdowns
|
||||
// compliance portal's published subprocessors, used to populate the filter dropdowns
|
||||
// (server-computed so the options never dead-end on an empty result).
|
||||
const subprocessorsToolbarFragment = graphql`
|
||||
fragment SubprocessorsToolbar_query on Query {
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
subprocessorCategories
|
||||
subprocessorCountries
|
||||
}
|
||||
@@ -58,7 +58,7 @@ export function SubprocessorsToolbar({ queryKey }: SubprocessorsToolbarProps) {
|
||||
const { category, country, setCategory, setCountry } = useSubprocessorFilters();
|
||||
const [queryInput, setQueryInput] = useSubprocessorSearch();
|
||||
|
||||
const { subprocessorCategories, subprocessorCountries } = data.currentTrustCenter;
|
||||
const { subprocessorCategories, subprocessorCountries } = data.currentCompliancePortal;
|
||||
|
||||
const categoryOptions = useMemo(() => {
|
||||
return [...subprocessorCategories].sort((a, b) => t(`categories.${a}.label`).localeCompare(t(`categories.${b}.label`)));
|
||||
|
||||
@@ -53,7 +53,7 @@ const updatesPageFragment = graphql`
|
||||
last: { type: "Int" }
|
||||
before: { type: "CursorKey" }
|
||||
) {
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
updates(first: $first, after: $after, last: $last, before: $before) {
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
@@ -96,7 +96,7 @@ export function UpdatesPage({ queryRef }: UpdatesPageProps) {
|
||||
});
|
||||
}, [refetch]);
|
||||
|
||||
const { updates } = data.currentTrustCenter;
|
||||
const { updates } = data.currentCompliancePortal;
|
||||
const { pageInfo } = updates;
|
||||
const { isPending, goPrevious, goNext } = useCursorPagination(refetchUpdates, pageInfo, UPDATES_PAGE_SIZE);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import { EmptyState } from "#/components/EmptyState/EmptyState";
|
||||
|
||||
import { UpdatesSubscribeButton } from "./UpdatesSubscribeButton";
|
||||
|
||||
// Empty state for the updates list: shown when the trust center has published no
|
||||
// Empty state for the updates list: shown when the compliance portal has published no
|
||||
// updates yet, inviting the visitor to subscribe.
|
||||
export function UpdatesEmpty() {
|
||||
const { t } = useTranslation("updates");
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# TrustCenter app
|
||||
# Trust app (compliance portal)
|
||||
|
||||
|
||||
@@ -32,14 +32,14 @@ import { useFragment, useMutation } from "react-relay";
|
||||
import { useLocation, useNavigate, useSearchParams } from "react-router";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { TrustCenterFileRow_requestAccessMutation } from "./__generated__/TrustCenterFileRow_requestAccessMutation.graphql";
|
||||
import type { TrustCenterFileRowFragment$key } from "./__generated__/TrustCenterFileRowFragment.graphql";
|
||||
import type { CompliancePortalFileRow_requestAccessMutation } from "./__generated__/CompliancePortalFileRow_requestAccessMutation.graphql";
|
||||
import type { CompliancePortalFileRowFragment$key } from "./__generated__/CompliancePortalFileRowFragment.graphql";
|
||||
|
||||
const requestAccessMutation = graphql`
|
||||
mutation TrustCenterFileRow_requestAccessMutation(
|
||||
$input: RequestTrustCenterFileAccessInput!
|
||||
mutation CompliancePortalFileRow_requestAccessMutation(
|
||||
$input: RequestCompliancePortalFileAccessInput!
|
||||
) {
|
||||
requestTrustCenterFileAccess(input: $input) {
|
||||
requestCompliancePortalFileAccess(input: $input) {
|
||||
file {
|
||||
access {
|
||||
id
|
||||
@@ -50,8 +50,8 @@ const requestAccessMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
const trustCenterFileRowFragment = graphql`
|
||||
fragment TrustCenterFileRowFragment on TrustCenterFile {
|
||||
const compliancePortalFileRowFragment = graphql`
|
||||
fragment CompliancePortalFileRowFragment on CompliancePortalFile {
|
||||
id
|
||||
alias
|
||||
name
|
||||
@@ -63,8 +63,8 @@ const trustCenterFileRowFragment = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export function TrustCenterFileRow(props: {
|
||||
file: TrustCenterFileRowFragment$key;
|
||||
export function CompliancePortalFileRow(props: {
|
||||
file: CompliancePortalFileRowFragment$key;
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
@@ -72,12 +72,12 @@ export function TrustCenterFileRow(props: {
|
||||
const [searchParams] = useSearchParams();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const file = useFragment(trustCenterFileRowFragment, props.file);
|
||||
const file = useFragment(compliancePortalFileRowFragment, props.file);
|
||||
const filePath = file.alias ?? file.id;
|
||||
const hasRequested = file.access?.status === "REQUESTED";
|
||||
|
||||
const [requestAccess, isRequestingAccess]
|
||||
= useMutation<TrustCenterFileRow_requestAccessMutation>(
|
||||
= useMutation<CompliancePortalFileRow_requestAccessMutation>(
|
||||
requestAccessMutation,
|
||||
);
|
||||
|
||||
@@ -85,7 +85,7 @@ export function TrustCenterFileRow(props: {
|
||||
requestAccess({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterFileId: file.id,
|
||||
compliancePortalFileId: file.id,
|
||||
},
|
||||
},
|
||||
onCompleted: (_, errors) => {
|
||||
@@ -37,7 +37,7 @@ import { useMutation } from "react-relay";
|
||||
import { useLocation, useNavigate, useSearchParams } from "react-router";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { TrustGraphCurrentQuery$data } from "#/queries/__generated__/TrustGraphCurrentQuery.graphql";
|
||||
import type { CompliancePortalGraphCurrentQuery$data } from "#/queries/__generated__/CompliancePortalGraphCurrentQuery.graphql";
|
||||
|
||||
import type { OrganizationSidebar_requestAllAccessesMutation } from "./__generated__/OrganizationSidebar_requestAllAccessesMutation.graphql";
|
||||
import type { OrganizationSidebar_subscribeToMailingListMutation } from "./__generated__/OrganizationSidebar_subscribeToMailingListMutation.graphql";
|
||||
@@ -47,7 +47,7 @@ import { FrameworkBadge } from "./FrameworkBadge";
|
||||
const requestAllAccessesMutation = graphql`
|
||||
mutation OrganizationSidebar_requestAllAccessesMutation {
|
||||
requestAllAccesses {
|
||||
trustCenterAccess {
|
||||
compliancePortalAccess {
|
||||
id
|
||||
}
|
||||
}
|
||||
@@ -76,13 +76,13 @@ const unsubscribeFromMailingListMutation = graphql`
|
||||
`;
|
||||
|
||||
export function OrganizationSidebar({
|
||||
trustCenter,
|
||||
compliancePortal,
|
||||
isAuthenticated,
|
||||
}: {
|
||||
trustCenter: TrustGraphCurrentQuery$data["currentTrustCenter"];
|
||||
compliancePortal: CompliancePortalGraphCurrentQuery$data["currentCompliancePortal"];
|
||||
isAuthenticated: boolean;
|
||||
}) {
|
||||
const trustCenterId = trustCenter?.id;
|
||||
const compliancePortalId = compliancePortal?.id;
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
const theme = useSystemTheme();
|
||||
@@ -91,8 +91,8 @@ export function OrganizationSidebar({
|
||||
const location = useLocation();
|
||||
|
||||
const logoFileUrl = theme === "dark"
|
||||
? (trustCenter?.darkLogo?.downloadUrl ?? trustCenter?.logo?.downloadUrl)
|
||||
: trustCenter?.logo?.downloadUrl;
|
||||
? (compliancePortal?.darkLogo?.downloadUrl ?? compliancePortal?.logo?.downloadUrl)
|
||||
: compliancePortal?.logo?.downloadUrl;
|
||||
|
||||
const [requestAllAccesses, isRequestingAccess]
|
||||
= useMutation<OrganizationSidebar_requestAllAccessesMutation>(
|
||||
@@ -155,12 +155,12 @@ export function OrganizationSidebar({
|
||||
variables: {},
|
||||
updater: (store, data) => {
|
||||
const subscription = data?.subscribeToMailingList?.subscription;
|
||||
if (!subscription?.id || !trustCenterId) return;
|
||||
const trustCenterRecord = store.get(trustCenterId);
|
||||
if (!trustCenterRecord) return;
|
||||
if (!subscription?.id || !compliancePortalId) return;
|
||||
const compliancePortalRecord = store.get(compliancePortalId);
|
||||
if (!compliancePortalRecord) return;
|
||||
const subscriptionRecord = store.get(subscription.id);
|
||||
if (!subscriptionRecord) return;
|
||||
trustCenterRecord.setLinkedRecord(subscriptionRecord, "viewerSubscription");
|
||||
compliancePortalRecord.setLinkedRecord(subscriptionRecord, "viewerSubscription");
|
||||
},
|
||||
onCompleted: (_, errors) => {
|
||||
if (errors?.length) {
|
||||
@@ -215,7 +215,7 @@ export function OrganizationSidebar({
|
||||
});
|
||||
};
|
||||
|
||||
if (!trustCenter) {
|
||||
if (!compliancePortal) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -233,9 +233,9 @@ export function OrganizationSidebar({
|
||||
: (
|
||||
<div className="size-24 rounded-2xl border border-border-mid shadow-mid bg-level-1" />
|
||||
)}
|
||||
<h1 className="text-2xl mt-6">{trustCenter.title}</h1>
|
||||
<h1 className="text-2xl mt-6">{compliancePortal.title}</h1>
|
||||
<p className="text-sm text-txt-secondary mt-1">
|
||||
{trustCenter.description}
|
||||
{compliancePortal.description}
|
||||
</p>
|
||||
|
||||
<hr className="my-6 -mx-6 h-px bg-border-low border-none" />
|
||||
@@ -246,32 +246,32 @@ export function OrganizationSidebar({
|
||||
<IconBlock size={16} />
|
||||
{__("Business information")}
|
||||
</h2>
|
||||
{trustCenter.websiteUrl && (
|
||||
{compliancePortal.websiteUrl && (
|
||||
<BusinessInfo label={__("Website")}>
|
||||
<a {...externalLinkProps(trustCenter.websiteUrl)}>
|
||||
<a {...externalLinkProps(compliancePortal.websiteUrl)}>
|
||||
<span className="text-txt-info hover:underline ">
|
||||
{new URL(trustCenter.websiteUrl).host}
|
||||
{new URL(compliancePortal.websiteUrl).host}
|
||||
</span>
|
||||
</a>
|
||||
</BusinessInfo>
|
||||
)}
|
||||
{trustCenter.email && (
|
||||
{compliancePortal.email && (
|
||||
<BusinessInfo label={__("Contact")}>
|
||||
<a href={`mailto:${trustCenter.email}`}>
|
||||
<a href={`mailto:${compliancePortal.email}`}>
|
||||
<span className="text-txt-info hover:underline ">
|
||||
{trustCenter.email}
|
||||
{compliancePortal.email}
|
||||
</span>
|
||||
</a>
|
||||
</BusinessInfo>
|
||||
)}
|
||||
{trustCenter.headquarterAddress && (
|
||||
{compliancePortal.headquarterAddress && (
|
||||
<BusinessInfo label={__("HQ address")}>
|
||||
{trustCenter.headquarterAddress}
|
||||
{compliancePortal.headquarterAddress}
|
||||
</BusinessInfo>
|
||||
)}
|
||||
{trustCenter.customLinks.edges.length > 0 && (
|
||||
{compliancePortal.customLinks.edges.length > 0 && (
|
||||
<div className="flex flex-wrap gap-x-4 gap-y-2">
|
||||
{trustCenter.customLinks.edges.map(({ node }) => (
|
||||
{compliancePortal.customLinks.edges.map(({ node }) => (
|
||||
<a
|
||||
key={node.id}
|
||||
{...externalLinkProps(node.url)}
|
||||
@@ -287,7 +287,7 @@ export function OrganizationSidebar({
|
||||
<hr className="my-6 -mx-6 h-px bg-border-low border-none" />
|
||||
|
||||
{/* Certifications */}
|
||||
{trustCenter.complianceFrameworks.edges.length > 0 && (
|
||||
{compliancePortal.complianceFrameworks.edges.length > 0 && (
|
||||
<>
|
||||
<div className="space-y-4">
|
||||
<h2 className="text-xs text-txt-secondary flex gap-1 items-center">
|
||||
@@ -300,7 +300,7 @@ export function OrganizationSidebar({
|
||||
gridTemplateColumns: "repeat(auto-fit, 75px",
|
||||
}}
|
||||
>
|
||||
{trustCenter.complianceFrameworks.edges.map(edge => (
|
||||
{compliancePortal.complianceFrameworks.edges.map(edge => (
|
||||
<FrameworkBadge key={edge.node.id} framework={edge.node.framework} />
|
||||
))}
|
||||
</div>
|
||||
@@ -322,7 +322,7 @@ export function OrganizationSidebar({
|
||||
{__("Request access")}
|
||||
</Button>
|
||||
{isAuthenticated && (
|
||||
trustCenter.viewerSubscription
|
||||
compliancePortal.viewerSubscription
|
||||
? (
|
||||
<Button
|
||||
disabled={isUnsubscribing}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { getTrustCenterUrl } from "@probo/helpers";
|
||||
import { getCompliancePortalUrl } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Skeleton, TabLink, Tabs } from "@probo/ui";
|
||||
|
||||
@@ -31,12 +31,12 @@ export function MainSkeleton() {
|
||||
<Skeleton className="w-full h-300" />
|
||||
<main>
|
||||
<Tabs className="mb-8">
|
||||
<TabLink to={getTrustCenterUrl("overview")}>{__("Overview")}</TabLink>
|
||||
<TabLink to={getTrustCenterUrl("documents")}>{__("Documents")}</TabLink>
|
||||
<TabLink to={getTrustCenterUrl("subprocessors")}>
|
||||
<TabLink to={getCompliancePortalUrl("overview")}>{__("Overview")}</TabLink>
|
||||
<TabLink to={getCompliancePortalUrl("documents")}>{__("Documents")}</TabLink>
|
||||
<TabLink to={getCompliancePortalUrl("subprocessors")}>
|
||||
{__("Subprocessors")}
|
||||
</TabLink>
|
||||
<TabLink to={getTrustCenterUrl("updates")}>{__("Updates")}</TabLink>
|
||||
<TabLink to={getCompliancePortalUrl("updates")}>{__("Updates")}</TabLink>
|
||||
</Tabs>
|
||||
<TabSkeleton />
|
||||
</main>
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
|
||||
import { useContext } from "react";
|
||||
|
||||
import { TrustCenterContext } from "#/providers/TrustCenterProvider";
|
||||
import { CompliancePortalContext } from "#/providers/CompliancePortalProvider";
|
||||
|
||||
export function useTrustCenter(): {
|
||||
export function useCompliancePortal(): {
|
||||
id: string;
|
||||
title: string;
|
||||
} {
|
||||
const context = useContext(TrustCenterContext);
|
||||
const context = useContext(CompliancePortalContext);
|
||||
if (!context) {
|
||||
throw new Error("useTrustCenter must be used within a TrustCenterProvider");
|
||||
throw new Error("useCompliancePortal must be used within a CompliancePortalProvider");
|
||||
}
|
||||
return context;
|
||||
}
|
||||
@@ -65,9 +65,9 @@ const reportMutation = graphql`
|
||||
|
||||
const fileMutation = graphql`
|
||||
mutation useRequestAccessCallback_fileMutation(
|
||||
$input: RequestTrustCenterFileAccessInput!
|
||||
$input: RequestCompliancePortalFileAccessInput!
|
||||
) {
|
||||
requestTrustCenterFileAccess(input: $input) {
|
||||
requestCompliancePortalFileAccess(input: $input) {
|
||||
file {
|
||||
access {
|
||||
id
|
||||
@@ -81,7 +81,7 @@ const fileMutation = graphql`
|
||||
const allMutation = graphql`
|
||||
mutation useRequestAccessCallback_allMutation {
|
||||
requestAllAccesses {
|
||||
trustCenterAccess {
|
||||
compliancePortalAccess {
|
||||
id
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ export function useRequestAccessCallback() {
|
||||
searchParams.delete("request-file-id");
|
||||
void requestFileAccess({
|
||||
variables: {
|
||||
input: { trustCenterFileId: fileId },
|
||||
input: { compliancePortalFileId: fileId },
|
||||
},
|
||||
onCompleted: (_, errors) => {
|
||||
if (errors?.length) {
|
||||
|
||||
@@ -26,42 +26,42 @@ import { Outlet } from "react-router";
|
||||
|
||||
import { OrganizationSidebar } from "#/components/OrganizationSidebar";
|
||||
import { useRequestAccessCallback } from "#/hooks/useRequestAccessCallback";
|
||||
import { TrustCenterProvider } from "#/providers/TrustCenterProvider";
|
||||
import type { TrustGraphCurrentQuery } from "#/queries/__generated__/TrustGraphCurrentQuery.graphql";
|
||||
import { currentTrustGraphQuery } from "#/queries/TrustGraph";
|
||||
import { CompliancePortalProvider } from "#/providers/CompliancePortalProvider";
|
||||
import type { CompliancePortalGraphCurrentQuery } from "#/queries/__generated__/CompliancePortalGraphCurrentQuery.graphql";
|
||||
import { currentCompliancePortalGraphQuery } from "#/queries/CompliancePortalGraph";
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<TrustGraphCurrentQuery>;
|
||||
queryRef: PreloadedQuery<CompliancePortalGraphCurrentQuery>;
|
||||
};
|
||||
|
||||
export function MainLayout(props: Props) {
|
||||
const { __ } = useTranslate();
|
||||
const data = usePreloadedQuery<TrustGraphCurrentQuery>(currentTrustGraphQuery, props.queryRef);
|
||||
const trustCenter = data.currentTrustCenter;
|
||||
const data = usePreloadedQuery<CompliancePortalGraphCurrentQuery>(currentCompliancePortalGraphQuery, props.queryRef);
|
||||
const compliancePortal = data.currentCompliancePortal;
|
||||
const isAuthenticated = data.viewer != null;
|
||||
|
||||
const theme = useSystemTheme();
|
||||
|
||||
useFavicon(
|
||||
theme === "dark"
|
||||
? (trustCenter?.darkLogo?.downloadUrl ?? trustCenter?.logo?.downloadUrl)
|
||||
: trustCenter?.logo?.downloadUrl,
|
||||
? (compliancePortal?.darkLogo?.downloadUrl ?? compliancePortal?.logo?.downloadUrl)
|
||||
: compliancePortal?.logo?.downloadUrl,
|
||||
);
|
||||
useRequestAccessCallback();
|
||||
|
||||
return (
|
||||
<TrustCenterProvider trustCenter={trustCenter}>
|
||||
<CompliancePortalProvider compliancePortal={compliancePortal}>
|
||||
<div className="grid grid-cols-1 max-w-[1280px] mx-4 pt-6 gap-4 lg:mx-auto lg:gap-10 lg:pt-20 lg:grid-cols-[400px_1fr] lg:items-start ">
|
||||
<OrganizationSidebar trustCenter={trustCenter} isAuthenticated={isAuthenticated} />
|
||||
<OrganizationSidebar compliancePortal={compliancePortal} isAuthenticated={isAuthenticated} />
|
||||
<main>
|
||||
<Tabs className="mb-8">
|
||||
<TabLink to="/overview">{__("Overview")}</TabLink>
|
||||
<TabLink to="/documents">{__("Documents")}</TabLink>
|
||||
{trustCenter.subprocessorInfo.totalCount > 0
|
||||
{compliancePortal.subprocessorInfo.totalCount > 0
|
||||
&& <TabLink to="/subprocessors">{__("Subprocessors")}</TabLink>}
|
||||
<TabLink to="/updates">{__("Updates")}</TabLink>
|
||||
</Tabs>
|
||||
<Outlet context={{ trustCenter }} />
|
||||
<Outlet context={{ compliancePortal }} />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -73,6 +73,6 @@ export function MainLayout(props: Props) {
|
||||
{" "}
|
||||
<Logo withPicto className="h-6" />
|
||||
</a>
|
||||
</TrustCenterProvider>
|
||||
</CompliancePortalProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,15 +43,15 @@ import { PDFPreview } from "#/components/PDFPreview";
|
||||
|
||||
import type { DocumentPageExportDocumentMutation } from "./__generated__/DocumentPageExportDocumentMutation.graphql";
|
||||
import type { DocumentPageExportReportMutation } from "./__generated__/DocumentPageExportReportMutation.graphql";
|
||||
import type { DocumentPageExportTrustCenterFileMutation } from "./__generated__/DocumentPageExportTrustCenterFileMutation.graphql";
|
||||
import type { DocumentPageExportCompliancePortalFileMutation } from "./__generated__/DocumentPageExportCompliancePortalFileMutation.graphql";
|
||||
import type { DocumentPageQuery as DocumentPageQueryType } from "./__generated__/DocumentPageQuery.graphql";
|
||||
import type { DocumentPageRequestDocumentAccessMutation } from "./__generated__/DocumentPageRequestDocumentAccessMutation.graphql";
|
||||
import type { DocumentPageRequestReportAccessMutation } from "./__generated__/DocumentPageRequestReportAccessMutation.graphql";
|
||||
import type { DocumentPageRequestTrustCenterFileAccessMutation } from "./__generated__/DocumentPageRequestTrustCenterFileAccessMutation.graphql";
|
||||
import type { DocumentPageRequestCompliancePortalFileAccessMutation } from "./__generated__/DocumentPageRequestCompliancePortalFileAccessMutation.graphql";
|
||||
|
||||
export const documentPageQuery = graphql`
|
||||
query DocumentPageQuery($alias: String!) {
|
||||
currentTrustCenter {
|
||||
currentCompliancePortal {
|
||||
logo {
|
||||
downloadUrl
|
||||
}
|
||||
@@ -70,7 +70,7 @@ export const documentPageQuery = graphql`
|
||||
status
|
||||
}
|
||||
}
|
||||
... on TrustCenterFile {
|
||||
... on CompliancePortalFile {
|
||||
id
|
||||
name
|
||||
isUserAuthorized
|
||||
@@ -102,11 +102,11 @@ const exportDocumentMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
const exportTrustCenterFileMutation = graphql`
|
||||
mutation DocumentPageExportTrustCenterFileMutation(
|
||||
$input: ExportTrustCenterFileInput!
|
||||
const exportCompliancePortalFileMutation = graphql`
|
||||
mutation DocumentPageExportCompliancePortalFileMutation(
|
||||
$input: ExportCompliancePortalFileInput!
|
||||
) {
|
||||
exportTrustCenterFile(input: $input) {
|
||||
exportCompliancePortalFile(input: $input) {
|
||||
data
|
||||
}
|
||||
}
|
||||
@@ -137,11 +137,11 @@ const requestDocumentAccessMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
const requestTrustCenterFileAccessMutation = graphql`
|
||||
mutation DocumentPageRequestTrustCenterFileAccessMutation(
|
||||
$input: RequestTrustCenterFileAccessInput!
|
||||
const requestCompliancePortalFileAccessMutation = graphql`
|
||||
mutation DocumentPageRequestCompliancePortalFileAccessMutation(
|
||||
$input: RequestCompliancePortalFileAccessInput!
|
||||
) {
|
||||
requestTrustCenterFileAccess(input: $input) {
|
||||
requestCompliancePortalFileAccess(input: $input) {
|
||||
file {
|
||||
access {
|
||||
id
|
||||
@@ -192,7 +192,7 @@ function getNodeTitle(node: DocumentPageQueryType["response"]["aliasedNode"]): s
|
||||
switch (node.__typename) {
|
||||
case "Document":
|
||||
return node.title;
|
||||
case "TrustCenterFile":
|
||||
case "CompliancePortalFile":
|
||||
return node.name;
|
||||
case "AuditReport":
|
||||
return node.fileName;
|
||||
@@ -204,7 +204,7 @@ function getNodeTitle(node: DocumentPageQueryType["response"]["aliasedNode"]): s
|
||||
function getNodeId(node: DocumentPageQueryType["response"]["aliasedNode"]): string | undefined {
|
||||
switch (node.__typename) {
|
||||
case "Document":
|
||||
case "TrustCenterFile":
|
||||
case "CompliancePortalFile":
|
||||
case "AuditReport":
|
||||
return node.id;
|
||||
default:
|
||||
@@ -224,12 +224,12 @@ export function DocumentPage({ queryRef }: Props) {
|
||||
const [exportError, setExportError] = useState<string | null>(null);
|
||||
|
||||
const data = usePreloadedQuery<DocumentPageQueryType>(documentPageQuery, queryRef);
|
||||
const trustCenter = data.currentTrustCenter;
|
||||
const compliancePortal = data.currentCompliancePortal;
|
||||
const node = data.aliasedNode;
|
||||
|
||||
if (
|
||||
node.__typename !== "Document"
|
||||
&& node.__typename !== "TrustCenterFile"
|
||||
&& node.__typename !== "CompliancePortalFile"
|
||||
&& node.__typename !== "AuditReport"
|
||||
) {
|
||||
throw new Error(`Unexpected node type: ${node.__typename}`);
|
||||
@@ -239,19 +239,19 @@ export function DocumentPage({ queryRef }: Props) {
|
||||
const nodeId = getNodeId(node);
|
||||
|
||||
const logoFileUrl = theme === "dark"
|
||||
? (trustCenter?.darkLogo?.downloadUrl ?? trustCenter?.logo?.downloadUrl)
|
||||
: trustCenter?.logo?.downloadUrl;
|
||||
? (compliancePortal?.darkLogo?.downloadUrl ?? compliancePortal?.logo?.downloadUrl)
|
||||
: compliancePortal?.logo?.downloadUrl;
|
||||
|
||||
const [exportDocument, isExportingDocument]
|
||||
= useMutation<DocumentPageExportDocumentMutation>(exportDocumentMutation);
|
||||
const [exportFile, isExportingFile]
|
||||
= useMutation<DocumentPageExportTrustCenterFileMutation>(exportTrustCenterFileMutation);
|
||||
= useMutation<DocumentPageExportCompliancePortalFileMutation>(exportCompliancePortalFileMutation);
|
||||
const [exportReport, isExportingReport]
|
||||
= useMutation<DocumentPageExportReportMutation>(exportReportMutation);
|
||||
const [requestAccess, isRequestingAccess]
|
||||
= useMutation<DocumentPageRequestDocumentAccessMutation>(requestDocumentAccessMutation);
|
||||
const [requestFileAccess, isRequestingFileAccess]
|
||||
= useMutation<DocumentPageRequestTrustCenterFileAccessMutation>(requestTrustCenterFileAccessMutation);
|
||||
= useMutation<DocumentPageRequestCompliancePortalFileAccessMutation>(requestCompliancePortalFileAccessMutation);
|
||||
const [requestReportAccess, isRequestingReportAccess]
|
||||
= useMutation<DocumentPageRequestReportAccessMutation>(requestReportAccessMutation);
|
||||
|
||||
@@ -291,15 +291,15 @@ export function DocumentPage({ queryRef }: Props) {
|
||||
onError,
|
||||
});
|
||||
break;
|
||||
case "TrustCenterFile":
|
||||
case "CompliancePortalFile":
|
||||
exportFile({
|
||||
variables: { input: { trustCenterFileId: node.id } },
|
||||
variables: { input: { compliancePortalFileId: node.id } },
|
||||
onCompleted: (response, errors) => {
|
||||
if (onCompletedErrors(errors)) return;
|
||||
if (isPdfDataUri(response.exportTrustCenterFile.data)) {
|
||||
setPdfData(response.exportTrustCenterFile.data);
|
||||
if (isPdfDataUri(response.exportCompliancePortalFile.data)) {
|
||||
setPdfData(response.exportCompliancePortalFile.data);
|
||||
} else {
|
||||
setFileData(response.exportTrustCenterFile.data);
|
||||
setFileData(response.exportCompliancePortalFile.data);
|
||||
}
|
||||
},
|
||||
onError,
|
||||
@@ -359,9 +359,9 @@ export function DocumentPage({ queryRef }: Props) {
|
||||
onError,
|
||||
});
|
||||
break;
|
||||
case "TrustCenterFile":
|
||||
case "CompliancePortalFile":
|
||||
requestFileAccess({
|
||||
variables: { input: { trustCenterFileId: node.id } },
|
||||
variables: { input: { compliancePortalFileId: node.id } },
|
||||
onCompleted,
|
||||
onError,
|
||||
});
|
||||
@@ -378,7 +378,7 @@ export function DocumentPage({ queryRef }: Props) {
|
||||
|
||||
const isRequesting = isRequestingAccess || isRequestingFileAccess || isRequestingReportAccess;
|
||||
const hasRequested = node.access?.status === "REQUESTED";
|
||||
const isPdf = node.__typename === "Document" || node.__typename === "AuditReport" || (node.__typename === "TrustCenterFile" && pdfData !== null);
|
||||
const isPdf = node.__typename === "Document" || node.__typename === "AuditReport" || (node.__typename === "CompliancePortalFile" && pdfData !== null);
|
||||
|
||||
const handleDownload = () => {
|
||||
if (!fileData || !nodeTitle) return;
|
||||
|
||||
@@ -26,25 +26,25 @@ import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
||||
import { DocumentRow } from "#/components/DocumentRow";
|
||||
import { RowHeader } from "#/components/RowHeader";
|
||||
import { Rows } from "#/components/Rows";
|
||||
import { TrustCenterFileRow } from "#/components/TrustCenterFileRow";
|
||||
import { CompliancePortalFileRow } from "#/components/CompliancePortalFileRow";
|
||||
import { documentTypeLabel } from "#/helpers/documents";
|
||||
import type { TrustGraphCurrentDocumentsQuery } from "#/queries/__generated__/TrustGraphCurrentDocumentsQuery.graphql";
|
||||
import { currentTrustDocumentsQuery } from "#/queries/TrustGraph";
|
||||
import type { CompliancePortalGraphCurrentDocumentsQuery } from "#/queries/__generated__/CompliancePortalGraphCurrentDocumentsQuery.graphql";
|
||||
import { currentTrustDocumentsQuery } from "#/queries/CompliancePortalGraph";
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<TrustGraphCurrentDocumentsQuery>;
|
||||
queryRef: PreloadedQuery<CompliancePortalGraphCurrentDocumentsQuery>;
|
||||
};
|
||||
|
||||
export function DocumentsPage({ queryRef }: Props) {
|
||||
const { __ } = useTranslate();
|
||||
const data = usePreloadedQuery<TrustGraphCurrentDocumentsQuery>(
|
||||
const data = usePreloadedQuery<CompliancePortalGraphCurrentDocumentsQuery>(
|
||||
currentTrustDocumentsQuery,
|
||||
queryRef,
|
||||
);
|
||||
const documents
|
||||
= data.currentTrustCenter?.documents.edges.map(edge => edge.node) ?? [];
|
||||
= data.currentCompliancePortal?.documents.edges.map(edge => edge.node) ?? [];
|
||||
const files
|
||||
= data.currentTrustCenter?.trustCenterFiles.edges.map(edge => edge.node) ?? [];
|
||||
= data.currentCompliancePortal?.compliancePortalFiles.edges.map(edge => edge.node) ?? [];
|
||||
const documentsPerType = groupBy(documents, document =>
|
||||
documentTypeLabel(document.documentType, __),
|
||||
);
|
||||
@@ -68,7 +68,7 @@ export function DocumentsPage({ queryRef }: Props) {
|
||||
<Fragment key={category}>
|
||||
<RowHeader>{category}</RowHeader>
|
||||
{files.map(file => (
|
||||
<TrustCenterFileRow key={file.id} file={file} />
|
||||
<CompliancePortalFileRow key={file.id} file={file} />
|
||||
))}
|
||||
</Fragment>
|
||||
))}
|
||||
|
||||
@@ -46,7 +46,7 @@ export const ndaPageQuery = graphql`
|
||||
# eslint-disable-next-line relay/unused-fields
|
||||
id
|
||||
}
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
title
|
||||
nonDisclosureAgreement {
|
||||
fileName
|
||||
@@ -61,7 +61,7 @@ export const ndaPageQuery = graphql`
|
||||
`;
|
||||
|
||||
const ndaPageFragment = graphql`
|
||||
fragment NDAPageFragment on TrustCenter
|
||||
fragment NDAPageFragment on CompliancePortal
|
||||
@refetchable(queryName: "NDAPageRefetchQuery") {
|
||||
nonDisclosureAgreement @required(action: THROW) {
|
||||
viewerSignature {
|
||||
@@ -108,12 +108,12 @@ export function NDAPage(props: {
|
||||
const isDesktop = !isMobile;
|
||||
|
||||
const queryData = usePreloadedQuery<NDAPageQueryType>(ndaPageQuery, props.queryRef);
|
||||
const trustCenter = queryData.currentTrustCenter;
|
||||
const compliancePortal = queryData.currentCompliancePortal;
|
||||
const viewer = queryData.viewer;
|
||||
|
||||
const [data, refetch] = useRefetchableFragment<NDAPageRefetchQuery, NDAPageFragment$key>(
|
||||
ndaPageFragment,
|
||||
trustCenter,
|
||||
compliancePortal,
|
||||
);
|
||||
const ndaSignature = data.nonDisclosureAgreement.viewerSignature;
|
||||
|
||||
@@ -217,7 +217,7 @@ export function NDAPage(props: {
|
||||
});
|
||||
};
|
||||
|
||||
const nda = trustCenter.nonDisclosureAgreement;
|
||||
const nda = compliancePortal.nonDisclosureAgreement;
|
||||
if (!viewer) {
|
||||
return <Navigate to="/connect" replace />;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ export function NDAPage(props: {
|
||||
__(
|
||||
"%s requires you to sign an NDA before accessing compliance documents.",
|
||||
),
|
||||
trustCenter.title,
|
||||
compliancePortal.title,
|
||||
)}
|
||||
</p>
|
||||
{isMobile && nda?.fileUrl && (
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
import {
|
||||
getTrustCenterUrl,
|
||||
getCompliancePortalUrl,
|
||||
groupBy,
|
||||
objectEntries,
|
||||
sprintf,
|
||||
@@ -36,9 +36,9 @@ import { DocumentRow } from "#/components/DocumentRow";
|
||||
import { RowHeader } from "#/components/RowHeader";
|
||||
import { Rows } from "#/components/Rows";
|
||||
import { SubprocessorRow } from "#/components/SubprocessorRow";
|
||||
import { TrustCenterFileRow } from "#/components/TrustCenterFileRow";
|
||||
import { CompliancePortalFileRow } from "#/components/CompliancePortalFileRow";
|
||||
import { documentTypeLabel } from "#/helpers/documents";
|
||||
import type { TrustGraphCurrentQuery$data } from "#/queries/__generated__/TrustGraphCurrentQuery.graphql";
|
||||
import type { CompliancePortalGraphCurrentQuery$data } from "#/queries/__generated__/CompliancePortalGraphCurrentQuery.graphql";
|
||||
|
||||
import type {
|
||||
OverviewPageFragment$data,
|
||||
@@ -46,7 +46,7 @@ import type {
|
||||
} from "./__generated__/OverviewPageFragment.graphql";
|
||||
|
||||
const overviewFragment = graphql`
|
||||
fragment OverviewPageFragment on TrustCenter {
|
||||
fragment OverviewPageFragment on CompliancePortal {
|
||||
references(first: 14) {
|
||||
edges {
|
||||
node {
|
||||
@@ -77,12 +77,12 @@ const overviewFragment = graphql`
|
||||
}
|
||||
}
|
||||
}
|
||||
trustCenterFiles(first: 5) {
|
||||
compliancePortalFiles(first: 5) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
category
|
||||
...TrustCenterFileRowFragment
|
||||
...CompliancePortalFileRowFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,26 +90,26 @@ const overviewFragment = graphql`
|
||||
`;
|
||||
|
||||
export function OverviewPage() {
|
||||
const { trustCenter } = useOutletContext<{
|
||||
trustCenter: OverviewPageFragment$key
|
||||
& TrustGraphCurrentQuery$data["currentTrustCenter"];
|
||||
const { compliancePortal } = useOutletContext<{
|
||||
compliancePortal: OverviewPageFragment$key
|
||||
& CompliancePortalGraphCurrentQuery$data["currentCompliancePortal"];
|
||||
}>();
|
||||
const fragment = useFragment(overviewFragment, trustCenter);
|
||||
const fragment = useFragment(overviewFragment, compliancePortal);
|
||||
return (
|
||||
<div>
|
||||
<References
|
||||
references={fragment.references.edges.map(edge => edge.node)}
|
||||
/>
|
||||
<Documents
|
||||
audits={trustCenter.audits.edges}
|
||||
audits={compliancePortal.audits.edges}
|
||||
documents={fragment.documents.edges}
|
||||
files={fragment.trustCenterFiles.edges}
|
||||
url={getTrustCenterUrl("documents")}
|
||||
files={fragment.compliancePortalFiles.edges}
|
||||
url={getCompliancePortalUrl("documents")}
|
||||
/>
|
||||
<Subprocessors
|
||||
title={trustCenter.title}
|
||||
title={compliancePortal.title}
|
||||
subprocessors={fragment.subprocessors.edges}
|
||||
url={getTrustCenterUrl("subprocessors")}
|
||||
url={getCompliancePortalUrl("subprocessors")}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
@@ -122,9 +122,9 @@ function Documents({
|
||||
url,
|
||||
}: {
|
||||
documents: OverviewPageFragment$data["documents"]["edges"];
|
||||
files: OverviewPageFragment$data["trustCenterFiles"]["edges"];
|
||||
files: OverviewPageFragment$data["compliancePortalFiles"]["edges"];
|
||||
audits: NonNullable<
|
||||
TrustGraphCurrentQuery$data["currentTrustCenter"]
|
||||
CompliancePortalGraphCurrentQuery$data["currentCompliancePortal"]
|
||||
>["audits"]["edges"];
|
||||
url: string;
|
||||
}) {
|
||||
@@ -171,7 +171,7 @@ function Documents({
|
||||
<Fragment key={category}>
|
||||
<RowHeader>{category}</RowHeader>
|
||||
{files.map(file => (
|
||||
<TrustCenterFileRow key={file.id} file={file} />
|
||||
<CompliancePortalFileRow key={file.id} file={file} />
|
||||
))}
|
||||
</Fragment>
|
||||
))}
|
||||
|
||||
@@ -24,18 +24,18 @@ import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
||||
|
||||
import { Rows } from "#/components/Rows";
|
||||
import { SubprocessorRow } from "#/components/SubprocessorRow";
|
||||
import type { TrustGraphCurrentSubprocessorsQuery } from "#/queries/__generated__/TrustGraphCurrentSubprocessorsQuery.graphql";
|
||||
import { currentTrustSubprocessorsQuery } from "#/queries/TrustGraph";
|
||||
import type { CompliancePortalGraphCurrentSubprocessorsQuery } from "#/queries/__generated__/CompliancePortalGraphCurrentSubprocessorsQuery.graphql";
|
||||
import { currentTrustSubprocessorsQuery } from "#/queries/CompliancePortalGraph";
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<TrustGraphCurrentSubprocessorsQuery>;
|
||||
queryRef: PreloadedQuery<CompliancePortalGraphCurrentSubprocessorsQuery>;
|
||||
};
|
||||
|
||||
export function SubprocessorsPage({ queryRef }: Props) {
|
||||
const { __ } = useTranslate();
|
||||
const data = usePreloadedQuery<TrustGraphCurrentSubprocessorsQuery>(currentTrustSubprocessorsQuery, queryRef);
|
||||
const data = usePreloadedQuery<CompliancePortalGraphCurrentSubprocessorsQuery>(currentTrustSubprocessorsQuery, queryRef);
|
||||
const subprocessors
|
||||
= data.currentTrustCenter?.subprocessors.edges.map(edge => edge.node) ?? [];
|
||||
= data.currentCompliancePortal?.subprocessors.edges.map(edge => edge.node) ?? [];
|
||||
|
||||
const hasAnyCountries = subprocessors.some(subprocessor => subprocessor.countries.length > 0);
|
||||
|
||||
@@ -45,7 +45,7 @@ export function SubprocessorsPage({ queryRef }: Props) {
|
||||
<p className="text-sm text-txt-secondary mb-4">
|
||||
{sprintf(
|
||||
__("Third-party subprocessors %s work with:"),
|
||||
data.currentTrustCenter?.title ?? "",
|
||||
data.currentCompliancePortal?.title ?? "",
|
||||
)}
|
||||
</p>
|
||||
<Rows>
|
||||
|
||||
@@ -29,7 +29,7 @@ import type { UpdatesPageQuery } from "#/pages/__generated__/UpdatesPageQuery.gr
|
||||
|
||||
export const currentTrustUpdatesQuery = graphql`
|
||||
query UpdatesPageQuery {
|
||||
currentTrustCenter {
|
||||
currentCompliancePortal {
|
||||
id
|
||||
updates(first: 50) {
|
||||
edges {
|
||||
@@ -57,7 +57,7 @@ export function UpdatesPage({ queryRef }: Props) {
|
||||
);
|
||||
|
||||
const items
|
||||
= data.currentTrustCenter?.updates.edges.map(e => e.node) ?? [];
|
||||
= data.currentCompliancePortal?.updates.edges.map(e => e.node) ?? [];
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -28,7 +28,7 @@ import type { AuthLayoutQuery } from "./__generated__/AuthLayoutQuery.graphql";
|
||||
|
||||
export const authLayoutQuery = graphql`
|
||||
query AuthLayoutQuery {
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
logo {
|
||||
downloadUrl
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export const authLayoutQuery = graphql`
|
||||
export function AuthLayout(props: { queryRef: PreloadedQuery<AuthLayoutQuery> }) {
|
||||
const { queryRef } = props;
|
||||
|
||||
const { currentTrustCenter: compliancePage } = usePreloadedQuery<AuthLayoutQuery>(authLayoutQuery, queryRef);
|
||||
const { currentCompliancePortal: compliancePage } = usePreloadedQuery<AuthLayoutQuery>(authLayoutQuery, queryRef);
|
||||
const theme = useSystemTheme();
|
||||
|
||||
const logoFileUrl = theme === "dark"
|
||||
|
||||
@@ -30,7 +30,7 @@ import type { ConnectPageQuery } from "./__generated__/ConnectPageQuery.graphql"
|
||||
|
||||
export const connectPageQuery = graphql`
|
||||
query ConnectPageQuery {
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
title
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ export function ConnectPage(props: {
|
||||
const safeContinueUrl = useSafeContinueUrl();
|
||||
|
||||
const {
|
||||
currentTrustCenter: { title },
|
||||
currentCompliancePortal: { title },
|
||||
} = usePreloadedQuery<ConnectPageQuery>(connectPageQuery, queryRef);
|
||||
|
||||
usePageTitle(__(`Connect to ${title}'s Compliance Page`));
|
||||
|
||||
@@ -20,22 +20,22 @@
|
||||
|
||||
import { createContext, type ReactNode } from "react";
|
||||
|
||||
import type { TrustGraphCurrentQuery$data } from "#/queries/__generated__/TrustGraphCurrentQuery.graphql";
|
||||
import type { CompliancePortalGraphCurrentQuery$data } from "#/queries/__generated__/CompliancePortalGraphCurrentQuery.graphql";
|
||||
|
||||
export const TrustCenterContext = createContext<
|
||||
TrustGraphCurrentQuery$data["currentTrustCenter"] | null
|
||||
export const CompliancePortalContext = createContext<
|
||||
CompliancePortalGraphCurrentQuery$data["currentCompliancePortal"] | null
|
||||
>(null);
|
||||
|
||||
export const TrustCenterProvider = ({
|
||||
export const CompliancePortalProvider = ({
|
||||
children,
|
||||
trustCenter,
|
||||
compliancePortal,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
trustCenter: TrustGraphCurrentQuery$data["currentTrustCenter"];
|
||||
compliancePortal: CompliancePortalGraphCurrentQuery$data["currentCompliancePortal"];
|
||||
}) => {
|
||||
return (
|
||||
<TrustCenterContext.Provider value={trustCenter}>
|
||||
<CompliancePortalContext.Provider value={compliancePortal}>
|
||||
{children}
|
||||
</TrustCenterContext.Provider>
|
||||
</CompliancePortalContext.Provider>
|
||||
);
|
||||
};
|
||||
@@ -23,12 +23,12 @@ import { graphql } from "relay-runtime";
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
|
||||
// Queries for custom domain (subdomain) approach
|
||||
export const currentTrustGraphQuery = graphql`
|
||||
query TrustGraphCurrentQuery {
|
||||
export const currentCompliancePortalGraphQuery = graphql`
|
||||
query CompliancePortalGraphCurrentQuery {
|
||||
viewer {
|
||||
id
|
||||
}
|
||||
currentTrustCenter @required(action: THROW) {
|
||||
currentCompliancePortal @required(action: THROW) {
|
||||
id
|
||||
slug
|
||||
title
|
||||
@@ -91,8 +91,8 @@ export const currentTrustGraphQuery = graphql`
|
||||
`;
|
||||
|
||||
export const currentTrustDocumentsQuery = graphql`
|
||||
query TrustGraphCurrentDocumentsQuery {
|
||||
currentTrustCenter {
|
||||
query CompliancePortalGraphCurrentDocumentsQuery {
|
||||
currentCompliancePortal {
|
||||
id
|
||||
documents(first: 50) {
|
||||
edges {
|
||||
@@ -103,12 +103,12 @@ export const currentTrustDocumentsQuery = graphql`
|
||||
}
|
||||
}
|
||||
}
|
||||
trustCenterFiles(first: 50) {
|
||||
compliancePortalFiles(first: 50) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
category
|
||||
...TrustCenterFileRowFragment
|
||||
...CompliancePortalFileRowFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,8 +117,8 @@ export const currentTrustDocumentsQuery = graphql`
|
||||
`;
|
||||
|
||||
export const currentTrustSubprocessorsQuery = graphql`
|
||||
query TrustGraphCurrentSubprocessorsQuery {
|
||||
currentTrustCenter {
|
||||
query CompliancePortalGraphCurrentSubprocessorsQuery {
|
||||
currentCompliancePortal {
|
||||
id
|
||||
subprocessors(first: 50) {
|
||||
edges {
|
||||
@@ -36,9 +36,9 @@ import { SubprocessorsPage } from "#/pages/SubprocessorsPage";
|
||||
import { currentTrustUpdatesQuery, UpdatesPage } from "#/pages/UpdatesPage";
|
||||
import {
|
||||
currentTrustDocumentsQuery,
|
||||
currentTrustGraphQuery,
|
||||
currentCompliancePortalGraphQuery,
|
||||
currentTrustSubprocessorsQuery,
|
||||
} from "#/queries/TrustGraph";
|
||||
} from "#/queries/CompliancePortalGraph";
|
||||
|
||||
import { DocumentPageErrorBoundary } from "./components/DocumentPageErrorBoundary";
|
||||
import { PageError } from "./components/PageError";
|
||||
@@ -79,7 +79,7 @@ const routes = [
|
||||
{
|
||||
path: "/overview",
|
||||
loader: loaderFromQueryLoader(() =>
|
||||
loadQuery(consoleEnvironment, currentTrustGraphQuery, {}),
|
||||
loadQuery(consoleEnvironment, currentCompliancePortalGraphQuery, {}),
|
||||
),
|
||||
Component: withQueryRef(MainLayout),
|
||||
Fallback: MainSkeleton,
|
||||
@@ -100,7 +100,7 @@ const routes = [
|
||||
{
|
||||
path: "/documents",
|
||||
loader: loaderFromQueryLoader(() =>
|
||||
loadQuery(consoleEnvironment, currentTrustGraphQuery, {}),
|
||||
loadQuery(consoleEnvironment, currentCompliancePortalGraphQuery, {}),
|
||||
),
|
||||
Component: withQueryRef(MainLayout),
|
||||
Fallback: MainSkeleton,
|
||||
@@ -119,7 +119,7 @@ const routes = [
|
||||
{
|
||||
path: "/subprocessors",
|
||||
loader: loaderFromQueryLoader(() =>
|
||||
loadQuery(consoleEnvironment, currentTrustGraphQuery, {}),
|
||||
loadQuery(consoleEnvironment, currentCompliancePortalGraphQuery, {}),
|
||||
),
|
||||
Component: withQueryRef(MainLayout),
|
||||
Fallback: MainSkeleton,
|
||||
@@ -138,7 +138,7 @@ const routes = [
|
||||
{
|
||||
path: "/updates",
|
||||
loader: loaderFromQueryLoader(() =>
|
||||
loadQuery(consoleEnvironment, currentTrustGraphQuery, {}),
|
||||
loadQuery(consoleEnvironment, currentCompliancePortalGraphQuery, {}),
|
||||
),
|
||||
Component: withQueryRef(MainLayout),
|
||||
Fallback: MainSkeleton,
|
||||
|
||||
Reference in New Issue
Block a user