Send mailing list emails
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<7e30e59b53799ccae49199d7b46f0320>>
|
||||
* @generated SignedSource<<1ddc7eb54e71de0d95fb5af865fc0348>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -21,6 +21,7 @@ export type CompliancePageMailingListPageQuery$data = {
|
||||
readonly mailingList: {
|
||||
readonly id: string;
|
||||
readonly replyTo: string | null | undefined;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageUpdatesListFragment">;
|
||||
} | null | undefined;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageMailingListFragment">;
|
||||
};
|
||||
@@ -77,7 +78,65 @@ v5 = [
|
||||
"name": "first",
|
||||
"value": 20
|
||||
}
|
||||
];
|
||||
],
|
||||
v6 = {
|
||||
"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
|
||||
},
|
||||
v7 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "status",
|
||||
"storageKey": null
|
||||
},
|
||||
v8 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
v9 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
},
|
||||
v10 = {
|
||||
"kind": "ClientExtension",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__id",
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
@@ -117,7 +176,12 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
(v4/*: any*/)
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "CompliancePageUpdatesListFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
@@ -179,6 +243,76 @@ return {
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "MailingListUpdateConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "updates",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v6/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdateEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdate",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "title",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "body",
|
||||
"storageKey": null
|
||||
},
|
||||
(v7/*: any*/),
|
||||
(v8/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
},
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v9/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v10/*: any*/)
|
||||
],
|
||||
"storageKey": "updates(first:20)"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"filters": null,
|
||||
"handle": "connection",
|
||||
"key": "CompliancePageUpdatesList_updates",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "updates"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
@@ -187,31 +321,7 @@ return {
|
||||
"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
|
||||
},
|
||||
(v6/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -243,46 +353,17 @@ return {
|
||||
"name": "email",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "status",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
(v7/*: any*/),
|
||||
(v8/*: any*/),
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
}
|
||||
(v9/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"kind": "ClientExtension",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__id",
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
}
|
||||
(v10/*: any*/)
|
||||
],
|
||||
"storageKey": "subscribers(first:20)"
|
||||
},
|
||||
@@ -312,16 +393,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "8eb57a5cf8f8b1294da6aee3228176f3",
|
||||
"cacheID": "c8ba2eeecdfac4115f0ab1493ecf02ce",
|
||||
"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"
|
||||
"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 ...CompliancePageUpdatesListFragment\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\nfragment CompliancePageUpdatesListFragment on MailingList {\n updates(first: 20) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n id\n title\n body\n status\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n }\n id\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "0df7b2a8b9f0d2f421f354bd56773e43";
|
||||
(node as any).hash = "bda0ad6e5ff15a324d4c2ad76d0c94cd";
|
||||
|
||||
export default node;
|
||||
|
||||
132
apps/console/src/__generated__/core/CompliancePageUpdatesListDeleteMutation.graphql.ts
generated
Normal file
132
apps/console/src/__generated__/core/CompliancePageUpdatesListDeleteMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* @generated SignedSource<<8fc725e69722e66e680df0ed52206c77>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteMailingListUpdateInput = {
|
||||
id: string;
|
||||
};
|
||||
export type CompliancePageUpdatesListDeleteMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: DeleteMailingListUpdateInput;
|
||||
};
|
||||
export type CompliancePageUpdatesListDeleteMutation$data = {
|
||||
readonly deleteMailingListUpdate: {
|
||||
readonly deletedMailingListUpdateId: string;
|
||||
};
|
||||
};
|
||||
export type CompliancePageUpdatesListDeleteMutation = {
|
||||
response: CompliancePageUpdatesListDeleteMutation$data;
|
||||
variables: CompliancePageUpdatesListDeleteMutation$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": "deletedMailingListUpdateId",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/)
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "CompliancePageUpdatesListDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteMailingListUpdatePayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteMailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [
|
||||
(v1/*: any*/),
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "CompliancePageUpdatesListDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteMailingListUpdatePayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteMailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"filters": null,
|
||||
"handle": "deleteEdge",
|
||||
"key": "",
|
||||
"kind": "ScalarHandle",
|
||||
"name": "deletedMailingListUpdateId",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "connections",
|
||||
"variableName": "connections"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "892a75687f4d8560945e5a30915aecbd",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "CompliancePageUpdatesListDeleteMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation CompliancePageUpdatesListDeleteMutation(\n $input: DeleteMailingListUpdateInput!\n) {\n deleteMailingListUpdate(input: $input) {\n deletedMailingListUpdateId\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "29a3142fa30bc64beb74d21f5162a00c";
|
||||
|
||||
export default node;
|
||||
226
apps/console/src/__generated__/core/CompliancePageUpdatesListFragment.graphql.ts
generated
Normal file
226
apps/console/src/__generated__/core/CompliancePageUpdatesListFragment.graphql.ts
generated
Normal file
@@ -0,0 +1,226 @@
|
||||
/**
|
||||
* @generated SignedSource<<d32034602cfb0c3128ebdfaa7e26af40>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type MailingListUpdateStatus = "DRAFT" | "ENQUEUED" | "PROCESSING" | "SENT";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type CompliancePageUpdatesListFragment$data = {
|
||||
readonly id: string;
|
||||
readonly updates: {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly body: string;
|
||||
readonly createdAt: string;
|
||||
readonly id: string;
|
||||
readonly status: MailingListUpdateStatus;
|
||||
readonly title: string;
|
||||
readonly updatedAt: string;
|
||||
};
|
||||
}>;
|
||||
readonly pageInfo: {
|
||||
readonly endCursor: string | null | undefined;
|
||||
readonly hasNextPage: boolean;
|
||||
};
|
||||
};
|
||||
readonly " $fragmentType": "CompliancePageUpdatesListFragment";
|
||||
};
|
||||
export type CompliancePageUpdatesListFragment$key = {
|
||||
readonly " $data"?: CompliancePageUpdatesListFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageUpdatesListFragment">;
|
||||
};
|
||||
|
||||
import CompliancePageUpdatesListQuery_graphql from './CompliancePageUpdatesListQuery.graphql';
|
||||
|
||||
const node: ReaderFragment = (function(){
|
||||
var v0 = [
|
||||
"updates"
|
||||
],
|
||||
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": CompliancePageUpdatesListQuery_graphql,
|
||||
"identifierInfo": {
|
||||
"identifierField": "id",
|
||||
"identifierQueryVariableName": "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": "CompliancePageUpdatesListFragment",
|
||||
"selections": [
|
||||
{
|
||||
"alias": "updates",
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdateConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "__CompliancePageUpdatesList_updates_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": "MailingListUpdateEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdate",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "title",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "body",
|
||||
"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": "updatedAt",
|
||||
"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
|
||||
},
|
||||
(v1/*: any*/)
|
||||
],
|
||||
"type": "MailingList",
|
||||
"abstractKey": null
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "97bcf2215cc4fa04d1d4b84b2da4c33a";
|
||||
|
||||
export default node;
|
||||
270
apps/console/src/__generated__/core/CompliancePageUpdatesListQuery.graphql.ts
generated
Normal file
270
apps/console/src/__generated__/core/CompliancePageUpdatesListQuery.graphql.ts
generated
Normal file
@@ -0,0 +1,270 @@
|
||||
/**
|
||||
* @generated SignedSource<<dcc3921bab2d3c42dc01f71fbf1a4338>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type CompliancePageUpdatesListQuery$variables = {
|
||||
after?: string | null | undefined;
|
||||
first?: number | null | undefined;
|
||||
id: string;
|
||||
};
|
||||
export type CompliancePageUpdatesListQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageUpdatesListFragment">;
|
||||
};
|
||||
};
|
||||
export type CompliancePageUpdatesListQuery = {
|
||||
response: CompliancePageUpdatesListQuery$data;
|
||||
variables: CompliancePageUpdatesListQuery$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": "CompliancePageUpdatesListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v1/*: any*/),
|
||||
"concreteType": null,
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "CompliancePageUpdatesListFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "CompliancePageUpdatesListQuery",
|
||||
"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": (v2/*: any*/),
|
||||
"concreteType": "MailingListUpdateConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "updates",
|
||||
"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": "MailingListUpdateEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdate",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "title",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "body",
|
||||
"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": "updatedAt",
|
||||
"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": "CompliancePageUpdatesList_updates",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "updates"
|
||||
}
|
||||
],
|
||||
"type": "MailingList",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "e1a6160f157715c1c52adca86d02b9c6",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "CompliancePageUpdatesListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query CompliancePageUpdatesListQuery(\n $after: CursorKey = null\n $first: Int = 20\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...CompliancePageUpdatesListFragment_2HEEH6\n id\n }\n}\n\nfragment CompliancePageUpdatesListFragment_2HEEH6 on MailingList {\n updates(first: $first, after: $after) {\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n id\n title\n body\n status\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n }\n id\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "97bcf2215cc4fa04d1d4b84b2da4c33a";
|
||||
|
||||
export default node;
|
||||
138
apps/console/src/__generated__/core/CompliancePageUpdatesListSendMutation.graphql.ts
generated
Normal file
138
apps/console/src/__generated__/core/CompliancePageUpdatesListSendMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,138 @@
|
||||
/**
|
||||
* @generated SignedSource<<f5323e8e7bd73882c9169eb01318a21c>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type MailingListUpdateStatus = "DRAFT" | "ENQUEUED" | "PROCESSING" | "SENT";
|
||||
export type SendMailingListUpdateInput = {
|
||||
id: string;
|
||||
};
|
||||
export type CompliancePageUpdatesListSendMutation$variables = {
|
||||
input: SendMailingListUpdateInput;
|
||||
};
|
||||
export type CompliancePageUpdatesListSendMutation$data = {
|
||||
readonly sendMailingListUpdate: {
|
||||
readonly mailingListUpdate: {
|
||||
readonly body: string;
|
||||
readonly id: string;
|
||||
readonly status: MailingListUpdateStatus;
|
||||
readonly title: string;
|
||||
readonly updatedAt: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
export type CompliancePageUpdatesListSendMutation = {
|
||||
response: CompliancePageUpdatesListSendMutation$data;
|
||||
variables: CompliancePageUpdatesListSendMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "input",
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
"concreteType": "SendMailingListUpdatePayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "sendMailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdate",
|
||||
"kind": "LinkedField",
|
||||
"name": "mailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "title",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "body",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "status",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "CompliancePageUpdatesListSendMutation",
|
||||
"selections": (v1/*: any*/),
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "CompliancePageUpdatesListSendMutation",
|
||||
"selections": (v1/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "23fee99a4999d2c9cbeecd6fa9863b67",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "CompliancePageUpdatesListSendMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation CompliancePageUpdatesListSendMutation(\n $input: SendMailingListUpdateInput!\n) {\n sendMailingListUpdate(input: $input) {\n mailingListUpdate {\n id\n title\n body\n status\n updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "37c68b46d761280e2ff16f5bff08b249";
|
||||
|
||||
export default node;
|
||||
140
apps/console/src/__generated__/core/EditComplianceUpdateDialogMutation.graphql.ts
generated
Normal file
140
apps/console/src/__generated__/core/EditComplianceUpdateDialogMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,140 @@
|
||||
/**
|
||||
* @generated SignedSource<<622eccc63036573a8e38ffc8dd36e7d7>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type MailingListUpdateStatus = "DRAFT" | "ENQUEUED" | "PROCESSING" | "SENT";
|
||||
export type UpdateMailingListUpdateInput = {
|
||||
body: string;
|
||||
id: string;
|
||||
title: string;
|
||||
};
|
||||
export type EditComplianceUpdateDialogMutation$variables = {
|
||||
input: UpdateMailingListUpdateInput;
|
||||
};
|
||||
export type EditComplianceUpdateDialogMutation$data = {
|
||||
readonly updateMailingListUpdate: {
|
||||
readonly mailingListUpdate: {
|
||||
readonly body: string;
|
||||
readonly id: string;
|
||||
readonly status: MailingListUpdateStatus;
|
||||
readonly title: string;
|
||||
readonly updatedAt: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
export type EditComplianceUpdateDialogMutation = {
|
||||
response: EditComplianceUpdateDialogMutation$data;
|
||||
variables: EditComplianceUpdateDialogMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "input"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "input",
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
"concreteType": "UpdateMailingListUpdatePayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "updateMailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdate",
|
||||
"kind": "LinkedField",
|
||||
"name": "mailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "title",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "body",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "status",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "EditComplianceUpdateDialogMutation",
|
||||
"selections": (v1/*: any*/),
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "EditComplianceUpdateDialogMutation",
|
||||
"selections": (v1/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "49b4c9f194a0bf6ebe01408ae6387f2e",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "EditComplianceUpdateDialogMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation EditComplianceUpdateDialogMutation(\n $input: UpdateMailingListUpdateInput!\n) {\n updateMailingListUpdate(input: $input) {\n mailingListUpdate {\n id\n title\n body\n status\n updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "8b2246ab3bddba658cc488610afcd80f";
|
||||
|
||||
export default node;
|
||||
193
apps/console/src/__generated__/core/NewComplianceUpdateDialogMutation.graphql.ts
generated
Normal file
193
apps/console/src/__generated__/core/NewComplianceUpdateDialogMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,193 @@
|
||||
/**
|
||||
* @generated SignedSource<<458f30b721ecd9df210621a8853008c3>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type MailingListUpdateStatus = "DRAFT" | "ENQUEUED" | "PROCESSING" | "SENT";
|
||||
export type CreateMailingListUpdateInput = {
|
||||
body: string;
|
||||
mailingListId: string;
|
||||
title: string;
|
||||
};
|
||||
export type NewComplianceUpdateDialogMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: CreateMailingListUpdateInput;
|
||||
};
|
||||
export type NewComplianceUpdateDialogMutation$data = {
|
||||
readonly createMailingListUpdate: {
|
||||
readonly mailingListUpdate: {
|
||||
readonly body: string;
|
||||
readonly createdAt: string;
|
||||
readonly id: string;
|
||||
readonly status: MailingListUpdateStatus;
|
||||
readonly title: string;
|
||||
readonly updatedAt: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
export type NewComplianceUpdateDialogMutation = {
|
||||
response: NewComplianceUpdateDialogMutation$data;
|
||||
variables: NewComplianceUpdateDialogMutation$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": "MailingListUpdate",
|
||||
"kind": "LinkedField",
|
||||
"name": "mailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "title",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "body",
|
||||
"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": "updatedAt",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/)
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NewComplianceUpdateDialogMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateMailingListUpdatePayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createMailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [
|
||||
(v1/*: any*/),
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "NewComplianceUpdateDialogMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateMailingListUpdatePayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createMailingListUpdate",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"filters": null,
|
||||
"handle": "prependNode",
|
||||
"key": "",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "mailingListUpdate",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "connections",
|
||||
"variableName": "connections"
|
||||
},
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "edgeTypeName",
|
||||
"value": "MailingListUpdateEdge"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "33fc392100d93803de3a189e75961a75",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NewComplianceUpdateDialogMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation NewComplianceUpdateDialogMutation(\n $input: CreateMailingListUpdateInput!\n) {\n createMailingListUpdate(input: $input) {\n mailingListUpdate {\n id\n title\n body\n status\n createdAt\n updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "bf02b571efaf38d4f4a8fde50b311832";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Button, Card, Field, IconPlusLarge, Spinner, useDialogRef } from "@probo/ui";
|
||||
import { Button, Card, Field, IconPlusLarge, Spinner, TabItem, Tabs, useDialogRef } from "@probo/ui";
|
||||
import { useState } from "react";
|
||||
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
||||
import { ConnectionHandler, graphql } from "relay-runtime";
|
||||
@@ -9,7 +9,10 @@ import type { CompliancePageMailingListPageQuery } from "#/__generated__/core/Co
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
|
||||
import { CompliancePageMailingList } from "./_components/CompliancePageMailingList";
|
||||
import { CompliancePageUpdatesList, type UpdateNode } from "./_components/CompliancePageUpdatesList";
|
||||
import { EditComplianceUpdateDialog } from "./_components/EditComplianceUpdateDialog";
|
||||
import { NewCompliancePageSubscriberDialog } from "./_components/NewCompliancePageSubscriberDialog";
|
||||
import { NewComplianceUpdateDialog } from "./_components/NewComplianceUpdateDialog";
|
||||
|
||||
export const compliancePageMailingListPageQuery = graphql`
|
||||
query CompliancePageMailingListPageQuery($organizationId: ID!) {
|
||||
@@ -21,6 +24,7 @@ export const compliancePageMailingListPageQuery = graphql`
|
||||
mailingList {
|
||||
id
|
||||
replyTo
|
||||
...CompliancePageUpdatesListFragment
|
||||
}
|
||||
...CompliancePageMailingListFragment
|
||||
}
|
||||
@@ -40,12 +44,19 @@ const updateMailingListMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
type Tab = "updates" | "subscribers";
|
||||
|
||||
export function CompliancePageMailingListPage(props: {
|
||||
queryRef: PreloadedQuery<CompliancePageMailingListPageQuery>;
|
||||
}) {
|
||||
const { queryRef } = props;
|
||||
const { __ } = useTranslate();
|
||||
const dialogRef = useDialogRef();
|
||||
const subscriberDialogRef = useDialogRef();
|
||||
const newUpdateDialogRef = useDialogRef();
|
||||
const editUpdateDialogRef = useDialogRef();
|
||||
|
||||
const [activeTab, setActiveTab] = useState<Tab>("updates");
|
||||
const [selectedUpdate, setSelectedUpdate] = useState<UpdateNode | null>(null);
|
||||
|
||||
const { organization } = usePreloadedQuery<CompliancePageMailingListPageQuery>(
|
||||
compliancePageMailingListPageQuery,
|
||||
@@ -56,13 +67,18 @@ export function CompliancePageMailingListPage(props: {
|
||||
throw new Error("invalid type for node");
|
||||
}
|
||||
|
||||
const mailingList = organization.compliancePage.mailingList;
|
||||
const { compliancePage } = organization;
|
||||
const mailingList = compliancePage.mailingList;
|
||||
const mailingListId = mailingList?.id;
|
||||
|
||||
const connectionId = mailingListId
|
||||
const subscriberConnectionId = mailingListId
|
||||
? ConnectionHandler.getConnectionID(mailingListId, "CompliancePageMailingList_subscribers")
|
||||
: null;
|
||||
|
||||
const updatesConnectionId = mailingListId
|
||||
? ConnectionHandler.getConnectionID(mailingListId, "CompliancePageUpdatesList_updates")
|
||||
: null;
|
||||
|
||||
const [replyTo, setReplyTo] = useState(mailingList?.replyTo ?? "");
|
||||
|
||||
const [updateMailingList, isUpdating] = useMutationWithToasts<CompliancePageMailingListPage_updateMailingListMutation>(
|
||||
@@ -85,6 +101,11 @@ export function CompliancePageMailingListPage(props: {
|
||||
});
|
||||
};
|
||||
|
||||
const handleEditUpdate = (update: UpdateNode) => {
|
||||
setSelectedUpdate({ ...update });
|
||||
editUpdateDialogRef.current?.open();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{mailingListId && (
|
||||
@@ -119,27 +140,57 @@ export function CompliancePageMailingListPage(props: {
|
||||
|
||||
<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()}>
|
||||
<Tabs>
|
||||
<TabItem active={activeTab === "updates"} onClick={() => setActiveTab("updates")}>
|
||||
{__("Updates")}
|
||||
</TabItem>
|
||||
<TabItem active={activeTab === "subscribers"} onClick={() => setActiveTab("subscribers")}>
|
||||
{__("Subscribers")}
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
{activeTab === "updates" && mailingListId && (
|
||||
<Button icon={IconPlusLarge} onClick={() => newUpdateDialogRef.current?.open()}>
|
||||
{__("Add Update")}
|
||||
</Button>
|
||||
)}
|
||||
{activeTab === "subscribers" && mailingListId && (
|
||||
<Button icon={IconPlusLarge} onClick={() => subscriberDialogRef.current?.open()}>
|
||||
{__("Add Subscriber")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<CompliancePageMailingList fragmentRef={organization.compliancePage} />
|
||||
{activeTab === "updates" && mailingList && (
|
||||
<CompliancePageUpdatesList
|
||||
fragmentRef={mailingList}
|
||||
onEdit={handleEditUpdate}
|
||||
/>
|
||||
)}
|
||||
|
||||
{activeTab === "subscribers" && (
|
||||
<CompliancePageMailingList fragmentRef={compliancePage} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{mailingListId && connectionId && (
|
||||
<NewCompliancePageSubscriberDialog
|
||||
ref={dialogRef}
|
||||
{mailingListId && updatesConnectionId && (
|
||||
<NewComplianceUpdateDialog
|
||||
ref={newUpdateDialogRef}
|
||||
mailingListId={mailingListId}
|
||||
connectionId={connectionId}
|
||||
connectionId={updatesConnectionId}
|
||||
/>
|
||||
)}
|
||||
|
||||
<EditComplianceUpdateDialog
|
||||
ref={editUpdateDialogRef}
|
||||
update={selectedUpdate}
|
||||
/>
|
||||
|
||||
{mailingListId && subscriberConnectionId && (
|
||||
<NewCompliancePageSubscriberDialog
|
||||
ref={subscriberDialogRef}
|
||||
mailingListId={mailingListId}
|
||||
connectionId={subscriberConnectionId}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,209 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Badge, Button, IconChevronDown, IconPencil, IconSend, IconTrashCan, Spinner, Table, Tbody, Td, Th, Thead, Tr, useConfirm } from "@probo/ui";
|
||||
import { usePaginationFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { CompliancePageUpdatesListDeleteMutation } from "#/__generated__/core/CompliancePageUpdatesListDeleteMutation.graphql";
|
||||
import type { CompliancePageUpdatesListFragment$data, CompliancePageUpdatesListFragment$key } from "#/__generated__/core/CompliancePageUpdatesListFragment.graphql";
|
||||
import type { CompliancePageUpdatesListQuery } from "#/__generated__/core/CompliancePageUpdatesListQuery.graphql";
|
||||
import type { CompliancePageUpdatesListSendMutation } from "#/__generated__/core/CompliancePageUpdatesListSendMutation.graphql";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
|
||||
const deleteMutation = graphql`
|
||||
mutation CompliancePageUpdatesListDeleteMutation(
|
||||
$input: DeleteMailingListUpdateInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteMailingListUpdate(input: $input) {
|
||||
deletedMailingListUpdateId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const sendMutation = graphql`
|
||||
mutation CompliancePageUpdatesListSendMutation($input: SendMailingListUpdateInput!) {
|
||||
sendMailingListUpdate(input: $input) {
|
||||
mailingListUpdate {
|
||||
id
|
||||
title
|
||||
body
|
||||
status
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageUpdatesListFragment on MailingList
|
||||
@argumentDefinitions(
|
||||
first: { type: Int, defaultValue: 20 }
|
||||
after: { type: CursorKey, defaultValue: null }
|
||||
)
|
||||
@refetchable(queryName: "CompliancePageUpdatesListQuery") {
|
||||
updates(
|
||||
first: $first
|
||||
after: $after
|
||||
) @connection(key: "CompliancePageUpdatesList_updates") {
|
||||
__id
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
body
|
||||
status
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export type UpdateNode = CompliancePageUpdatesListFragment$data["updates"]["edges"][number]["node"];
|
||||
|
||||
export function CompliancePageUpdatesList(props: {
|
||||
fragmentRef: CompliancePageUpdatesListFragment$key;
|
||||
onEdit: (update: UpdateNode) => void;
|
||||
}) {
|
||||
const { fragmentRef, onEdit } = props;
|
||||
const { __ } = useTranslate();
|
||||
const confirm = useConfirm();
|
||||
|
||||
const { data, hasNext, loadNext, isLoadingNext } = usePaginationFragment<
|
||||
CompliancePageUpdatesListQuery,
|
||||
CompliancePageUpdatesListFragment$key
|
||||
>(fragment, fragmentRef);
|
||||
|
||||
const connection = data.updates;
|
||||
|
||||
const [deleteUpdate, isDeleting]
|
||||
= useMutationWithToasts<CompliancePageUpdatesListDeleteMutation>(deleteMutation, {
|
||||
successMessage: __("Update deleted successfully"),
|
||||
errorMessage: __("Failed to delete update"),
|
||||
});
|
||||
|
||||
const [sendUpdate, isSending]
|
||||
= useMutationWithToasts<CompliancePageUpdatesListSendMutation>(sendMutation, {
|
||||
successMessage: __("Update enqueued for delivery"),
|
||||
errorMessage: __("Failed to enqueue update for delivery"),
|
||||
});
|
||||
|
||||
const handleDelete = (id: string) => {
|
||||
void deleteUpdate({
|
||||
variables: {
|
||||
input: { id },
|
||||
connections: [connection.__id],
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleSend = (node: UpdateNode) => {
|
||||
confirm(
|
||||
() =>
|
||||
sendUpdate({
|
||||
variables: {
|
||||
input: {
|
||||
id: node.id,
|
||||
},
|
||||
},
|
||||
}),
|
||||
{
|
||||
title: __("Send this update to all subscribers?"),
|
||||
message: `"${node.title}" — ${node.body.length > 120 ? node.body.slice(0, 120) + "…" : node.body}`,
|
||||
label: __("Send"),
|
||||
variant: "primary",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{connection.edges.length === 0
|
||||
? (
|
||||
<Table>
|
||||
<Tbody>
|
||||
<Tr>
|
||||
<Td className="text-center text-txt-tertiary py-8">
|
||||
{__("No updates yet")}
|
||||
</Td>
|
||||
</Tr>
|
||||
</Tbody>
|
||||
</Table>
|
||||
)
|
||||
: (
|
||||
<>
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{__("Title")}</Th>
|
||||
<Th>{__("Status")}</Th>
|
||||
<Th>{__("Created")}</Th>
|
||||
<Th />
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{connection.edges.map(({ node }) => (
|
||||
<Tr key={node.id}>
|
||||
<Td>{node.title}</Td>
|
||||
<Td>
|
||||
<Badge variant={node.status === "SENT" ? "success" : node.status === "DRAFT" ? "warning" : "info"}>
|
||||
{node.status === "SENT" ? __("Sent") : node.status === "ENQUEUED" ? __("Queued") : node.status === "PROCESSING" ? __("Processing…") : __("Draft")}
|
||||
</Badge>
|
||||
</Td>
|
||||
<Td className="text-txt-tertiary text-sm">
|
||||
{new Date(node.createdAt).toLocaleDateString()}
|
||||
</Td>
|
||||
<Td className="w-auto">
|
||||
<div className="flex gap-1 justify-end">
|
||||
{node.status === "DRAFT" && (
|
||||
<Button
|
||||
icon={IconSend}
|
||||
disabled={isSending}
|
||||
onClick={() => handleSend(node)}
|
||||
className="bg-green-600 text-white hover:bg-green-700 active:bg-green-800 shadow-none"
|
||||
aria-label={__("Send")}
|
||||
>
|
||||
{__("Send")}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant="tertiary"
|
||||
icon={IconPencil}
|
||||
onClick={() => onEdit(node)}
|
||||
aria-label={__("Edit update")}
|
||||
/>
|
||||
<Button
|
||||
variant="tertiary"
|
||||
icon={IconTrashCan}
|
||||
disabled={isDeleting}
|
||||
onClick={() => handleDelete(node.id)}
|
||||
aria-label={__("Delete update")}
|
||||
/>
|
||||
</div>
|
||||
</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>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Button, Dialog, DialogContent, DialogFooter, type DialogRef, Field, IconCircleInfo, Spinner, Textarea } from "@probo/ui";
|
||||
import { useEffect } from "react";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { z } from "zod";
|
||||
|
||||
import type { EditComplianceUpdateDialogMutation } from "#/__generated__/core/EditComplianceUpdateDialogMutation.graphql";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
|
||||
import type { UpdateNode } from "./CompliancePageUpdatesList";
|
||||
|
||||
const updateMutation = graphql`
|
||||
mutation EditComplianceUpdateDialogMutation($input: UpdateMailingListUpdateInput!) {
|
||||
updateMailingListUpdate(input: $input) {
|
||||
mailingListUpdate {
|
||||
id
|
||||
title
|
||||
body
|
||||
status
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function EditComplianceUpdateDialog(props: {
|
||||
update: UpdateNode | null;
|
||||
ref: DialogRef;
|
||||
}) {
|
||||
const { update, ref } = props;
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const isSent = update?.status !== "DRAFT";
|
||||
|
||||
const schema = z.object({
|
||||
title: z.string().trim().min(1, __("Title is required")),
|
||||
body: z.string().trim().min(1, __("Body is required")),
|
||||
});
|
||||
|
||||
const form = useFormWithSchema(schema, {
|
||||
defaultValues: { title: "", body: "" },
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (update) {
|
||||
form.reset({ title: update.title, body: update.body });
|
||||
}
|
||||
}, [update, form]);
|
||||
|
||||
const [saveUpdate, isSaving] = useMutationWithToasts<EditComplianceUpdateDialogMutation>(
|
||||
updateMutation,
|
||||
{
|
||||
successMessage: __("Update saved successfully"),
|
||||
errorMessage: __("Failed to save update"),
|
||||
},
|
||||
);
|
||||
|
||||
const handleSubmit = async (data: { title: string; body: string }) => {
|
||||
if (!update) return;
|
||||
await saveUpdate({
|
||||
variables: {
|
||||
input: {
|
||||
id: update.id,
|
||||
title: data.title.trim(),
|
||||
body: data.body.trim(),
|
||||
},
|
||||
},
|
||||
onCompleted: (_, errors) => {
|
||||
if (!errors?.length) {
|
||||
ref.current?.close();
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog ref={ref} title={__("Edit Update")}>
|
||||
<form onSubmit={e => void form.handleSubmit(handleSubmit)(e)}>
|
||||
<DialogContent padded className="space-y-6">
|
||||
<div className="flex gap-2.5 rounded-lg bg-surface-secondary p-3 text-sm text-txt-secondary">
|
||||
<IconCircleInfo size={16} className="mt-0.5 shrink-0 text-txt-tertiary" />
|
||||
<p>
|
||||
{__("Do not include confidential or sensitive information in this update. Any content that requires protection should be placed behind your NDA-gated documents instead.")}
|
||||
</p>
|
||||
</div>
|
||||
<Field
|
||||
label={__("Title")}
|
||||
required
|
||||
disabled={isSent}
|
||||
error={form.formState.errors.title?.message}
|
||||
{...form.register("title")}
|
||||
/>
|
||||
<Field
|
||||
label={__("Body")}
|
||||
required
|
||||
error={form.formState.errors.body?.message}
|
||||
>
|
||||
<Textarea rows={6} disabled={isSent} {...form.register("body")} />
|
||||
</Field>
|
||||
{isSent && (
|
||||
<p className="text-sm text-txt-tertiary">
|
||||
{__("This update has been sent and can no longer be edited.")}
|
||||
</p>
|
||||
)}
|
||||
</DialogContent>
|
||||
<DialogFooter>
|
||||
{!isSent && (
|
||||
<Button type="submit" disabled={isSaving}>
|
||||
{isSaving && <Spinner />}
|
||||
{__("Save")}
|
||||
</Button>
|
||||
)}
|
||||
</DialogFooter>
|
||||
</form>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -36,7 +36,7 @@ export function NewCompliancePageSubscriberDialog(props: {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const schema = z.object({
|
||||
fullName: z.string().min(1, __("Full name is required")).trim(),
|
||||
fullName: z.string().trim().min(1, __("Full name is required")),
|
||||
email: z
|
||||
.string()
|
||||
.min(1, __("Email is required"))
|
||||
@@ -90,6 +90,7 @@ export function NewCompliancePageSubscriberDialog(props: {
|
||||
label={__("Full Name")}
|
||||
required
|
||||
error={form.formState.errors.fullName?.message}
|
||||
type="text"
|
||||
{...form.register("fullName")}
|
||||
placeholder={__("John Doe")}
|
||||
/>
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Button, Dialog, DialogContent, DialogFooter, type DialogRef, Field, Spinner, Textarea } from "@probo/ui";
|
||||
import { graphql } from "relay-runtime";
|
||||
import { z } from "zod";
|
||||
|
||||
import type { NewComplianceUpdateDialogMutation } from "#/__generated__/core/NewComplianceUpdateDialogMutation.graphql";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
|
||||
const createMutation = graphql`
|
||||
mutation NewComplianceUpdateDialogMutation(
|
||||
$input: CreateMailingListUpdateInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createMailingListUpdate(input: $input) {
|
||||
mailingListUpdate
|
||||
@prependNode(connections: $connections, edgeTypeName: "MailingListUpdateEdge") {
|
||||
id
|
||||
title
|
||||
body
|
||||
status
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function NewComplianceUpdateDialog(props: {
|
||||
mailingListId: string;
|
||||
connectionId: string;
|
||||
ref: DialogRef;
|
||||
onCreated?: () => void;
|
||||
}) {
|
||||
const { mailingListId, connectionId, ref, onCreated } = props;
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const schema = z.object({
|
||||
title: z.string().trim().min(1, __("Title is required")),
|
||||
body: z.string().trim().min(1, __("Body is required")),
|
||||
});
|
||||
|
||||
const form = useFormWithSchema(schema, {
|
||||
defaultValues: { title: "", body: "" },
|
||||
});
|
||||
|
||||
const [createUpdate, isCreating] = useMutationWithToasts<NewComplianceUpdateDialogMutation>(
|
||||
createMutation,
|
||||
{
|
||||
successMessage: __("Update created successfully"),
|
||||
errorMessage: __("Failed to create update"),
|
||||
},
|
||||
);
|
||||
|
||||
const handleSubmit = async (data: { title: string; body: string }) => {
|
||||
await createUpdate({
|
||||
variables: {
|
||||
input: {
|
||||
mailingListId,
|
||||
title: data.title.trim(),
|
||||
body: data.body.trim(),
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
onCompleted: (_, errors) => {
|
||||
if (!errors?.length) {
|
||||
form.reset();
|
||||
ref.current?.close();
|
||||
onCreated?.();
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog ref={ref} title={__("Add Update")}>
|
||||
<form onSubmit={e => void form.handleSubmit(handleSubmit)(e)}>
|
||||
<DialogContent padded className="space-y-6">
|
||||
<Field
|
||||
label={__("Title")}
|
||||
required
|
||||
error={form.formState.errors.title?.message}
|
||||
{...form.register("title")}
|
||||
/>
|
||||
<Field
|
||||
label={__("Body")}
|
||||
required
|
||||
error={form.formState.errors.body?.message}
|
||||
>
|
||||
<Textarea rows={6} {...form.register("body")} />
|
||||
</Field>
|
||||
</DialogContent>
|
||||
<DialogFooter>
|
||||
<Button type="submit" disabled={isCreating}>
|
||||
{isCreating && <Spinner />}
|
||||
{__("Create")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -4,8 +4,7 @@ import { useCallback, useState, useTransition } from "react";
|
||||
import { useRefetchableFragment } from "react-relay";
|
||||
import { ConnectionHandler, graphql } from "relay-runtime";
|
||||
|
||||
import type { CompliancePageFrameworkList_compliancePageFragment$key } from "#/__generated__/core/CompliancePageFrameworkList_compliancePageFragment.graphql";
|
||||
import type { CompliancePageFrameworkList_compliancePageFragment$data } from "#/__generated__/core/CompliancePageFrameworkList_compliancePageFragment.graphql";
|
||||
import type { CompliancePageFrameworkList_compliancePageFragment$data, CompliancePageFrameworkList_compliancePageFragment$key } from "#/__generated__/core/CompliancePageFrameworkList_compliancePageFragment.graphql";
|
||||
import type { CompliancePageFrameworkList_compliancePageRefetchQuery } from "#/__generated__/core/CompliancePageFrameworkList_compliancePageRefetchQuery.graphql";
|
||||
import type { CompliancePageFrameworkList_createMutation } from "#/__generated__/core/CompliancePageFrameworkList_createMutation.graphql";
|
||||
import type { CompliancePageFrameworkList_deleteMutation } from "#/__generated__/core/CompliancePageFrameworkList_deleteMutation.graphql";
|
||||
|
||||
@@ -39,6 +39,8 @@ export function MainLayout(props: Props) {
|
||||
<TabLink to="/documents">{__("Documents")}</TabLink>
|
||||
{trustCenter.vendorInfo.totalCount > 0
|
||||
&& <TabLink to="/subprocessors">{__("Subprocessors")}</TabLink>}
|
||||
{isAuthenticated
|
||||
&& <TabLink to="/updates">{__("Updates")}</TabLink>}
|
||||
</Tabs>
|
||||
<Outlet context={{ trustCenter }} />
|
||||
</main>
|
||||
|
||||
108
apps/trust/src/pages/UpdatesPage.tsx
Normal file
108
apps/trust/src/pages/UpdatesPage.tsx
Normal file
@@ -0,0 +1,108 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { IconChevronDown } from "@probo/ui";
|
||||
import { useState } from "react";
|
||||
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { UpdatesPageQuery } from "#/pages/__generated__/UpdatesPageQuery.graphql";
|
||||
|
||||
export const currentTrustUpdatesQuery = graphql`
|
||||
query UpdatesPageQuery {
|
||||
currentTrustCenter {
|
||||
id
|
||||
updates(first: 50) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
body
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<UpdatesPageQuery>;
|
||||
};
|
||||
|
||||
export function UpdatesPage({ queryRef }: Props) {
|
||||
const { __ } = useTranslate();
|
||||
const data = usePreloadedQuery<UpdatesPageQuery>(
|
||||
currentTrustUpdatesQuery,
|
||||
queryRef,
|
||||
);
|
||||
|
||||
const items
|
||||
= data.currentTrustCenter?.updates.edges.map(e => e.node) ?? [];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2 className="font-medium mb-1">{__("Updates")}</h2>
|
||||
<p className="text-sm text-txt-secondary mb-4">
|
||||
{__("Latest compliance and security updates:")}
|
||||
</p>
|
||||
<div className="space-y-0">
|
||||
{items.map(item => (
|
||||
<UpdateItem key={item.id} item={item} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
type UpdateItemType = {
|
||||
id: string;
|
||||
title: string;
|
||||
body: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
function UpdateItem({ item }: { item: UpdateItemType }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="border border-border-solid -mt-px first:rounded-t-lg last:rounded-b-lg overflow-hidden">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setOpen(o => !o)}
|
||||
className="w-full flex items-center justify-between px-6 py-4 text-left hover:bg-highlight transition-colors group"
|
||||
>
|
||||
<div className="flex items-center gap-3 min-w-0">
|
||||
<span className="text-sm font-medium text-txt-primary truncate">
|
||||
{item.title}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-4 flex-none ml-4">
|
||||
<span className="text-xs text-txt-tertiary hidden sm:block">
|
||||
{new Date(item.updatedAt).toLocaleDateString(undefined, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
})}
|
||||
</span>
|
||||
<IconChevronDown
|
||||
size={16}
|
||||
className={`flex-none text-txt-tertiary transition-transform duration-200 ${open ? "rotate-180" : ""}`}
|
||||
/>
|
||||
</div>
|
||||
</button>
|
||||
{open && (
|
||||
<div className="px-6 pb-5 pt-0 border-t border-border-solid bg-highlight/40">
|
||||
<p className="text-sm text-txt-secondary whitespace-pre-wrap leading-relaxed pt-4">
|
||||
{item.body}
|
||||
</p>
|
||||
<p className="text-xs text-txt-tertiary mt-3 sm:hidden">
|
||||
{new Date(item.updatedAt).toLocaleDateString(undefined, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
146
apps/trust/src/pages/__generated__/UpdatesPageQuery.graphql.ts
generated
Normal file
146
apps/trust/src/pages/__generated__/UpdatesPageQuery.graphql.ts
generated
Normal file
@@ -0,0 +1,146 @@
|
||||
/**
|
||||
* @generated SignedSource<<4560049874109fe98528d64249673d23>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type UpdatesPageQuery$variables = Record<PropertyKey, never>;
|
||||
export type UpdatesPageQuery$data = {
|
||||
readonly currentTrustCenter: {
|
||||
readonly id: string;
|
||||
readonly updates: {
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly body: string;
|
||||
readonly id: string;
|
||||
readonly title: string;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
} | null | undefined;
|
||||
};
|
||||
export type UpdatesPageQuery = {
|
||||
response: UpdatesPageQuery$data;
|
||||
variables: UpdatesPageQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
v1 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenter",
|
||||
"kind": "LinkedField",
|
||||
"name": "currentTrustCenter",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v0/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "first",
|
||||
"value": 50
|
||||
}
|
||||
],
|
||||
"concreteType": "MailingListUpdateConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "updates",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdateEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "MailingListUpdate",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v0/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "title",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "body",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": "updates(first:50)"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "UpdatesPageQuery",
|
||||
"selections": (v1/*: any*/),
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Operation",
|
||||
"name": "UpdatesPageQuery",
|
||||
"selections": (v1/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "5d323cbbdf9bfec294bb22dd6a6be735",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "UpdatesPageQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query UpdatesPageQuery {\n currentTrustCenter {\n id\n updates(first: 50) {\n edges {\n node {\n id\n title\n body\n updatedAt\n }\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "5c0e074ce562f24bd841cc750f492988";
|
||||
|
||||
export default node;
|
||||
@@ -13,6 +13,7 @@ import { MainLayout } from "#/layouts/MainLayout";
|
||||
import { DocumentsPage } from "#/pages/DocumentsPage";
|
||||
import { OverviewPage } from "#/pages/OverviewPage";
|
||||
import { SubprocessorsPage } from "#/pages/SubprocessorsPage";
|
||||
import { currentTrustUpdatesQuery, UpdatesPage } from "#/pages/UpdatesPage";
|
||||
import {
|
||||
currentTrustDocumentsQuery,
|
||||
currentTrustGraphQuery,
|
||||
@@ -112,6 +113,25 @@ const routes = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/updates",
|
||||
loader: loaderFromQueryLoader(() =>
|
||||
loadQuery(consoleEnvironment, currentTrustGraphQuery, {}),
|
||||
),
|
||||
Component: withQueryRef(MainLayout),
|
||||
Fallback: MainSkeleton,
|
||||
ErrorBoundary: RootErrorBoundary,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
loader: loaderFromQueryLoader(() =>
|
||||
loadQuery(consoleEnvironment, currentTrustUpdatesQuery, {}),
|
||||
),
|
||||
Fallback: TabSkeleton,
|
||||
Component: withQueryRef(UpdatesPage),
|
||||
},
|
||||
],
|
||||
},
|
||||
// Fallback URL to the NotFound Page
|
||||
{
|
||||
path: "*",
|
||||
|
||||
Reference in New Issue
Block a user