Add compliance page mailing list base

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-02-25 14:59:00 +01:00
parent c0a69100e8
commit 4d2cb793b6
50 changed files with 6365 additions and 110 deletions

View File

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

View File

@@ -0,0 +1,234 @@
/**
* @generated SignedSource<<e9dd50980011bde2eb30f8c1f7fd5344>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type MailingListSubscriberStatus = "CONFIRMED" | "PENDING";
import { FragmentRefs } from "relay-runtime";
export type CompliancePageMailingListFragment$data = {
readonly id: string;
readonly mailingList: {
readonly id: string;
readonly subscribers: {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly createdAt: string;
readonly email: string;
readonly fullName: string;
readonly id: string;
readonly status: MailingListSubscriberStatus;
};
}>;
readonly pageInfo: {
readonly endCursor: string | null | undefined;
readonly hasNextPage: boolean;
};
};
} | null | undefined;
readonly " $fragmentType": "CompliancePageMailingListFragment";
};
export type CompliancePageMailingListFragment$key = {
readonly " $data"?: CompliancePageMailingListFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageMailingListFragment">;
};
import CompliancePageMailingListQuery_graphql from './CompliancePageMailingListQuery.graphql';
const node: ReaderFragment = (function(){
var v0 = [
"mailingList",
"subscribers"
],
v1 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"argumentDefinitions": [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "after"
},
{
"defaultValue": 20,
"kind": "LocalArgument",
"name": "first"
}
],
"kind": "Fragment",
"metadata": {
"connection": [
{
"count": "first",
"cursor": "after",
"direction": "forward",
"path": (v0/*: any*/)
}
],
"refetch": {
"connection": {
"forward": {
"count": "first",
"cursor": "after"
},
"backward": null,
"path": (v0/*: any*/)
},
"fragmentPathInResult": [
"node"
],
"operation": CompliancePageMailingListQuery_graphql,
"identifierInfo": {
"identifierField": "id",
"identifierQueryVariableName": "id"
}
}
},
"name": "CompliancePageMailingListFragment",
"selections": [
{
"alias": null,
"args": null,
"concreteType": "MailingList",
"kind": "LinkedField",
"name": "mailingList",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": "subscribers",
"args": null,
"concreteType": "MailingListSubscriberConnection",
"kind": "LinkedField",
"name": "__CompliancePageMailingList_subscribers_connection",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "MailingListSubscriberEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "MailingListSubscriber",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": null
}
],
"storageKey": null
},
(v1/*: any*/)
],
"type": "TrustCenter",
"abstractKey": null
};
})();
(node as any).hash = "b1828ed7ded38bb3e3e150b0875ea0a6";
export default node;

View File

@@ -0,0 +1,327 @@
/**
* @generated SignedSource<<7e30e59b53799ccae49199d7b46f0320>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type CompliancePageMailingListPageQuery$variables = {
organizationId: string;
};
export type CompliancePageMailingListPageQuery$data = {
readonly organization: {
readonly __typename: "Organization";
readonly compliancePage: {
readonly id: string;
readonly mailingList: {
readonly id: string;
readonly replyTo: string | null | undefined;
} | null | undefined;
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageMailingListFragment">;
};
} | {
// This will never be '%other', but we need some
// value in case none of the concrete values match.
readonly __typename: "%other";
};
};
export type CompliancePageMailingListPageQuery = {
response: CompliancePageMailingListPageQuery$data;
variables: CompliancePageMailingListPageQuery$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "organizationId"
}
],
v1 = [
{
"kind": "Variable",
"name": "id",
"variableName": "organizationId"
}
],
v2 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "replyTo",
"storageKey": null
},
v5 = [
{
"kind": "Literal",
"name": "first",
"value": 20
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "CompliancePageMailingListPageQuery",
"selections": [
{
"alias": "organization",
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"kind": "RequiredField",
"field": {
"alias": "compliancePage",
"args": null,
"concreteType": "TrustCenter",
"kind": "LinkedField",
"name": "trustCenter",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "MailingList",
"kind": "LinkedField",
"name": "mailingList",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/)
],
"storageKey": null
},
{
"args": null,
"kind": "FragmentSpread",
"name": "CompliancePageMailingListFragment"
}
],
"storageKey": null
},
"action": "THROW"
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
],
"type": "Query",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "CompliancePageMailingListPageQuery",
"selections": [
{
"alias": "organization",
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"alias": "compliancePage",
"args": null,
"concreteType": "TrustCenter",
"kind": "LinkedField",
"name": "trustCenter",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "MailingList",
"kind": "LinkedField",
"name": "mailingList",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/),
{
"alias": null,
"args": (v5/*: any*/),
"concreteType": "MailingListSubscriberConnection",
"kind": "LinkedField",
"name": "subscribers",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "MailingListSubscriberEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "MailingListSubscriber",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
(v2/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": "subscribers(first:20)"
},
{
"alias": null,
"args": (v5/*: any*/),
"filters": null,
"handle": "connection",
"key": "CompliancePageMailingList_subscribers",
"kind": "LinkedHandle",
"name": "subscribers"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"type": "Organization",
"abstractKey": null
},
(v3/*: any*/)
],
"storageKey": null
}
]
},
"params": {
"cacheID": "8eb57a5cf8f8b1294da6aee3228176f3",
"id": null,
"metadata": {},
"name": "CompliancePageMailingListPageQuery",
"operationKind": "query",
"text": "query CompliancePageMailingListPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n compliancePage: trustCenter {\n id\n mailingList {\n id\n replyTo\n }\n ...CompliancePageMailingListFragment\n }\n }\n id\n }\n}\n\nfragment CompliancePageMailingListFragment on TrustCenter {\n mailingList {\n id\n subscribers(first: 20) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n id\n fullName\n email\n status\n createdAt\n __typename\n }\n cursor\n }\n }\n }\n id\n}\n"
}
};
})();
(node as any).hash = "0df7b2a8b9f0d2f421f354bd56773e43";
export default node;

View File

@@ -0,0 +1,114 @@
/**
* @generated SignedSource<<c5e3b54834d5bcf46746de91d32e964a>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type UpdateMailingListInput = {
id: string;
replyTo?: string | null | undefined;
};
export type CompliancePageMailingListPage_updateMailingListMutation$variables = {
input: UpdateMailingListInput;
};
export type CompliancePageMailingListPage_updateMailingListMutation$data = {
readonly updateMailingList: {
readonly mailingList: {
readonly id: string;
readonly replyTo: string | null | undefined;
};
};
};
export type CompliancePageMailingListPage_updateMailingListMutation = {
response: CompliancePageMailingListPage_updateMailingListMutation$data;
variables: CompliancePageMailingListPage_updateMailingListMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "UpdateMailingListPayload",
"kind": "LinkedField",
"name": "updateMailingList",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "MailingList",
"kind": "LinkedField",
"name": "mailingList",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "replyTo",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "CompliancePageMailingListPage_updateMailingListMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "CompliancePageMailingListPage_updateMailingListMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "30b67540b107297075df95ee044714ea",
"id": null,
"metadata": {},
"name": "CompliancePageMailingListPage_updateMailingListMutation",
"operationKind": "mutation",
"text": "mutation CompliancePageMailingListPage_updateMailingListMutation(\n $input: UpdateMailingListInput!\n) {\n updateMailingList(input: $input) {\n mailingList {\n id\n replyTo\n }\n }\n}\n"
}
};
})();
(node as any).hash = "0a1e6524623210147ba5db2affec456c";
export default node;

View File

@@ -0,0 +1,275 @@
/**
* @generated SignedSource<<88648e469580db301e2d4105dae6a072>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type CompliancePageMailingListQuery$variables = {
after?: string | null | undefined;
first?: number | null | undefined;
id: string;
};
export type CompliancePageMailingListQuery$data = {
readonly node: {
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageMailingListFragment">;
};
};
export type CompliancePageMailingListQuery = {
response: CompliancePageMailingListQuery$data;
variables: CompliancePageMailingListQuery$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "after"
},
{
"defaultValue": 20,
"kind": "LocalArgument",
"name": "first"
},
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "id"
}
],
v1 = [
{
"kind": "Variable",
"name": "id",
"variableName": "id"
}
],
v2 = [
{
"kind": "Variable",
"name": "after",
"variableName": "after"
},
{
"kind": "Variable",
"name": "first",
"variableName": "first"
}
],
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "CompliancePageMailingListQuery",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"args": (v2/*: any*/),
"kind": "FragmentSpread",
"name": "CompliancePageMailingListFragment"
}
],
"storageKey": null
}
],
"type": "Query",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "CompliancePageMailingListQuery",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"alias": null,
"args": null,
"concreteType": "MailingList",
"kind": "LinkedField",
"name": "mailingList",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "MailingListSubscriberConnection",
"kind": "LinkedField",
"name": "subscribers",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "MailingListSubscriberEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "MailingListSubscriber",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
(v3/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": null
},
{
"alias": null,
"args": (v2/*: any*/),
"filters": null,
"handle": "connection",
"key": "CompliancePageMailingList_subscribers",
"kind": "LinkedHandle",
"name": "subscribers"
}
],
"storageKey": null
}
],
"type": "TrustCenter",
"abstractKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "409500a631f678d3b173a2feae512f71",
"id": null,
"metadata": {},
"name": "CompliancePageMailingListQuery",
"operationKind": "query",
"text": "query CompliancePageMailingListQuery(\n $after: CursorKey = null\n $first: Int = 20\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...CompliancePageMailingListFragment_2HEEH6\n id\n }\n}\n\nfragment CompliancePageMailingListFragment_2HEEH6 on TrustCenter {\n mailingList {\n id\n subscribers(first: $first, after: $after) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n id\n fullName\n email\n status\n createdAt\n __typename\n }\n cursor\n }\n }\n }\n id\n}\n"
}
};
})();
(node as any).hash = "b1828ed7ded38bb3e3e150b0875ea0a6";
export default node;

View File

@@ -0,0 +1,201 @@
/**
* @generated SignedSource<<61ab320d87e6fb43d245dc070871a160>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type MailingListSubscriberStatus = "CONFIRMED" | "PENDING";
export type CreateMailingListSubscriberInput = {
email: string;
fullName: string;
mailingListId: string;
};
export type NewCompliancePageSubscriberDialogMutation$variables = {
connections: ReadonlyArray<string>;
input: CreateMailingListSubscriberInput;
};
export type NewCompliancePageSubscriberDialogMutation$data = {
readonly createMailingListSubscriber: {
readonly mailingListSubscriberEdge: {
readonly cursor: string;
readonly node: {
readonly createdAt: string;
readonly email: string;
readonly fullName: string;
readonly id: string;
readonly status: MailingListSubscriberStatus;
};
};
};
};
export type NewCompliancePageSubscriberDialogMutation = {
response: NewCompliancePageSubscriberDialogMutation$data;
variables: NewCompliancePageSubscriberDialogMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "connections"
},
v1 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
},
v2 = [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
v3 = {
"alias": null,
"args": null,
"concreteType": "MailingListSubscriberEdge",
"kind": "LinkedField",
"name": "mailingListSubscriberEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "MailingListSubscriber",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": [
(v0/*: any*/),
(v1/*: any*/)
],
"kind": "Fragment",
"metadata": null,
"name": "NewCompliancePageSubscriberDialogMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreateMailingListSubscriberPayload",
"kind": "LinkedField",
"name": "createMailingListSubscriber",
"plural": false,
"selections": [
(v3/*: any*/)
],
"storageKey": null
}
],
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": [
(v1/*: any*/),
(v0/*: any*/)
],
"kind": "Operation",
"name": "NewCompliancePageSubscriberDialogMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreateMailingListSubscriberPayload",
"kind": "LinkedField",
"name": "createMailingListSubscriber",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"filters": null,
"handle": "prependEdge",
"key": "",
"kind": "LinkedHandle",
"name": "mailingListSubscriberEdge",
"handleArgs": [
{
"kind": "Variable",
"name": "connections",
"variableName": "connections"
}
]
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "6029b34056e1e0477db8bec0080b4ad1",
"id": null,
"metadata": {},
"name": "NewCompliancePageSubscriberDialogMutation",
"operationKind": "mutation",
"text": "mutation NewCompliancePageSubscriberDialogMutation(\n $input: CreateMailingListSubscriberInput!\n) {\n createMailingListSubscriber(input: $input) {\n mailingListSubscriberEdge {\n cursor\n node {\n id\n fullName\n email\n status\n createdAt\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "fae262a9df20589ff2923f631692a6ce";
export default node;

View File

@@ -1,6 +1,6 @@
import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n";
import { Badge, IconCheckmark1, IconFolder2, IconMedal, IconPageTextLine, IconPencil, IconPeopleAdd, IconSettingsGear2, IconStore, PageHeader, TabLink, Tabs } from "@probo/ui";
import { Badge, IconBell2, IconCheckmark1, IconFolder2, IconMedal, IconPageTextLine, IconPencil, IconPeopleAdd, IconSettingsGear2, IconStore, PageHeader, TabLink, Tabs } from "@probo/ui";
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
import { Outlet } from "react-router";
import { graphql } from "relay-runtime";
@@ -84,6 +84,10 @@ export function CompliancePageLayout(props: { queryRef: PreloadedQuery<Complianc
<IconPeopleAdd className="size-4" />
{__("Access")}
</TabLink>
<TabLink to={`/organizations/${organizationId}/compliance-page/mailing-list`}>
<IconBell2 className="size-4" />
{__("Mailing List")}
</TabLink>
</Tabs>
<Outlet />

View File

@@ -0,0 +1,147 @@
import { useTranslate } from "@probo/i18n";
import { Button, Card, Field, IconPlusLarge, Spinner, useDialogRef } from "@probo/ui";
import { useState } from "react";
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
import { ConnectionHandler, graphql } from "relay-runtime";
import type { CompliancePageMailingListPage_updateMailingListMutation } from "#/__generated__/core/CompliancePageMailingListPage_updateMailingListMutation.graphql";
import type { CompliancePageMailingListPageQuery } from "#/__generated__/core/CompliancePageMailingListPageQuery.graphql";
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
import { CompliancePageMailingList } from "./_components/CompliancePageMailingList";
import { NewCompliancePageSubscriberDialog } from "./_components/NewCompliancePageSubscriberDialog";
export const compliancePageMailingListPageQuery = graphql`
query CompliancePageMailingListPageQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
__typename
... on Organization {
compliancePage: trustCenter @required(action: THROW) {
id
mailingList {
id
replyTo
}
...CompliancePageMailingListFragment
}
}
}
}
`;
const updateMailingListMutation = graphql`
mutation CompliancePageMailingListPage_updateMailingListMutation($input: UpdateMailingListInput!) {
updateMailingList(input: $input) {
mailingList {
id
replyTo
}
}
}
`;
export function CompliancePageMailingListPage(props: {
queryRef: PreloadedQuery<CompliancePageMailingListPageQuery>;
}) {
const { queryRef } = props;
const { __ } = useTranslate();
const dialogRef = useDialogRef();
const { organization } = usePreloadedQuery<CompliancePageMailingListPageQuery>(
compliancePageMailingListPageQuery,
queryRef,
);
if (organization.__typename !== "Organization") {
throw new Error("invalid type for node");
}
const mailingList = organization.compliancePage.mailingList;
const mailingListId = mailingList?.id;
const connectionId = mailingListId
? ConnectionHandler.getConnectionID(mailingListId, "CompliancePageMailingList_subscribers")
: null;
const [replyTo, setReplyTo] = useState(mailingList?.replyTo ?? "");
const [updateMailingList, isUpdating] = useMutationWithToasts<CompliancePageMailingListPage_updateMailingListMutation>(
updateMailingListMutation,
{
successMessage: __("Mailing list updated successfully"),
errorMessage: __("Failed to update mailing list"),
},
);
const handleSaveReplyTo = () => {
if (!mailingListId) return;
void updateMailingList({
variables: {
input: {
id: mailingListId,
replyTo: replyTo.trim() || null,
},
},
});
};
return (
<div className="space-y-6">
{mailingListId && (
<Card className="p-6 space-y-4">
<div>
<h3 className="text-base font-medium">{__("Settings")}</h3>
<p className="text-sm text-txt-tertiary">
{__("Configure how your mailing list behaves")}
</p>
</div>
<div className="flex items-end gap-3">
<div className="flex-1">
<Field
label={__("Reply-to email")}
type="email"
placeholder={__("security@example.com")}
value={replyTo}
onChange={e => setReplyTo(e.target.value)}
/>
</div>
<Button
onClick={handleSaveReplyTo}
disabled={isUpdating}
className="shrink-0"
>
{isUpdating && <Spinner />}
{__("Save")}
</Button>
</div>
</Card>
)}
<div className="space-y-4">
<div className="flex items-center justify-between">
<div>
<h3 className="text-base font-medium">{__("Subscribers")}</h3>
<p className="text-sm text-txt-tertiary">
{__("People subscribed to receive security and compliance updates")}
</p>
</div>
{mailingListId && (
<Button icon={IconPlusLarge} onClick={() => dialogRef.current?.open()}>
{__("Add Subscriber")}
</Button>
)}
</div>
<CompliancePageMailingList fragmentRef={organization.compliancePage} />
</div>
{mailingListId && connectionId && (
<NewCompliancePageSubscriberDialog
ref={dialogRef}
mailingListId={mailingListId}
connectionId={connectionId}
/>
)}
</div>
);
}

View File

@@ -0,0 +1,37 @@
import { useEffect } from "react";
import { useQueryLoader } from "react-relay";
import type { CompliancePageMailingListPageQuery } from "#/__generated__/core/CompliancePageMailingListPageQuery.graphql";
import { LinkCardSkeleton } from "#/components/skeletons/LinkCardSkeleton";
import { useOrganizationId } from "#/hooks/useOrganizationId";
import { CoreRelayProvider } from "#/providers/CoreRelayProvider";
import {
CompliancePageMailingListPage,
compliancePageMailingListPageQuery,
} from "./CompliancePageMailingListPage";
function CompliancePageMailingListPageQueryLoader() {
const organizationId = useOrganizationId();
const [queryRef, loadQuery] = useQueryLoader<CompliancePageMailingListPageQuery>(
compliancePageMailingListPageQuery,
);
useEffect(() => {
if (!queryRef) {
loadQuery({ organizationId });
}
});
if (!queryRef) return <LinkCardSkeleton />;
return <CompliancePageMailingListPage queryRef={queryRef} />;
}
export default function CompliancePageMailingListPageLoader() {
return (
<CoreRelayProvider>
<CompliancePageMailingListPageQueryLoader />
</CoreRelayProvider>
);
}

View File

@@ -0,0 +1,160 @@
import { useTranslate } from "@probo/i18n";
import { Badge, Button, IconChevronDown, IconTrashCan, Spinner, Table, Tbody, Td, Th, Thead, Tr } from "@probo/ui";
import { usePaginationFragment } from "react-relay";
import { graphql } from "relay-runtime";
import type { CompliancePageMailingListDeleteMutation } from "#/__generated__/core/CompliancePageMailingListDeleteMutation.graphql";
import type { CompliancePageMailingListFragment$key } from "#/__generated__/core/CompliancePageMailingListFragment.graphql";
import type { CompliancePageMailingListQuery } from "#/__generated__/core/CompliancePageMailingListQuery.graphql";
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
const deleteMutation = graphql`
mutation CompliancePageMailingListDeleteMutation(
$input: DeleteMailingListSubscriberInput!
$connections: [ID!]!
) {
deleteMailingListSubscriber(input: $input) {
deletedMailingListSubscriberId @deleteEdge(connections: $connections)
}
}
`;
const fragment = graphql`
fragment CompliancePageMailingListFragment on TrustCenter
@argumentDefinitions(
first: { type: Int, defaultValue: 20 }
after: { type: CursorKey, defaultValue: null }
)
@refetchable(queryName: "CompliancePageMailingListQuery") {
mailingList {
id
subscribers(
first: $first
after: $after
) @connection(key: "CompliancePageMailingList_subscribers") {
__id
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
fullName
email
status
createdAt
}
}
}
}
}
`;
export function CompliancePageMailingList(props: {
fragmentRef: CompliancePageMailingListFragment$key;
}) {
const { fragmentRef } = props;
const { __ } = useTranslate();
const {
data,
hasNext,
loadNext,
isLoadingNext,
} = usePaginationFragment<CompliancePageMailingListQuery, CompliancePageMailingListFragment$key>(
fragment,
fragmentRef,
);
const subscribers = data.mailingList?.subscribers;
const [deleteSubscriber, isDeleting] = useMutationWithToasts<CompliancePageMailingListDeleteMutation>(
deleteMutation,
{
successMessage: __("Subscriber removed successfully"),
errorMessage: __("Failed to delete subscriber"),
},
);
const handleDelete = (id: string) => {
if (!subscribers) return;
void deleteSubscriber({
variables: {
input: { id },
connections: [subscribers.__id],
},
});
};
return (
<>
{!subscribers || subscribers.edges.length === 0
? (
<Table>
<Tbody>
<Tr>
<Td className="text-center text-txt-tertiary py-8">
{__("No mailing list subscribers yet")}
</Td>
</Tr>
</Tbody>
</Table>
)
: (
<>
<Table>
<Thead>
<Tr>
<Th>{__("Name")}</Th>
<Th>{__("Email")}</Th>
<Th>{__("Status")}</Th>
<Th>{__("Subscribed on")}</Th>
<Th />
</Tr>
</Thead>
<Tbody>
{subscribers.edges.map(({ node: subscriber }) => (
<Tr key={subscriber.id}>
<Td>{subscriber.fullName}</Td>
<Td>{subscriber.email}</Td>
<Td>
<Badge
variant={subscriber.status === "CONFIRMED" ? "success" : "warning"}
>
{subscriber.status === "CONFIRMED" ? __("Confirmed") : __("Pending")}
</Badge>
</Td>
<Td className="text-txt-tertiary text-sm">
{new Date(subscriber.createdAt).toLocaleDateString()}
</Td>
<Td className="w-10">
<Button
variant="tertiary"
icon={IconTrashCan}
disabled={isDeleting}
onClick={() => handleDelete(subscriber.id)}
aria-label={__("Delete subscriber")}
/>
</Td>
</Tr>
))}
</Tbody>
</Table>
{hasNext && (
<Button
variant="tertiary"
onClick={() => loadNext(10)}
disabled={isLoadingNext}
className="mt-3 mx-auto"
icon={IconChevronDown}
>
{isLoadingNext && <Spinner />}
{__("Show More")}
</Button>
)}
</>
)}
</>
);
}

View File

@@ -0,0 +1,114 @@
import { useTranslate } from "@probo/i18n";
import { Button, Dialog, DialogContent, DialogFooter, type DialogRef, Field, Spinner } from "@probo/ui";
import { type DataID, graphql } from "relay-runtime";
import { z } from "zod";
import type { NewCompliancePageSubscriberDialogMutation } from "#/__generated__/core/NewCompliancePageSubscriberDialogMutation.graphql";
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
const createSubscriberMutation = graphql`
mutation NewCompliancePageSubscriberDialogMutation(
$input: CreateMailingListSubscriberInput!
$connections: [ID!]!
) {
createMailingListSubscriber(input: $input) {
mailingListSubscriberEdge @prependEdge(connections: $connections) {
cursor
node {
id
fullName
email
status
createdAt
}
}
}
}
`;
export function NewCompliancePageSubscriberDialog(props: {
mailingListId: string;
connectionId: DataID;
ref: DialogRef;
}) {
const { mailingListId, connectionId, ref } = props;
const { __ } = useTranslate();
const schema = z.object({
fullName: z.string().min(1, __("Full name is required")).trim(),
email: z
.string()
.min(1, __("Email is required"))
.trim()
.email(__("Please enter a valid email address")),
});
const form = useFormWithSchema(schema, {
defaultValues: { fullName: "", email: "" },
});
const [createSubscriber, isCreating] = useMutationWithToasts<NewCompliancePageSubscriberDialogMutation>(
createSubscriberMutation,
{
successMessage: __("Subscriber added successfully"),
errorMessage: __("Failed to add subscriber"),
},
);
const handleSubmit = async (data: z.infer<typeof schema>) => {
await createSubscriber({
variables: {
input: {
mailingListId,
fullName: data.fullName.trim(),
email: data.email.trim(),
},
connections: connectionId ? [connectionId] : [],
},
onCompleted: (_, errors) => {
if (errors?.length) return;
setTimeout(() => {
form.reset();
ref.current?.close();
}, 50);
setTimeout(() => {
form.reset();
}, 300);
},
});
};
return (
<Dialog ref={ref} title={__("Add Subscriber")}>
<form onSubmit={e => void form.handleSubmit(handleSubmit)(e)}>
<DialogContent padded className="space-y-6">
<p className="text-txt-secondary text-sm">
{__("Add a person to receive security and compliance updates")}
</p>
<Field
label={__("Full Name")}
required
error={form.formState.errors.fullName?.message}
{...form.register("fullName")}
placeholder={__("John Doe")}
/>
<Field
label={__("Email Address")}
required
error={form.formState.errors.email?.message}
type="email"
{...form.register("email")}
placeholder={__("john@example.com")}
/>
</DialogContent>
<DialogFooter>
<Button type="submit" disabled={isCreating}>
{isCreating && <Spinner />}
{__("Add Subscriber")}
</Button>
</DialogFooter>
</form>
</Dialog>
);
}

View File

@@ -57,6 +57,11 @@ export const compliancePageRoutes = [
Fallback: LinkCardSkeleton,
Component: lazy(() => import("#/pages/organizations/compliance-page/access/CompliancePageAccessPageLoader")),
},
{
path: "mailing-list",
Fallback: LinkCardSkeleton,
Component: lazy(() => import("#/pages/organizations/compliance-page/mailing-list/CompliancePageMailingListPageLoader")),
},
],
},
];

View File

@@ -5,6 +5,7 @@ import { UnAuthenticatedError } from "@probo/relay";
import {
Button,
Card,
IconBell2,
IconBlock,
IconLock,
IconMedal,
@@ -20,6 +21,8 @@ import type { TrustGraphCurrentQuery$data } from "#/queries/__generated__/TrustG
import { getPathPrefix } from "#/utils/pathPrefix";
import type { OrganizationSidebar_requestAllAccessesMutation } from "./__generated__/OrganizationSidebar_requestAllAccessesMutation.graphql";
import type { OrganizationSidebar_subscribeToMailingListMutation } from "./__generated__/OrganizationSidebar_subscribeToMailingListMutation.graphql";
import type { OrganizationSidebar_unsubscribeFromMailingListMutation } from "./__generated__/OrganizationSidebar_unsubscribeFromMailingListMutation.graphql";
import { FrameworkBadge } from "./FrameworkBadge";
const requestAllAccessesMutation = graphql`
@@ -32,11 +35,35 @@ const requestAllAccessesMutation = graphql`
}
`;
const subscribeToMailingListMutation = graphql`
mutation OrganizationSidebar_subscribeToMailingListMutation {
subscribeToMailingList {
subscription {
id
email
createdAt
updatedAt
}
}
}
`;
const unsubscribeFromMailingListMutation = graphql`
mutation OrganizationSidebar_unsubscribeFromMailingListMutation {
unsubscribeFromMailingList {
deletedMailingListSubscriberId @deleteRecord
}
}
`;
export function OrganizationSidebar({
trustCenter,
isAuthenticated,
}: {
trustCenter: TrustGraphCurrentQuery$data["currentTrustCenter"];
isAuthenticated: boolean;
}) {
const trustCenterId = trustCenter?.id;
const { __ } = useTranslate();
const { toast } = useToast();
const theme = useSystemTheme();
@@ -51,6 +78,16 @@ export function OrganizationSidebar({
requestAllAccessesMutation,
);
const [subscribeToMailingList, isSubscribing]
= useMutation<OrganizationSidebar_subscribeToMailingListMutation>(
subscribeToMailingListMutation,
);
const [unsubscribeFromMailingList, isUnsubscribing]
= useMutation<OrganizationSidebar_unsubscribeFromMailingListMutation>(
unsubscribeFromMailingListMutation,
);
const handleRequestAllAccesses = () => {
requestAllAccesses({
variables: {},
@@ -93,6 +130,71 @@ export function OrganizationSidebar({
});
};
const handleSubscribe = () => {
subscribeToMailingList({
variables: {},
updater: (store, data) => {
const subscription = data?.subscribeToMailingList?.subscription;
if (!subscription?.id || !trustCenterId) return;
const trustCenterRecord = store.get(trustCenterId);
if (!trustCenterRecord) return;
const subscriptionRecord = store.get(subscription.id);
if (!subscriptionRecord) return;
trustCenterRecord.setLinkedRecord(subscriptionRecord, "viewerSubscription");
},
onCompleted: (_, errors) => {
if (errors?.length) {
toast({
title: __("Error"),
description: formatError(__("Cannot subscribe"), errors),
variant: "error",
});
return;
}
toast({
title: __("Subscribed"),
description: __("You will be notified of security updates."),
variant: "success",
});
},
onError: (error) => {
toast({
title: __("Error"),
description: error.message ?? __("Cannot subscribe"),
variant: "error",
});
},
});
};
const handleUnsubscribe = () => {
unsubscribeFromMailingList({
variables: {},
onCompleted: (_, errors) => {
if (errors?.length) {
toast({
title: __("Error"),
description: formatError(__("Cannot unsubscribe"), errors),
variant: "error",
});
return;
}
toast({
title: __("Unsubscribed"),
description: __("You will no longer receive security updates."),
variant: "success",
});
},
onError: (error) => {
toast({
title: __("Error"),
description: error.message ?? __("Cannot unsubscribe"),
variant: "error",
});
},
});
};
if (!trustCenter) {
return null;
}
@@ -188,15 +290,43 @@ export function OrganizationSidebar({
</>
)}
<Button
disabled={isRequestingAccess}
variant="primary"
icon={IconLock}
className="w-full h-10"
onClick={handleRequestAllAccesses}
>
{__("Request access")}
</Button>
{/* Actions */}
<div className="space-y-2">
<Button
disabled={isRequestingAccess}
variant="primary"
icon={IconLock}
className="w-full h-10"
onClick={handleRequestAllAccesses}
>
{__("Request access")}
</Button>
{isAuthenticated && (
trustCenter.viewerSubscription
? (
<Button
disabled={isUnsubscribing}
variant="secondary"
icon={IconBell2}
className="w-full h-10"
onClick={handleUnsubscribe}
>
{__("Unsubscribe from updates")}
</Button>
)
: (
<Button
disabled={isSubscribing}
variant="secondary"
icon={IconBell2}
className="w-full h-10"
onClick={handleSubscribe}
>
{__("Subscribe to updates")}
</Button>
)
)}
</div>
</div>
</Card>
);

View File

@@ -0,0 +1,111 @@
/**
* @generated SignedSource<<80e6e1e3558d126472e7affb5b7b6cbd>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type OrganizationSidebar_subscribeToMailingListMutation$variables = Record<PropertyKey, never>;
export type OrganizationSidebar_subscribeToMailingListMutation$data = {
readonly subscribeToMailingList: {
readonly subscription: {
readonly createdAt: any;
readonly email: any;
readonly id: string;
readonly updatedAt: any;
};
};
};
export type OrganizationSidebar_subscribeToMailingListMutation = {
response: OrganizationSidebar_subscribeToMailingListMutation$data;
variables: OrganizationSidebar_subscribeToMailingListMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"alias": null,
"args": null,
"concreteType": "SubscribeToMailingListPayload",
"kind": "LinkedField",
"name": "subscribeToMailingList",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "MailingListSubscriber",
"kind": "LinkedField",
"name": "subscription",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "OrganizationSidebar_subscribeToMailingListMutation",
"selections": (v0/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": [],
"kind": "Operation",
"name": "OrganizationSidebar_subscribeToMailingListMutation",
"selections": (v0/*: any*/)
},
"params": {
"cacheID": "07d99ad1645ea1e8752678fd9b5e6748",
"id": null,
"metadata": {},
"name": "OrganizationSidebar_subscribeToMailingListMutation",
"operationKind": "mutation",
"text": "mutation OrganizationSidebar_subscribeToMailingListMutation {\n subscribeToMailingList {\n subscription {\n id\n email\n createdAt\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "80d3e85f4a55a7de7b066959f4a457c8";
export default node;

View File

@@ -0,0 +1,96 @@
/**
* @generated SignedSource<<8c1211258e4480dcaa6fdf14364cb49b>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type OrganizationSidebar_unsubscribeFromMailingListMutation$variables = Record<PropertyKey, never>;
export type OrganizationSidebar_unsubscribeFromMailingListMutation$data = {
readonly unsubscribeFromMailingList: {
readonly deletedMailingListSubscriberId: string | null | undefined;
};
};
export type OrganizationSidebar_unsubscribeFromMailingListMutation = {
response: OrganizationSidebar_unsubscribeFromMailingListMutation$data;
variables: OrganizationSidebar_unsubscribeFromMailingListMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "deletedMailingListSubscriberId",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "OrganizationSidebar_unsubscribeFromMailingListMutation",
"selections": [
{
"alias": null,
"args": null,
"concreteType": "UnsubscribeFromMailingListPayload",
"kind": "LinkedField",
"name": "unsubscribeFromMailingList",
"plural": false,
"selections": [
(v0/*: any*/)
],
"storageKey": null
}
],
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": [],
"kind": "Operation",
"name": "OrganizationSidebar_unsubscribeFromMailingListMutation",
"selections": [
{
"alias": null,
"args": null,
"concreteType": "UnsubscribeFromMailingListPayload",
"kind": "LinkedField",
"name": "unsubscribeFromMailingList",
"plural": false,
"selections": [
(v0/*: any*/),
{
"alias": null,
"args": null,
"filters": null,
"handle": "deleteRecord",
"key": "",
"kind": "ScalarHandle",
"name": "deletedMailingListSubscriberId"
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "1c6706f94348a5426c1e57d5fe99ab82",
"id": null,
"metadata": {},
"name": "OrganizationSidebar_unsubscribeFromMailingListMutation",
"operationKind": "mutation",
"text": "mutation OrganizationSidebar_unsubscribeFromMailingListMutation {\n unsubscribeFromMailingList {\n deletedMailingListSubscriberId\n }\n}\n"
}
};
})();
(node as any).hash = "7f3949f63166fc3bd23838a44fb94993";
export default node;

View File

@@ -18,6 +18,7 @@ export function MainLayout(props: Props) {
const { __ } = useTranslate();
const data = usePreloadedQuery(currentTrustGraphQuery, props.queryRef);
const trustCenter = data.currentTrustCenter;
const isAuthenticated = data.viewer != null;
const theme = useSystemTheme();
@@ -31,7 +32,7 @@ export function MainLayout(props: Props) {
return (
<TrustCenterProvider trustCenter={trustCenter}>
<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} />
<OrganizationSidebar trustCenter={trustCenter} isAuthenticated={isAuthenticated} />
<main>
<Tabs className="mb-8">
<TabLink to="/overview">{__("Overview")}</TabLink>

View File

@@ -3,9 +3,18 @@ import { graphql } from "relay-runtime";
// Queries for custom domain (subdomain) approach
export const currentTrustGraphQuery = graphql`
query TrustGraphCurrentQuery {
viewer {
id
}
currentTrustCenter @required(action: THROW) {
id
slug
viewerSubscription {
id
email
createdAt
updatedAt
}
logoFileUrl
darkLogoFileUrl
nonDisclosureAgreement {

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<74757bf9a32552f6353eb888c9f663cd>>
* @generated SignedSource<<5b0657c3423f38cbd689de2dae810831>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -62,8 +62,17 @@ export type TrustGraphCurrentQuery$data = {
readonly vendorInfo: {
readonly totalCount: number;
};
readonly viewerSubscription: {
readonly createdAt: any;
readonly email: any;
readonly id: string;
readonly updatedAt: any;
} | null | undefined;
readonly " $fragmentSpreads": FragmentRefs<"OverviewPageFragment">;
};
readonly viewer: {
readonly id: string;
} | null | undefined;
};
export type TrustGraphCurrentQuery = {
response: TrustGraphCurrentQuery$data;
@@ -81,81 +90,120 @@ var v0 = {
v1 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "slug",
"concreteType": "Identity",
"kind": "LinkedField",
"name": "viewer",
"plural": false,
"selections": [
(v0/*: any*/)
],
"storageKey": null
},
v2 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "logoFileUrl",
"name": "slug",
"storageKey": null
},
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "darkLogoFileUrl",
"name": "email",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fileName",
"concreteType": "MailingListSubscriber",
"kind": "LinkedField",
"name": "viewerSubscription",
"plural": false,
"selections": [
(v0/*: any*/),
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
},
v5 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fileUrl",
"name": "logoFileUrl",
"storageKey": null
},
v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "status",
"name": "darkLogoFileUrl",
"storageKey": null
},
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"name": "fileName",
"storageKey": null
},
v8 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"name": "fileUrl",
"storageKey": null
},
v9 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "websiteUrl",
"name": "status",
"storageKey": null
},
v10 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"name": "name",
"storageKey": null
},
v11 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "headquarterAddress",
"name": "description",
"storageKey": null
},
v12 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "websiteUrl",
"storageKey": null
},
v13 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "headquarterAddress",
"storageKey": null
},
v14 = {
"alias": null,
"args": [
{
@@ -186,7 +234,7 @@ v12 = {
"plural": false,
"selections": [
(v0/*: any*/),
(v7/*: any*/),
(v10/*: any*/),
{
"alias": null,
"args": null,
@@ -203,7 +251,7 @@ v12 = {
],
"storageKey": "externalUrls(first:20)"
},
v13 = {
v15 = {
"alias": "vendorInfo",
"args": [
{
@@ -227,28 +275,28 @@ v13 = {
],
"storageKey": "vendors(first:0)"
},
v14 = [
v16 = [
{
"kind": "Literal",
"name": "first",
"value": 50
}
],
v15 = [
v17 = [
{
"kind": "Literal",
"name": "first",
"value": 5
}
],
v16 = {
v18 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "isUserAuthorized",
"storageKey": null
},
v17 = {
v19 = {
"alias": null,
"args": null,
"concreteType": "DocumentAccess",
@@ -257,11 +305,11 @@ v17 = {
"plural": false,
"selections": [
(v0/*: any*/),
(v6/*: any*/)
(v9/*: any*/)
],
"storageKey": null
},
v18 = {
v20 = {
"alias": null,
"args": null,
"concreteType": "Framework",
@@ -270,7 +318,7 @@ v18 = {
"plural": false,
"selections": [
(v0/*: any*/),
(v7/*: any*/),
(v10/*: any*/),
{
"alias": null,
"args": null,
@@ -295,6 +343,7 @@ return {
"metadata": null,
"name": "TrustGraphCurrentQuery",
"selections": [
(v1/*: any*/),
{
"kind": "RequiredField",
"field": {
@@ -306,9 +355,10 @@ return {
"plural": false,
"selections": [
(v0/*: any*/),
(v1/*: any*/),
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
(v5/*: any*/),
(v6/*: any*/),
{
"alias": null,
"args": null,
@@ -317,8 +367,8 @@ return {
"name": "nonDisclosureAgreement",
"plural": false,
"selections": [
(v4/*: any*/),
(v5/*: any*/),
(v7/*: any*/),
(v8/*: any*/),
{
"alias": null,
"args": null,
@@ -327,7 +377,7 @@ return {
"name": "viewerSignature",
"plural": false,
"selections": [
(v6/*: any*/)
(v9/*: any*/)
],
"storageKey": null
}
@@ -342,24 +392,24 @@ return {
"name": "organization",
"plural": false,
"selections": [
(v7/*: any*/),
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
(v11/*: any*/)
(v11/*: any*/),
(v12/*: any*/),
(v3/*: any*/),
(v13/*: any*/)
],
"storageKey": null
},
(v12/*: any*/),
(v14/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "OverviewPageFragment"
},
(v13/*: any*/),
(v15/*: any*/),
{
"alias": null,
"args": (v14/*: any*/),
"args": (v16/*: any*/),
"concreteType": "AuditConnection",
"kind": "LinkedField",
"name": "audits",
@@ -398,7 +448,7 @@ return {
},
{
"alias": null,
"args": (v14/*: any*/),
"args": (v16/*: any*/),
"concreteType": "ComplianceFrameworkConnection",
"kind": "LinkedField",
"name": "complianceFrameworks",
@@ -461,6 +511,7 @@ return {
"kind": "Operation",
"name": "TrustGraphCurrentQuery",
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
@@ -470,9 +521,10 @@ return {
"plural": false,
"selections": [
(v0/*: any*/),
(v1/*: any*/),
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
(v5/*: any*/),
(v6/*: any*/),
{
"alias": null,
"args": null,
@@ -481,8 +533,8 @@ return {
"name": "nonDisclosureAgreement",
"plural": false,
"selections": [
(v4/*: any*/),
(v5/*: any*/),
(v7/*: any*/),
(v8/*: any*/),
{
"alias": null,
"args": null,
@@ -491,7 +543,7 @@ return {
"name": "viewerSignature",
"plural": false,
"selections": [
(v6/*: any*/),
(v9/*: any*/),
(v0/*: any*/)
],
"storageKey": null
@@ -507,16 +559,16 @@ return {
"name": "organization",
"plural": false,
"selections": [
(v7/*: any*/),
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
(v11/*: any*/),
(v12/*: any*/),
(v3/*: any*/),
(v13/*: any*/),
(v0/*: any*/)
],
"storageKey": null
},
(v12/*: any*/),
(v14/*: any*/),
{
"alias": null,
"args": [
@@ -548,7 +600,7 @@ return {
"plural": false,
"selections": [
(v0/*: any*/),
(v7/*: any*/),
(v10/*: any*/),
{
"alias": null,
"args": null,
@@ -556,7 +608,7 @@ return {
"name": "logoUrl",
"storageKey": null
},
(v9/*: any*/)
(v12/*: any*/)
],
"storageKey": null
}
@@ -604,9 +656,9 @@ return {
"name": "countries",
"storageKey": null
},
(v7/*: any*/),
(v8/*: any*/),
(v9/*: any*/)
(v10/*: any*/),
(v11/*: any*/),
(v12/*: any*/)
],
"storageKey": null
}
@@ -618,7 +670,7 @@ return {
},
{
"alias": null,
"args": (v15/*: any*/),
"args": (v17/*: any*/),
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "documents",
@@ -648,8 +700,8 @@ return {
"name": "title",
"storageKey": null
},
(v16/*: any*/),
(v17/*: any*/),
(v18/*: any*/),
(v19/*: any*/),
{
"alias": null,
"args": null,
@@ -668,7 +720,7 @@ return {
},
{
"alias": null,
"args": (v15/*: any*/),
"args": (v17/*: any*/),
"concreteType": "TrustCenterFileConnection",
"kind": "LinkedField",
"name": "trustCenterFiles",
@@ -698,9 +750,9 @@ return {
"name": "category",
"storageKey": null
},
(v7/*: any*/),
(v16/*: any*/),
(v17/*: any*/)
(v10/*: any*/),
(v18/*: any*/),
(v19/*: any*/)
],
"storageKey": null
}
@@ -710,10 +762,10 @@ return {
],
"storageKey": "trustCenterFiles(first:5)"
},
(v13/*: any*/),
(v15/*: any*/),
{
"alias": null,
"args": (v14/*: any*/),
"args": (v16/*: any*/),
"concreteType": "AuditConnection",
"kind": "LinkedField",
"name": "audits",
@@ -736,7 +788,7 @@ return {
"plural": false,
"selections": [
(v0/*: any*/),
(v7/*: any*/),
(v10/*: any*/),
{
"alias": null,
"args": null,
@@ -753,12 +805,12 @@ return {
"name": "filename",
"storageKey": null
},
(v16/*: any*/),
(v17/*: any*/)
(v18/*: any*/),
(v19/*: any*/)
],
"storageKey": null
},
(v18/*: any*/)
(v20/*: any*/)
],
"storageKey": null
}
@@ -770,7 +822,7 @@ return {
},
{
"alias": null,
"args": (v14/*: any*/),
"args": (v16/*: any*/),
"concreteType": "ComplianceFrameworkConnection",
"kind": "LinkedField",
"name": "complianceFrameworks",
@@ -793,7 +845,7 @@ return {
"plural": false,
"selections": [
(v0/*: any*/),
(v18/*: any*/)
(v20/*: any*/)
],
"storageKey": null
}
@@ -809,16 +861,16 @@ return {
]
},
"params": {
"cacheID": "96e75937f385e17b760440e001cefc47",
"cacheID": "80334c766999a3d299eaf40fd32235b7",
"id": null,
"metadata": {},
"name": "TrustGraphCurrentQuery",
"operationKind": "query",
"text": "query TrustGraphCurrentQuery {\n currentTrustCenter {\n id\n slug\n logoFileUrl\n darkLogoFileUrl\n nonDisclosureAgreement {\n fileName\n fileUrl\n viewerSignature {\n status\n id\n }\n }\n organization {\n name\n description\n websiteUrl\n email\n headquarterAddress\n id\n }\n externalUrls(first: 20) {\n edges {\n node {\n id\n name\n url\n }\n }\n }\n ...OverviewPageFragment\n vendorInfo: vendors(first: 0) {\n totalCount\n }\n audits(first: 50) {\n edges {\n node {\n id\n ...AuditRowFragment\n }\n }\n }\n complianceFrameworks(first: 50) {\n edges {\n node {\n id\n framework {\n ...FrameworkBadgeFragment\n id\n }\n }\n }\n }\n }\n}\n\nfragment AuditRowFragment on Audit {\n name\n report {\n id\n filename\n isUserAuthorized\n access {\n id\n status\n }\n }\n framework {\n id\n name\n lightLogoURL\n darkLogoURL\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n access {\n id\n status\n }\n}\n\nfragment FrameworkBadgeFragment on Framework {\n id\n name\n lightLogoURL\n darkLogoURL\n}\n\nfragment OverviewPageFragment on TrustCenter {\n references(first: 14) {\n edges {\n node {\n id\n name\n logoUrl\n websiteUrl\n }\n }\n }\n vendors(first: 3) {\n edges {\n node {\n id\n countries\n ...VendorRowFragment\n }\n }\n }\n documents(first: 5) {\n edges {\n node {\n id\n ...DocumentRowFragment\n documentType\n }\n }\n }\n trustCenterFiles(first: 5) {\n edges {\n node {\n id\n category\n ...TrustCenterFileRowFragment\n }\n }\n }\n}\n\nfragment TrustCenterFileRowFragment on TrustCenterFile {\n id\n name\n isUserAuthorized\n access {\n id\n status\n }\n}\n\nfragment VendorRowFragment on Vendor {\n name\n description\n websiteUrl\n countries\n}\n"
"text": "query TrustGraphCurrentQuery {\n viewer {\n id\n }\n currentTrustCenter {\n id\n slug\n viewerSubscription {\n id\n email\n createdAt\n updatedAt\n }\n logoFileUrl\n darkLogoFileUrl\n nonDisclosureAgreement {\n fileName\n fileUrl\n viewerSignature {\n status\n id\n }\n }\n organization {\n name\n description\n websiteUrl\n email\n headquarterAddress\n id\n }\n externalUrls(first: 20) {\n edges {\n node {\n id\n name\n url\n }\n }\n }\n ...OverviewPageFragment\n vendorInfo: vendors(first: 0) {\n totalCount\n }\n audits(first: 50) {\n edges {\n node {\n id\n ...AuditRowFragment\n }\n }\n }\n complianceFrameworks(first: 50) {\n edges {\n node {\n id\n framework {\n ...FrameworkBadgeFragment\n id\n }\n }\n }\n }\n }\n}\n\nfragment AuditRowFragment on Audit {\n name\n report {\n id\n filename\n isUserAuthorized\n access {\n id\n status\n }\n }\n framework {\n id\n name\n lightLogoURL\n darkLogoURL\n }\n}\n\nfragment DocumentRowFragment on Document {\n id\n title\n isUserAuthorized\n access {\n id\n status\n }\n}\n\nfragment FrameworkBadgeFragment on Framework {\n id\n name\n lightLogoURL\n darkLogoURL\n}\n\nfragment OverviewPageFragment on TrustCenter {\n references(first: 14) {\n edges {\n node {\n id\n name\n logoUrl\n websiteUrl\n }\n }\n }\n vendors(first: 3) {\n edges {\n node {\n id\n countries\n ...VendorRowFragment\n }\n }\n }\n documents(first: 5) {\n edges {\n node {\n id\n ...DocumentRowFragment\n documentType\n }\n }\n }\n trustCenterFiles(first: 5) {\n edges {\n node {\n id\n category\n ...TrustCenterFileRowFragment\n }\n }\n }\n}\n\nfragment TrustCenterFileRowFragment on TrustCenterFile {\n id\n name\n isUserAuthorized\n access {\n id\n status\n }\n}\n\nfragment VendorRowFragment on Vendor {\n name\n description\n websiteUrl\n countries\n}\n"
}
};
})();
(node as any).hash = "ca6f04fecf9bce92407f33e8c0e4bd03";
(node as any).hash = "d38cdfff47370448fff4d9c6c22ad1bd";
export default node;