Fix trust center references tab permissions handling
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<e67073eb7045d7e1b44337df273de6e0>>
|
* @generated SignedSource<<18ee21b1b07c34808fb34640fd0eee77>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -51,6 +51,7 @@ export type TrustCenterGraphQuery$data = {
|
|||||||
};
|
};
|
||||||
readonly trustCenter?: {
|
readonly trustCenter?: {
|
||||||
readonly active: boolean;
|
readonly active: boolean;
|
||||||
|
readonly canCreateReference: boolean;
|
||||||
readonly canDeleteNDA: boolean;
|
readonly canDeleteNDA: boolean;
|
||||||
readonly canGetNDA: boolean;
|
readonly canGetNDA: boolean;
|
||||||
readonly canUpdate: boolean;
|
readonly canUpdate: boolean;
|
||||||
@@ -59,19 +60,6 @@ export type TrustCenterGraphQuery$data = {
|
|||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly ndaFileName: string | null | undefined;
|
readonly ndaFileName: string | null | undefined;
|
||||||
readonly ndaFileUrl: string | null | undefined;
|
readonly ndaFileUrl: string | null | undefined;
|
||||||
readonly references: {
|
|
||||||
readonly edges: ReadonlyArray<{
|
|
||||||
readonly node: {
|
|
||||||
readonly createdAt: any;
|
|
||||||
readonly description: string | null | undefined;
|
|
||||||
readonly id: string;
|
|
||||||
readonly logoUrl: string;
|
|
||||||
readonly name: string;
|
|
||||||
readonly updatedAt: any;
|
|
||||||
readonly websiteUrl: string;
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
readonly updatedAt: any;
|
readonly updatedAt: any;
|
||||||
} | null | undefined;
|
} | null | undefined;
|
||||||
readonly trustCenterFiles?: {
|
readonly trustCenterFiles?: {
|
||||||
@@ -174,18 +162,6 @@ v7 = {
|
|||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v8 = {
|
v8 = {
|
||||||
"kind": "Literal",
|
|
||||||
"name": "first",
|
|
||||||
"value": 100
|
|
||||||
},
|
|
||||||
v9 = {
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "description",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
v10 = {
|
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "TrustCenter",
|
"concreteType": "TrustCenter",
|
||||||
@@ -270,88 +246,43 @@ v10 = {
|
|||||||
"storageKey": "permission(action:\"core:trust-center:delete-nda\")"
|
"storageKey": "permission(action:\"core:trust-center:delete-nda\")"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": "canCreateReference",
|
||||||
"args": [
|
"args": [
|
||||||
(v8/*: any*/),
|
|
||||||
{
|
{
|
||||||
"kind": "Literal",
|
"kind": "Literal",
|
||||||
"name": "orderBy",
|
"name": "action",
|
||||||
"value": {
|
"value": "core:trust-center-reference:create"
|
||||||
"direction": "DESC",
|
|
||||||
"field": "CREATED_AT"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "TrustCenterReferenceConnection",
|
|
||||||
"kind": "LinkedField",
|
|
||||||
"name": "references",
|
|
||||||
"plural": false,
|
|
||||||
"selections": [
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"concreteType": "TrustCenterReferenceEdge",
|
|
||||||
"kind": "LinkedField",
|
|
||||||
"name": "edges",
|
|
||||||
"plural": true,
|
|
||||||
"selections": [
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"concreteType": "TrustCenterReference",
|
|
||||||
"kind": "LinkedField",
|
|
||||||
"name": "node",
|
|
||||||
"plural": false,
|
|
||||||
"selections": [
|
|
||||||
(v2/*: any*/),
|
|
||||||
(v3/*: any*/),
|
|
||||||
(v9/*: any*/),
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "websiteUrl",
|
"name": "permission",
|
||||||
|
"storageKey": "permission(action:\"core:trust-center-reference:create\")"
|
||||||
|
}
|
||||||
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
v9 = [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"kind": "Literal",
|
||||||
"args": null,
|
"name": "first",
|
||||||
"kind": "ScalarField",
|
"value": 100
|
||||||
"name": "logoUrl",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
(v6/*: any*/),
|
|
||||||
(v7/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": null
|
v10 = {
|
||||||
}
|
|
||||||
],
|
|
||||||
"storageKey": "references(first:100,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
v11 = [
|
|
||||||
(v8/*: any*/)
|
|
||||||
],
|
|
||||||
v12 = {
|
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "__typename",
|
"name": "__typename",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v13 = {
|
v11 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "cursor",
|
"name": "cursor",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v14 = {
|
v12 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "PageInfo",
|
"concreteType": "PageInfo",
|
||||||
@@ -376,7 +307,7 @@ v14 = {
|
|||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v15 = {
|
v13 = {
|
||||||
"kind": "ClientExtension",
|
"kind": "ClientExtension",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -388,9 +319,9 @@ v15 = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
v16 = {
|
v14 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"concreteType": "SlackConnectionConnection",
|
"concreteType": "SlackConnectionConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "slackConnections",
|
"name": "slackConnections",
|
||||||
@@ -438,14 +369,14 @@ v16 = {
|
|||||||
],
|
],
|
||||||
"storageKey": "slackConnections(first:100)"
|
"storageKey": "slackConnections(first:100)"
|
||||||
},
|
},
|
||||||
v17 = {
|
v15 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "trustCenterVisibility",
|
"name": "trustCenterVisibility",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v18 = {
|
v16 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
@@ -474,10 +405,10 @@ return {
|
|||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
(v4/*: any*/),
|
(v4/*: any*/),
|
||||||
(v5/*: any*/),
|
(v5/*: any*/),
|
||||||
(v10/*: any*/),
|
(v8/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"concreteType": "DocumentConnection",
|
"concreteType": "DocumentConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "documents",
|
"name": "documents",
|
||||||
@@ -516,7 +447,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"concreteType": "AuditConnection",
|
"concreteType": "AuditConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "audits",
|
"name": "audits",
|
||||||
@@ -555,7 +486,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"concreteType": "VendorConnection",
|
"concreteType": "VendorConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "vendors",
|
"name": "vendors",
|
||||||
@@ -622,20 +553,20 @@ return {
|
|||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "TrustCenterFilesCardFragment"
|
"name": "TrustCenterFilesCardFragment"
|
||||||
},
|
},
|
||||||
(v12/*: any*/)
|
(v10/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v11/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v12/*: any*/),
|
||||||
(v13/*: any*/)
|
(v13/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v14/*: any*/),
|
(v14/*: any*/)
|
||||||
(v15/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
(v16/*: any*/)
|
|
||||||
],
|
],
|
||||||
"type": "Organization",
|
"type": "Organization",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -661,7 +592,7 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v12/*: any*/),
|
(v10/*: any*/),
|
||||||
(v2/*: any*/),
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
@@ -669,10 +600,10 @@ return {
|
|||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
(v4/*: any*/),
|
(v4/*: any*/),
|
||||||
(v5/*: any*/),
|
(v5/*: any*/),
|
||||||
(v10/*: any*/),
|
(v8/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"concreteType": "DocumentConnection",
|
"concreteType": "DocumentConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "documents",
|
"name": "documents",
|
||||||
@@ -710,7 +641,7 @@ return {
|
|||||||
"name": "documentType",
|
"name": "documentType",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v17/*: any*/),
|
(v15/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": [
|
"args": [
|
||||||
@@ -769,7 +700,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"concreteType": "AuditConnection",
|
"concreteType": "AuditConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "audits",
|
"name": "audits",
|
||||||
@@ -827,7 +758,7 @@ return {
|
|||||||
"name": "state",
|
"name": "state",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v17/*: any*/),
|
(v15/*: any*/),
|
||||||
(v6/*: any*/)
|
(v6/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -840,7 +771,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"concreteType": "VendorConnection",
|
"concreteType": "VendorConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "vendors",
|
"name": "vendors",
|
||||||
@@ -864,8 +795,14 @@ return {
|
|||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/),
|
(v2/*: any*/),
|
||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
(v18/*: any*/),
|
(v16/*: any*/),
|
||||||
(v9/*: any*/),
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "description",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -885,7 +822,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"concreteType": "TrustCenterFileConnection",
|
"concreteType": "TrustCenterFileConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "trustCenterFiles",
|
"name": "trustCenterFiles",
|
||||||
@@ -909,7 +846,7 @@ return {
|
|||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/),
|
(v2/*: any*/),
|
||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
(v18/*: any*/),
|
(v16/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -917,7 +854,7 @@ return {
|
|||||||
"name": "fileUrl",
|
"name": "fileUrl",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v17/*: any*/),
|
(v15/*: any*/),
|
||||||
(v6/*: any*/),
|
(v6/*: any*/),
|
||||||
(v7/*: any*/),
|
(v7/*: any*/),
|
||||||
{
|
{
|
||||||
@@ -946,29 +883,29 @@ return {
|
|||||||
"name": "permission",
|
"name": "permission",
|
||||||
"storageKey": "permission(action:\"core:trust-center-file:delete\")"
|
"storageKey": "permission(action:\"core:trust-center-file:delete\")"
|
||||||
},
|
},
|
||||||
(v12/*: any*/)
|
(v10/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v11/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v12/*: any*/),
|
||||||
(v13/*: any*/)
|
(v13/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
(v14/*: any*/),
|
|
||||||
(v15/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": "trustCenterFiles(first:100)"
|
"storageKey": "trustCenterFiles(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v11/*: any*/),
|
"args": (v9/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "TrustCenterPage_trustCenterFiles",
|
"key": "TrustCenterPage_trustCenterFiles",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "trustCenterFiles"
|
"name": "trustCenterFiles"
|
||||||
},
|
},
|
||||||
(v16/*: any*/)
|
(v14/*: any*/)
|
||||||
],
|
],
|
||||||
"type": "Organization",
|
"type": "Organization",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -979,7 +916,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "0fbd1275d4051e236a6f9711cf21c23b",
|
"cacheID": "6af8bc39a3654fa715f0f235bcb5f488",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -996,11 +933,11 @@ return {
|
|||||||
},
|
},
|
||||||
"name": "TrustCenterGraphQuery",
|
"name": "TrustCenterGraphQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query TrustCenterGraphQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n name\n canCreateTrustCenterFile: permission(action: \"core:trust-center-file:create\")\n customDomain {\n id\n domain\n }\n trustCenter {\n id\n active\n ndaFileName\n ndaFileUrl\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:trust-center:update\")\n canGetNDA: permission(action: \"core:trust-center:get-nda\")\n canUploadNDA: permission(action: \"core:trust-center:upload-nda\")\n canDeleteNDA: permission(action: \"core:trust-center:delete-nda\")\n references(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n createdAt\n updatedAt\n }\n }\n }\n }\n documents(first: 100) {\n edges {\n node {\n id\n ...TrustCenterDocumentsCardFragment\n }\n }\n }\n audits(first: 100) {\n edges {\n node {\n id\n ...TrustCenterAuditsCardFragment\n }\n }\n }\n vendors(first: 100) {\n edges {\n node {\n id\n ...TrustCenterVendorsCardFragment\n }\n }\n }\n trustCenterFiles(first: 100) {\n edges {\n node {\n id\n ...TrustCenterFilesCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n slackConnections(first: 100) {\n edges {\n node {\n id\n channel\n channelId\n createdAt\n updatedAt\n }\n }\n }\n }\n id\n }\n}\n\nfragment TrustCenterAuditsCardFragment on Audit {\n id\n name\n framework {\n name\n id\n }\n validFrom\n validUntil\n state\n trustCenterVisibility\n createdAt\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n trustCenterVisibility\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment TrustCenterFilesCardFragment on TrustCenterFile {\n id\n name\n category\n fileUrl\n trustCenterVisibility\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:trust-center-file:update\")\n canDelete: permission(action: \"core:trust-center-file:delete\")\n}\n\nfragment TrustCenterVendorsCardFragment on Vendor {\n id\n name\n category\n description\n showOnTrustCenter\n createdAt\n}\n"
|
"text": "query TrustCenterGraphQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n name\n canCreateTrustCenterFile: permission(action: \"core:trust-center-file:create\")\n customDomain {\n id\n domain\n }\n trustCenter {\n id\n active\n ndaFileName\n ndaFileUrl\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:trust-center:update\")\n canGetNDA: permission(action: \"core:trust-center:get-nda\")\n canUploadNDA: permission(action: \"core:trust-center:upload-nda\")\n canDeleteNDA: permission(action: \"core:trust-center:delete-nda\")\n canCreateReference: permission(action: \"core:trust-center-reference:create\")\n }\n documents(first: 100) {\n edges {\n node {\n id\n ...TrustCenterDocumentsCardFragment\n }\n }\n }\n audits(first: 100) {\n edges {\n node {\n id\n ...TrustCenterAuditsCardFragment\n }\n }\n }\n vendors(first: 100) {\n edges {\n node {\n id\n ...TrustCenterVendorsCardFragment\n }\n }\n }\n trustCenterFiles(first: 100) {\n edges {\n node {\n id\n ...TrustCenterFilesCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n slackConnections(first: 100) {\n edges {\n node {\n id\n channel\n channelId\n createdAt\n updatedAt\n }\n }\n }\n }\n id\n }\n}\n\nfragment TrustCenterAuditsCardFragment on Audit {\n id\n name\n framework {\n name\n id\n }\n validFrom\n validUntil\n state\n trustCenterVisibility\n createdAt\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n trustCenterVisibility\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment TrustCenterFilesCardFragment on TrustCenterFile {\n id\n name\n category\n fileUrl\n trustCenterVisibility\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:trust-center-file:update\")\n canDelete: permission(action: \"core:trust-center-file:delete\")\n}\n\nfragment TrustCenterVendorsCardFragment on Vendor {\n id\n name\n category\n description\n showOnTrustCenter\n createdAt\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "2c169dd5176d4dedd98ff82210335a86";
|
(node as any).hash = "9669200b7f9e58c412b73b30fa506f51";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<566b652d24d80b551827cb5d3bf5518c>>
|
* @generated SignedSource<<461baa03d93bbfde6ad39536a695caa7>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -25,6 +25,8 @@ export type TrustCenterReferenceGraphCreateMutation$data = {
|
|||||||
readonly trustCenterReferenceEdge: {
|
readonly trustCenterReferenceEdge: {
|
||||||
readonly cursor: any;
|
readonly cursor: any;
|
||||||
readonly node: {
|
readonly node: {
|
||||||
|
readonly canDelete: boolean;
|
||||||
|
readonly canUpdate: boolean;
|
||||||
readonly createdAt: any;
|
readonly createdAt: any;
|
||||||
readonly description: string | null | undefined;
|
readonly description: string | null | undefined;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -138,6 +140,32 @@ v3 = {
|
|||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": "canUpdate",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "Literal",
|
||||||
|
"name": "action",
|
||||||
|
"value": "core:trust-center-reference:update"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "permission",
|
||||||
|
"storageKey": "permission(action:\"core:trust-center-reference:update\")"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": "canDelete",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "Literal",
|
||||||
|
"name": "action",
|
||||||
|
"value": "core:trust-center-reference:delete"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "permission",
|
||||||
|
"storageKey": "permission(action:\"core:trust-center-reference:delete\")"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -211,16 +239,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "623c9df0fba82887a878addd1ddaf706",
|
"cacheID": "4cffbce769a3af5a0b95188c5fdb1ab1",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "TrustCenterReferenceGraphCreateMutation",
|
"name": "TrustCenterReferenceGraphCreateMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation TrustCenterReferenceGraphCreateMutation(\n $input: CreateTrustCenterReferenceInput!\n) {\n createTrustCenterReference(input: $input) {\n trustCenterReferenceEdge {\n cursor\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n rank\n createdAt\n updatedAt\n }\n }\n }\n}\n"
|
"text": "mutation TrustCenterReferenceGraphCreateMutation(\n $input: CreateTrustCenterReferenceInput!\n) {\n createTrustCenterReference(input: $input) {\n trustCenterReferenceEdge {\n cursor\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n rank\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:trust-center-reference:update\")\n canDelete: permission(action: \"core:trust-center-reference:delete\")\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "ee754e6c9bc3aa992e1a40e828b0d07e";
|
(node as any).hash = "2235fdf1f63c55b4a6670eaa0f32fe20";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<e7776b4ead5bff52ce340c208ec5bbc6>>
|
* @generated SignedSource<<08cc43ef600ae775505f8446d31ae058>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -14,12 +14,15 @@ export type TrustCenterReferenceGraphQuery$variables = {
|
|||||||
};
|
};
|
||||||
export type TrustCenterReferenceGraphQuery$data = {
|
export type TrustCenterReferenceGraphQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly id?: string;
|
readonly __typename: "TrustCenter";
|
||||||
readonly references?: {
|
readonly id: string;
|
||||||
|
readonly references: {
|
||||||
readonly __id: string;
|
readonly __id: string;
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly cursor: any;
|
readonly cursor: any;
|
||||||
readonly node: {
|
readonly node: {
|
||||||
|
readonly canDelete: boolean;
|
||||||
|
readonly canUpdate: boolean;
|
||||||
readonly createdAt: any;
|
readonly createdAt: any;
|
||||||
readonly description: string | null | undefined;
|
readonly description: string | null | undefined;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -37,6 +40,10 @@ export type TrustCenterReferenceGraphQuery$data = {
|
|||||||
readonly startCursor: any | null | undefined;
|
readonly startCursor: any | null | undefined;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
} | {
|
||||||
|
// This will never be '%other', but we need some
|
||||||
|
// value in case none of the concrete values match.
|
||||||
|
readonly __typename: "%other";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type TrustCenterReferenceGraphQuery = {
|
export type TrustCenterReferenceGraphQuery = {
|
||||||
@@ -63,10 +70,17 @@ v2 = {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "id",
|
"name": "__typename",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v3 = {
|
v3 = {
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "id",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
v4 = {
|
||||||
"kind": "Literal",
|
"kind": "Literal",
|
||||||
"name": "orderBy",
|
"name": "orderBy",
|
||||||
"value": {
|
"value": {
|
||||||
@@ -74,15 +88,7 @@ v3 = {
|
|||||||
"field": "RANK"
|
"field": "RANK"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
v4 = {
|
v5 = {
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "__typename",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
v5 = [
|
|
||||||
{
|
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "PageInfo",
|
"concreteType": "PageInfo",
|
||||||
@@ -121,7 +127,7 @@ v5 = [
|
|||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
v6 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "TrustCenterReferenceEdge",
|
"concreteType": "TrustCenterReferenceEdge",
|
||||||
@@ -144,7 +150,7 @@ v5 = [
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/),
|
(v3/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -194,14 +200,40 @@ v5 = [
|
|||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v4/*: any*/)
|
{
|
||||||
|
"alias": "canUpdate",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "Literal",
|
||||||
|
"name": "action",
|
||||||
|
"value": "core:trust-center-reference:update"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "permission",
|
||||||
|
"storageKey": "permission(action:\"core:trust-center-reference:update\")"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": "canDelete",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "Literal",
|
||||||
|
"name": "action",
|
||||||
|
"value": "core:trust-center-reference:delete"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "permission",
|
||||||
|
"storageKey": "permission(action:\"core:trust-center-reference:delete\")"
|
||||||
|
},
|
||||||
|
(v2/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
v7 = {
|
||||||
"kind": "ClientExtension",
|
"kind": "ClientExtension",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -212,15 +244,14 @@ v5 = [
|
|||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
],
|
v8 = [
|
||||||
v6 = [
|
|
||||||
{
|
{
|
||||||
"kind": "Literal",
|
"kind": "Literal",
|
||||||
"name": "first",
|
"name": "first",
|
||||||
"value": 100
|
"value": 100
|
||||||
},
|
},
|
||||||
(v3/*: any*/)
|
(v4/*: any*/)
|
||||||
];
|
];
|
||||||
return {
|
return {
|
||||||
"fragment": {
|
"fragment": {
|
||||||
@@ -237,21 +268,34 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/),
|
(v3/*: any*/),
|
||||||
{
|
{
|
||||||
|
"kind": "RequiredField",
|
||||||
|
"field": {
|
||||||
"alias": "references",
|
"alias": "references",
|
||||||
"args": [
|
"args": [
|
||||||
(v3/*: any*/)
|
(v4/*: any*/)
|
||||||
],
|
],
|
||||||
"concreteType": "TrustCenterReferenceConnection",
|
"concreteType": "TrustCenterReferenceConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__TrustCenterReferencesSection_references_connection",
|
"name": "__TrustCenterReferencesSection_references_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v5/*: any*/),
|
"selections": [
|
||||||
|
(v5/*: any*/),
|
||||||
|
{
|
||||||
|
"kind": "RequiredField",
|
||||||
|
"field": (v6/*: any*/),
|
||||||
|
"action": "THROW"
|
||||||
|
},
|
||||||
|
(v7/*: any*/)
|
||||||
|
],
|
||||||
"storageKey": "__TrustCenterReferencesSection_references_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"RANK\"})"
|
"storageKey": "__TrustCenterReferencesSection_references_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"RANK\"})"
|
||||||
|
},
|
||||||
|
"action": "THROW"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "TrustCenter",
|
"type": "TrustCenter",
|
||||||
@@ -278,24 +322,28 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v4/*: any*/),
|
|
||||||
(v2/*: any*/),
|
(v2/*: any*/),
|
||||||
|
(v3/*: any*/),
|
||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v6/*: any*/),
|
"args": (v8/*: any*/),
|
||||||
"concreteType": "TrustCenterReferenceConnection",
|
"concreteType": "TrustCenterReferenceConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "references",
|
"name": "references",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v5/*: any*/),
|
"selections": [
|
||||||
|
(v5/*: any*/),
|
||||||
|
(v6/*: any*/),
|
||||||
|
(v7/*: any*/)
|
||||||
|
],
|
||||||
"storageKey": "references(first:100,orderBy:{\"direction\":\"ASC\",\"field\":\"RANK\"})"
|
"storageKey": "references(first:100,orderBy:{\"direction\":\"ASC\",\"field\":\"RANK\"})"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v6/*: any*/),
|
"args": (v8/*: any*/),
|
||||||
"filters": [
|
"filters": [
|
||||||
"orderBy"
|
"orderBy"
|
||||||
],
|
],
|
||||||
@@ -314,7 +362,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "8fdd97abcaa0d9eb889eb454c85f2e4c",
|
"cacheID": "3eaf772859927eca50f824a7298fd2d5",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -331,11 +379,11 @@ return {
|
|||||||
},
|
},
|
||||||
"name": "TrustCenterReferenceGraphQuery",
|
"name": "TrustCenterReferenceGraphQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query TrustCenterReferenceGraphQuery(\n $trustCenterId: ID!\n) {\n node(id: $trustCenterId) {\n __typename\n ... on TrustCenter {\n id\n references(first: 100, orderBy: {field: RANK, direction: ASC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n rank\n createdAt\n updatedAt\n __typename\n }\n }\n }\n }\n id\n }\n}\n"
|
"text": "query TrustCenterReferenceGraphQuery(\n $trustCenterId: ID!\n) {\n node(id: $trustCenterId) {\n __typename\n ... on TrustCenter {\n id\n references(first: 100, orderBy: {field: RANK, direction: ASC}) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n rank\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:trust-center-reference:update\")\n canDelete: permission(action: \"core:trust-center-reference:delete\")\n __typename\n }\n }\n }\n }\n id\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "cb4b9b8a68249ae8066a3ff2bfc6acd8";
|
(node as any).hash = "5c1e65a30423ec4357ef2cb546bca387";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<2b51f7fdbc055d912be03031b258c042>>
|
* @generated SignedSource<<20900a908dde87c301e15c5af24f849d>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -23,6 +23,8 @@ export type TrustCenterReferenceGraphUpdateMutation$variables = {
|
|||||||
export type TrustCenterReferenceGraphUpdateMutation$data = {
|
export type TrustCenterReferenceGraphUpdateMutation$data = {
|
||||||
readonly updateTrustCenterReference: {
|
readonly updateTrustCenterReference: {
|
||||||
readonly trustCenterReference: {
|
readonly trustCenterReference: {
|
||||||
|
readonly canDelete: boolean;
|
||||||
|
readonly canUpdate: boolean;
|
||||||
readonly createdAt: any;
|
readonly createdAt: any;
|
||||||
readonly description: string | null | undefined;
|
readonly description: string | null | undefined;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -125,6 +127,32 @@ v1 = [
|
|||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": "canUpdate",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "Literal",
|
||||||
|
"name": "action",
|
||||||
|
"value": "core:trust-center-reference:update"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "permission",
|
||||||
|
"storageKey": "permission(action:\"core:trust-center-reference:update\")"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": "canDelete",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "Literal",
|
||||||
|
"name": "action",
|
||||||
|
"value": "core:trust-center-reference:delete"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "permission",
|
||||||
|
"storageKey": "permission(action:\"core:trust-center-reference:delete\")"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -151,16 +179,16 @@ return {
|
|||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "f55510d6d1e0a686d4733f5bd82a605a",
|
"cacheID": "7c0e441a6e51c68b72f3dc0b74079da1",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "TrustCenterReferenceGraphUpdateMutation",
|
"name": "TrustCenterReferenceGraphUpdateMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation TrustCenterReferenceGraphUpdateMutation(\n $input: UpdateTrustCenterReferenceInput!\n) {\n updateTrustCenterReference(input: $input) {\n trustCenterReference {\n id\n name\n description\n websiteUrl\n logoUrl\n rank\n createdAt\n updatedAt\n }\n }\n}\n"
|
"text": "mutation TrustCenterReferenceGraphUpdateMutation(\n $input: UpdateTrustCenterReferenceInput!\n) {\n updateTrustCenterReference(input: $input) {\n trustCenterReference {\n id\n name\n description\n websiteUrl\n logoUrl\n rank\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:trust-center-reference:update\")\n canDelete: permission(action: \"core:trust-center-reference:delete\")\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "bed2a3190570cd85d85dd38f20f375da";
|
(node as any).hash = "f6add85271c2b048654bf586745252fc";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -29,13 +29,7 @@ type ReferenceFormData = z.infer<typeof referenceSchema>;
|
|||||||
|
|
||||||
export type TrustCenterReferenceDialogRef = {
|
export type TrustCenterReferenceDialogRef = {
|
||||||
openCreate: (trustCenterId: string, connectionId: string) => void;
|
openCreate: (trustCenterId: string, connectionId: string) => void;
|
||||||
openEdit: (reference: {
|
openEdit: (reference: Reference) => void;
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
description?: string | null;
|
|
||||||
websiteUrl: string;
|
|
||||||
rank: number;
|
|
||||||
}) => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type Reference = {
|
type Reference = {
|
||||||
|
|||||||
@@ -14,43 +14,54 @@ import {
|
|||||||
IconPencil,
|
IconPencil,
|
||||||
IconArrowLink,
|
IconArrowLink,
|
||||||
} from "@probo/ui";
|
} from "@probo/ui";
|
||||||
import { type ReactNode, useRef, useState, use } from "react";
|
import { useRef, useState } from "react";
|
||||||
import {
|
import {
|
||||||
useTrustCenterReferences,
|
trustCenterReferencesQuery,
|
||||||
useUpdateTrustCenterReferenceRankMutation,
|
useUpdateTrustCenterReferenceRankMutation,
|
||||||
} from "/hooks/graph/TrustCenterReferenceGraph";
|
} from "/hooks/graph/TrustCenterReferenceGraph";
|
||||||
import { TrustCenterReferenceDialog, type TrustCenterReferenceDialogRef } from "./TrustCenterReferenceDialog";
|
import {
|
||||||
|
TrustCenterReferenceDialog,
|
||||||
|
type TrustCenterReferenceDialogRef,
|
||||||
|
} from "./TrustCenterReferenceDialog";
|
||||||
import { DeleteTrustCenterReferenceDialog } from "./DeleteTrustCenterReferenceDialog";
|
import { DeleteTrustCenterReferenceDialog } from "./DeleteTrustCenterReferenceDialog";
|
||||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
import type {
|
||||||
|
TrustCenterReferenceGraphQuery,
|
||||||
|
TrustCenterReferenceGraphQuery$data,
|
||||||
|
} from "/__generated__/core/TrustCenterReferenceGraphQuery.graphql";
|
||||||
|
import { useLazyLoadQuery } from "react-relay";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
trustCenterId: string;
|
trustCenterId: string;
|
||||||
children?: ReactNode;
|
canCreateReference: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Reference = {
|
export type Reference = Extract<
|
||||||
id: string;
|
TrustCenterReferenceGraphQuery$data["node"],
|
||||||
name: string;
|
{ __typename: "TrustCenter" }
|
||||||
description?: string | null;
|
>["references"]["edges"][number]["node"];
|
||||||
websiteUrl: string;
|
|
||||||
logoUrl: string;
|
|
||||||
rank: number;
|
|
||||||
createdAt: string;
|
|
||||||
updatedAt: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function TrustCenterReferencesSection({ trustCenterId }: Props) {
|
export function TrustCenterReferencesSection({
|
||||||
|
canCreateReference,
|
||||||
|
trustCenterId,
|
||||||
|
}: Props) {
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const { isAuthorized } = use(PermissionsContext);
|
|
||||||
const dialogRef = useRef<TrustCenterReferenceDialogRef>(null);
|
const dialogRef = useRef<TrustCenterReferenceDialogRef>(null);
|
||||||
const [draggedIndex, setDraggedIndex] = useState<number | null>(null);
|
const [draggedIndex, setDraggedIndex] = useState<number | null>(null);
|
||||||
const [dragOverIndex, setDragOverIndex] = useState<number | null>(null);
|
const [dragOverIndex, setDragOverIndex] = useState<number | null>(null);
|
||||||
const [refetchKey, setRefetchKey] = useState(0);
|
const [refetchKey, setRefetchKey] = useState(0);
|
||||||
const data = useTrustCenterReferences(trustCenterId, refetchKey);
|
const { node: trustCenterNode } =
|
||||||
|
useLazyLoadQuery<TrustCenterReferenceGraphQuery>(
|
||||||
|
trustCenterReferencesQuery,
|
||||||
|
{ trustCenterId: trustCenterId || "" },
|
||||||
|
{ fetchPolicy: "network-only", fetchKey: refetchKey },
|
||||||
|
);
|
||||||
|
if (trustCenterNode.__typename !== "TrustCenter") {
|
||||||
|
throw new Error("invalid node type");
|
||||||
|
}
|
||||||
const [updateRank] = useUpdateTrustCenterReferenceRankMutation();
|
const [updateRank] = useUpdateTrustCenterReferenceRankMutation();
|
||||||
|
|
||||||
const trustCenterNode = data?.node;
|
const references =
|
||||||
const references = trustCenterNode?.references?.edges?.map((edge) => edge.node) || [];
|
trustCenterNode?.references?.edges?.map((edge) => edge.node) || [];
|
||||||
const referencesConnectionId = trustCenterNode?.references?.__id || "";
|
const referencesConnectionId = trustCenterNode?.references?.__id || "";
|
||||||
|
|
||||||
const handleCreate = () => {
|
const handleCreate = () => {
|
||||||
@@ -113,11 +124,8 @@ export function TrustCenterReferencesSection({ trustCenterId }: Props) {
|
|||||||
{__("Showcase your customers and partners on your trust center")}
|
{__("Showcase your customers and partners on your trust center")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{isAuthorized("TrustCenter", "createTrustCenterReference") && (
|
{canCreateReference && (
|
||||||
<Button
|
<Button icon={IconPlusLarge} onClick={handleCreate}>
|
||||||
icon={IconPlusLarge}
|
|
||||||
onClick={handleCreate}
|
|
||||||
>
|
|
||||||
{__("Add Reference")}
|
{__("Add Reference")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
@@ -191,14 +199,15 @@ function ReferenceRow({
|
|||||||
onDrop,
|
onDrop,
|
||||||
}: ReferenceRowProps) {
|
}: ReferenceRowProps) {
|
||||||
const [isMouseDown, setIsMouseDown] = useState(false);
|
const [isMouseDown, setIsMouseDown] = useState(false);
|
||||||
const { isAuthorized } = use(PermissionsContext);
|
|
||||||
|
|
||||||
const className = [
|
const className = [
|
||||||
isDragging && "opacity-50 cursor-grabbing",
|
isDragging && "opacity-50 cursor-grabbing",
|
||||||
!isDragging && !isMouseDown && "cursor-grab",
|
!isDragging && !isMouseDown && "cursor-grab",
|
||||||
!isDragging && isMouseDown && "cursor-grabbing",
|
!isDragging && isMouseDown && "cursor-grabbing",
|
||||||
isDropTarget && "!bg-primary-50 border-y-2 border-primary-500",
|
isDropTarget && "!bg-primary-50 border-y-2 border-primary-500",
|
||||||
].filter(Boolean).join(" ");
|
]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(" ");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tr
|
<Tr
|
||||||
@@ -213,11 +222,7 @@ function ReferenceRow({
|
|||||||
>
|
>
|
||||||
<Td>
|
<Td>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<Avatar
|
<Avatar src={reference.logoUrl} name={reference.name} size="m" />
|
||||||
src={reference.logoUrl}
|
|
||||||
name={reference.name}
|
|
||||||
size="m"
|
|
||||||
/>
|
|
||||||
<span className="font-medium">{reference.name}</span>
|
<span className="font-medium">{reference.name}</span>
|
||||||
</div>
|
</div>
|
||||||
</Td>
|
</Td>
|
||||||
@@ -233,23 +238,16 @@ function ReferenceRow({
|
|||||||
icon={IconArrowLink}
|
icon={IconArrowLink}
|
||||||
onClick={onVisitWebsite}
|
onClick={onVisitWebsite}
|
||||||
/>
|
/>
|
||||||
{isAuthorized("TrustCenterReference", "updateTrustCenterReference") && (
|
{reference.canUpdate && (
|
||||||
<Button
|
<Button variant="secondary" icon={IconPencil} onClick={onEdit} />
|
||||||
variant="secondary"
|
|
||||||
icon={IconPencil}
|
|
||||||
onClick={onEdit}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
{isAuthorized("TrustCenterReference", "deleteTrustCenterReference") && (
|
{reference.canDelete && (
|
||||||
<DeleteTrustCenterReferenceDialog
|
<DeleteTrustCenterReferenceDialog
|
||||||
referenceId={reference.id}
|
referenceId={reference.id}
|
||||||
referenceName={reference.name}
|
referenceName={reference.name}
|
||||||
connectionId={connectionId}
|
connectionId={connectionId}
|
||||||
>
|
>
|
||||||
<Button
|
<Button variant="danger" icon={IconTrashCan} />
|
||||||
variant="danger"
|
|
||||||
icon={IconTrashCan}
|
|
||||||
/>
|
|
||||||
</DeleteTrustCenterReferenceDialog>
|
</DeleteTrustCenterReferenceDialog>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,22 +26,9 @@ export const trustCenterQuery = graphql`
|
|||||||
canGetNDA: permission(action: "core:trust-center:get-nda")
|
canGetNDA: permission(action: "core:trust-center:get-nda")
|
||||||
canUploadNDA: permission(action: "core:trust-center:upload-nda")
|
canUploadNDA: permission(action: "core:trust-center:upload-nda")
|
||||||
canDeleteNDA: permission(action: "core:trust-center:delete-nda")
|
canDeleteNDA: permission(action: "core:trust-center:delete-nda")
|
||||||
references(
|
canCreateReference: permission(
|
||||||
first: 100
|
action: "core:trust-center-reference:create"
|
||||||
orderBy: { field: CREATED_AT, direction: DESC }
|
)
|
||||||
) {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
description
|
|
||||||
websiteUrl
|
|
||||||
logoUrl
|
|
||||||
createdAt
|
|
||||||
updatedAt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
documents(first: 100) {
|
documents(first: 100) {
|
||||||
edges {
|
edges {
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
import { graphql } from "react-relay";
|
import { graphql } from "react-relay";
|
||||||
import { useLazyLoadQuery } from "react-relay";
|
|
||||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||||
import type {
|
|
||||||
TrustCenterReferenceGraphQuery,
|
|
||||||
TrustCenterReferenceGraphQuery$data,
|
|
||||||
} from "/__generated__/core/TrustCenterReferenceGraphQuery.graphql";
|
|
||||||
import type { TrustCenterReferenceGraphCreateMutation } from "/__generated__/core/TrustCenterReferenceGraphCreateMutation.graphql";
|
import type { TrustCenterReferenceGraphCreateMutation } from "/__generated__/core/TrustCenterReferenceGraphCreateMutation.graphql";
|
||||||
import type { TrustCenterReferenceGraphUpdateMutation } from "/__generated__/core/TrustCenterReferenceGraphUpdateMutation.graphql";
|
import type { TrustCenterReferenceGraphUpdateMutation } from "/__generated__/core/TrustCenterReferenceGraphUpdateMutation.graphql";
|
||||||
import type { TrustCenterReferenceGraphUpdateRankMutation } from "/__generated__/core/TrustCenterReferenceGraphUpdateRankMutation.graphql";
|
import type { TrustCenterReferenceGraphUpdateRankMutation } from "/__generated__/core/TrustCenterReferenceGraphUpdateRankMutation.graphql";
|
||||||
@@ -13,10 +8,12 @@ import type { TrustCenterReferenceGraphDeleteMutation } from "/__generated__/cor
|
|||||||
export const trustCenterReferencesQuery = graphql`
|
export const trustCenterReferencesQuery = graphql`
|
||||||
query TrustCenterReferenceGraphQuery($trustCenterId: ID!) {
|
query TrustCenterReferenceGraphQuery($trustCenterId: ID!) {
|
||||||
node(id: $trustCenterId) {
|
node(id: $trustCenterId) {
|
||||||
|
__typename
|
||||||
... on TrustCenter {
|
... on TrustCenter {
|
||||||
id
|
id
|
||||||
references(first: 100, orderBy: { field: RANK, direction: ASC })
|
references(first: 100, orderBy: { field: RANK, direction: ASC })
|
||||||
@connection(key: "TrustCenterReferencesSection_references") {
|
@connection(key: "TrustCenterReferencesSection_references")
|
||||||
|
@required(action: THROW) {
|
||||||
__id
|
__id
|
||||||
pageInfo {
|
pageInfo {
|
||||||
hasNextPage
|
hasNextPage
|
||||||
@@ -24,7 +21,7 @@ export const trustCenterReferencesQuery = graphql`
|
|||||||
startCursor
|
startCursor
|
||||||
endCursor
|
endCursor
|
||||||
}
|
}
|
||||||
edges {
|
edges @required(action: THROW) {
|
||||||
cursor
|
cursor
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -35,6 +32,12 @@ export const trustCenterReferencesQuery = graphql`
|
|||||||
rank
|
rank
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
|
canUpdate: permission(
|
||||||
|
action: "core:trust-center-reference:update"
|
||||||
|
)
|
||||||
|
canDelete: permission(
|
||||||
|
action: "core:trust-center-reference:delete"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,6 +63,8 @@ export const createTrustCenterReferenceMutation = graphql`
|
|||||||
rank
|
rank
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
|
canUpdate: permission(action: "core:trust-center-reference:update")
|
||||||
|
canDelete: permission(action: "core:trust-center-reference:delete")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,6 +85,8 @@ export const updateTrustCenterReferenceMutation = graphql`
|
|||||||
rank
|
rank
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
|
canUpdate: permission(action: "core:trust-center-reference:update")
|
||||||
|
canDelete: permission(action: "core:trust-center-reference:delete")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,19 +103,6 @@ export const deleteTrustCenterReferenceMutation = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export function useTrustCenterReferences(
|
|
||||||
trustCenterId: string,
|
|
||||||
refetchKey = 0,
|
|
||||||
): TrustCenterReferenceGraphQuery$data | null {
|
|
||||||
const data = useLazyLoadQuery<TrustCenterReferenceGraphQuery>(
|
|
||||||
trustCenterReferencesQuery,
|
|
||||||
{ trustCenterId: trustCenterId || "" },
|
|
||||||
{ fetchPolicy: "network-only", fetchKey: refetchKey },
|
|
||||||
);
|
|
||||||
|
|
||||||
return trustCenterId ? data : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useCreateTrustCenterReferenceMutation() {
|
export function useCreateTrustCenterReferenceMutation() {
|
||||||
return useMutationWithToasts<TrustCenterReferenceGraphCreateMutation>(
|
return useMutationWithToasts<TrustCenterReferenceGraphCreateMutation>(
|
||||||
createTrustCenterReferenceMutation,
|
createTrustCenterReferenceMutation,
|
||||||
|
|||||||
@@ -1,21 +1,17 @@
|
|||||||
import { useOutletContext } from "react-router";
|
import { useOutletContext } from "react-router";
|
||||||
import { TrustCenterReferencesSection } from "/components/trustCenter/TrustCenterReferencesSection";
|
import { TrustCenterReferencesSection } from "/components/trustCenter/TrustCenterReferencesSection";
|
||||||
|
import type { TrustCenterGraphQuery$data } from "/__generated__/core/TrustCenterGraphQuery.graphql";
|
||||||
type ContextType = {
|
|
||||||
organization: {
|
|
||||||
trustCenter?: {
|
|
||||||
id: string;
|
|
||||||
} | null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function TrustCenterReferencesTab() {
|
export default function TrustCenterReferencesTab() {
|
||||||
const { organization } = useOutletContext<ContextType>();
|
const { organization } = useOutletContext<TrustCenterGraphQuery$data>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{organization.trustCenter?.id && (
|
{organization.trustCenter?.id && (
|
||||||
<TrustCenterReferencesSection trustCenterId={organization.trustCenter.id} />
|
<TrustCenterReferencesSection
|
||||||
|
trustCenterId={organization.trustCenter.id}
|
||||||
|
canCreateReference={!!organization.trustCenter.canCreateReference}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -32,18 +32,18 @@ const (
|
|||||||
ActionTrustCenterGetNda = "core:trust-center:get-nda"
|
ActionTrustCenterGetNda = "core:trust-center:get-nda"
|
||||||
ActionTrustCenterNonDisclosureAgreementUpload = "core:trust-center:upload-nda"
|
ActionTrustCenterNonDisclosureAgreementUpload = "core:trust-center:upload-nda"
|
||||||
ActionTrustCenterNonDisclosureAgreementDelete = "core:trust-center:delete-nda"
|
ActionTrustCenterNonDisclosureAgreementDelete = "core:trust-center:delete-nda"
|
||||||
ActionTrustCenterAccessCreate = "core:trust-center:create-access"
|
|
||||||
ActionTrustCenterReferenceCreate = "core:trust-center:create-reference"
|
|
||||||
|
|
||||||
// TrustCenterAccess actions
|
// TrustCenterAccess actions
|
||||||
ActionTrustCenterAccessGet = "core:trust-center-access:get"
|
ActionTrustCenterAccessGet = "core:trust-center-access:get"
|
||||||
ActionTrustCenterAccessList = "core:trust-center-access:list"
|
ActionTrustCenterAccessList = "core:trust-center-access:list"
|
||||||
|
ActionTrustCenterAccessCreate = "core:trust-center-access:create"
|
||||||
ActionTrustCenterAccessUpdate = "core:trust-center-access:update"
|
ActionTrustCenterAccessUpdate = "core:trust-center-access:update"
|
||||||
ActionTrustCenterAccessDelete = "core:trust-center-access:delete"
|
ActionTrustCenterAccessDelete = "core:trust-center-access:delete"
|
||||||
|
|
||||||
// TrustCenterReference actions
|
// TrustCenterReference actions
|
||||||
ActionTrustCenterReferenceList = "core:trust-center-reference:list"
|
ActionTrustCenterReferenceList = "core:trust-center-reference:list"
|
||||||
ActionTrustCenterReferenceGetLogoUrl = "core:trust-center-reference:get-logo-url"
|
ActionTrustCenterReferenceGetLogoUrl = "core:trust-center-reference:get-logo-url"
|
||||||
|
ActionTrustCenterReferenceCreate = "core:trust-center-reference:create"
|
||||||
ActionTrustCenterReferenceUpdate = "core:trust-center-reference:update"
|
ActionTrustCenterReferenceUpdate = "core:trust-center-reference:update"
|
||||||
ActionTrustCenterReferenceDelete = "core:trust-center-reference:delete"
|
ActionTrustCenterReferenceDelete = "core:trust-center-reference:delete"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user