Show custom domain URL on trust center page when configured

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-10-13 23:02:37 +02:00
parent eedb4861d2
commit a848f81a5c
3 changed files with 63 additions and 32 deletions

View File

@@ -8,6 +8,10 @@ export const trustCenterQuery = graphql`
... on Organization { ... on Organization {
id id
name name
customDomain {
id
domain
}
trustCenter { trustCenter {
id id
active active

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<da6b3823d7bc60f99482bce2b08b9668>> * @generated SignedSource<<8cd42363722a49fe7e843086be0c6b4f>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -23,6 +23,10 @@ export type TrustCenterGraphQuery$data = {
}; };
}>; }>;
}; };
readonly customDomain?: {
readonly domain: string;
readonly id: string;
} | null | undefined;
readonly documents?: { readonly documents?: {
readonly edges: ReadonlyArray<{ readonly edges: ReadonlyArray<{
readonly node: { readonly node: {
@@ -100,32 +104,51 @@ v3 = {
"storageKey": null "storageKey": null
}, },
v4 = { v4 = {
"alias": null,
"args": null,
"concreteType": "CustomDomain",
"kind": "LinkedField",
"name": "customDomain",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "createdAt", "name": "domain",
"storageKey": null
}
],
"storageKey": null "storageKey": null
}, },
v5 = { v5 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "updatedAt", "name": "createdAt",
"storageKey": null "storageKey": null
}, },
v6 = { v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
v7 = {
"kind": "Literal", "kind": "Literal",
"name": "first", "name": "first",
"value": 100 "value": 100
}, },
v7 = { v8 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "description", "name": "description",
"storageKey": null "storageKey": null
}, },
v8 = { v9 = {
"alias": null, "alias": null,
"args": null, "args": null,
"concreteType": "TrustCenter", "concreteType": "TrustCenter",
@@ -162,12 +185,12 @@ v8 = {
"name": "ndaFileUrl", "name": "ndaFileUrl",
"storageKey": null "storageKey": null
}, },
(v4/*: any*/),
(v5/*: any*/), (v5/*: any*/),
(v6/*: any*/),
{ {
"alias": null, "alias": null,
"args": [ "args": [
(v6/*: any*/), (v7/*: any*/),
{ {
"kind": "Literal", "kind": "Literal",
"name": "orderBy", "name": "orderBy",
@@ -200,7 +223,7 @@ v8 = {
"selections": [ "selections": [
(v2/*: any*/), (v2/*: any*/),
(v3/*: any*/), (v3/*: any*/),
(v7/*: any*/), (v8/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -215,8 +238,8 @@ v8 = {
"name": "logoUrl", "name": "logoUrl",
"storageKey": null "storageKey": null
}, },
(v4/*: any*/), (v5/*: any*/),
(v5/*: any*/) (v6/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -229,10 +252,10 @@ v8 = {
], ],
"storageKey": null "storageKey": null
}, },
v9 = [ v10 = [
(v6/*: any*/) (v7/*: any*/)
], ],
v10 = { v11 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
@@ -259,10 +282,11 @@ return {
"selections": [ "selections": [
(v2/*: any*/), (v2/*: any*/),
(v3/*: any*/), (v3/*: any*/),
(v8/*: any*/), (v4/*: any*/),
(v9/*: any*/),
{ {
"alias": null, "alias": null,
"args": (v9/*: any*/), "args": (v10/*: any*/),
"concreteType": "DocumentConnection", "concreteType": "DocumentConnection",
"kind": "LinkedField", "kind": "LinkedField",
"name": "documents", "name": "documents",
@@ -301,7 +325,7 @@ return {
}, },
{ {
"alias": null, "alias": null,
"args": (v9/*: any*/), "args": (v10/*: any*/),
"concreteType": "AuditConnection", "concreteType": "AuditConnection",
"kind": "LinkedField", "kind": "LinkedField",
"name": "audits", "name": "audits",
@@ -340,7 +364,7 @@ return {
}, },
{ {
"alias": null, "alias": null,
"args": (v9/*: any*/), "args": (v10/*: any*/),
"concreteType": "VendorConnection", "concreteType": "VendorConnection",
"kind": "LinkedField", "kind": "LinkedField",
"name": "vendors", "name": "vendors",
@@ -414,10 +438,11 @@ return {
"kind": "InlineFragment", "kind": "InlineFragment",
"selections": [ "selections": [
(v3/*: any*/), (v3/*: any*/),
(v8/*: any*/), (v4/*: any*/),
(v9/*: any*/),
{ {
"alias": null, "alias": null,
"args": (v9/*: any*/), "args": (v10/*: any*/),
"concreteType": "DocumentConnection", "concreteType": "DocumentConnection",
"kind": "LinkedField", "kind": "LinkedField",
"name": "documents", "name": "documents",
@@ -447,7 +472,7 @@ return {
"name": "title", "name": "title",
"storageKey": null "storageKey": null
}, },
(v4/*: any*/), (v5/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -455,7 +480,7 @@ return {
"name": "documentType", "name": "documentType",
"storageKey": null "storageKey": null
}, },
(v10/*: any*/), (v11/*: any*/),
{ {
"alias": null, "alias": null,
"args": [ "args": [
@@ -514,7 +539,7 @@ return {
}, },
{ {
"alias": null, "alias": null,
"args": (v9/*: any*/), "args": (v10/*: any*/),
"concreteType": "AuditConnection", "concreteType": "AuditConnection",
"kind": "LinkedField", "kind": "LinkedField",
"name": "audits", "name": "audits",
@@ -572,8 +597,8 @@ return {
"name": "state", "name": "state",
"storageKey": null "storageKey": null
}, },
(v10/*: any*/), (v11/*: any*/),
(v4/*: any*/) (v5/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -585,7 +610,7 @@ return {
}, },
{ {
"alias": null, "alias": null,
"args": (v9/*: any*/), "args": (v10/*: any*/),
"concreteType": "VendorConnection", "concreteType": "VendorConnection",
"kind": "LinkedField", "kind": "LinkedField",
"name": "vendors", "name": "vendors",
@@ -616,7 +641,7 @@ return {
"name": "category", "name": "category",
"storageKey": null "storageKey": null
}, },
(v7/*: any*/), (v8/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -624,7 +649,7 @@ return {
"name": "showOnTrustCenter", "name": "showOnTrustCenter",
"storageKey": null "storageKey": null
}, },
(v4/*: any*/) (v5/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -644,16 +669,16 @@ return {
] ]
}, },
"params": { "params": {
"cacheID": "3aed31b283ab7aa8e5ae0549474b449f", "cacheID": "5344c186b2f81c2e3e82e2e7398c477a",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "TrustCenterGraphQuery", "name": "TrustCenterGraphQuery",
"operationKind": "query", "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 trustCenterVisibility\n createdAt\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n trustCenterVisibility\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment TrustCenterVendorsCardFragment on Vendor {\n id\n name\n category\n description\n showOnTrustCenter\n createdAt\n}\n" "text": "query TrustCenterGraphQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n name\n customDomain {\n id\n domain\n }\n trustCenter {\n id\n active\n 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"
} }
}; };
})(); })();
(node as any).hash = "4d70dd23cdcdac7cd715b3eb9020ed37"; (node as any).hash = "e23ad5ad1f1e29900a49be2312244147";
export default node; export default node;

View File

@@ -158,7 +158,9 @@ export default function TrustCenterPage({ queryRef }: Props) {
}; };
const trustCenterUrl = organization.trustCenter?.slug const trustCenterUrl = organization.trustCenter?.slug
? `${window.location.origin}/trust/${organization.trustCenter.slug}` ? organization.customDomain?.domain
? `https://${organization.customDomain.domain}`
: `${window.location.origin}/trust/${organization.trustCenter.slug}`
: null; : null;