Fix vendor pages permissions handling
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<5c8614e9d015da9e6d79c806b556de1d>>
|
||||
* @generated SignedSource<<8f9e37a76c35d572a81006be1c54b685>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -212,6 +212,19 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v12/*: any*/),
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-compliance-report:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-compliance-report:delete\")"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -355,16 +368,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "594e7edf24b110430566c9a21d1b5d29",
|
||||
"cacheID": "0301f89298e5a1d39beac8f822095c6d",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ComplianceReportListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ComplianceReportListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorComplianceReportOrder = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorComplianceTabFragment_16fISc\n id\n }\n}\n\nfragment VendorComplianceTabFragment_16fISc on Vendor {\n complianceReports(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n file {\n fileName\n mimeType\n size\n id\n }\n}\n"
|
||||
"text": "query ComplianceReportListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorComplianceReportOrder = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorComplianceTabFragment_16fISc\n id\n }\n}\n\nfragment VendorComplianceTabFragment_16fISc on Vendor {\n complianceReports(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n canDelete: permission(action: \"core:vendor-compliance-report:delete\")\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n file {\n fileName\n mimeType\n size\n id\n }\n canDelete: permission(action: \"core:vendor-compliance-report:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "1fe4e0b1f9fb781c3b01e539145d610a";
|
||||
(node as any).hash = "078c14e9b989c435abf83ec5b4396f6c";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<843a80b3503ff276081e69b558dcce81>>
|
||||
* @generated SignedSource<<ab083cd47dc11eb4e2960a244cd4a9b4>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -25,6 +25,8 @@ export type CreateContactDialogMutation$data = {
|
||||
readonly createVendorContact: {
|
||||
readonly vendorContactEdge: {
|
||||
readonly node: {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"VendorContactsTabFragment_contact">;
|
||||
};
|
||||
};
|
||||
@@ -52,7 +54,33 @@ v2 = [
|
||||
"name": "input",
|
||||
"variableName": "input"
|
||||
}
|
||||
];
|
||||
],
|
||||
v3 = {
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:update\")"
|
||||
},
|
||||
v4 = {
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:delete\")"
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [
|
||||
@@ -87,6 +115,8 @@ return {
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
@@ -138,6 +168,8 @@ return {
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
(v4/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -215,16 +247,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "dac4774aa797162239a60596464811d8",
|
||||
"cacheID": "ec71338bbc4d5591606e752bdcc0eeaf",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "CreateContactDialogMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation CreateContactDialogMutation(\n $input: CreateVendorContactInput!\n) {\n createVendorContact(input: $input) {\n vendorContactEdge {\n node {\n ...VendorContactsTabFragment_contact\n id\n }\n }\n }\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n"
|
||||
"text": "mutation CreateContactDialogMutation(\n $input: CreateVendorContactInput!\n) {\n createVendorContact(input: $input) {\n vendorContactEdge {\n node {\n canUpdate: permission(action: \"core:vendor-contact:update\")\n canDelete: permission(action: \"core:vendor-contact:delete\")\n ...VendorContactsTabFragment_contact\n id\n }\n }\n }\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor-contact:update\")\n canDelete: permission(action: \"core:vendor-contact:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "f44f76bce42470683c55db50426d3f7b";
|
||||
(node as any).hash = "5e50a35ba78497790a49461f684d0541";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<57cf7bb390b9d8d00ce0368cf782205c>>
|
||||
* @generated SignedSource<<aacbb3c4646610f327cc7cea8f944158>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -172,6 +172,32 @@ return {
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -201,12 +227,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "c4c687377eb1a18eb15abbfa1bf86bfa",
|
||||
"cacheID": "05250ac44a987544335a9e97eed9d66b",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "CreateServiceDialogMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation CreateServiceDialogMutation(\n $input: CreateVendorServiceInput!\n) {\n createVendorService(input: $input) {\n vendorServiceEdge {\n node {\n ...VendorServicesTabFragment_service\n id\n }\n }\n }\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n}\n"
|
||||
"text": "mutation CreateServiceDialogMutation(\n $input: CreateVendorServiceInput!\n) {\n createVendorService(input: $input) {\n vendorServiceEdge {\n node {\n ...VendorServicesTabFragment_service\n id\n }\n }\n }\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor-service:update\")\n canDelete: permission(action: \"core:vendor-service:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<d22f20fafedcdddc50cd21917a8a5c28>>
|
||||
* @generated SignedSource<<460e6a454050ccc3c06a50b1c3cd95d4>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -155,6 +155,32 @@ return {
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -165,12 +191,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "bacc163156572b5da49705a27084f5c9",
|
||||
"cacheID": "c07a9743c2296880b73a838d774b4bbd",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "EditContactDialogUpdateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation EditContactDialogUpdateMutation(\n $input: UpdateVendorContactInput!\n) {\n updateVendorContact(input: $input) {\n vendorContact {\n ...VendorContactsTabFragment_contact\n id\n }\n }\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n"
|
||||
"text": "mutation EditContactDialogUpdateMutation(\n $input: UpdateVendorContactInput!\n) {\n updateVendorContact(input: $input) {\n vendorContact {\n ...VendorContactsTabFragment_contact\n id\n }\n }\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor-contact:update\")\n canDelete: permission(action: \"core:vendor-contact:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<97f0c6ed319e3fba440079ef085a55eb>>
|
||||
* @generated SignedSource<<e83a53e6de1bb7926c99b70425582ede>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -141,6 +141,32 @@ return {
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -151,12 +177,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "f2c37fa9a0b7f0ed043a4529d1f50c65",
|
||||
"cacheID": "5944b8aa370dff2ef78b2690dd4b3f35",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "EditServiceDialogUpdateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation EditServiceDialogUpdateMutation(\n $input: UpdateVendorServiceInput!\n) {\n updateVendorService(input: $input) {\n vendorService {\n ...VendorServicesTabFragment_service\n id\n }\n }\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n}\n"
|
||||
"text": "mutation EditServiceDialogUpdateMutation(\n $input: UpdateVendorServiceInput!\n) {\n updateVendorService(input: $input) {\n vendorService {\n ...VendorServicesTabFragment_service\n id\n }\n }\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor-service:update\")\n canDelete: permission(action: \"core:vendor-service:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<f851ea2f7b0fa09f081a26967bb7766e>>
|
||||
* @generated SignedSource<<da4cb1788d09bf3876d561062ad92880>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -347,6 +347,19 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-compliance-report:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-compliance-report:delete\")"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -542,12 +555,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "d0d8cc2e128b7a7b31f5e9c86e427a7f",
|
||||
"cacheID": "b5d6ce081b43c94793be27d4fc87e39d",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ImportAssessmentDialogMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ImportAssessmentDialogMutation(\n $input: AssessVendorInput!\n) {\n assessVendor(input: $input) {\n vendor {\n id\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorRiskAssessmentTabFragment\n }\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n file {\n fileName\n mimeType\n size\n id\n }\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n createdAt\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n category\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n countries\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n"
|
||||
"text": "mutation ImportAssessmentDialogMutation(\n $input: AssessVendorInput!\n) {\n assessVendor(input: $input) {\n vendor {\n id\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorRiskAssessmentTabFragment\n }\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n canDelete: permission(action: \"core:vendor-compliance-report:delete\")\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n file {\n fileName\n mimeType\n size\n id\n }\n canDelete: permission(action: \"core:vendor-compliance-report:delete\")\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n createdAt\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n category\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n countries\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<e5f0f2600db655bd96ca2c7ea52f8b44>>
|
||||
* @generated SignedSource<<08a3ccf322eccf9d7c86b2f383526687>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -15,6 +15,7 @@ export type VendorComplianceTabFragment$data = {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly canDelete: boolean;
|
||||
readonly id: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"VendorComplianceTabFragment_report">;
|
||||
};
|
||||
@@ -134,6 +135,19 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-compliance-report:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-compliance-report:delete\")"
|
||||
},
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
@@ -220,6 +234,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "1fe4e0b1f9fb781c3b01e539145d610a";
|
||||
(node as any).hash = "078c14e9b989c435abf83ec5b4396f6c";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<dc7aecc55aa17f43d9a601e60eea165a>>
|
||||
* @generated SignedSource<<ecb2f1b1e2f7614af9a86484fa5940bf>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,6 +11,7 @@
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type VendorComplianceTabFragment_report$data = {
|
||||
readonly canDelete: boolean;
|
||||
readonly file: {
|
||||
readonly fileName: string;
|
||||
readonly mimeType: string;
|
||||
@@ -92,12 +93,25 @@ const node: ReaderFragment = {
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-compliance-report:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-compliance-report:delete\")"
|
||||
}
|
||||
],
|
||||
"type": "VendorComplianceReport",
|
||||
"abstractKey": null
|
||||
};
|
||||
|
||||
(node as any).hash = "18f52de61577c8b1c61784d2404c24ae";
|
||||
(node as any).hash = "7676d7b6379940339458e259707c222e";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<34551b84e130ebf112182e8926a526ad>>
|
||||
* @generated SignedSource<<7234ce37ee1c29a4b4546b9f9de471c8>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -201,6 +201,19 @@ return {
|
||||
(v3/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-compliance-report:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-compliance-report:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -230,12 +243,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "193fdb014a3493e0b0d56a96309afae3",
|
||||
"cacheID": "404f46e6eabb0fbe406f06ca861414fe",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "VendorComplianceTabUploadReportMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation VendorComplianceTabUploadReportMutation(\n $input: UploadVendorComplianceReportInput!\n) {\n uploadVendorComplianceReport(input: $input) {\n vendorComplianceReportEdge {\n node {\n id\n ...VendorComplianceTabFragment_report\n }\n }\n }\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n file {\n fileName\n mimeType\n size\n id\n }\n}\n"
|
||||
"text": "mutation VendorComplianceTabUploadReportMutation(\n $input: UploadVendorComplianceReportInput!\n) {\n uploadVendorComplianceReport(input: $input) {\n vendorComplianceReportEdge {\n node {\n id\n ...VendorComplianceTabFragment_report\n }\n }\n }\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n file {\n fileName\n mimeType\n size\n id\n }\n canDelete: permission(action: \"core:vendor-compliance-report:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<4d2c61f9790a63656dde7d5199ea6a25>>
|
||||
* @generated SignedSource<<72e8dfdd3ad86ac69f4e631191d994ad>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -212,6 +212,32 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v12/*: any*/),
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:delete\")"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -343,16 +369,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "bc07b88571f6a7fbb20595cbf442d3b8",
|
||||
"cacheID": "99175ca46dc5865d6d7a5f6c55fd8c8d",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "VendorContactsListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query VendorContactsListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorContactOrder = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorContactsTabFragment_16fISc\n id\n }\n}\n\nfragment VendorContactsTabFragment_16fISc on Vendor {\n contacts(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n ...VendorContactsTabFragment_contact\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n"
|
||||
"text": "query VendorContactsListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorContactOrder = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorContactsTabFragment_16fISc\n id\n }\n}\n\nfragment VendorContactsTabFragment_16fISc on Vendor {\n contacts(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n canUpdate: permission(action: \"core:vendor-contact:update\")\n canDelete: permission(action: \"core:vendor-contact:delete\")\n ...VendorContactsTabFragment_contact\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor-contact:update\")\n canDelete: permission(action: \"core:vendor-contact:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "aa8ba87386ba04dd624566661fe0a524";
|
||||
(node as any).hash = "b0516167cf827553fe6c6617b2025967";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<6aea0078adcf4d7180d89dbf964eaceb>>
|
||||
* @generated SignedSource<<67ebbddf5fa502880ebc8aa6b5f9810c>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -15,6 +15,8 @@ export type VendorContactsTabFragment$data = {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly id: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"VendorContactsTabFragment_contact">;
|
||||
};
|
||||
@@ -134,6 +136,32 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:delete\")"
|
||||
},
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
@@ -220,6 +248,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "aa8ba87386ba04dd624566661fe0a524";
|
||||
(node as any).hash = "b0516167cf827553fe6c6617b2025967";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<ea6290653015d098eabae99bb4ff4061>>
|
||||
* @generated SignedSource<<2e0270bf6c8a8f1849c2e05463ece19b>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,6 +11,8 @@
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type VendorContactsTabFragment_contact$data = {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly createdAt: string;
|
||||
readonly email: string | null | undefined;
|
||||
readonly fullName: string | null | undefined;
|
||||
@@ -79,12 +81,38 @@ const node: ReaderFragment = {
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:delete\")"
|
||||
}
|
||||
],
|
||||
"type": "VendorContact",
|
||||
"abstractKey": null
|
||||
};
|
||||
|
||||
(node as any).hash = "9c3e5b8b262263249160f5fd3708162a";
|
||||
(node as any).hash = "fbcc45db4e2f857e3208ed8dc35e912d";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<048cece5b3ce6165cab071d0b86de6fa>>
|
||||
* @generated SignedSource<<dc9115d5a6b814a7c3b4a95077afe694>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -41,6 +41,8 @@ export type VendorGraphCreateMutation$data = {
|
||||
readonly createVendor: {
|
||||
readonly vendorEdge: {
|
||||
readonly node: {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly createdAt: string;
|
||||
readonly description: string | null | undefined;
|
||||
readonly id: string;
|
||||
@@ -131,6 +133,32 @@ v3 = {
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -204,16 +232,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "b6e686d8c3e4add7f11f09fd0d1e1de3",
|
||||
"cacheID": "94b1c06e8575dd431ade59add9fdcb8a",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "VendorGraphCreateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation VendorGraphCreateMutation(\n $input: CreateVendorInput!\n) {\n createVendor(input: $input) {\n vendorEdge {\n node {\n id\n name\n description\n websiteUrl\n createdAt\n updatedAt\n }\n }\n }\n}\n"
|
||||
"text": "mutation VendorGraphCreateMutation(\n $input: CreateVendorInput!\n) {\n createVendor(input: $input) {\n vendorEdge {\n node {\n id\n name\n description\n websiteUrl\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor:update\")\n canDelete: permission(action: \"core:vendor:delete\")\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "ae71994587599f61caf6b79d9159ad44";
|
||||
(node as any).hash = "d4fbc819ee92c20d31400395a924eb7c";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<554f3a594f825db3f7f7da0c5c1d8b1f>>
|
||||
* @generated SignedSource<<2fb0056a5c2b8df4604284949b579bff>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -16,6 +16,7 @@ export type VendorGraphListQuery$variables = {
|
||||
};
|
||||
export type VendorGraphListQuery$data = {
|
||||
readonly node: {
|
||||
readonly canCreateVendor?: boolean;
|
||||
readonly id?: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"VendorGraphPaginatedFragment">;
|
||||
};
|
||||
@@ -52,23 +53,36 @@ v2 = {
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
v3 = [
|
||||
v3 = {
|
||||
"alias": "canCreateVendor",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:create"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:create\")"
|
||||
},
|
||||
v4 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "snapshotId",
|
||||
"variableName": "snapshotId"
|
||||
}
|
||||
],
|
||||
v4 = {
|
||||
v5 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
},
|
||||
v5 = [
|
||||
v6 = [
|
||||
{
|
||||
"fields": (v3/*: any*/),
|
||||
"fields": (v4/*: any*/),
|
||||
"kind": "ObjectValue",
|
||||
"name": "filter"
|
||||
},
|
||||
@@ -97,8 +111,9 @@ return {
|
||||
"kind": "InlineFragment",
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"args": (v3/*: any*/),
|
||||
"args": (v4/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "VendorGraphPaginatedFragment"
|
||||
}
|
||||
@@ -127,14 +142,15 @@ return {
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/),
|
||||
(v5/*: any*/),
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"args": (v6/*: any*/),
|
||||
"concreteType": "VendorConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "vendors",
|
||||
@@ -261,7 +277,33 @@ return {
|
||||
],
|
||||
"storageKey": "riskAssessments(first:1,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||
},
|
||||
(v4/*: any*/)
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:delete\")"
|
||||
},
|
||||
(v5/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
@@ -331,7 +373,7 @@ return {
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"args": (v6/*: any*/),
|
||||
"filters": [
|
||||
"filter"
|
||||
],
|
||||
@@ -350,16 +392,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "998ad60d132157090312ac11e318b2e5",
|
||||
"cacheID": "c2264340742570acaecb4b0b7b53723c",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "VendorGraphListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query VendorGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n ...VendorGraphPaginatedFragment_3iomuz\n }\n id\n }\n}\n\nfragment VendorGraphPaginatedFragment_3iomuz on Organization {\n vendors(first: 50, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n snapshotId\n name\n websiteUrl\n updatedAt\n riskAssessments(first: 1, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n createdAt\n expiresAt\n dataSensitivity\n businessImpact\n }\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
|
||||
"text": "query VendorGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n canCreateVendor: permission(action: \"core:vendor:create\")\n ...VendorGraphPaginatedFragment_3iomuz\n }\n id\n }\n}\n\nfragment VendorGraphPaginatedFragment_3iomuz on Organization {\n vendors(first: 50, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n snapshotId\n name\n websiteUrl\n updatedAt\n riskAssessments(first: 1, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n createdAt\n expiresAt\n dataSensitivity\n businessImpact\n }\n }\n }\n canUpdate: permission(action: \"core:vendor:update\")\n canDelete: permission(action: \"core:vendor:delete\")\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "3034ee812f89d0596f3f6d3094c1dfc8";
|
||||
(node as any).hash = "725a4385cbde48d0f8895d1a35ca2135";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<0e32303844bb448ea43a6f5c6e58a105>>
|
||||
* @generated SignedSource<<f72445ad5e95c960270b2234da2b1a1f>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -15,7 +15,16 @@ export type VendorGraphNodeQuery$variables = {
|
||||
};
|
||||
export type VendorGraphNodeQuery$data = {
|
||||
readonly node: {
|
||||
readonly id?: string;
|
||||
readonly canAssess?: boolean;
|
||||
readonly canCreateContact?: boolean;
|
||||
readonly canCreateRiskAssessment?: boolean;
|
||||
readonly canCreateService?: boolean;
|
||||
readonly canDelete?: boolean;
|
||||
readonly canUpdate?: boolean;
|
||||
readonly canUploadBAA?: boolean;
|
||||
readonly canUploadComplianceReport?: boolean;
|
||||
readonly canUploadDPA?: boolean;
|
||||
readonly id: string;
|
||||
readonly name?: string;
|
||||
readonly snapshotId?: string | null | undefined;
|
||||
readonly websiteUrl?: string | null | undefined;
|
||||
@@ -73,90 +82,207 @@ v5 = {
|
||||
"name": "websiteUrl",
|
||||
"storageKey": null
|
||||
},
|
||||
v6 = [
|
||||
v6 = {
|
||||
"alias": "canAssess",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:assess"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:assess\")"
|
||||
},
|
||||
v7 = {
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:update\")"
|
||||
},
|
||||
v8 = {
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:delete\")"
|
||||
},
|
||||
v9 = {
|
||||
"alias": "canUploadComplianceReport",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-compliance-report:upload"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-compliance-report:upload\")"
|
||||
},
|
||||
v10 = {
|
||||
"alias": "canCreateRiskAssessment",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-risk-assessment:create"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-risk-assessment:create\")"
|
||||
},
|
||||
v11 = {
|
||||
"alias": "canCreateContact",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:create"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:create\")"
|
||||
},
|
||||
v12 = {
|
||||
"alias": "canCreateService",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:create"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:create\")"
|
||||
},
|
||||
v13 = {
|
||||
"alias": "canUploadBAA",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-business-associate-agreement:upload"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-business-associate-agreement:upload\")"
|
||||
},
|
||||
v14 = {
|
||||
"alias": "canUploadDPA",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-data-privacy-agreement:upload"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-data-privacy-agreement:upload\")"
|
||||
},
|
||||
v15 = [
|
||||
(v2/*: any*/)
|
||||
],
|
||||
v7 = {
|
||||
v16 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Viewer",
|
||||
"kind": "LinkedField",
|
||||
"name": "viewer",
|
||||
"plural": false,
|
||||
"selections": (v6/*: any*/),
|
||||
"storageKey": null
|
||||
},
|
||||
v8 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
},
|
||||
v9 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "description",
|
||||
"storageKey": null
|
||||
},
|
||||
v10 = [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "first",
|
||||
"value": 50
|
||||
}
|
||||
],
|
||||
v11 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "validUntil",
|
||||
"storageKey": null
|
||||
},
|
||||
v12 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "fileName",
|
||||
"storageKey": null
|
||||
},
|
||||
v13 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
},
|
||||
v14 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "endCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
v15 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasNextPage",
|
||||
"storageKey": null
|
||||
},
|
||||
v16 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasPreviousPage",
|
||||
"selections": (v15/*: any*/),
|
||||
"storageKey": null
|
||||
},
|
||||
v17 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "startCursor",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
},
|
||||
v18 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "description",
|
||||
"storageKey": null
|
||||
},
|
||||
v19 = [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "first",
|
||||
"value": 50
|
||||
}
|
||||
],
|
||||
v20 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "validUntil",
|
||||
"storageKey": null
|
||||
},
|
||||
v21 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "fileName",
|
||||
"storageKey": null
|
||||
},
|
||||
v22 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
},
|
||||
v23 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "endCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
v24 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasNextPage",
|
||||
"storageKey": null
|
||||
},
|
||||
v25 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasPreviousPage",
|
||||
"storageKey": null
|
||||
},
|
||||
v26 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "startCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
v27 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "PageInfo",
|
||||
@@ -164,14 +290,14 @@ v18 = {
|
||||
"name": "pageInfo",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v14/*: any*/),
|
||||
(v15/*: any*/),
|
||||
(v16/*: any*/),
|
||||
(v17/*: any*/)
|
||||
(v23/*: any*/),
|
||||
(v24/*: any*/),
|
||||
(v25/*: any*/),
|
||||
(v26/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
v19 = {
|
||||
v28 = {
|
||||
"kind": "ClientExtension",
|
||||
"selections": [
|
||||
{
|
||||
@@ -183,43 +309,37 @@ v19 = {
|
||||
}
|
||||
]
|
||||
},
|
||||
v20 = [
|
||||
v29 = [
|
||||
"orderBy"
|
||||
],
|
||||
v21 = {
|
||||
v30 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
v22 = {
|
||||
v31 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
},
|
||||
v23 = [
|
||||
(v2/*: any*/),
|
||||
(v12/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "fileUrl",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "validFrom",
|
||||
"storageKey": null
|
||||
},
|
||||
(v11/*: any*/),
|
||||
(v21/*: any*/)
|
||||
];
|
||||
v32 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "fileUrl",
|
||||
"storageKey": null
|
||||
},
|
||||
v33 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "validFrom",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
@@ -235,13 +355,22 @@ return {
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
(v3/*: any*/),
|
||||
(v4/*: any*/),
|
||||
(v5/*: any*/),
|
||||
(v6/*: any*/),
|
||||
(v7/*: any*/),
|
||||
(v8/*: any*/),
|
||||
(v9/*: any*/),
|
||||
(v10/*: any*/),
|
||||
(v11/*: any*/),
|
||||
(v12/*: any*/),
|
||||
(v13/*: any*/),
|
||||
(v14/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
@@ -284,7 +413,7 @@ return {
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v7/*: any*/)
|
||||
(v16/*: any*/)
|
||||
],
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
@@ -303,7 +432,7 @@ return {
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v8/*: any*/),
|
||||
(v17/*: any*/),
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
@@ -311,7 +440,16 @@ return {
|
||||
(v3/*: any*/),
|
||||
(v4/*: any*/),
|
||||
(v5/*: any*/),
|
||||
(v6/*: any*/),
|
||||
(v7/*: any*/),
|
||||
(v8/*: any*/),
|
||||
(v9/*: any*/),
|
||||
(v10/*: any*/),
|
||||
(v11/*: any*/),
|
||||
(v12/*: any*/),
|
||||
(v13/*: any*/),
|
||||
(v14/*: any*/),
|
||||
(v18/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -403,7 +541,7 @@ return {
|
||||
"kind": "LinkedField",
|
||||
"name": "businessOwner",
|
||||
"plural": false,
|
||||
"selections": (v6/*: any*/),
|
||||
"selections": (v15/*: any*/),
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -413,12 +551,12 @@ return {
|
||||
"kind": "LinkedField",
|
||||
"name": "securityOwner",
|
||||
"plural": false,
|
||||
"selections": (v6/*: any*/),
|
||||
"selections": (v15/*: any*/),
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"args": (v19/*: any*/),
|
||||
"concreteType": "VendorComplianceReportConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "complianceReports",
|
||||
@@ -441,6 +579,19 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-compliance-report:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-compliance-report:delete\")"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -448,7 +599,7 @@ return {
|
||||
"name": "reportDate",
|
||||
"storageKey": null
|
||||
},
|
||||
(v11/*: any*/),
|
||||
(v20/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -464,7 +615,7 @@ return {
|
||||
"name": "file",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v12/*: any*/),
|
||||
(v21/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -483,23 +634,23 @@ return {
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v8/*: any*/)
|
||||
(v17/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v13/*: any*/)
|
||||
(v22/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v18/*: any*/),
|
||||
(v19/*: any*/)
|
||||
(v27/*: any*/),
|
||||
(v28/*: any*/)
|
||||
],
|
||||
"storageKey": "complianceReports(first:50)"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"filters": (v20/*: any*/),
|
||||
"args": (v19/*: any*/),
|
||||
"filters": (v29/*: any*/),
|
||||
"handle": "connection",
|
||||
"key": "VendorComplianceTabFragment_complianceReports",
|
||||
"kind": "LinkedHandle",
|
||||
@@ -507,7 +658,7 @@ return {
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"args": (v19/*: any*/),
|
||||
"concreteType": "VendorContactConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "contacts",
|
||||
@@ -530,6 +681,32 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-contact:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-contact:delete\")"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -558,25 +735,25 @@ return {
|
||||
"name": "role",
|
||||
"storageKey": null
|
||||
},
|
||||
(v21/*: any*/),
|
||||
(v22/*: any*/),
|
||||
(v8/*: any*/)
|
||||
(v30/*: any*/),
|
||||
(v31/*: any*/),
|
||||
(v17/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v13/*: any*/)
|
||||
(v22/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v18/*: any*/),
|
||||
(v19/*: any*/)
|
||||
(v27/*: any*/),
|
||||
(v28/*: any*/)
|
||||
],
|
||||
"storageKey": "contacts(first:50)"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"filters": (v20/*: any*/),
|
||||
"args": (v19/*: any*/),
|
||||
"filters": (v29/*: any*/),
|
||||
"handle": "connection",
|
||||
"key": "VendorContactsTabFragment_contacts",
|
||||
"kind": "LinkedHandle",
|
||||
@@ -584,7 +761,7 @@ return {
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"args": (v19/*: any*/),
|
||||
"concreteType": "VendorServiceConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "services",
|
||||
@@ -607,27 +784,53 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:delete\")"
|
||||
},
|
||||
(v4/*: any*/),
|
||||
(v9/*: any*/),
|
||||
(v21/*: any*/),
|
||||
(v22/*: any*/),
|
||||
(v8/*: any*/)
|
||||
(v18/*: any*/),
|
||||
(v30/*: any*/),
|
||||
(v31/*: any*/),
|
||||
(v17/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v13/*: any*/)
|
||||
(v22/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v18/*: any*/),
|
||||
(v19/*: any*/)
|
||||
(v27/*: any*/),
|
||||
(v28/*: any*/)
|
||||
],
|
||||
"storageKey": "services(first:50)"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"filters": (v20/*: any*/),
|
||||
"args": (v19/*: any*/),
|
||||
"filters": (v29/*: any*/),
|
||||
"handle": "connection",
|
||||
"key": "VendorServicesTabFragment_services",
|
||||
"kind": "LinkedHandle",
|
||||
@@ -635,7 +838,7 @@ return {
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"args": (v19/*: any*/),
|
||||
"concreteType": "VendorRiskAssessmentConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "riskAssessments",
|
||||
@@ -658,7 +861,7 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
(v21/*: any*/),
|
||||
(v30/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -687,11 +890,11 @@ return {
|
||||
"name": "notes",
|
||||
"storageKey": null
|
||||
},
|
||||
(v8/*: any*/)
|
||||
(v17/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v13/*: any*/)
|
||||
(v22/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
@@ -703,21 +906,21 @@ return {
|
||||
"name": "pageInfo",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v15/*: any*/),
|
||||
(v14/*: any*/),
|
||||
(v16/*: any*/),
|
||||
(v17/*: any*/)
|
||||
(v24/*: any*/),
|
||||
(v23/*: any*/),
|
||||
(v25/*: any*/),
|
||||
(v26/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v19/*: any*/)
|
||||
(v28/*: any*/)
|
||||
],
|
||||
"storageKey": "riskAssessments(first:50)"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"filters": (v20/*: any*/),
|
||||
"args": (v19/*: any*/),
|
||||
"filters": (v29/*: any*/),
|
||||
"handle": "connection",
|
||||
"key": "VendorRiskAssessmentTabFragment_riskAssessments",
|
||||
"kind": "LinkedHandle",
|
||||
@@ -730,7 +933,40 @@ return {
|
||||
"kind": "LinkedField",
|
||||
"name": "businessAssociateAgreement",
|
||||
"plural": false,
|
||||
"selections": (v23/*: any*/),
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
(v21/*: any*/),
|
||||
(v32/*: any*/),
|
||||
(v33/*: any*/),
|
||||
(v20/*: any*/),
|
||||
(v30/*: any*/),
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-business-associate-agreement:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-business-associate-agreement:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-business-associate-agreement:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-business-associate-agreement:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
@@ -740,7 +976,40 @@ return {
|
||||
"kind": "LinkedField",
|
||||
"name": "dataPrivacyAgreement",
|
||||
"plural": false,
|
||||
"selections": (v23/*: any*/),
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
(v21/*: any*/),
|
||||
(v32/*: any*/),
|
||||
(v33/*: any*/),
|
||||
(v20/*: any*/),
|
||||
(v30/*: any*/),
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-data-privacy-agreement:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-data-privacy-agreement:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-data-privacy-agreement:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-data-privacy-agreement:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
@@ -750,20 +1019,20 @@ return {
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
(v7/*: any*/)
|
||||
(v16/*: any*/)
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "8828ab43745d22ab3fe52df71b96f947",
|
||||
"cacheID": "2e729f8d534ac8b2c3ed86175ef62da7",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "VendorGraphNodeQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query VendorGraphNodeQuery(\n $vendorId: ID!\n) {\n node(id: $vendorId) {\n __typename\n ... on Vendor {\n id\n snapshotId\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorContactsTabFragment\n ...VendorServicesTabFragment\n ...VendorRiskAssessmentTabFragment\n ...VendorOverviewTabBusinessAssociateAgreementFragment\n ...VendorOverviewTabDataPrivacyAgreementFragment\n }\n id\n }\n viewer {\n id\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n file {\n fileName\n mimeType\n size\n id\n }\n}\n\nfragment VendorContactsTabFragment on Vendor {\n contacts(first: 50) {\n edges {\n node {\n id\n ...VendorContactsTabFragment_contact\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n\nfragment VendorOverviewTabBusinessAssociateAgreementFragment on Vendor {\n businessAssociateAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n }\n}\n\nfragment VendorOverviewTabDataPrivacyAgreementFragment on Vendor {\n dataPrivacyAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n }\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n createdAt\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment VendorServicesTabFragment on Vendor {\n services(first: 50) {\n edges {\n node {\n id\n ...VendorServicesTabFragment_service\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n category\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n countries\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n"
|
||||
"text": "query VendorGraphNodeQuery(\n $vendorId: ID!\n) {\n node(id: $vendorId) {\n __typename\n id\n ... on Vendor {\n snapshotId\n name\n websiteUrl\n canAssess: permission(action: \"core:vendor:assess\")\n canUpdate: permission(action: \"core:vendor:update\")\n canDelete: permission(action: \"core:vendor:delete\")\n canUploadComplianceReport: permission(action: \"core:vendor-compliance-report:upload\")\n canCreateRiskAssessment: permission(action: \"core:vendor-risk-assessment:create\")\n canCreateContact: permission(action: \"core:vendor-contact:create\")\n canCreateService: permission(action: \"core:vendor-service:create\")\n canUploadBAA: permission(action: \"core:vendor-business-associate-agreement:upload\")\n canUploadDPA: permission(action: \"core:vendor-data-privacy-agreement:upload\")\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorContactsTabFragment\n ...VendorServicesTabFragment\n ...VendorRiskAssessmentTabFragment\n ...VendorOverviewTabBusinessAssociateAgreementFragment\n ...VendorOverviewTabDataPrivacyAgreementFragment\n }\n }\n viewer {\n id\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n canDelete: permission(action: \"core:vendor-compliance-report:delete\")\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n file {\n fileName\n mimeType\n size\n id\n }\n canDelete: permission(action: \"core:vendor-compliance-report:delete\")\n}\n\nfragment VendorContactsTabFragment on Vendor {\n contacts(first: 50) {\n edges {\n node {\n id\n canUpdate: permission(action: \"core:vendor-contact:update\")\n canDelete: permission(action: \"core:vendor-contact:delete\")\n ...VendorContactsTabFragment_contact\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor-contact:update\")\n canDelete: permission(action: \"core:vendor-contact:delete\")\n}\n\nfragment VendorOverviewTabBusinessAssociateAgreementFragment on Vendor {\n businessAssociateAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n canUpdate: permission(action: \"core:vendor-business-associate-agreement:update\")\n canDelete: permission(action: \"core:vendor-business-associate-agreement:delete\")\n }\n}\n\nfragment VendorOverviewTabDataPrivacyAgreementFragment on Vendor {\n dataPrivacyAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n canUpdate: permission(action: \"core:vendor-data-privacy-agreement:update\")\n canDelete: permission(action: \"core:vendor-data-privacy-agreement:delete\")\n }\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n createdAt\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment VendorServicesTabFragment on Vendor {\n services(first: 50) {\n edges {\n node {\n id\n canUpdate: permission(action: \"core:vendor-service:update\")\n canDelete: permission(action: \"core:vendor-service:delete\")\n ...VendorServicesTabFragment_service\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor-service:update\")\n canDelete: permission(action: \"core:vendor-service:delete\")\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n category\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n countries\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "09aa3c306a606a7b306dc6c3d89afb83";
|
||||
(node as any).hash = "4de8ce39d2595e8b9866617badc36cae";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<4beefb4b0cb6b5258b3761151c8f722d>>
|
||||
* @generated SignedSource<<5e319c5022f751db916ef2ba18d368e2>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -18,6 +18,8 @@ export type VendorGraphPaginatedFragment$data = {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly riskAssessments: {
|
||||
@@ -265,6 +267,32 @@ return {
|
||||
],
|
||||
"storageKey": "riskAssessments(first:1,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:delete\")"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -346,6 +374,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "bf222e31d20ebe7c9dfdedff7d5a9c68";
|
||||
(node as any).hash = "023558795ed2a60c50d2c39edbe3db36";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<68b0a7b674474bde11fd886437848f4c>>
|
||||
* @generated SignedSource<<92455d5992a9e72cb7d395f570ad308c>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -12,6 +12,8 @@ import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type VendorOverviewTabBusinessAssociateAgreementFragment$data = {
|
||||
readonly businessAssociateAgreement: {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly createdAt: string;
|
||||
readonly fileName: string;
|
||||
readonly fileUrl: string;
|
||||
@@ -81,6 +83,32 @@ const node: ReaderFragment = {
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-business-associate-agreement:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-business-associate-agreement:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-business-associate-agreement:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-business-associate-agreement:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -90,6 +118,6 @@ const node: ReaderFragment = {
|
||||
"abstractKey": null
|
||||
};
|
||||
|
||||
(node as any).hash = "5f45b3392cbce2a58d3d68932ec68f88";
|
||||
(node as any).hash = "3c3bb156f86684d1834ec63cf43dc99f";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<1fa31b2eb4941ffb82b51248dd11711c>>
|
||||
* @generated SignedSource<<3cf0d5be883754321b4278ac59d77a54>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -12,6 +12,8 @@ import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type VendorOverviewTabDataPrivacyAgreementFragment$data = {
|
||||
readonly dataPrivacyAgreement: {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly createdAt: string;
|
||||
readonly fileName: string;
|
||||
readonly fileUrl: string;
|
||||
@@ -81,6 +83,32 @@ const node: ReaderFragment = {
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-data-privacy-agreement:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-data-privacy-agreement:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-data-privacy-agreement:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-data-privacy-agreement:delete\")"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -90,6 +118,6 @@ const node: ReaderFragment = {
|
||||
"abstractKey": null
|
||||
};
|
||||
|
||||
(node as any).hash = "9a3e19e369a57ce4c1dd08760d244b74";
|
||||
(node as any).hash = "c07606a63a9dc76f5cfad938c9d54268";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<eb8e9cc9e50d48176edcd507b42a7dd7>>
|
||||
* @generated SignedSource<<5eb43de8b9e005e9d6a505932b1e2bfd>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -212,6 +212,32 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v12/*: any*/),
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:delete\")"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -329,16 +355,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "102f3aac3e2c7ef5115d73246f1bb241",
|
||||
"cacheID": "94e552f4d7ee637234214d9277109b51",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "VendorServicesListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query VendorServicesListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorServiceOrder = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorServicesTabFragment_16fISc\n id\n }\n}\n\nfragment VendorServicesTabFragment_16fISc on Vendor {\n services(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n ...VendorServicesTabFragment_service\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n}\n"
|
||||
"text": "query VendorServicesListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorServiceOrder = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorServicesTabFragment_16fISc\n id\n }\n}\n\nfragment VendorServicesTabFragment_16fISc on Vendor {\n services(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n canUpdate: permission(action: \"core:vendor-service:update\")\n canDelete: permission(action: \"core:vendor-service:delete\")\n ...VendorServicesTabFragment_service\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:vendor-service:update\")\n canDelete: permission(action: \"core:vendor-service:delete\")\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "fd0c58f2929f925fb47e5df22f6a84f7";
|
||||
(node as any).hash = "9ef8673eefe25a94bb6e02b564c2f1aa";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<4dfc017ac50d12a09ddac0cf37061c06>>
|
||||
* @generated SignedSource<<63a5d7d63f436c96a8f7d9b66a4f708d>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -16,6 +16,8 @@ export type VendorServicesTabFragment$data = {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly id: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"VendorServicesTabFragment_service">;
|
||||
};
|
||||
@@ -134,6 +136,32 @@ return {
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:delete\")"
|
||||
},
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
@@ -220,6 +248,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "fd0c58f2929f925fb47e5df22f6a84f7";
|
||||
(node as any).hash = "9ef8673eefe25a94bb6e02b564c2f1aa";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<6e7ee5d7dad966afab1e9ddbf60e14f3>>
|
||||
* @generated SignedSource<<f8640f48ff7cc9e6d9431195f6aec66b>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,6 +11,8 @@
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type VendorServicesTabFragment_service$data = {
|
||||
readonly canDelete: boolean;
|
||||
readonly canUpdate: boolean;
|
||||
readonly createdAt: string;
|
||||
readonly description: string | null | undefined;
|
||||
readonly id: string;
|
||||
@@ -63,12 +65,38 @@ const node: ReaderFragment = {
|
||||
"kind": "ScalarField",
|
||||
"name": "updatedAt",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor-service:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor-service:delete\")"
|
||||
}
|
||||
],
|
||||
"type": "VendorService",
|
||||
"abstractKey": null
|
||||
};
|
||||
|
||||
(node as any).hash = "276b5545b9e5eb7f9d9f56c4ea2ed352";
|
||||
(node as any).hash = "6371ec5f43c5d090c72fa50ca7ec1686";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<5f9ff983582bf49d588a9d0d986653d7>>
|
||||
* @generated SignedSource<<32bbeab909437ba96ded84710a198413>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -337,6 +337,32 @@ return {
|
||||
],
|
||||
"storageKey": "riskAssessments(first:1,orderBy:{\"direction\":\"DESC\",\"field\":\"CREATED_AT\"})"
|
||||
},
|
||||
{
|
||||
"alias": "canUpdate",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:update"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:update\")"
|
||||
},
|
||||
{
|
||||
"alias": "canDelete",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "action",
|
||||
"value": "core:vendor:delete"
|
||||
}
|
||||
],
|
||||
"kind": "ScalarField",
|
||||
"name": "permission",
|
||||
"storageKey": "permission(action:\"core:vendor:delete\")"
|
||||
},
|
||||
(v13/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -426,16 +452,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "bf14bba14dba4fb544d431600ea31317",
|
||||
"cacheID": "04d4f2010cbc972eea3c0b464a7d2ad8",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "VendorsListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query VendorsListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorOrder = null\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorGraphPaginatedFragment_25MC8O\n id\n }\n}\n\nfragment VendorGraphPaginatedFragment_25MC8O on Organization {\n vendors(first: $first, after: $after, last: $last, before: $before, orderBy: $order, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n snapshotId\n name\n websiteUrl\n updatedAt\n riskAssessments(first: 1, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n createdAt\n expiresAt\n dataSensitivity\n businessImpact\n }\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
|
||||
"text": "query VendorsListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorOrder = null\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorGraphPaginatedFragment_25MC8O\n id\n }\n}\n\nfragment VendorGraphPaginatedFragment_25MC8O on Organization {\n vendors(first: $first, after: $after, last: $last, before: $before, orderBy: $order, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n snapshotId\n name\n websiteUrl\n updatedAt\n riskAssessments(first: 1, orderBy: {direction: DESC, field: CREATED_AT}) {\n edges {\n node {\n id\n createdAt\n expiresAt\n dataSensitivity\n businessImpact\n }\n }\n }\n canUpdate: permission(action: \"core:vendor:update\")\n canDelete: permission(action: \"core:vendor:delete\")\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "bf222e31d20ebe7c9dfdedff7d5a9c68";
|
||||
(node as any).hash = "023558795ed2a60c50d2c39edbe3db36";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -19,7 +19,7 @@ import type { LoadMoreFn } from "react-relay";
|
||||
import type { OperationType } from "relay-runtime";
|
||||
|
||||
type Order = {
|
||||
direction: string;
|
||||
direction: "ASC" | "DESC";
|
||||
field: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ const createVendorMutation = graphql`
|
||||
websiteUrl
|
||||
createdAt
|
||||
updatedAt
|
||||
canUpdate: permission(action: "core:vendor:update")
|
||||
canDelete: permission(action: "core:vendor:delete")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,6 +95,7 @@ export const vendorsQuery = graphql`
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
id
|
||||
canCreateVendor: permission(action: "core:vendor:create")
|
||||
...VendorGraphPaginatedFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
@@ -140,6 +143,8 @@ export const paginatedVendorsFragment = graphql`
|
||||
}
|
||||
}
|
||||
}
|
||||
canUpdate: permission(action: "core:vendor:update")
|
||||
canDelete: permission(action: "core:vendor:delete")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,11 +154,28 @@ export const paginatedVendorsFragment = graphql`
|
||||
export const vendorNodeQuery = graphql`
|
||||
query VendorGraphNodeQuery($vendorId: ID!) {
|
||||
node(id: $vendorId) {
|
||||
id
|
||||
... on Vendor {
|
||||
id
|
||||
snapshotId
|
||||
name
|
||||
websiteUrl
|
||||
canAssess: permission(action: "core:vendor:assess")
|
||||
canUpdate: permission(action: "core:vendor:update")
|
||||
canDelete: permission(action: "core:vendor:delete")
|
||||
canUploadComplianceReport: permission(
|
||||
action: "core:vendor-compliance-report:upload"
|
||||
)
|
||||
canCreateRiskAssessment: permission(
|
||||
action: "core:vendor-risk-assessment:create"
|
||||
)
|
||||
canCreateContact: permission(action: "core:vendor-contact:create")
|
||||
canCreateService: permission(action: "core:vendor-service:create")
|
||||
canUploadBAA: permission(
|
||||
action: "core:vendor-business-associate-agreement:upload"
|
||||
)
|
||||
canUploadDPA: permission(
|
||||
action: "core:vendor-data-privacy-agreement:upload"
|
||||
)
|
||||
...useVendorFormFragment
|
||||
...VendorComplianceTabFragment
|
||||
...VendorContactsTabFragment
|
||||
|
||||
@@ -29,21 +29,17 @@ import { ImportAssessmentDialog } from "./dialogs/ImportAssessmentDialog";
|
||||
import { complianceReportsFragment } from "./tabs/VendorComplianceTab";
|
||||
import type { VendorComplianceTabFragment$key } from "/__generated__/core/VendorComplianceTabFragment.graphql";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import { use } from "react";
|
||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<VendorGraphNodeQuery>;
|
||||
};
|
||||
|
||||
export default function VendorDetailPage(props: Props) {
|
||||
const data = usePreloadedQuery(vendorNodeQuery, props.queryRef);
|
||||
const vendor = data.node;
|
||||
const { node: vendor } = usePreloadedQuery(vendorNodeQuery, props.queryRef);
|
||||
const { __ } = useTranslate();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
|
||||
validateSnapshotConsistency(vendor, snapshotId);
|
||||
const deleteVendor = useDeleteVendor(
|
||||
@@ -93,14 +89,14 @@ export default function VendorDetailPage(props: Props) {
|
||||
</div>
|
||||
{!isSnapshotMode && (
|
||||
<div className="flex gap-2 items-center">
|
||||
{isAuthorized("Vendor", "assessVendor") && (
|
||||
{vendor.canAssess && (
|
||||
<ImportAssessmentDialog vendorId={vendor.id!}>
|
||||
<Button icon={IconPageTextLine} variant="secondary">
|
||||
{__("Assessment From Website")}
|
||||
</Button>
|
||||
</ImportAssessmentDialog>
|
||||
)}
|
||||
{isAuthorized("Vendor", "deleteVendor") && (
|
||||
{vendor.canDelete && (
|
||||
<ActionDropdown variant="secondary">
|
||||
<DropdownItem
|
||||
variant="danger"
|
||||
|
||||
@@ -37,8 +37,6 @@ import type {
|
||||
} from "/__generated__/core/VendorGraphPaginatedFragment.graphql";
|
||||
import { SortableTable, SortableTh } from "/components/SortableTable";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import { use } from "react";
|
||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||
|
||||
type Vendor = NodeOf<VendorGraphPaginatedFragment$data["vendors"]>;
|
||||
|
||||
@@ -51,7 +49,6 @@ export default function VendorsPage(props: Props) {
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
|
||||
const data = usePreloadedQuery(vendorsQuery, props.queryRef);
|
||||
const pagination = usePaginationFragment(
|
||||
@@ -66,8 +63,7 @@ export default function VendorsPage(props: Props) {
|
||||
|
||||
const hasAnyAction =
|
||||
!isSnapshotMode &&
|
||||
(isAuthorized("Vendor", "updateVendor") ||
|
||||
isAuthorized("Vendor", "deleteVendor"));
|
||||
vendors.some(({ canUpdate, canDelete }) => canUpdate || canDelete);
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -78,7 +74,7 @@ export default function VendorsPage(props: Props) {
|
||||
"Vendors are third-party services that your company uses. Add them to keep track of their risk and compliance status.",
|
||||
)}
|
||||
>
|
||||
{!isSnapshotMode && isAuthorized("Organization", "createVendor") && (
|
||||
{!isSnapshotMode && data.node.canCreateVendor && (
|
||||
<CreateVendorDialog
|
||||
connection={connectionId}
|
||||
organizationId={organizationId}
|
||||
@@ -128,7 +124,6 @@ function VendorRow({
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const { __ } = useTranslate();
|
||||
const latestAssessment = vendor.riskAssessments?.edges[0]?.node;
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
const deleteVendor = useDeleteVendor(vendor, connectionId);
|
||||
|
||||
const vendorUrl =
|
||||
@@ -159,7 +154,7 @@ function VendorRow({
|
||||
{hasAnyAction && (
|
||||
<Td noLink width={50} className="text-end">
|
||||
<ActionDropdown>
|
||||
{isAuthorized("Vendor", "deleteVendor") && (
|
||||
{vendor.canDelete && (
|
||||
<DropdownItem
|
||||
onClick={deleteVendor}
|
||||
variant="danger"
|
||||
|
||||
@@ -29,6 +29,8 @@ const createContactMutation = graphql`
|
||||
createVendorContact(input: $input) {
|
||||
vendorContactEdge @prependEdge(connections: $connections) {
|
||||
node {
|
||||
canUpdate: permission(action: "core:vendor-contact:update")
|
||||
canDelete: permission(action: "core:vendor-contact:delete")
|
||||
...VendorContactsTabFragment_contact
|
||||
}
|
||||
}
|
||||
@@ -47,8 +49,21 @@ export function CreateContactDialog({
|
||||
|
||||
const schema = z.object({
|
||||
fullName: z.string().optional(),
|
||||
email: z.union([z.string().email(__("Please enter a valid email address")), z.literal("")]),
|
||||
phone: z.union([z.string().regex(phoneRegex, __("Phone number must be in international format (e.g., +1234567890)")), z.literal("")]),
|
||||
email: z.union([
|
||||
z.string().email(__("Please enter a valid email address")),
|
||||
z.literal(""),
|
||||
]),
|
||||
phone: z.union([
|
||||
z
|
||||
.string()
|
||||
.regex(
|
||||
phoneRegex,
|
||||
__(
|
||||
"Phone number must be in international format (e.g., +1234567890)",
|
||||
),
|
||||
),
|
||||
z.literal(""),
|
||||
]),
|
||||
role: z.string().optional(),
|
||||
});
|
||||
|
||||
@@ -61,14 +76,14 @@ export function CreateContactDialog({
|
||||
phone: "",
|
||||
role: "",
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
const [createContact, isLoading] = useMutationWithToasts(
|
||||
createContactMutation,
|
||||
{
|
||||
successMessage: __("Contact created successfully."),
|
||||
errorMessage: __("Failed to create contact"),
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const onSubmit = handleSubmit((data) => {
|
||||
@@ -96,9 +111,7 @@ export function CreateContactDialog({
|
||||
className="max-w-lg"
|
||||
ref={dialogRef}
|
||||
trigger={children}
|
||||
title={
|
||||
<Breadcrumb items={[__("Contacts"), __("New Contact")]} />
|
||||
}
|
||||
title={<Breadcrumb items={[__("Contacts"), __("New Contact")]} />}
|
||||
>
|
||||
<form onSubmit={onSubmit}>
|
||||
<DialogContent padded className="space-y-4">
|
||||
|
||||
@@ -14,15 +14,11 @@ import { graphql } from "relay-runtime";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import { z } from "zod";
|
||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import type { VendorContactsTabFragment_contact$data } from "/__generated__/core/VendorContactsTabFragment_contact.graphql";
|
||||
|
||||
type Props = {
|
||||
contactId: string;
|
||||
contact: {
|
||||
fullName?: string | null;
|
||||
email?: string | null;
|
||||
phone?: string | null;
|
||||
role?: string | null;
|
||||
};
|
||||
contact: VendorContactsTabFragment_contact$data;
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
@@ -43,29 +39,39 @@ export function EditContactDialog({ contactId, contact, onClose }: Props) {
|
||||
|
||||
const schema = z.object({
|
||||
fullName: z.string().optional(),
|
||||
email: z.union([z.string().email(__("Please enter a valid email address")), z.literal("")]),
|
||||
phone: z.union([z.string().regex(phoneRegex, __("Phone number must be in international format (e.g., +1234567890)")), z.literal("")]),
|
||||
email: z.union([
|
||||
z.string().email(__("Please enter a valid email address")),
|
||||
z.literal(""),
|
||||
]),
|
||||
phone: z.union([
|
||||
z
|
||||
.string()
|
||||
.regex(
|
||||
phoneRegex,
|
||||
__(
|
||||
"Phone number must be in international format (e.g., +1234567890)",
|
||||
),
|
||||
),
|
||||
z.literal(""),
|
||||
]),
|
||||
role: z.string().optional(),
|
||||
});
|
||||
|
||||
const { register, handleSubmit, formState } = useFormWithSchema(
|
||||
schema,
|
||||
{
|
||||
defaultValues: {
|
||||
fullName: contact.fullName || "",
|
||||
email: contact.email || "",
|
||||
phone: contact.phone || "",
|
||||
role: contact.role || "",
|
||||
},
|
||||
}
|
||||
);
|
||||
const { register, handleSubmit, formState } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
fullName: contact.fullName || "",
|
||||
email: contact.email || "",
|
||||
phone: contact.phone || "",
|
||||
role: contact.role || "",
|
||||
},
|
||||
});
|
||||
|
||||
const [updateContact, isLoading] = useMutationWithToasts(
|
||||
updateContactMutation,
|
||||
{
|
||||
successMessage: __("Contact updated successfully."),
|
||||
errorMessage: __("Failed to update contact"),
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const onSubmit = handleSubmit((data) => {
|
||||
@@ -95,9 +101,7 @@ export function EditContactDialog({ contactId, contact, onClose }: Props) {
|
||||
className="max-w-lg"
|
||||
ref={dialogRef}
|
||||
onClose={onClose}
|
||||
title={
|
||||
<Breadcrumb items={[__("Contacts"), __("Edit Contact")]} />
|
||||
}
|
||||
title={<Breadcrumb items={[__("Contacts"), __("Edit Contact")]} />}
|
||||
>
|
||||
<form onSubmit={onSubmit}>
|
||||
<DialogContent padded className="space-y-4">
|
||||
|
||||
@@ -10,35 +10,32 @@ import {
|
||||
} from "@probo/ui";
|
||||
import { Controller } from "react-hook-form";
|
||||
import { useVendorForm } from "/hooks/forms/useVendorForm";
|
||||
import type { useVendorFormFragment$key } from "/__generated__/core/useVendorFormFragment.graphql";
|
||||
import { useOutletContext, useParams } from "react-router";
|
||||
import {
|
||||
certificationCategoryLabel,
|
||||
certifications,
|
||||
objectEntries,
|
||||
} from "@probo/helpers";
|
||||
import { use, useRef, useState } from "react";
|
||||
import { useRef, useState } from "react";
|
||||
import clsx from "clsx";
|
||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||
import type { VendorGraphNodeQuery$data } from "/__generated__/core/VendorGraphNodeQuery.graphql";
|
||||
|
||||
/**
|
||||
* Vendor certifications tab
|
||||
*/
|
||||
export default function VendorCertificationsTab() {
|
||||
const { vendor } = useOutletContext<{
|
||||
vendor: useVendorFormFragment$key & { name: string };
|
||||
vendor: VendorGraphNodeQuery$data["node"];
|
||||
}>();
|
||||
const { __ } = useTranslate();
|
||||
const { control, handleSubmit } = useVendorForm(vendor);
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
const canUpdateVendor = isAuthorized("Vendor", "updateVendor");
|
||||
|
||||
return (
|
||||
<form
|
||||
className="space-y-4"
|
||||
onSubmit={!isSnapshotMode && canUpdateVendor ? handleSubmit : undefined}
|
||||
onSubmit={!isSnapshotMode && vendor.canUpdate ? handleSubmit : undefined}
|
||||
>
|
||||
<Card padded>
|
||||
<Controller
|
||||
@@ -48,12 +45,12 @@ export default function VendorCertificationsTab() {
|
||||
<Certifications
|
||||
onValueChange={field.onChange}
|
||||
value={field.value ?? []}
|
||||
readOnly={isSnapshotMode || !canUpdateVendor}
|
||||
readOnly={isSnapshotMode || !vendor.canUpdate}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Card>
|
||||
{!isSnapshotMode && canUpdateVendor && (
|
||||
{!isSnapshotMode && vendor.canUpdate && (
|
||||
<div className="flex justify-end">
|
||||
<Button type="submit">{__("Update vendor")}</Button>
|
||||
</div>
|
||||
|
||||
@@ -20,8 +20,9 @@ import type { VendorComplianceTabFragment_report$key } from "/__generated__/core
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import { sprintf, fileSize, formatDate } from "@probo/helpers";
|
||||
import { SortableTable, SortableTh } from "/components/SortableTable";
|
||||
import { use } from "react";
|
||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||
import type { VendorGraphNodeQuery$data } from "/__generated__/core/VendorGraphNodeQuery.graphql";
|
||||
import type { ComplianceReportListQuery } from "/__generated__/core/ComplianceReportListQuery.graphql";
|
||||
import type { ComponentProps } from "react";
|
||||
|
||||
export const complianceReportsFragment = graphql`
|
||||
fragment VendorComplianceTabFragment on Vendor
|
||||
@@ -44,6 +45,7 @@ export const complianceReportsFragment = graphql`
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
canDelete: permission(action: "core:vendor-compliance-report:delete")
|
||||
...VendorComplianceTabFragment_report
|
||||
}
|
||||
}
|
||||
@@ -62,6 +64,7 @@ const complianceReportFragment = graphql`
|
||||
mimeType
|
||||
size
|
||||
}
|
||||
canDelete: permission(action: "core:vendor-compliance-report:delete")
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -94,26 +97,18 @@ const deleteReportMutation = graphql`
|
||||
|
||||
export default function VendorComplianceTab() {
|
||||
const { vendor } = useOutletContext<{
|
||||
vendor: VendorComplianceTabFragment$key & { name: string; id: string };
|
||||
vendor: VendorGraphNodeQuery$data["node"];
|
||||
}>();
|
||||
const [data, refetch] = useRefetchableFragment(
|
||||
complianceReportsFragment,
|
||||
vendor,
|
||||
);
|
||||
const [data, refetch] = useRefetchableFragment<
|
||||
ComplianceReportListQuery,
|
||||
VendorComplianceTabFragment$key
|
||||
>(complianceReportsFragment, vendor);
|
||||
const connectionId = data.complianceReports.__id;
|
||||
const reports = data.complianceReports.edges.map((edge) => edge.node);
|
||||
const { __ } = useTranslate();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
const canUploadReport = isAuthorized(
|
||||
"Vendor",
|
||||
"uploadVendorComplianceReport",
|
||||
);
|
||||
const canDeleteReport = isAuthorized(
|
||||
"VendorComplianceReport",
|
||||
"deleteVendorComplianceReport",
|
||||
);
|
||||
const canDeleteSomeReport = reports.some(({ canDelete }) => canDelete);
|
||||
|
||||
usePageTitle(vendor.name + " - " + __("Compliance reports"));
|
||||
|
||||
@@ -141,7 +136,7 @@ export default function VendorComplianceTab() {
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{!isSnapshotMode && canUploadReport && (
|
||||
{!isSnapshotMode && vendor.canUploadComplianceReport && (
|
||||
<Dropzone
|
||||
description={__("Only PDF files up to 10MB are allowed")}
|
||||
isUploading={isMutating}
|
||||
@@ -152,14 +147,16 @@ export default function VendorComplianceTab() {
|
||||
maxSize={10}
|
||||
/>
|
||||
)}
|
||||
<SortableTable refetch={refetch}>
|
||||
<SortableTable
|
||||
refetch={refetch as ComponentProps<typeof SortableTable>["refetch"]}
|
||||
>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{__("Report name")}</Th>
|
||||
<SortableTh field="REPORT_DATE">{__("Report date")}</SortableTh>
|
||||
<Th>{__("Valid until")}</Th>
|
||||
<Th>{__("File size")}</Th>
|
||||
{!isSnapshotMode && canDeleteReport && <Th>{__("Actions")}</Th>}
|
||||
{!isSnapshotMode && canDeleteSomeReport && <Th>{__("Actions")}</Th>}
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
@@ -169,7 +166,6 @@ export default function VendorComplianceTab() {
|
||||
reportKey={report}
|
||||
connectionId={connectionId}
|
||||
isSnapshotMode={isSnapshotMode}
|
||||
canDelete={canDeleteReport}
|
||||
/>
|
||||
))}
|
||||
</Tbody>
|
||||
@@ -182,7 +178,6 @@ type ReportRowProps = {
|
||||
reportKey: VendorComplianceTabFragment_report$key;
|
||||
connectionId: string;
|
||||
isSnapshotMode: boolean;
|
||||
canDelete?: boolean;
|
||||
};
|
||||
|
||||
function ReportRow(props: ReportRowProps) {
|
||||
@@ -225,7 +220,7 @@ function ReportRow(props: ReportRowProps) {
|
||||
<Td>{formatDate(report.reportDate)}</Td>
|
||||
<Td>{formatDate(report.validUntil)}</Td>
|
||||
<Td>{fileSize(__, report.file?.size ?? 0)}</Td>
|
||||
{!props.isSnapshotMode && props.canDelete && (
|
||||
{!props.isSnapshotMode && report.canDelete && (
|
||||
<Td width={50} className="text-end">
|
||||
<ActionDropdown>
|
||||
<DropdownItem
|
||||
|
||||
@@ -19,14 +19,18 @@ import {
|
||||
useConfirm,
|
||||
} from "@probo/ui";
|
||||
import { useFragment, useRefetchableFragment } from "react-relay";
|
||||
import type { VendorContactsTabFragment_contact$key } from "/__generated__/core/VendorContactsTabFragment_contact.graphql";
|
||||
import type {
|
||||
VendorContactsTabFragment_contact$data,
|
||||
VendorContactsTabFragment_contact$key,
|
||||
} from "/__generated__/core/VendorContactsTabFragment_contact.graphql";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import { sprintf } from "@probo/helpers";
|
||||
import { SortableTable, SortableTh } from "/components/SortableTable";
|
||||
import { CreateContactDialog } from "../dialogs/CreateContactDialog";
|
||||
import { EditContactDialog } from "../dialogs/EditContactDialog";
|
||||
import { use, useState } from "react";
|
||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||
import { useState, type ComponentProps } from "react";
|
||||
import type { VendorGraphNodeQuery$data } from "/__generated__/core/VendorGraphNodeQuery.graphql";
|
||||
import type { VendorContactsListQuery } from "/__generated__/core/VendorContactsListQuery.graphql";
|
||||
|
||||
export const vendorContactsFragment = graphql`
|
||||
fragment VendorContactsTabFragment on Vendor
|
||||
@@ -49,6 +53,8 @@ export const vendorContactsFragment = graphql`
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
canUpdate: permission(action: "core:vendor-contact:update")
|
||||
canDelete: permission(action: "core:vendor-contact:delete")
|
||||
...VendorContactsTabFragment_contact
|
||||
}
|
||||
}
|
||||
@@ -65,6 +71,8 @@ const contactFragment = graphql`
|
||||
role
|
||||
createdAt
|
||||
updatedAt
|
||||
canUpdate: permission(action: "core:vendor-contact:update")
|
||||
canDelete: permission(action: "core:vendor-contact:delete")
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -81,29 +89,22 @@ const deleteContactMutation = graphql`
|
||||
|
||||
export default function VendorContactsTab() {
|
||||
const { vendor } = useOutletContext<{
|
||||
vendor: VendorContactsTabFragment$key & { name: string; id: string };
|
||||
vendor: VendorGraphNodeQuery$data["node"];
|
||||
}>();
|
||||
const [data, refetch] = useRefetchableFragment(
|
||||
vendorContactsFragment,
|
||||
vendor,
|
||||
);
|
||||
const [data, refetch] = useRefetchableFragment<
|
||||
VendorContactsListQuery,
|
||||
VendorContactsTabFragment$key
|
||||
>(vendorContactsFragment, vendor);
|
||||
const connectionId = data.contacts.__id;
|
||||
const contacts = data.contacts.edges.map((edge) => edge.node);
|
||||
const { __ } = useTranslate();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const [editingContact, setEditingContact] = useState<{
|
||||
id: string;
|
||||
fullName?: string | null;
|
||||
email?: string | null;
|
||||
phone?: string | null;
|
||||
role?: string | null;
|
||||
} | null>(null);
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
const canCreateContact = isAuthorized("Vendor", "createVendorContact");
|
||||
const canUpdateContact = isAuthorized("VendorContact", "updateVendorContact");
|
||||
const canDeleteContact = isAuthorized("VendorContact", "deleteVendorContact");
|
||||
const hasAnyAction = canUpdateContact || canDeleteContact;
|
||||
const [editingContact, setEditingContact] =
|
||||
useState<VendorContactsTabFragment_contact$data | null>(null);
|
||||
const hasAnyAction = contacts.some(
|
||||
({ canUpdate, canDelete }) => canUpdate || canDelete,
|
||||
);
|
||||
|
||||
usePageTitle(vendor.name + " - " + __("Contacts"));
|
||||
|
||||
@@ -113,14 +114,16 @@ export default function VendorContactsTab() {
|
||||
title={__("Contacts")}
|
||||
description={__("Manage vendor contacts and their information.")}
|
||||
>
|
||||
{!isSnapshotMode && canCreateContact && (
|
||||
{!isSnapshotMode && vendor.canCreateContact && (
|
||||
<CreateContactDialog vendorId={vendor.id} connectionId={connectionId}>
|
||||
<Button icon={IconPlusLarge}>{__("Add contact")}</Button>
|
||||
</CreateContactDialog>
|
||||
)}
|
||||
</PageHeader>
|
||||
|
||||
<SortableTable refetch={refetch}>
|
||||
<SortableTable
|
||||
refetch={refetch as ComponentProps<typeof SortableTable>["refetch"]}
|
||||
>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<SortableTh field="FULL_NAME">{__("Name")}</SortableTh>
|
||||
@@ -138,14 +141,12 @@ export default function VendorContactsTab() {
|
||||
connectionId={connectionId}
|
||||
onEdit={setEditingContact}
|
||||
isSnapshotMode={isSnapshotMode}
|
||||
canUpdate={canUpdateContact}
|
||||
canDelete={canDeleteContact}
|
||||
/>
|
||||
))}
|
||||
</Tbody>
|
||||
</SortableTable>
|
||||
|
||||
{editingContact && !isSnapshotMode && canUpdateContact && (
|
||||
{editingContact && !isSnapshotMode && editingContact.canUpdate && (
|
||||
<EditContactDialog
|
||||
contactId={editingContact.id}
|
||||
contact={editingContact}
|
||||
@@ -159,16 +160,8 @@ export default function VendorContactsTab() {
|
||||
type ContactRowProps = {
|
||||
contactKey: VendorContactsTabFragment_contact$key;
|
||||
connectionId: string;
|
||||
onEdit: (contact: {
|
||||
id: string;
|
||||
fullName?: string | null;
|
||||
email?: string | null;
|
||||
phone?: string | null;
|
||||
role?: string | null;
|
||||
}) => void;
|
||||
onEdit: (contact: VendorContactsTabFragment_contact$data) => void;
|
||||
isSnapshotMode: boolean;
|
||||
canUpdate?: boolean;
|
||||
canDelete?: boolean;
|
||||
};
|
||||
|
||||
function ContactRow(props: ContactRowProps) {
|
||||
@@ -182,7 +175,7 @@ function ContactRow(props: ContactRowProps) {
|
||||
successMessage: __("Contact deleted successfully"),
|
||||
errorMessage: __("Failed to delete contact"),
|
||||
});
|
||||
const hasAnyAction = props.canUpdate || props.canDelete;
|
||||
const hasAnyAction = contact.canUpdate || contact.canDelete;
|
||||
|
||||
const handleDelete = () => {
|
||||
confirm(
|
||||
@@ -237,23 +230,15 @@ function ContactRow(props: ContactRowProps) {
|
||||
{!props.isSnapshotMode && hasAnyAction && (
|
||||
<Td width={50} className="text-end">
|
||||
<ActionDropdown>
|
||||
{props.canUpdate && (
|
||||
{contact.canUpdate && (
|
||||
<DropdownItem
|
||||
icon={IconPencil}
|
||||
onClick={() =>
|
||||
props.onEdit({
|
||||
id: contact.id,
|
||||
fullName: contact.fullName,
|
||||
email: contact.email,
|
||||
phone: contact.phone,
|
||||
role: contact.role,
|
||||
})
|
||||
}
|
||||
onClick={() => props.onEdit(contact)}
|
||||
>
|
||||
{__("Edit")}
|
||||
</DropdownItem>
|
||||
)}
|
||||
{props.canDelete && (
|
||||
{contact.canDelete && (
|
||||
<DropdownItem
|
||||
icon={IconTrashCan}
|
||||
onClick={handleDelete}
|
||||
|
||||
@@ -15,7 +15,7 @@ import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||
import { ControlledField } from "/components/form/ControlledField";
|
||||
import { CountriesField } from "/components/form/CountriesField";
|
||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||
import { use, useMemo } from "react";
|
||||
import { useMemo } from "react";
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import { downloadFile, formatDate } from "@probo/helpers";
|
||||
import { useFragment, graphql } from "react-relay";
|
||||
@@ -25,11 +25,10 @@ import { EditBusinessAssociateAgreementDialog } from "../dialogs/EditBusinessAss
|
||||
import { UploadDataPrivacyAgreementDialog } from "../dialogs/UploadDataPrivacyAgreementDialog";
|
||||
import { DeleteDataPrivacyAgreementDialog } from "../dialogs/DeleteDataPrivacyAgreementDialog";
|
||||
import { EditDataPrivacyAgreementDialog } from "../dialogs/EditDataPrivacyAgreementDialog";
|
||||
import type { useVendorFormFragment$key } from "/__generated__/core/useVendorFormFragment.graphql";
|
||||
import type { VendorOverviewTabBusinessAssociateAgreementFragment$key } from "/__generated__/core/VendorOverviewTabBusinessAssociateAgreementFragment.graphql";
|
||||
import type { VendorOverviewTabDataPrivacyAgreementFragment$key } from "/__generated__/core/VendorOverviewTabDataPrivacyAgreementFragment.graphql";
|
||||
import type { VendorCategory } from "@probo/vendors";
|
||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||
import type { VendorGraphNodeQuery$data } from "/__generated__/core/VendorGraphNodeQuery.graphql";
|
||||
|
||||
const vendorBusinessAssociateAgreementFragment = graphql`
|
||||
fragment VendorOverviewTabBusinessAssociateAgreementFragment on Vendor {
|
||||
@@ -40,6 +39,12 @@ const vendorBusinessAssociateAgreementFragment = graphql`
|
||||
validFrom
|
||||
validUntil
|
||||
createdAt
|
||||
canUpdate: permission(
|
||||
action: "core:vendor-business-associate-agreement:update"
|
||||
)
|
||||
canDelete: permission(
|
||||
action: "core:vendor-business-associate-agreement:delete"
|
||||
)
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -53,47 +58,18 @@ const vendorDataPrivacyAgreementFragment = graphql`
|
||||
validFrom
|
||||
validUntil
|
||||
createdAt
|
||||
canUpdate: permission(action: "core:vendor-data-privacy-agreement:update")
|
||||
canDelete: permission(action: "core:vendor-data-privacy-agreement:delete")
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default function VendorOverviewTab() {
|
||||
const { vendor } = useOutletContext<{
|
||||
vendor: useVendorFormFragment$key & { id: string; name: string };
|
||||
}>();
|
||||
|
||||
const { vendor: vendorForBAA } = useOutletContext<{
|
||||
vendor: VendorOverviewTabBusinessAssociateAgreementFragment$key &
|
||||
VendorOverviewTabDataPrivacyAgreementFragment$key;
|
||||
vendor: VendorGraphNodeQuery$data["node"];
|
||||
}>();
|
||||
|
||||
const { __ } = useTranslate();
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
const canUpdateVendor = isAuthorized("Vendor", "updateVendor");
|
||||
const canUploadBAA = isAuthorized(
|
||||
"Vendor",
|
||||
"uploadVendorBusinessAssociateAgreement",
|
||||
);
|
||||
const canUpdateBAA = isAuthorized(
|
||||
"Vendor",
|
||||
"updateVendorBusinessAssociateAgreement",
|
||||
);
|
||||
const canDeleteBAA = isAuthorized(
|
||||
"Vendor",
|
||||
"deleteVendorBusinessAssociateAgreement",
|
||||
);
|
||||
const canUploadDPA = isAuthorized(
|
||||
"Vendor",
|
||||
"uploadVendorDataPrivacyAgreement",
|
||||
);
|
||||
const canUpdateDPA = isAuthorized(
|
||||
"Vendor",
|
||||
"updateVendorDataPrivacyAgreement",
|
||||
);
|
||||
const canDeleteDPA = isAuthorized(
|
||||
"Vendor",
|
||||
"deleteVendorDataPrivacyAgreement",
|
||||
);
|
||||
const vendorCategories: { value: VendorCategory; label: string }[] = [
|
||||
{ value: "ANALYTICS", label: __("Analytics") },
|
||||
{ value: "CLOUD_MONITORING", label: __("Cloud Monitoring") },
|
||||
@@ -135,14 +111,14 @@ export default function VendorOverviewTab() {
|
||||
const vendorWithBAA =
|
||||
useFragment<VendorOverviewTabBusinessAssociateAgreementFragment$key>(
|
||||
vendorBusinessAssociateAgreementFragment,
|
||||
vendorForBAA,
|
||||
vendor,
|
||||
);
|
||||
const businessAssociateAgreement = vendorWithBAA.businessAssociateAgreement;
|
||||
|
||||
const vendorWithDPA =
|
||||
useFragment<VendorOverviewTabDataPrivacyAgreementFragment$key>(
|
||||
vendorDataPrivacyAgreementFragment,
|
||||
vendorForBAA,
|
||||
vendor,
|
||||
);
|
||||
const dataPrivacyAgreement = vendorWithDPA.dataPrivacyAgreement;
|
||||
|
||||
@@ -168,11 +144,11 @@ export default function VendorOverviewTab() {
|
||||
|
||||
usePageTitle(vendor.name + " - " + __("Overview"));
|
||||
|
||||
const isFormDisabled = isSubmitting || isSnapshotMode || !canUpdateVendor;
|
||||
const isFormDisabled = isSubmitting || isSnapshotMode || !vendor.canUpdate;
|
||||
|
||||
return (
|
||||
<form
|
||||
onSubmit={isSnapshotMode || !canUpdateVendor ? undefined : handleSubmit}
|
||||
onSubmit={isSnapshotMode || !vendor.canUpdate ? undefined : handleSubmit}
|
||||
className="space-y-12"
|
||||
>
|
||||
{/* Vendor Details */}
|
||||
@@ -338,7 +314,7 @@ export default function VendorOverviewTab() {
|
||||
>
|
||||
{__("Download PDF")}
|
||||
</Button>
|
||||
{!isSnapshotMode && canUpdateBAA && (
|
||||
{!isSnapshotMode && businessAssociateAgreement.canUpdate && (
|
||||
<EditBusinessAssociateAgreementDialog
|
||||
vendorId={vendor.id}
|
||||
agreement={{
|
||||
@@ -350,7 +326,7 @@ export default function VendorOverviewTab() {
|
||||
<Button variant="quaternary" icon={IconPencil} />
|
||||
</EditBusinessAssociateAgreementDialog>
|
||||
)}
|
||||
{!isSnapshotMode && canDeleteBAA && (
|
||||
{!isSnapshotMode && businessAssociateAgreement.canDelete && (
|
||||
<DeleteBusinessAssociateAgreementDialog
|
||||
vendorId={vendor.id}
|
||||
fileName={businessAssociateAgreement.fileName}
|
||||
@@ -362,7 +338,7 @@ export default function VendorOverviewTab() {
|
||||
</>
|
||||
) : (
|
||||
!isSnapshotMode &&
|
||||
canUploadBAA && (
|
||||
vendor.canUploadBAA && (
|
||||
<UploadBusinessAssociateAgreementDialog
|
||||
vendorId={vendor.id}
|
||||
onSuccess={() => window.location.reload()}
|
||||
@@ -412,7 +388,7 @@ export default function VendorOverviewTab() {
|
||||
>
|
||||
{__("Download PDF")}
|
||||
</Button>
|
||||
{!isSnapshotMode && canUpdateDPA && (
|
||||
{!isSnapshotMode && dataPrivacyAgreement.canUpdate && (
|
||||
<EditDataPrivacyAgreementDialog
|
||||
vendorId={vendor.id}
|
||||
agreement={{
|
||||
@@ -424,7 +400,7 @@ export default function VendorOverviewTab() {
|
||||
<Button variant="quaternary" icon={IconPencil} />
|
||||
</EditDataPrivacyAgreementDialog>
|
||||
)}
|
||||
{!isSnapshotMode && canDeleteDPA && (
|
||||
{!isSnapshotMode && dataPrivacyAgreement.canDelete && (
|
||||
<DeleteDataPrivacyAgreementDialog
|
||||
vendorId={vendor.id}
|
||||
fileName={dataPrivacyAgreement.fileName}
|
||||
@@ -436,7 +412,7 @@ export default function VendorOverviewTab() {
|
||||
</>
|
||||
) : (
|
||||
!isSnapshotMode &&
|
||||
canUploadDPA && (
|
||||
vendor.canUploadDPA && (
|
||||
<UploadDataPrivacyAgreementDialog
|
||||
vendorId={vendor.id}
|
||||
onSuccess={() => window.location.reload()}
|
||||
@@ -455,7 +431,7 @@ export default function VendorOverviewTab() {
|
||||
{/* Submit */}
|
||||
{!isSnapshotMode && (
|
||||
<div className="flex justify-end">
|
||||
{isAuthorized("Vendor", "updateVendor") && (
|
||||
{vendor.canUpdate && (
|
||||
<Button type="submit" disabled={isSubmitting}>
|
||||
{__("Update vendor")}
|
||||
</Button>
|
||||
|
||||
@@ -21,8 +21,9 @@ import type { VendorRiskAssessmentTabFragment_assessment$key } from "/__generate
|
||||
import { SortableTable, SortableTh } from "/components/SortableTable";
|
||||
import { CreateRiskAssessmentDialog } from "../dialogs/CreateRiskAssessmentDialog";
|
||||
import clsx from "clsx";
|
||||
import { use, useState } from "react";
|
||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||
import { useState, type ComponentProps } from "react";
|
||||
import type { VendorGraphNodeQuery$data } from "/__generated__/core/VendorGraphNodeQuery.graphql";
|
||||
import type { VendorRiskAssessmentTabQuery } from "/__generated__/core/VendorRiskAssessmentTabQuery.graphql";
|
||||
|
||||
const riskAssessmentsFragment = graphql`
|
||||
fragment VendorRiskAssessmentTabFragment on Vendor
|
||||
@@ -71,22 +72,17 @@ const riskAssessmentFragment = graphql`
|
||||
|
||||
export default function VendorRiskAssessmentTab() {
|
||||
const { vendor } = useOutletContext<{
|
||||
vendor: VendorRiskAssessmentTabFragment$key & { name: string; id: string };
|
||||
vendor: VendorGraphNodeQuery$data["node"];
|
||||
}>();
|
||||
const [data, refetch] = useRefetchableFragment(
|
||||
riskAssessmentsFragment,
|
||||
vendor,
|
||||
);
|
||||
const [data, refetch] = useRefetchableFragment<
|
||||
VendorRiskAssessmentTabQuery,
|
||||
VendorRiskAssessmentTabFragment$key
|
||||
>(riskAssessmentsFragment, vendor);
|
||||
const assessments = data.riskAssessments.edges.map((edge) => edge.node);
|
||||
const { __ } = useTranslate();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const [expanded, setExpanded] = useState<string | null>(null);
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
const canCreateRiskAssessment = isAuthorized(
|
||||
"Vendor",
|
||||
"createVendorRiskAssessment",
|
||||
);
|
||||
|
||||
usePageTitle(vendor.name + " - " + __("Risk Assessments"));
|
||||
|
||||
@@ -94,7 +90,7 @@ export default function VendorRiskAssessmentTab() {
|
||||
return (
|
||||
<div className="text-center text-sm py-6 text-txt-secondary flex flex-col items-center gap-2">
|
||||
{__("No risk assessments found")}
|
||||
{!isSnapshotMode && canCreateRiskAssessment && (
|
||||
{!isSnapshotMode && vendor.canCreateRiskAssessment && (
|
||||
<CreateRiskAssessmentDialog
|
||||
vendorId={vendor.id}
|
||||
connection={data.riskAssessments.__id}
|
||||
@@ -112,7 +108,9 @@ export default function VendorRiskAssessmentTab() {
|
||||
<div className="space-y-6 relative">
|
||||
<div className="flex justify-end"></div>
|
||||
<div className="overflow-x-auto">
|
||||
<SortableTable refetch={refetch}>
|
||||
<SortableTable
|
||||
refetch={refetch as ComponentProps<typeof SortableTable>["refetch"]}
|
||||
>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<SortableTh field="CREATED_AT">{__("Created At")}</SortableTh>
|
||||
@@ -122,7 +120,7 @@ export default function VendorRiskAssessmentTab() {
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{!isSnapshotMode && canCreateRiskAssessment && (
|
||||
{!isSnapshotMode && vendor.canCreateRiskAssessment && (
|
||||
<CreateRiskAssessmentDialog
|
||||
vendorId={vendor.id}
|
||||
connection={data.riskAssessments.__id}
|
||||
|
||||
@@ -19,14 +19,18 @@ import {
|
||||
useConfirm,
|
||||
} from "@probo/ui";
|
||||
import { useFragment, useRefetchableFragment } from "react-relay";
|
||||
import type { VendorServicesTabFragment_service$key } from "/__generated__/core/VendorServicesTabFragment_service.graphql";
|
||||
import type {
|
||||
VendorServicesTabFragment_service$data,
|
||||
VendorServicesTabFragment_service$key,
|
||||
} from "/__generated__/core/VendorServicesTabFragment_service.graphql";
|
||||
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
||||
import { sprintf } from "@probo/helpers";
|
||||
import { SortableTable, SortableTh } from "/components/SortableTable";
|
||||
import { CreateServiceDialog } from "../dialogs/CreateServiceDialog";
|
||||
import { EditServiceDialog } from "../dialogs/EditServiceDialog";
|
||||
import { use, useState } from "react";
|
||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
||||
import { useState, type ComponentProps } from "react";
|
||||
import type { VendorGraphNodeQuery$data } from "/__generated__/core/VendorGraphNodeQuery.graphql";
|
||||
import type { VendorServicesListQuery } from "/__generated__/core/VendorServicesListQuery.graphql";
|
||||
|
||||
export const vendorServicesFragment = graphql`
|
||||
fragment VendorServicesTabFragment on Vendor
|
||||
@@ -49,6 +53,8 @@ export const vendorServicesFragment = graphql`
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
canUpdate: permission(action: "core:vendor-service:update")
|
||||
canDelete: permission(action: "core:vendor-service:delete")
|
||||
...VendorServicesTabFragment_service
|
||||
}
|
||||
}
|
||||
@@ -63,6 +69,8 @@ const serviceFragment = graphql`
|
||||
description
|
||||
createdAt
|
||||
updatedAt
|
||||
canUpdate: permission(action: "core:vendor-service:update")
|
||||
canDelete: permission(action: "core:vendor-service:delete")
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -79,27 +87,22 @@ const deleteServiceMutation = graphql`
|
||||
|
||||
export default function VendorServicesTab() {
|
||||
const { vendor } = useOutletContext<{
|
||||
vendor: VendorServicesTabFragment$key & { name: string; id: string };
|
||||
vendor: VendorGraphNodeQuery$data["node"];
|
||||
}>();
|
||||
const [data, refetch] = useRefetchableFragment(
|
||||
vendorServicesFragment,
|
||||
vendor,
|
||||
);
|
||||
const [data, refetch] = useRefetchableFragment<
|
||||
VendorServicesListQuery,
|
||||
VendorServicesTabFragment$key
|
||||
>(vendorServicesFragment, vendor);
|
||||
const connectionId = data.services.__id;
|
||||
const services = data.services.edges.map((edge) => edge.node);
|
||||
const { __ } = useTranslate();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const [editingService, setEditingService] = useState<{
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string | null;
|
||||
} | null>(null);
|
||||
const { isAuthorized } = use(PermissionsContext);
|
||||
const canCreateService = isAuthorized("Vendor", "createVendorService");
|
||||
const canUpdateService = isAuthorized("VendorService", "updateVendorService");
|
||||
const canDeleteService = isAuthorized("VendorService", "deleteVendorService");
|
||||
const hasAnyAction = canUpdateService || canDeleteService;
|
||||
const [editingService, setEditingService] =
|
||||
useState<VendorServicesTabFragment_service$data | null>(null);
|
||||
const hasAnyAction = services.some(
|
||||
({ canUpdate, canDelete }) => canUpdate || canDelete,
|
||||
);
|
||||
|
||||
usePageTitle(vendor.name + " - " + __("Services"));
|
||||
|
||||
@@ -109,14 +112,16 @@ export default function VendorServicesTab() {
|
||||
title={__("Services")}
|
||||
description={__("Manage services provided by this vendor.")}
|
||||
>
|
||||
{!isSnapshotMode && canCreateService && (
|
||||
{!isSnapshotMode && vendor.canCreateService && (
|
||||
<CreateServiceDialog vendorId={vendor.id} connectionId={connectionId}>
|
||||
<Button icon={IconPlusLarge}>{__("Add service")}</Button>
|
||||
</CreateServiceDialog>
|
||||
)}
|
||||
</PageHeader>
|
||||
|
||||
<SortableTable refetch={refetch}>
|
||||
<SortableTable
|
||||
refetch={refetch as ComponentProps<typeof SortableTable>["refetch"]}
|
||||
>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<SortableTh field="NAME">{__("Name")}</SortableTh>
|
||||
@@ -132,14 +137,12 @@ export default function VendorServicesTab() {
|
||||
connectionId={connectionId}
|
||||
onEdit={setEditingService}
|
||||
isSnapshotMode={isSnapshotMode}
|
||||
canUpdate={canUpdateService}
|
||||
canDelete={canDeleteService}
|
||||
/>
|
||||
))}
|
||||
</Tbody>
|
||||
</SortableTable>
|
||||
|
||||
{editingService && !isSnapshotMode && canUpdateService && (
|
||||
{editingService && !isSnapshotMode && editingService.canUpdate && (
|
||||
<EditServiceDialog
|
||||
serviceId={editingService.id}
|
||||
service={editingService}
|
||||
@@ -153,14 +156,8 @@ export default function VendorServicesTab() {
|
||||
type ServiceRowProps = {
|
||||
serviceKey: VendorServicesTabFragment_service$key;
|
||||
connectionId: string;
|
||||
onEdit: (service: {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string | null;
|
||||
}) => void;
|
||||
onEdit: (service: VendorServicesTabFragment_service$data) => void;
|
||||
isSnapshotMode: boolean;
|
||||
canUpdate?: boolean;
|
||||
canDelete?: boolean;
|
||||
};
|
||||
|
||||
function ServiceRow(props: ServiceRowProps) {
|
||||
@@ -174,7 +171,7 @@ function ServiceRow(props: ServiceRowProps) {
|
||||
successMessage: __("Service deleted successfully"),
|
||||
errorMessage: __("Failed to delete service"),
|
||||
});
|
||||
const hasAnyAction = props.canUpdate || props.canDelete;
|
||||
const hasAnyAction = service.canUpdate || service.canDelete;
|
||||
|
||||
const handleDelete = () => {
|
||||
confirm(
|
||||
@@ -205,21 +202,15 @@ function ServiceRow(props: ServiceRowProps) {
|
||||
{!props.isSnapshotMode && hasAnyAction && (
|
||||
<Td width={50} className="text-end">
|
||||
<ActionDropdown>
|
||||
{props.canUpdate && (
|
||||
{service.canUpdate && (
|
||||
<DropdownItem
|
||||
icon={IconPencil}
|
||||
onClick={() =>
|
||||
props.onEdit({
|
||||
id: service.id,
|
||||
name: service.name,
|
||||
description: service.description,
|
||||
})
|
||||
}
|
||||
onClick={() => props.onEdit(service)}
|
||||
>
|
||||
{__("Edit")}
|
||||
</DropdownItem>
|
||||
)}
|
||||
{props.canDelete && (
|
||||
{service.canDelete && (
|
||||
<DropdownItem
|
||||
icon={IconTrashCan}
|
||||
onClick={handleDelete}
|
||||
|
||||
Reference in New Issue
Block a user