Refactor compliance page access page
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<17aba6dd50ebba280c11c963a4adede3>>
|
||||
* @generated SignedSource<<b6be9a950f88b30b167bada9075ece11>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,22 +10,14 @@
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type TrustCenterAccessGraph_accesses$data = {
|
||||
export type CompliancePageAccessListFragment$data = {
|
||||
readonly accesses: {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly cursor: string;
|
||||
readonly node: {
|
||||
readonly active: boolean;
|
||||
readonly activeCount: number;
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly createdAt: string;
|
||||
readonly email: string;
|
||||
readonly hasAcceptedNonDisclosureAgreement: boolean;
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly pendingRequestCount: number;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageAccessListItemFragment">;
|
||||
};
|
||||
}>;
|
||||
readonly pageInfo: {
|
||||
@@ -36,14 +28,14 @@ export type TrustCenterAccessGraph_accesses$data = {
|
||||
};
|
||||
};
|
||||
readonly id: string;
|
||||
readonly " $fragmentType": "TrustCenterAccessGraph_accesses";
|
||||
readonly " $fragmentType": "CompliancePageAccessListFragment";
|
||||
};
|
||||
export type TrustCenterAccessGraph_accesses$key = {
|
||||
readonly " $data"?: TrustCenterAccessGraph_accesses$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterAccessGraph_accesses">;
|
||||
export type CompliancePageAccessListFragment$key = {
|
||||
readonly " $data"?: CompliancePageAccessListFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageAccessListFragment">;
|
||||
};
|
||||
|
||||
import TrustCenterAccessGraphPaginationQuery_graphql from './TrustCenterAccessGraphPaginationQuery.graphql';
|
||||
import CompliancePageAccessListQuery_graphql from './CompliancePageAccessListQuery.graphql';
|
||||
|
||||
const node: ReaderFragment = (function(){
|
||||
var v0 = [
|
||||
@@ -59,20 +51,30 @@ v1 = {
|
||||
return {
|
||||
"argumentDefinitions": [
|
||||
{
|
||||
"kind": "RootArgument",
|
||||
"name": "count"
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "after"
|
||||
},
|
||||
{
|
||||
"kind": "RootArgument",
|
||||
"name": "cursor"
|
||||
"defaultValue": 10,
|
||||
"kind": "LocalArgument",
|
||||
"name": "first"
|
||||
},
|
||||
{
|
||||
"defaultValue": {
|
||||
"direction": "DESC",
|
||||
"field": "CREATED_AT"
|
||||
},
|
||||
"kind": "LocalArgument",
|
||||
"name": "order"
|
||||
}
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": {
|
||||
"connection": [
|
||||
{
|
||||
"count": "count",
|
||||
"cursor": "cursor",
|
||||
"count": "first",
|
||||
"cursor": "after",
|
||||
"direction": "forward",
|
||||
"path": (v0/*: any*/)
|
||||
}
|
||||
@@ -80,8 +82,8 @@ return {
|
||||
"refetch": {
|
||||
"connection": {
|
||||
"forward": {
|
||||
"count": "count",
|
||||
"cursor": "cursor"
|
||||
"count": "first",
|
||||
"cursor": "after"
|
||||
},
|
||||
"backward": null,
|
||||
"path": (v0/*: any*/)
|
||||
@@ -89,30 +91,27 @@ return {
|
||||
"fragmentPathInResult": [
|
||||
"node"
|
||||
],
|
||||
"operation": TrustCenterAccessGraphPaginationQuery_graphql,
|
||||
"operation": CompliancePageAccessListQuery_graphql,
|
||||
"identifierInfo": {
|
||||
"identifierField": "id",
|
||||
"identifierQueryVariableName": "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": "TrustCenterAccessGraph_accesses",
|
||||
"name": "CompliancePageAccessListFragment",
|
||||
"selections": [
|
||||
{
|
||||
"alias": "accesses",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"kind": "Variable",
|
||||
"name": "orderBy",
|
||||
"value": {
|
||||
"direction": "DESC",
|
||||
"field": "CREATED_AT"
|
||||
}
|
||||
"variableName": "order"
|
||||
}
|
||||
],
|
||||
"concreteType": "TrustCenterAccessConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "__TrustCenterAccessGraph_accesses_connection",
|
||||
"name": "__CompliancePageAccessList_accesses_connection",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -179,79 +178,9 @@ return {
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "email",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "name",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasAcceptedNonDisclosureAgreement",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "pendingRequestCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "activeCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:delete\")"
|
||||
"kind": "FragmentSpread",
|
||||
"name": "CompliancePageAccessListItemFragment"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
@@ -279,7 +208,7 @@ return {
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": "__TrustCenterAccessGraph_accesses_connection(orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||
"storageKey": null
|
||||
},
|
||||
(v1/*: any*/)
|
||||
],
|
||||
@@ -288,6 +217,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "7d69d885bc80ed04776bafa53157590e";
|
||||
(node as any).hash = "51879d3ed361c46e313f58abaaac04d9";
|
||||
|
||||
export default node;
|
||||
126
apps/console/src/__generated__/core/CompliancePageAccessListItemFragment.graphql.ts
generated
Normal file
126
apps/console/src/__generated__/core/CompliancePageAccessListItemFragment.graphql.ts
generated
Normal file
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* @generated SignedSource<<c3f94c9533e0031a201dd75921757748>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type CompliancePageAccessListItemFragment$data = {
|
||||
readonly active: boolean;
|
||||
readonly activeCount: number;
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly createdAt: string;
|
||||
readonly email: string;
|
||||
readonly hasAcceptedNonDisclosureAgreement: boolean;
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly pendingRequestCount: number;
|
||||
readonly " $fragmentType": "CompliancePageAccessListItemFragment";
|
||||
};
|
||||
export type CompliancePageAccessListItemFragment$key = {
|
||||
readonly " $data"?: CompliancePageAccessListItemFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageAccessListItemFragment">;
|
||||
};
|
||||
|
||||
const node: ReaderFragment = {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "CompliancePageAccessListItemFragment",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "name",
|
||||
"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": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "activeCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "pendingRequestCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasAcceptedNonDisclosureAgreement",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:delete\")"
|
||||
}
|
||||
],
|
||||
"type": "TrustCenterAccess",
|
||||
"abstractKey": null
|
||||
};
|
||||
|
||||
(node as any).hash = "e7120d76d08974b672e2ed1e66bf6cd7";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<ed4ab6c79b848843012fc091a7eb325c>>
|
||||
* @generated SignedSource<<25c74b1d91584c785476f8eb07a6db6a>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -12,18 +12,18 @@ import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteTrustCenterAccessInput = {
|
||||
id: string;
|
||||
};
|
||||
export type TrustCenterAccessGraphDeleteMutation$variables = {
|
||||
export type CompliancePageAccessListItem_deleteMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: DeleteTrustCenterAccessInput;
|
||||
};
|
||||
export type TrustCenterAccessGraphDeleteMutation$data = {
|
||||
export type CompliancePageAccessListItem_deleteMutation$data = {
|
||||
readonly deleteTrustCenterAccess: {
|
||||
readonly deletedTrustCenterAccessId: string;
|
||||
};
|
||||
};
|
||||
export type TrustCenterAccessGraphDeleteMutation = {
|
||||
response: TrustCenterAccessGraphDeleteMutation$data;
|
||||
variables: TrustCenterAccessGraphDeleteMutation$variables;
|
||||
export type CompliancePageAccessListItem_deleteMutation = {
|
||||
response: CompliancePageAccessListItem_deleteMutation$data;
|
||||
variables: CompliancePageAccessListItem_deleteMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -59,7 +59,7 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "TrustCenterAccessGraphDeleteMutation",
|
||||
"name": "CompliancePageAccessListItem_deleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -84,7 +84,7 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "TrustCenterAccessGraphDeleteMutation",
|
||||
"name": "CompliancePageAccessListItem_deleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -117,16 +117,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "3f55c9ce5cac2874b769ec994977367a",
|
||||
"cacheID": "10030545f3bff35111fd9eae0c57d351",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "TrustCenterAccessGraphDeleteMutation",
|
||||
"name": "CompliancePageAccessListItem_deleteMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation TrustCenterAccessGraphDeleteMutation(\n $input: DeleteTrustCenterAccessInput!\n) {\n deleteTrustCenterAccess(input: $input) {\n deletedTrustCenterAccessId\n }\n}\n"
|
||||
"text": "mutation CompliancePageAccessListItem_deleteMutation(\n $input: DeleteTrustCenterAccessInput!\n) {\n deleteTrustCenterAccess(input: $input) {\n deletedTrustCenterAccessId\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "0d0a44eb6db912eeb533d24718c49b35";
|
||||
(node as any).hash = "ed9591cbfdafb0ac1ea26b820a4dbf93";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<4daa20d8f82a95b0d405c37e5bac0280>>
|
||||
* @generated SignedSource<<3c657b1368adbcba6300b5b94eff92f2>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,77 +10,90 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type TrustCenterAccessGraphQuery$variables = {
|
||||
count: number;
|
||||
cursor?: string | null | undefined;
|
||||
trustCenterId: string;
|
||||
export type OrderDirection = "ASC" | "DESC";
|
||||
export type TrustCenterAccessOrderField = "CREATED_AT";
|
||||
export type TrustCenterAccessOrder = {
|
||||
direction: OrderDirection;
|
||||
field: TrustCenterAccessOrderField;
|
||||
};
|
||||
export type TrustCenterAccessGraphQuery$data = {
|
||||
export type CompliancePageAccessListQuery$variables = {
|
||||
after?: string | null | undefined;
|
||||
first?: number | null | undefined;
|
||||
id: string;
|
||||
order?: TrustCenterAccessOrder | null | undefined;
|
||||
};
|
||||
export type CompliancePageAccessListQuery$data = {
|
||||
readonly node: {
|
||||
readonly id?: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterAccessGraph_accesses">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageAccessListFragment">;
|
||||
};
|
||||
};
|
||||
export type TrustCenterAccessGraphQuery = {
|
||||
response: TrustCenterAccessGraphQuery$data;
|
||||
variables: TrustCenterAccessGraphQuery$variables;
|
||||
export type CompliancePageAccessListQuery = {
|
||||
response: CompliancePageAccessListQuery$data;
|
||||
variables: CompliancePageAccessListQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = {
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "count"
|
||||
"name": "after"
|
||||
},
|
||||
v1 = {
|
||||
"defaultValue": null,
|
||||
"defaultValue": 10,
|
||||
"kind": "LocalArgument",
|
||||
"name": "cursor"
|
||||
"name": "first"
|
||||
},
|
||||
v2 = {
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "trustCenterId"
|
||||
"name": "id"
|
||||
},
|
||||
v3 = [
|
||||
v3 = {
|
||||
"defaultValue": {
|
||||
"direction": "DESC",
|
||||
"field": "CREATED_AT"
|
||||
},
|
||||
"kind": "LocalArgument",
|
||||
"name": "order"
|
||||
},
|
||||
v4 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "id",
|
||||
"variableName": "trustCenterId"
|
||||
"variableName": "id"
|
||||
}
|
||||
],
|
||||
v4 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
v5 = {
|
||||
"kind": "Variable",
|
||||
"name": "after",
|
||||
"variableName": "after"
|
||||
},
|
||||
v6 = {
|
||||
"kind": "Variable",
|
||||
"name": "first",
|
||||
"variableName": "first"
|
||||
},
|
||||
v7 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
},
|
||||
v6 = [
|
||||
v8 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
v9 = [
|
||||
(v5/*: any*/),
|
||||
(v6/*: any*/),
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "after",
|
||||
"variableName": "cursor"
|
||||
},
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "first",
|
||||
"variableName": "count"
|
||||
},
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "orderBy",
|
||||
"value": {
|
||||
"direction": "DESC",
|
||||
"field": "CREATED_AT"
|
||||
}
|
||||
"variableName": "order"
|
||||
}
|
||||
];
|
||||
return {
|
||||
@@ -88,32 +101,33 @@ return {
|
||||
"argumentDefinitions": [
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/),
|
||||
(v2/*: any*/)
|
||||
(v2/*: any*/),
|
||||
(v3/*: any*/)
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "TrustCenterAccessGraphQuery",
|
||||
"name": "CompliancePageAccessListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v3/*: any*/),
|
||||
"args": (v4/*: any*/),
|
||||
"concreteType": null,
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
"selections": [
|
||||
(v4/*: any*/),
|
||||
"args": [
|
||||
(v5/*: any*/),
|
||||
(v6/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "TrustCenterAccessGraph_accesses"
|
||||
"kind": "Variable",
|
||||
"name": "order",
|
||||
"variableName": "order"
|
||||
}
|
||||
],
|
||||
"type": "TrustCenter",
|
||||
"abstractKey": null
|
||||
"kind": "FragmentSpread",
|
||||
"name": "CompliancePageAccessListFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -125,29 +139,30 @@ return {
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [
|
||||
(v2/*: any*/),
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/)
|
||||
(v1/*: any*/),
|
||||
(v3/*: any*/),
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "TrustCenterAccessGraphQuery",
|
||||
"name": "CompliancePageAccessListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v3/*: any*/),
|
||||
"args": (v4/*: any*/),
|
||||
"concreteType": null,
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v5/*: any*/),
|
||||
(v4/*: any*/),
|
||||
(v7/*: any*/),
|
||||
(v8/*: any*/),
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v6/*: any*/),
|
||||
"args": (v9/*: any*/),
|
||||
"concreteType": "TrustCenterAccessConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "accesses",
|
||||
@@ -215,14 +230,7 @@ return {
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "email",
|
||||
"storageKey": null
|
||||
},
|
||||
(v8/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -234,14 +242,7 @@ return {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasAcceptedNonDisclosureAgreement",
|
||||
"name": "email",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -255,7 +256,7 @@ return {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "pendingRequestCount",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -265,6 +266,20 @@ return {
|
||||
"name": "activeCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "pendingRequestCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasAcceptedNonDisclosureAgreement",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
@@ -291,7 +306,7 @@ return {
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:delete\")"
|
||||
},
|
||||
(v5/*: any*/)
|
||||
(v7/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
@@ -315,12 +330,12 @@ return {
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v6/*: any*/),
|
||||
"args": (v9/*: any*/),
|
||||
"filters": [
|
||||
"orderBy"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "TrustCenterAccessGraph_accesses",
|
||||
"key": "CompliancePageAccessList_accesses",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "accesses"
|
||||
}
|
||||
@@ -334,16 +349,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "605b209b5d31e97773f696a76b752bd5",
|
||||
"cacheID": "75c843f8501c2e5bd2c1422f7cf35b5f",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "TrustCenterAccessGraphQuery",
|
||||
"name": "CompliancePageAccessListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query TrustCenterAccessGraphQuery(\n $trustCenterId: ID!\n $count: Int!\n $cursor: CursorKey\n) {\n node(id: $trustCenterId) {\n __typename\n ... on TrustCenter {\n id\n ...TrustCenterAccessGraph_accesses\n }\n id\n }\n}\n\nfragment TrustCenterAccessGraph_accesses on TrustCenter {\n accesses(first: $count, after: $cursor, orderBy: {field: CREATED_AT, direction: DESC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n pendingRequestCount\n activeCount\n canUpdate: permission(action: \"core:trust-center-access:update\")\n canDelete: permission(action: \"core:trust-center-access:delete\")\n __typename\n }\n }\n }\n id\n}\n"
|
||||
"text": "query CompliancePageAccessListQuery(\n $after: CursorKey = null\n $first: Int = 10\n $order: TrustCenterAccessOrder = {field: CREATED_AT, direction: DESC}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...CompliancePageAccessListFragment_gOVF5\n id\n }\n}\n\nfragment CompliancePageAccessListFragment_gOVF5 on TrustCenter {\n accesses(first: $first, after: $after, orderBy: $order) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n ...CompliancePageAccessListItemFragment\n __typename\n }\n }\n }\n id\n}\n\nfragment CompliancePageAccessListItemFragment on TrustCenterAccess {\n id\n name\n email\n createdAt\n active\n activeCount\n pendingRequestCount\n hasAcceptedNonDisclosureAgreement\n canUpdate: permission(action: \"core:trust-center-access:update\")\n canDelete: permission(action: \"core:trust-center-access:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "da875d7c80a605898a30cf634d033380";
|
||||
(node as any).hash = "51879d3ed361c46e313f58abaaac04d9";
|
||||
|
||||
export default node;
|
||||
377
apps/console/src/__generated__/core/CompliancePageAccessPageQuery.graphql.ts
generated
Normal file
377
apps/console/src/__generated__/core/CompliancePageAccessPageQuery.graphql.ts
generated
Normal file
@@ -0,0 +1,377 @@
|
||||
/**
|
||||
* @generated SignedSource<<e5353f41022bedfa45f3607edac692d7>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type CompliancePageAccessPageQuery$variables = {
|
||||
organizationId: string;
|
||||
};
|
||||
export type CompliancePageAccessPageQuery$data = {
|
||||
readonly organization: {
|
||||
readonly __typename: "Organization";
|
||||
readonly compliancePage: {
|
||||
readonly canCreateAccess: boolean;
|
||||
readonly id: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageAccessListFragment">;
|
||||
};
|
||||
} | {
|
||||
// This will never be '%other', but we need some
|
||||
// value in case none of the concrete values match.
|
||||
readonly __typename: "%other";
|
||||
};
|
||||
};
|
||||
export type CompliancePageAccessPageQuery = {
|
||||
response: CompliancePageAccessPageQuery$data;
|
||||
variables: CompliancePageAccessPageQuery$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": "canCreateAccess",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:create"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:create\")"
|
||||
},
|
||||
v5 = [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "first",
|
||||
"value": 10
|
||||
},
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "orderBy",
|
||||
"value": {
|
||||
"direction": "DESC",
|
||||
"field": "CREATED_AT"
|
||||
}
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "CompliancePageAccessPageQuery",
|
||||
"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*/),
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "CompliancePageAccessListFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
"action": "THROW"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "CompliancePageAccessPageQuery",
|
||||
"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*/),
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "TrustCenterAccessConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "accesses",
|
||||
"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": "hasPreviousPage",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "startCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "endCursor",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccessEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccess",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "name",
|
||||
"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": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "activeCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "pendingRequestCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasAcceptedNonDisclosureAgreement",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:delete\")"
|
||||
},
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"kind": "ClientExtension",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__id",
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": "accesses(first:10,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"filters": [
|
||||
"orderBy"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "CompliancePageAccessList_accesses",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "accesses"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
"abstractKey": null
|
||||
},
|
||||
(v3/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "651e7d8df512ab49f09e5b086a488266",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "CompliancePageAccessPageQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query CompliancePageAccessPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n compliancePage: trustCenter {\n id\n canCreateAccess: permission(action: \"core:trust-center-access:create\")\n ...CompliancePageAccessListFragment\n }\n }\n id\n }\n}\n\nfragment CompliancePageAccessListFragment on TrustCenter {\n accesses(first: 10, orderBy: {field: CREATED_AT, direction: DESC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n ...CompliancePageAccessListItemFragment\n __typename\n }\n }\n }\n id\n}\n\nfragment CompliancePageAccessListItemFragment on TrustCenterAccess {\n id\n name\n email\n createdAt\n active\n activeCount\n pendingRequestCount\n hasAcceptedNonDisclosureAgreement\n canUpdate: permission(action: \"core:trust-center-access:update\")\n canDelete: permission(action: \"core:trust-center-access:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "4cc473e91fd49ddd83b6cdb0c8da0abf";
|
||||
|
||||
export default node;
|
||||
275
apps/console/src/__generated__/core/NewCompliancePageAccessDialogMutation.graphql.ts
generated
Normal file
275
apps/console/src/__generated__/core/NewCompliancePageAccessDialogMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,275 @@
|
||||
/**
|
||||
* @generated SignedSource<<953f0fbe58d5428b76797adcd479aa06>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type CreateTrustCenterAccessInput = {
|
||||
active: boolean;
|
||||
email: string;
|
||||
name: string;
|
||||
trustCenterId: string;
|
||||
};
|
||||
export type NewCompliancePageAccessDialogMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: CreateTrustCenterAccessInput;
|
||||
};
|
||||
export type NewCompliancePageAccessDialogMutation$data = {
|
||||
readonly createTrustCenterAccess: {
|
||||
readonly trustCenterAccessEdge: {
|
||||
readonly cursor: string;
|
||||
readonly node: {
|
||||
readonly id: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"CompliancePageAccessListItemFragment">;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export type NewCompliancePageAccessDialogMutation = {
|
||||
response: NewCompliancePageAccessDialogMutation$data;
|
||||
variables: NewCompliancePageAccessDialogMutation$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": "cursor",
|
||||
"storageKey": null
|
||||
},
|
||||
v4 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/)
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NewCompliancePageAccessDialogMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateTrustCenterAccessPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createTrustCenterAccess",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccessEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "trustCenterAccessEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccess",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "CompliancePageAccessListItemFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [
|
||||
(v1/*: any*/),
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "NewCompliancePageAccessDialogMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateTrustCenterAccessPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createTrustCenterAccess",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccessEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "trustCenterAccessEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccess",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "name",
|
||||
"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": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "activeCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "pendingRequestCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasAcceptedNonDisclosureAgreement",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"filters": null,
|
||||
"handle": "prependEdge",
|
||||
"key": "",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "trustCenterAccessEdge",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "connections",
|
||||
"variableName": "connections"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "35604e9722512d1d60d70b6bce7d866b",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NewCompliancePageAccessDialogMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation NewCompliancePageAccessDialogMutation(\n $input: CreateTrustCenterAccessInput!\n) {\n createTrustCenterAccess(input: $input) {\n trustCenterAccessEdge {\n cursor\n node {\n id\n ...CompliancePageAccessListItemFragment\n }\n }\n }\n}\n\nfragment CompliancePageAccessListItemFragment on TrustCenterAccess {\n id\n name\n email\n createdAt\n active\n activeCount\n pendingRequestCount\n hasAcceptedNonDisclosureAgreement\n canUpdate: permission(action: \"core:trust-center-access:update\")\n canDelete: permission(action: \"core:trust-center-access:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "43aac1b4e3b2006dc097ef818860f541";
|
||||
|
||||
export default node;
|
||||
@@ -1,253 +0,0 @@
|
||||
/**
|
||||
* @generated SignedSource<<a65c1699d7cf70edf7084ad4f3eaf603>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type CreateTrustCenterAccessInput = {
|
||||
active: boolean;
|
||||
email: string;
|
||||
name: string;
|
||||
trustCenterId: string;
|
||||
};
|
||||
export type TrustCenterAccessGraphCreateMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: CreateTrustCenterAccessInput;
|
||||
};
|
||||
export type TrustCenterAccessGraphCreateMutation$data = {
|
||||
readonly createTrustCenterAccess: {
|
||||
readonly trustCenterAccessEdge: {
|
||||
readonly cursor: string;
|
||||
readonly node: {
|
||||
readonly active: boolean;
|
||||
readonly activeCount: number;
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly createdAt: string;
|
||||
readonly email: string;
|
||||
readonly hasAcceptedNonDisclosureAgreement: boolean;
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly pendingRequestCount: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export type TrustCenterAccessGraphCreateMutation = {
|
||||
response: TrustCenterAccessGraphCreateMutation$data;
|
||||
variables: TrustCenterAccessGraphCreateMutation$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": "TrustCenterAccessEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "trustCenterAccessEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccess",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"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": "name",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasAcceptedNonDisclosureAgreement",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "pendingRequestCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "activeCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/)
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "TrustCenterAccessGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateTrustCenterAccessPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createTrustCenterAccess",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [
|
||||
(v1/*: any*/),
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "TrustCenterAccessGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateTrustCenterAccessPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createTrustCenterAccess",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"filters": null,
|
||||
"handle": "prependEdge",
|
||||
"key": "",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "trustCenterAccessEdge",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "connections",
|
||||
"variableName": "connections"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "6afb34eabf677345a8b94479a62b101d",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "TrustCenterAccessGraphCreateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation TrustCenterAccessGraphCreateMutation(\n $input: CreateTrustCenterAccessInput!\n) {\n createTrustCenterAccess(input: $input) {\n trustCenterAccessEdge {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n pendingRequestCount\n activeCount\n canUpdate: permission(action: \"core:trust-center-access:update\")\n canDelete: permission(action: \"core:trust-center-access:delete\")\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "71ca86286860103cdce4720d26a52f21";
|
||||
|
||||
export default node;
|
||||
@@ -1,334 +0,0 @@
|
||||
/**
|
||||
* @generated SignedSource<<0a06a583c9eafcd4b26a4ec7415ca88b>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type TrustCenterAccessGraphPaginationQuery$variables = {
|
||||
count?: number | null | undefined;
|
||||
cursor?: string | null | undefined;
|
||||
id: string;
|
||||
};
|
||||
export type TrustCenterAccessGraphPaginationQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"TrustCenterAccessGraph_accesses">;
|
||||
};
|
||||
};
|
||||
export type TrustCenterAccessGraphPaginationQuery = {
|
||||
response: TrustCenterAccessGraphPaginationQuery$data;
|
||||
variables: TrustCenterAccessGraphPaginationQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "count"
|
||||
},
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "cursor"
|
||||
},
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "id"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "id",
|
||||
"variableName": "id"
|
||||
}
|
||||
],
|
||||
v2 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
},
|
||||
v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
v4 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "after",
|
||||
"variableName": "cursor"
|
||||
},
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "first",
|
||||
"variableName": "count"
|
||||
},
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "orderBy",
|
||||
"value": {
|
||||
"direction": "DESC",
|
||||
"field": "CREATED_AT"
|
||||
}
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "TrustCenterAccessGraphPaginationQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v1/*: any*/),
|
||||
"concreteType": null,
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "TrustCenterAccessGraph_accesses"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "TrustCenterAccessGraphPaginationQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v1/*: any*/),
|
||||
"concreteType": null,
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v4/*: any*/),
|
||||
"concreteType": "TrustCenterAccessConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "accesses",
|
||||
"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": "hasPreviousPage",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "startCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "endCursor",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccessEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "TrustCenterAccess",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "email",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "name",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasAcceptedNonDisclosureAgreement",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "pendingRequestCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "activeCount",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:trust-center-access:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:trust-center-access:delete\")"
|
||||
},
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"kind": "ClientExtension",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__id",
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v4/*: any*/),
|
||||
"filters": [
|
||||
"orderBy"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "TrustCenterAccessGraph_accesses",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "accesses"
|
||||
}
|
||||
],
|
||||
"type": "TrustCenter",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "650290081ecafbf348f371c1becf15e3",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "TrustCenterAccessGraphPaginationQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query TrustCenterAccessGraphPaginationQuery(\n $count: Int\n $cursor: CursorKey\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...TrustCenterAccessGraph_accesses\n id\n }\n}\n\nfragment TrustCenterAccessGraph_accesses on TrustCenter {\n accesses(first: $count, after: $cursor, orderBy: {field: CREATED_AT, direction: DESC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n email\n name\n active\n hasAcceptedNonDisclosureAgreement\n createdAt\n pendingRequestCount\n activeCount\n canUpdate: permission(action: \"core:trust-center-access:update\")\n canDelete: permission(action: \"core:trust-center-access:delete\")\n __typename\n }\n }\n }\n id\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "7d69d885bc80ed04776bafa53157590e";
|
||||
|
||||
export default node;
|
||||
@@ -1,84 +1,4 @@
|
||||
import { graphql, useLazyLoadQuery, usePaginationFragment } from "react-relay";
|
||||
|
||||
import type {
|
||||
TrustCenterAccessGraph_accesses$data,
|
||||
TrustCenterAccessGraph_accesses$key,
|
||||
} from "#/__generated__/core/TrustCenterAccessGraph_accesses.graphql";
|
||||
import type { TrustCenterAccessGraphQuery } from "#/__generated__/core/TrustCenterAccessGraphQuery.graphql";
|
||||
|
||||
export const trustCenterAccessesPaginationFragment = graphql`
|
||||
fragment TrustCenterAccessGraph_accesses on TrustCenter
|
||||
@refetchable(queryName: "TrustCenterAccessGraphPaginationQuery") {
|
||||
accesses(
|
||||
first: $count
|
||||
after: $cursor
|
||||
orderBy: { field: CREATED_AT, direction: DESC }
|
||||
) @connection(key: "TrustCenterAccessGraph_accesses") {
|
||||
__id
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
hasPreviousPage
|
||||
startCursor
|
||||
endCursor
|
||||
}
|
||||
edges {
|
||||
cursor
|
||||
node {
|
||||
id
|
||||
email
|
||||
name
|
||||
active
|
||||
hasAcceptedNonDisclosureAgreement
|
||||
createdAt
|
||||
pendingRequestCount
|
||||
activeCount
|
||||
canUpdate: permission(action: "core:trust-center-access:update")
|
||||
canDelete: permission(action: "core:trust-center-access:delete")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const trustCenterAccessesQuery = graphql`
|
||||
query TrustCenterAccessGraphQuery(
|
||||
$trustCenterId: ID!
|
||||
$count: Int!
|
||||
$cursor: CursorKey
|
||||
) {
|
||||
node(id: $trustCenterId) {
|
||||
... on TrustCenter {
|
||||
id
|
||||
...TrustCenterAccessGraph_accesses
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const createTrustCenterAccessMutation = graphql`
|
||||
mutation TrustCenterAccessGraphCreateMutation(
|
||||
$input: CreateTrustCenterAccessInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createTrustCenterAccess(input: $input) {
|
||||
trustCenterAccessEdge @prependEdge(connections: $connections) {
|
||||
cursor
|
||||
node {
|
||||
id
|
||||
email
|
||||
name
|
||||
active
|
||||
hasAcceptedNonDisclosureAgreement
|
||||
createdAt
|
||||
pendingRequestCount
|
||||
activeCount
|
||||
canUpdate: permission(action: "core:trust-center-access:update")
|
||||
canDelete: permission(action: "core:trust-center-access:delete")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
import { graphql } from "react-relay";
|
||||
|
||||
export const updateTrustCenterAccessMutation = graphql`
|
||||
mutation TrustCenterAccessGraphUpdateMutation(
|
||||
@@ -100,17 +20,6 @@ export const updateTrustCenterAccessMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const deleteTrustCenterAccessMutation = graphql`
|
||||
mutation TrustCenterAccessGraphDeleteMutation(
|
||||
$input: DeleteTrustCenterAccessInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteTrustCenterAccess(input: $input) {
|
||||
deletedTrustCenterAccessId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const loadTrustCenterAccessDocumentAccessesQuery = graphql`
|
||||
query TrustCenterAccessGraphLoadDocumentAccessesQuery($accessId: ID!) {
|
||||
node(id: $accessId) {
|
||||
@@ -151,54 +60,3 @@ export const loadTrustCenterAccessDocumentAccessesQuery = graphql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
interface PaginatedData {
|
||||
data: TrustCenterAccessGraph_accesses$data | null;
|
||||
hasNext: boolean;
|
||||
loadMore: () => void;
|
||||
isLoadingNext: boolean;
|
||||
}
|
||||
|
||||
export function useTrustCenterAccesses(trustCenterId: string): PaginatedData {
|
||||
const data = useLazyLoadQuery<TrustCenterAccessGraphQuery>(
|
||||
trustCenterAccessesQuery,
|
||||
{
|
||||
trustCenterId: trustCenterId || "",
|
||||
count: 10,
|
||||
cursor: null,
|
||||
},
|
||||
{ fetchPolicy: "store-and-network" },
|
||||
);
|
||||
|
||||
const trustCenter = data?.node;
|
||||
|
||||
const {
|
||||
data: paginationData,
|
||||
loadNext,
|
||||
hasNext,
|
||||
isLoadingNext,
|
||||
} = usePaginationFragment<
|
||||
TrustCenterAccessGraphQuery,
|
||||
TrustCenterAccessGraph_accesses$key
|
||||
>(trustCenterAccessesPaginationFragment, trustCenter);
|
||||
|
||||
if (!trustCenterId) {
|
||||
return {
|
||||
data: null,
|
||||
hasNext: false,
|
||||
loadMore: () => {},
|
||||
isLoadingNext: false,
|
||||
};
|
||||
}
|
||||
|
||||
const loadMore = () => {
|
||||
loadNext(10);
|
||||
};
|
||||
|
||||
return {
|
||||
data: paginationData,
|
||||
hasNext,
|
||||
loadMore,
|
||||
isLoadingNext,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Button, IconPlusLarge, Spinner, Table, Tbody, Td, Tr, useDialogRef } from "@probo/ui";
|
||||
import { useState } from "react";
|
||||
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
||||
import { ConnectionHandler, graphql } from "relay-runtime";
|
||||
|
||||
import type { CompliancePageAccessPageQuery } from "#/__generated__/core/CompliancePageAccessPageQuery.graphql";
|
||||
|
||||
import { CompliancePageAccessList } from "./_components/CompliancePageAccessList";
|
||||
import { NewCompliancePageAccessDialog } from "./_components/NewCompliancePageAccessDialog";
|
||||
|
||||
export const compliancePageAccessPageQuery = graphql`
|
||||
query CompliancePageAccessPageQuery($organizationId: ID!) {
|
||||
organization: node(id: $organizationId) {
|
||||
__typename
|
||||
... on Organization {
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
id
|
||||
canCreateAccess: permission(action: "core:trust-center-access:create")
|
||||
...CompliancePageAccessListFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function CompliancePageAccessPage(props: { queryRef: PreloadedQuery<CompliancePageAccessPageQuery> }) {
|
||||
const { queryRef } = props;
|
||||
|
||||
const { __ } = useTranslate();
|
||||
const dialogRef = useDialogRef();
|
||||
const [editingAccessId, setEditingAccessId] = useState<string | null>(null);
|
||||
|
||||
const { organization } = usePreloadedQuery<CompliancePageAccessPageQuery>(compliancePageAccessPageQuery, queryRef);
|
||||
if (organization.__typename !== "Organization") {
|
||||
throw new Error("invalid type for node");
|
||||
}
|
||||
|
||||
const connectionId = ConnectionHandler.getConnectionID(
|
||||
organization.compliancePage.id,
|
||||
"CompliancePageAccessList_accesses",
|
||||
{ orderBy: { field: "CREATED_AT", direction: "DESC" } },
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h3 className="text-base font-medium">{__("External Access")}</h3>
|
||||
<p className="text-sm text-txt-tertiary">
|
||||
{__(
|
||||
"Manage who can access your trust center with time-limited tokens",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
{organization.compliancePage?.id
|
||||
&& organization.compliancePage.canCreateAccess && (
|
||||
<Button
|
||||
icon={IconPlusLarge}
|
||||
onClick={() => {
|
||||
dialogRef.current?.open();
|
||||
}}
|
||||
>
|
||||
{__("Add Access")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{organization.compliancePage
|
||||
? (
|
||||
<CompliancePageAccessList
|
||||
editingAccessId={editingAccessId}
|
||||
fragmentRef={organization.compliancePage}
|
||||
/>
|
||||
)
|
||||
: (
|
||||
<Table>
|
||||
<Tbody>
|
||||
<Tr>
|
||||
<Td className="text-center text-txt-tertiary py-8">
|
||||
<Spinner />
|
||||
</Td>
|
||||
</Tr>
|
||||
</Tbody>
|
||||
</Table>
|
||||
)}
|
||||
|
||||
<NewCompliancePageAccessDialog
|
||||
connectionId={connectionId}
|
||||
compliancePageId={organization.compliancePage.id}
|
||||
onCreate={setEditingAccessId}
|
||||
ref={dialogRef}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { useEffect } from "react";
|
||||
import { useQueryLoader } from "react-relay";
|
||||
|
||||
import type { CompliancePageAccessPageQuery } from "#/__generated__/core/CompliancePageAccessPageQuery.graphql";
|
||||
import { LinkCardSkeleton } from "#/components/skeletons/LinkCardSkeleton";
|
||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||
import { CoreRelayProvider } from "#/providers/CoreRelayProvider";
|
||||
|
||||
import { CompliancePageAccessPage, compliancePageAccessPageQuery } from "./CompliancePageAccessPage";
|
||||
|
||||
function CompliancePageAccessPageQueryLoader() {
|
||||
const organizationId = useOrganizationId();
|
||||
const [queryRef, loadQuery] = useQueryLoader<CompliancePageAccessPageQuery>(compliancePageAccessPageQuery);
|
||||
|
||||
useEffect(() => {
|
||||
if (!queryRef) {
|
||||
loadQuery({ organizationId });
|
||||
}
|
||||
});
|
||||
|
||||
if (!queryRef) return <LinkCardSkeleton />;
|
||||
|
||||
return <CompliancePageAccessPage queryRef={queryRef} />;
|
||||
}
|
||||
|
||||
export default function CompliancePageAccessPageLoader() {
|
||||
return (
|
||||
<CoreRelayProvider>
|
||||
<CompliancePageAccessPageQueryLoader />
|
||||
</CoreRelayProvider>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Button, IconChevronDown, Spinner, Table, Tbody, Td, Th, Thead, Tr } from "@probo/ui";
|
||||
import { usePaginationFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { CompliancePageAccessListFragment$key } from "#/__generated__/core/CompliancePageAccessListFragment.graphql";
|
||||
import type { CompliancePageAccessListQuery } from "#/__generated__/core/CompliancePageAccessListQuery.graphql";
|
||||
|
||||
import { CompliancePageAccessListItem } from "./CompliancePageAccessListItem";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageAccessListFragment on TrustCenter
|
||||
@argumentDefinitions(
|
||||
first: { type: Int, defaultValue: 10 }
|
||||
after: { type: CursorKey, defaultValue: null }
|
||||
order: { type: TrustCenterAccessOrder, defaultValue: { field: CREATED_AT, direction: DESC } }
|
||||
)
|
||||
@refetchable(queryName: "CompliancePageAccessListQuery") {
|
||||
accesses(
|
||||
first: $first
|
||||
after: $after
|
||||
orderBy: $order
|
||||
) @connection(key: "CompliancePageAccessList_accesses" filters: ["orderBy"]) {
|
||||
__id
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
hasPreviousPage
|
||||
startCursor
|
||||
endCursor
|
||||
}
|
||||
edges {
|
||||
cursor
|
||||
node {
|
||||
id
|
||||
...CompliancePageAccessListItemFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function CompliancePageAccessList(props: {
|
||||
fragmentRef: CompliancePageAccessListFragment$key;
|
||||
editingAccessId: string | null;
|
||||
}) {
|
||||
const { editingAccessId, fragmentRef } = props;
|
||||
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const {
|
||||
data: { accesses },
|
||||
hasNext,
|
||||
loadNext,
|
||||
isLoadingNext,
|
||||
} = usePaginationFragment<CompliancePageAccessListQuery, CompliancePageAccessListFragment$key>(
|
||||
fragment,
|
||||
fragmentRef,
|
||||
);
|
||||
|
||||
console.log(accesses.__id);
|
||||
|
||||
return accesses.edges.length === 0
|
||||
? (
|
||||
<Table>
|
||||
<Tbody>
|
||||
<Tr>
|
||||
<Td className="text-center text-txt-tertiary py-8">
|
||||
{__("No external access granted yet")}
|
||||
</Td>
|
||||
</Tr>
|
||||
</Tbody>
|
||||
</Table>
|
||||
)
|
||||
: (
|
||||
<>
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{__("Name")}</Th>
|
||||
<Th>{__("Email")}</Th>
|
||||
<Th>{__("Date")}</Th>
|
||||
<Th className="text-center">{__("Active")}</Th>
|
||||
<Th className="text-center">{__("Access")}</Th>
|
||||
<Th className="text-center">{__("Requests")}</Th>
|
||||
<Th className="text-center">{__("NDA")}</Th>
|
||||
<Th></Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{accesses.edges.map(({ node: access }) => (
|
||||
<CompliancePageAccessListItem
|
||||
key={`${access.id}-${editingAccessId === access.id}`}
|
||||
fragmentRef={access}
|
||||
connectionId={accesses.__id}
|
||||
dialogOpen={editingAccessId === access.id}
|
||||
/>
|
||||
))}
|
||||
</Tbody>
|
||||
</Table>
|
||||
{hasNext && (
|
||||
<Button
|
||||
variant="tertiary"
|
||||
onClick={() => loadNext(10)}
|
||||
disabled={isLoadingNext}
|
||||
className="mt-3 mx-auto"
|
||||
icon={IconChevronDown}
|
||||
>
|
||||
{isLoadingNext && <Spinner />}
|
||||
{__("Show More")}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,37 +1,55 @@
|
||||
import { formatDate } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import {
|
||||
Button,
|
||||
IconCheckmark1,
|
||||
IconCrossLargeX,
|
||||
IconPencil,
|
||||
IconTrashCan,
|
||||
Td,
|
||||
Tr,
|
||||
} from "@probo/ui";
|
||||
import { Button, IconCheckmark1, IconCrossLargeX, IconPencil, IconTrashCan, Td, Tr } from "@probo/ui";
|
||||
import { useCallback, useState } from "react";
|
||||
import { useFragment } from "react-relay";
|
||||
import { type DataID, graphql } from "relay-runtime";
|
||||
|
||||
import type { TrustCenterAccessGraph_accesses$data } from "#/__generated__/core/TrustCenterAccessGraph_accesses.graphql";
|
||||
import { deleteTrustCenterAccessMutation } from "#/hooks/graph/TrustCenterAccessGraph";
|
||||
import type { CompliancePageAccessListItem_deleteMutation } from "#/__generated__/core/CompliancePageAccessListItem_deleteMutation.graphql";
|
||||
import type { CompliancePageAccessListItemFragment$key } from "#/__generated__/core/CompliancePageAccessListItemFragment.graphql";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
import type { NodeOf } from "#/types";
|
||||
import { TrustCenterAccessEditDialog } from "#/pages/organizations/trustCenter/TrustCenterAccessTab/TrustCenterAccessEditDialog";
|
||||
|
||||
import { TrustCenterAccessEditDialog } from "./TrustCenterAccessEditDialog";
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageAccessListItemFragment on TrustCenterAccess {
|
||||
id
|
||||
name
|
||||
email
|
||||
createdAt
|
||||
active
|
||||
activeCount
|
||||
pendingRequestCount
|
||||
hasAcceptedNonDisclosureAgreement
|
||||
canUpdate: permission(action: "core:trust-center-access:update")
|
||||
canDelete: permission(action: "core:trust-center-access:delete")
|
||||
}
|
||||
`;
|
||||
|
||||
interface TrustCenterAccessItemProps {
|
||||
access: NodeOf<TrustCenterAccessGraph_accesses$data["accesses"]>;
|
||||
connectionId?: string;
|
||||
const deleteCompliancePageAccessMutation = graphql`
|
||||
mutation CompliancePageAccessListItem_deleteMutation(
|
||||
$input: DeleteTrustCenterAccessInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteTrustCenterAccess(input: $input) {
|
||||
deletedTrustCenterAccessId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function CompliancePageAccessListItem(props: {
|
||||
connectionId: DataID;
|
||||
fragmentRef: CompliancePageAccessListItemFragment$key;
|
||||
dialogOpen: boolean;
|
||||
}
|
||||
|
||||
export function TrustCenterAccessItem(props: TrustCenterAccessItemProps) {
|
||||
const { access, connectionId, dialogOpen: initialDialogOpen } = props;
|
||||
}) {
|
||||
const { connectionId, fragmentRef, dialogOpen: initialDialogOpen } = props;
|
||||
|
||||
const { __ } = useTranslate();
|
||||
const [dialogOpen, setDialogOpen] = useState<boolean>(initialDialogOpen);
|
||||
|
||||
const [deleteInvitation, isDeleting] = useMutationWithToasts(
|
||||
deleteTrustCenterAccessMutation,
|
||||
const access = useFragment<CompliancePageAccessListItemFragment$key>(fragment, fragmentRef);
|
||||
|
||||
const [deleteInvitation, isDeleting] = useMutationWithToasts<CompliancePageAccessListItem_deleteMutation>(
|
||||
deleteCompliancePageAccessMutation,
|
||||
{
|
||||
successMessage: __("Access deleted successfully"),
|
||||
errorMessage: __("Failed to delete access"),
|
||||
@@ -43,7 +61,7 @@ export function TrustCenterAccessItem(props: TrustCenterAccessItemProps) {
|
||||
await deleteInvitation({
|
||||
variables: {
|
||||
input: { id },
|
||||
connections: connectionId ? [connectionId] : [],
|
||||
connections: [connectionId],
|
||||
},
|
||||
});
|
||||
},
|
||||
@@ -0,0 +1,128 @@
|
||||
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 { NewCompliancePageAccessDialogMutation } from "#/__generated__/core/NewCompliancePageAccessDialogMutation.graphql";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
|
||||
const createCompliancePageAccessMutation = graphql`
|
||||
mutation NewCompliancePageAccessDialogMutation(
|
||||
$input: CreateTrustCenterAccessInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createTrustCenterAccess(input: $input) {
|
||||
trustCenterAccessEdge @prependEdge(connections: $connections) {
|
||||
cursor
|
||||
node {
|
||||
id
|
||||
...CompliancePageAccessListItemFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function NewCompliancePageAccessDialog(props: {
|
||||
connectionId: DataID;
|
||||
compliancePageId: string;
|
||||
ref: DialogRef;
|
||||
onCreate: (accessId: string) => void;
|
||||
}) {
|
||||
const { connectionId, compliancePageId, ref, onCreate } = props;
|
||||
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const inviteSchema = z.object({
|
||||
name: z
|
||||
.string()
|
||||
.min(1, __("Name is required"))
|
||||
.min(2, __("Name must be at least 2 characters long")),
|
||||
email: z
|
||||
.string()
|
||||
.min(1, __("Email is required"))
|
||||
.email(__("Please enter a valid email address")),
|
||||
});
|
||||
const inviteForm = useFormWithSchema(inviteSchema, {
|
||||
defaultValues: { name: "", email: "" },
|
||||
});
|
||||
|
||||
const [createInvitation, isCreating] = useMutationWithToasts<NewCompliancePageAccessDialogMutation>(
|
||||
createCompliancePageAccessMutation,
|
||||
{
|
||||
successMessage: __("Access created successfully"),
|
||||
errorMessage: __("Failed to create access"),
|
||||
},
|
||||
);
|
||||
const handleInvite = async (data: z.infer<typeof inviteSchema>) => {
|
||||
const email = data.email.trim();
|
||||
|
||||
await createInvitation({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: compliancePageId,
|
||||
email: email,
|
||||
name: data.name.trim(),
|
||||
active: false,
|
||||
},
|
||||
connections: connectionId ? [connectionId] : [],
|
||||
},
|
||||
onCompleted: (response, errors) => {
|
||||
if (errors?.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newAccess = response.createTrustCenterAccess.trustCenterAccessEdge.node;
|
||||
onCreate(newAccess.id);
|
||||
setTimeout(() => {
|
||||
inviteForm.reset();
|
||||
ref.current?.close();
|
||||
}, 50);
|
||||
setTimeout(() => {
|
||||
inviteForm.reset();
|
||||
}, 300);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog ref={ref} title={__("Invite External Access")}>
|
||||
<form onSubmit={e => void inviteForm.handleSubmit(handleInvite)(e)}>
|
||||
<DialogContent padded className="space-y-6">
|
||||
<div>
|
||||
<p className="text-txt-secondary text-sm mb-4">
|
||||
{__("Give a person access to your trust center")}
|
||||
</p>
|
||||
|
||||
<Field
|
||||
label={__("Full Name")}
|
||||
required
|
||||
error={inviteForm.formState.errors.name?.message}
|
||||
{...inviteForm.register("name")}
|
||||
placeholder={__("John Doe")}
|
||||
/>
|
||||
|
||||
<div className="mt-4">
|
||||
<Field
|
||||
label={__("Email Address")}
|
||||
required
|
||||
error={inviteForm.formState.errors.email?.message}
|
||||
type="email"
|
||||
{...inviteForm.register("email")}
|
||||
placeholder={__("john@example.com")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="submit" disabled={isCreating}>
|
||||
{isCreating && <Spinner />}
|
||||
{__("Create Access")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -39,6 +39,11 @@ export const compliancePageRoutes = [
|
||||
Fallback: LinkCardSkeleton,
|
||||
Component: lazy(() => import("#/pages/organizations/compliance-page/vendors/CompliancePageVendorsPageLoader")),
|
||||
},
|
||||
{
|
||||
path: "access",
|
||||
Fallback: LinkCardSkeleton,
|
||||
Component: lazy(() => import("#/pages/organizations/compliance-page/access/CompliancePageAccessPageLoader")),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
} from "react-relay";
|
||||
import { z } from "zod";
|
||||
|
||||
import type { TrustCenterAccessGraph_accesses$data } from "#/__generated__/core/TrustCenterAccessGraph_accesses.graphql";
|
||||
import type { CompliancePageAccessListItemFragment$data } from "#/__generated__/core/CompliancePageAccessListItemFragment.graphql";
|
||||
import type { TrustCenterAccessGraphLoadDocumentAccessesQuery } from "#/__generated__/core/TrustCenterAccessGraphLoadDocumentAccessesQuery.graphql";
|
||||
import {
|
||||
loadTrustCenterAccessDocumentAccessesQuery,
|
||||
@@ -29,12 +29,11 @@ import {
|
||||
} from "#/hooks/graph/TrustCenterAccessGraph";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
import type { NodeOf } from "#/types";
|
||||
|
||||
import { TrustCenterDocumentAccessList } from "./TrustCenterDocumentAccessList";
|
||||
|
||||
interface TrustCenterAccessEditDialogProps {
|
||||
access: NodeOf<TrustCenterAccessGraph_accesses$data["accesses"]>;
|
||||
access: CompliancePageAccessListItemFragment$data;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
@@ -77,7 +76,7 @@ export function TrustCenterAccessEditDialog(
|
||||
}
|
||||
|
||||
interface TrustCenterAccessEditFormProps {
|
||||
access: NodeOf<TrustCenterAccessGraph_accesses$data["accesses"]>;
|
||||
access: CompliancePageAccessListItemFragment$data;
|
||||
onSubmit: () => void;
|
||||
queryRef: PreloadedQuery<TrustCenterAccessGraphLoadDocumentAccessesQuery>;
|
||||
}
|
||||
|
||||
@@ -1,243 +0,0 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
Field,
|
||||
IconChevronDown,
|
||||
IconPlusLarge,
|
||||
Spinner,
|
||||
Table,
|
||||
Tbody,
|
||||
Td,
|
||||
Th,
|
||||
Thead,
|
||||
Tr,
|
||||
useDialogRef,
|
||||
} from "@probo/ui";
|
||||
import { useMemo, useState } from "react";
|
||||
import { useOutletContext } from "react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import type { TrustCenterAccessGraph_accesses$data } from "#/__generated__/core/TrustCenterAccessGraph_accesses.graphql";
|
||||
import type { TrustCenterAccessGraphCreateMutation } from "#/__generated__/core/TrustCenterAccessGraphCreateMutation.graphql";
|
||||
import type { TrustCenterGraphQuery$data } from "#/__generated__/core/TrustCenterGraphQuery.graphql";
|
||||
import {
|
||||
createTrustCenterAccessMutation,
|
||||
useTrustCenterAccesses,
|
||||
} from "#/hooks/graph/TrustCenterAccessGraph";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
import type { NodeOf } from "#/types";
|
||||
|
||||
import { TrustCenterAccessItem } from "./TrustCenterAccessItem";
|
||||
|
||||
export default function TrustCenterAccessTab() {
|
||||
const { __ } = useTranslate();
|
||||
const { organization } = useOutletContext<TrustCenterGraphQuery$data>();
|
||||
const inviteSchema = z.object({
|
||||
name: z
|
||||
.string()
|
||||
.min(1, __("Name is required"))
|
||||
.min(2, __("Name must be at least 2 characters long")),
|
||||
email: z
|
||||
.string()
|
||||
.min(1, __("Email is required"))
|
||||
.email(__("Please enter a valid email address")),
|
||||
});
|
||||
|
||||
const [createInvitation, isCreating] = useMutationWithToasts<TrustCenterAccessGraphCreateMutation>(
|
||||
createTrustCenterAccessMutation,
|
||||
{
|
||||
successMessage: __("Access created successfully"),
|
||||
errorMessage: __("Failed to create access"),
|
||||
},
|
||||
);
|
||||
|
||||
const dialogRef = useDialogRef();
|
||||
const [editingAccess, setEditingAccess] = useState<NodeOf<
|
||||
TrustCenterAccessGraph_accesses$data["accesses"]
|
||||
> | null>(null);
|
||||
|
||||
const inviteForm = useFormWithSchema(inviteSchema, {
|
||||
defaultValues: { name: "", email: "" },
|
||||
});
|
||||
|
||||
const {
|
||||
data: trustCenterData,
|
||||
loadMore,
|
||||
hasNext,
|
||||
isLoadingNext,
|
||||
} = useTrustCenterAccesses(organization.trustCenter?.id || "");
|
||||
|
||||
const accesses = useMemo(
|
||||
() => trustCenterData?.accesses?.edges.map(edge => edge.node) ?? [],
|
||||
[trustCenterData?.accesses?.edges],
|
||||
);
|
||||
|
||||
const handleInvite = async (data: z.infer<typeof inviteSchema>) => {
|
||||
if (!organization.trustCenter?.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
const connectionId = trustCenterData?.accesses?.__id;
|
||||
const email = data.email.trim();
|
||||
|
||||
await createInvitation({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: organization.trustCenter.id,
|
||||
email: email,
|
||||
name: data.name.trim(),
|
||||
active: false,
|
||||
},
|
||||
connections: connectionId ? [connectionId] : [],
|
||||
},
|
||||
onCompleted: (response, errors) => {
|
||||
if (errors?.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newAccess = response.createTrustCenterAccess.trustCenterAccessEdge.node;
|
||||
setEditingAccess(newAccess);
|
||||
setTimeout(() => {
|
||||
dialogRef.current?.close();
|
||||
}, 50);
|
||||
setTimeout(() => {
|
||||
inviteForm.reset();
|
||||
}, 300);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h3 className="text-base font-medium">{__("External Access")}</h3>
|
||||
<p className="text-sm text-txt-tertiary">
|
||||
{__(
|
||||
"Manage who can access your trust center with time-limited tokens",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
{organization.trustCenter?.id
|
||||
&& organization.trustCenter.canCreateAccess && (
|
||||
<Button
|
||||
icon={IconPlusLarge}
|
||||
onClick={() => {
|
||||
inviteForm.reset();
|
||||
dialogRef.current?.open();
|
||||
}}
|
||||
>
|
||||
{__("Add Access")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{!organization.trustCenter?.id
|
||||
? (
|
||||
<Table>
|
||||
<Tbody>
|
||||
<Tr>
|
||||
<Td className="text-center text-txt-tertiary py-8">
|
||||
<Spinner />
|
||||
</Td>
|
||||
</Tr>
|
||||
</Tbody>
|
||||
</Table>
|
||||
)
|
||||
: accesses.length === 0
|
||||
? (
|
||||
<Table>
|
||||
<Tbody>
|
||||
<Tr>
|
||||
<Td className="text-center text-txt-tertiary py-8">
|
||||
{__("No external access granted yet")}
|
||||
</Td>
|
||||
</Tr>
|
||||
</Tbody>
|
||||
</Table>
|
||||
)
|
||||
: (
|
||||
<>
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{__("Name")}</Th>
|
||||
<Th>{__("Email")}</Th>
|
||||
<Th>{__("Date")}</Th>
|
||||
<Th className="text-center">{__("Active")}</Th>
|
||||
<Th className="text-center">{__("Access")}</Th>
|
||||
<Th className="text-center">{__("Requests")}</Th>
|
||||
<Th className="text-center">{__("NDA")}</Th>
|
||||
<Th></Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{accesses.map(access => (
|
||||
<TrustCenterAccessItem
|
||||
key={`${access.id}-${editingAccess?.id === access.id}`}
|
||||
access={access}
|
||||
connectionId={trustCenterData?.accesses?.__id}
|
||||
dialogOpen={editingAccess?.id === access.id}
|
||||
/>
|
||||
))}
|
||||
</Tbody>
|
||||
</Table>
|
||||
{hasNext && (
|
||||
<Button
|
||||
variant="tertiary"
|
||||
onClick={loadMore}
|
||||
disabled={isLoadingNext}
|
||||
className="mt-3 mx-auto"
|
||||
icon={IconChevronDown}
|
||||
>
|
||||
{isLoadingNext && <Spinner />}
|
||||
{__("Show More")}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<Dialog ref={dialogRef} title={__("Invite External Access")}>
|
||||
<form onSubmit={e => void inviteForm.handleSubmit(handleInvite)(e)}>
|
||||
<DialogContent padded className="space-y-6">
|
||||
<div>
|
||||
<p className="text-txt-secondary text-sm mb-4">
|
||||
{__("Give a person access to your trust center")}
|
||||
</p>
|
||||
|
||||
<Field
|
||||
label={__("Full Name")}
|
||||
required
|
||||
error={inviteForm.formState.errors.name?.message}
|
||||
{...inviteForm.register("name")}
|
||||
placeholder={__("John Doe")}
|
||||
/>
|
||||
|
||||
<div className="mt-4">
|
||||
<Field
|
||||
label={__("Email Address")}
|
||||
required
|
||||
error={inviteForm.formState.errors.email?.message}
|
||||
type="email"
|
||||
{...inviteForm.register("email")}
|
||||
placeholder={__("john@example.com")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="submit" disabled={isCreating}>
|
||||
{isCreating && <Spinner />}
|
||||
{__("Create Access")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
import { loadQuery } from "react-relay";
|
||||
|
||||
import type { TrustCenterGraphQuery } from "#/__generated__/core/TrustCenterGraphQuery.graphql";
|
||||
import { LinkCardSkeleton } from "#/components/skeletons/LinkCardSkeleton";
|
||||
import { PageSkeleton } from "#/components/skeletons/PageSkeleton";
|
||||
import { coreEnvironment } from "#/environments";
|
||||
|
||||
@@ -28,15 +27,5 @@ export const trustCenterRoutes = [
|
||||
Component: withQueryRef(
|
||||
lazy(() => import("#/pages/organizations/trustCenter/TrustCenterPage")),
|
||||
),
|
||||
children: [
|
||||
{
|
||||
path: "access",
|
||||
Fallback: LinkCardSkeleton,
|
||||
Component: lazy(
|
||||
() =>
|
||||
import("#/pages/organizations/trustCenter/TrustCenterAccessTab/TrustCenterAccessTab"),
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
|
||||
Reference in New Issue
Block a user