diff --git a/apps/console/src/components/form/ProcessingActivityRegistryEnumOptions.tsx b/apps/console/src/components/form/ProcessingActivityRegistryEnumOptions.tsx new file mode 100644 index 000000000..5a65d39fb --- /dev/null +++ b/apps/console/src/components/form/ProcessingActivityRegistryEnumOptions.tsx @@ -0,0 +1,143 @@ +import { useTranslate } from "@probo/i18n"; +import { Option } from "@probo/ui"; +import type { + ProcessingActivityRegistrySpecialOrCriminalData, + ProcessingActivityRegistryLawfulBasis, + ProcessingActivityRegistryDataProtectionImpactAssessment, + ProcessingActivityRegistryTransferImpactAssessment, +} from "../../hooks/graph/__generated__/ProcessingActivityRegistryGraphCreateMutation.graphql"; + +export function SpecialOrCriminalDataOptions() { + const { __ } = useTranslate(); + + const options: Array<{ + value: ProcessingActivityRegistrySpecialOrCriminalData; + label: string; + }> = [ + { value: "YES", label: __("Yes") }, + { value: "NO", label: __("No") }, + { value: "POSSIBLE", label: __("Possible") }, + ]; + + return ( + <> + {options.map((option) => ( + + ))} + + ); +} + +export function LawfulBasisOptions() { + const { __ } = useTranslate(); + + const options: Array<{ + value: ProcessingActivityRegistryLawfulBasis; + label: string; + }> = [ + { value: "CONSENT", label: __("Consent") }, + { value: "CONTRACTUAL_NECESSITY", label: __("Contractual Necessity") }, + { value: "LEGAL_OBLIGATION", label: __("Legal Obligation") }, + { value: "LEGITIMATE_INTEREST", label: __("Legitimate Interest") }, + { value: "PUBLIC_TASK", label: __("Public Task") }, + { value: "VITAL_INTERESTS", label: __("Vital Interests") }, + ]; + + return ( + <> + {options.map((option) => ( + + ))} + + ); +} + +export function getLawfulBasisLabel(value: ProcessingActivityRegistryLawfulBasis | null | undefined, __: (key: string) => string): string { + if (!value) return "-"; + + const labels = { + "CONSENT": __("Consent"), + "CONTRACTUAL_NECESSITY": __("Contractual Necessity"), + "LEGAL_OBLIGATION": __("Legal Obligation"), + "LEGITIMATE_INTEREST": __("Legitimate Interest"), + "PUBLIC_TASK": __("Public Task"), + "VITAL_INTERESTS": __("Vital Interests"), + }; + + return labels[value] || value; +} + +export function TransferSafeguardsOptions() { + const { __ } = useTranslate(); + + const options: Array<{ + value: string; + label: string; + }> = [ + { value: "__NONE__", label: __("None") }, + { value: "STANDARD_CONTRACTUAL_CLAUSES", label: __("Standard Contractual Clauses") }, + { value: "BINDING_CORPORATE_RULES", label: __("Binding Corporate Rules") }, + { value: "ADEQUACY_DECISION", label: __("Adequacy Decision") }, + { value: "DEROGATIONS", label: __("Derogations") }, + { value: "CODES_OF_CONDUCT", label: __("Codes of Conduct") }, + { value: "CERTIFICATION_MECHANISMS", label: __("Certification Mechanisms") }, + ]; + + return ( + <> + {options.map((option) => ( + + ))} + + ); +} + +export function DataProtectionImpactAssessmentOptions() { + const { __ } = useTranslate(); + + const options: Array<{ + value: ProcessingActivityRegistryDataProtectionImpactAssessment; + label: string; + }> = [ + { value: "NEEDED", label: __("Needed") }, + { value: "NOT_NEEDED", label: __("Not Needed") }, + ]; + + return ( + <> + {options.map((option) => ( + + ))} + + ); +} + +export function TransferImpactAssessmentOptions() { + const { __ } = useTranslate(); + + const options: Array<{ + value: ProcessingActivityRegistryTransferImpactAssessment; + label: string; + }> = [ + { value: "NEEDED", label: __("Needed") }, + { value: "NOT_NEEDED", label: __("Not Needed") }, + ]; + + return ( + <> + {options.map((option) => ( + + ))} + + ); +} diff --git a/apps/console/src/hooks/graph/ProcessingActivityRegistryGraph.ts b/apps/console/src/hooks/graph/ProcessingActivityRegistryGraph.ts new file mode 100644 index 000000000..9bed2cc4c --- /dev/null +++ b/apps/console/src/hooks/graph/ProcessingActivityRegistryGraph.ts @@ -0,0 +1,269 @@ +import { graphql } from "relay-runtime"; +import { useMutation } from "react-relay"; +import { useConfirm } from "@probo/ui"; +import { useTranslate } from "@probo/i18n"; +import { promisifyMutation, sprintf } from "@probo/helpers"; +import { useMutationWithToasts } from "../useMutationWithToasts"; + +export const ProcessingActivityRegistriesConnectionKey = "ProcessingActivityRegistriesPage_processingActivityRegistries"; + +export const processingActivityRegistriesQuery = graphql` + query ProcessingActivityRegistryGraphListQuery($organizationId: ID!) { + node(id: $organizationId) { + ... on Organization { + ...ProcessingActivityRegistriesPageFragment + } + } + } +`; + +export const processingActivityRegistryNodeQuery = graphql` + query ProcessingActivityRegistryGraphNodeQuery($processingActivityRegistryId: ID!) { + node(id: $processingActivityRegistryId) { + ... on ProcessingActivityRegistry { + id + name + purpose + dataSubjectCategory + personalDataCategory + specialOrCriminalData + consentEvidenceLink + lawfulBasis + recipients + location + internationalTransfers + transferSafeguards + retentionPeriod + securityMeasures + dataProtectionImpactAssessment + transferImpactAssessment + audit { + id + name + framework { + id + name + } + } + organization { + id + name + } + createdAt + updatedAt + } + } + } +`; + +export const createProcessingActivityRegistryMutation = graphql` + mutation ProcessingActivityRegistryGraphCreateMutation( + $input: CreateProcessingActivityRegistryInput! + $connections: [ID!]! + ) { + createProcessingActivityRegistry(input: $input) { + processingActivityRegistryEdge @prependEdge(connections: $connections) { + node { + id + name + purpose + dataSubjectCategory + personalDataCategory + specialOrCriminalData + consentEvidenceLink + lawfulBasis + recipients + location + internationalTransfers + transferSafeguards + retentionPeriod + securityMeasures + dataProtectionImpactAssessment + transferImpactAssessment + audit { + id + name + framework { + name + } + } + createdAt + } + } + } + } +`; + +export const updateProcessingActivityRegistryMutation = graphql` + mutation ProcessingActivityRegistryGraphUpdateMutation($input: UpdateProcessingActivityRegistryInput!) { + updateProcessingActivityRegistry(input: $input) { + processingActivityRegistry { + id + name + purpose + dataSubjectCategory + personalDataCategory + specialOrCriminalData + consentEvidenceLink + lawfulBasis + recipients + location + internationalTransfers + transferSafeguards + retentionPeriod + securityMeasures + dataProtectionImpactAssessment + transferImpactAssessment + audit { + id + name + framework { + id + name + } + } + updatedAt + } + } + } +`; + +export const deleteProcessingActivityRegistryMutation = graphql` + mutation ProcessingActivityRegistryGraphDeleteMutation( + $input: DeleteProcessingActivityRegistryInput! + $connections: [ID!]! + ) { + deleteProcessingActivityRegistry(input: $input) { + deletedProcessingActivityRegistryId @deleteEdge(connections: $connections) + } + } +`; + +export const useDeleteProcessingActivityRegistry = ( + registry: { id: string; name: string }, + connectionId: string +) => { + const { __ } = useTranslate(); + const [mutate] = useMutationWithToasts(deleteProcessingActivityRegistryMutation, { + successMessage: __("Processing activity registry entry deleted successfully"), + errorMessage: __("Failed to delete processing activity registry entry"), + }); + const confirm = useConfirm(); + + return () => { + confirm( + () => + mutate({ + variables: { + input: { + processingActivityRegistryId: registry.id, + }, + connections: [connectionId], + }, + }), + { + message: sprintf( + __( + "This will permanently delete the processing activity registry entry %s. This action cannot be undone." + ), + registry.name + ), + } + ); + }; +}; + +export const useCreateProcessingActivityRegistry = (connectionId?: string) => { + const [mutate] = useMutation(createProcessingActivityRegistryMutation); + const { __ } = useTranslate(); + + return (input: { + organizationId: string; + auditId: string; + name: string; + purpose?: string; + dataSubjectCategory?: string; + personalDataCategory?: string; + specialOrCriminalData?: string; + consentEvidenceLink?: string; + lawfulBasis?: string; + recipients?: string; + location?: string; + internationalTransfers: boolean; + transferSafeguards?: string; + retentionPeriod?: string; + securityMeasures?: string; + dataProtectionImpactAssessment?: string; + transferImpactAssessment?: string; + }) => { + if (!input.organizationId) { + return alert(__("Failed to create processing activity registry entry: organization is required")); + } + if (!input.name) { + return alert(__("Failed to create processing activity registry entry: name is required")); + } + if (!input.auditId) { + return alert(__("Failed to create processing activity registry entry: audit is required")); + } + + return promisifyMutation(mutate)({ + variables: { + input: { + organizationId: input.organizationId, + auditId: input.auditId, + name: input.name, + purpose: input.purpose, + dataSubjectCategory: input.dataSubjectCategory, + personalDataCategory: input.personalDataCategory, + specialOrCriminalData: input.specialOrCriminalData, + consentEvidenceLink: input.consentEvidenceLink, + lawfulBasis: input.lawfulBasis, + recipients: input.recipients, + location: input.location, + internationalTransfers: input.internationalTransfers, + transferSafeguards: input.transferSafeguards, + retentionPeriod: input.retentionPeriod, + securityMeasures: input.securityMeasures, + dataProtectionImpactAssessment: input.dataProtectionImpactAssessment, + transferImpactAssessment: input.transferImpactAssessment, + }, + connections: connectionId ? [connectionId] : [], + }, + }); + }; +}; + +export const useUpdateProcessingActivityRegistry = () => { + const [mutate] = useMutation(updateProcessingActivityRegistryMutation); + const { __ } = useTranslate(); + + return (input: { + id: string; + auditId?: string; + name?: string; + purpose?: string; + dataSubjectCategory?: string; + personalDataCategory?: string; + specialOrCriminalData?: string; + consentEvidenceLink?: string; + lawfulBasis?: string; + recipients?: string; + location?: string; + internationalTransfers?: boolean; + transferSafeguards?: string; + retentionPeriod?: string; + securityMeasures?: string; + dataProtectionImpactAssessment?: string; + transferImpactAssessment?: string; + }) => { + if (!input.id) { + return alert(__("Failed to update processing activity registry entry: registry ID is required")); + } + + return promisifyMutation(mutate)({ + variables: { + input, + }, + }); + }; +}; diff --git a/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphCreateMutation.graphql.ts b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphCreateMutation.graphql.ts new file mode 100644 index 000000000..955ae62c6 --- /dev/null +++ b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphCreateMutation.graphql.ts @@ -0,0 +1,419 @@ +/** + * @generated SignedSource<<8372cc0960f7642aa8619dbc091dc4de>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type ProcessingActivityRegistryDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED"; +export type ProcessingActivityRegistryLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS"; +export type ProcessingActivityRegistrySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES"; +export type ProcessingActivityRegistryTransferImpactAssessment = "NEEDED" | "NOT_NEEDED"; +export type ProcessingActivityRegistryTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES"; +export type CreateProcessingActivityRegistryInput = { + auditId: string; + consentEvidenceLink?: string | null | undefined; + dataProtectionImpactAssessment: ProcessingActivityRegistryDataProtectionImpactAssessment; + dataSubjectCategory?: string | null | undefined; + internationalTransfers: boolean; + lawfulBasis: ProcessingActivityRegistryLawfulBasis; + location?: string | null | undefined; + name: string; + organizationId: string; + personalDataCategory?: string | null | undefined; + purpose?: string | null | undefined; + recipients?: string | null | undefined; + retentionPeriod?: string | null | undefined; + securityMeasures?: string | null | undefined; + specialOrCriminalData: ProcessingActivityRegistrySpecialOrCriminalData; + transferImpactAssessment: ProcessingActivityRegistryTransferImpactAssessment; + transferSafeguards: ProcessingActivityRegistryTransferSafeguards; +}; +export type ProcessingActivityRegistryGraphCreateMutation$variables = { + connections: ReadonlyArray; + input: CreateProcessingActivityRegistryInput; +}; +export type ProcessingActivityRegistryGraphCreateMutation$data = { + readonly createProcessingActivityRegistry: { + readonly processingActivityRegistryEdge: { + readonly node: { + readonly audit: { + readonly framework: { + readonly name: string; + }; + readonly id: string; + readonly name: string | null | undefined; + }; + readonly consentEvidenceLink: string | null | undefined; + readonly createdAt: any; + readonly dataProtectionImpactAssessment: ProcessingActivityRegistryDataProtectionImpactAssessment; + readonly dataSubjectCategory: string | null | undefined; + readonly id: string; + readonly internationalTransfers: boolean; + readonly lawfulBasis: ProcessingActivityRegistryLawfulBasis; + readonly location: string | null | undefined; + readonly name: string; + readonly personalDataCategory: string | null | undefined; + readonly purpose: string | null | undefined; + readonly recipients: string | null | undefined; + readonly retentionPeriod: string | null | undefined; + readonly securityMeasures: string | null | undefined; + readonly specialOrCriminalData: ProcessingActivityRegistrySpecialOrCriminalData; + readonly transferImpactAssessment: ProcessingActivityRegistryTransferImpactAssessment; + readonly transferSafeguards: ProcessingActivityRegistryTransferSafeguards; + }; + }; + }; +}; +export type ProcessingActivityRegistryGraphCreateMutation = { + response: ProcessingActivityRegistryGraphCreateMutation$data; + variables: ProcessingActivityRegistryGraphCreateMutation$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "connections" +}, +v1 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "input" +}, +v2 = [ + { + "kind": "Variable", + "name": "input", + "variableName": "input" + } +], +v3 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v4 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}, +v5 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "purpose", + "storageKey": null +}, +v6 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataSubjectCategory", + "storageKey": null +}, +v7 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "personalDataCategory", + "storageKey": null +}, +v8 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "specialOrCriminalData", + "storageKey": null +}, +v9 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "consentEvidenceLink", + "storageKey": null +}, +v10 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "lawfulBasis", + "storageKey": null +}, +v11 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "recipients", + "storageKey": null +}, +v12 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "location", + "storageKey": null +}, +v13 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "internationalTransfers", + "storageKey": null +}, +v14 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "transferSafeguards", + "storageKey": null +}, +v15 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "retentionPeriod", + "storageKey": null +}, +v16 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "securityMeasures", + "storageKey": null +}, +v17 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataProtectionImpactAssessment", + "storageKey": null +}, +v18 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "transferImpactAssessment", + "storageKey": null +}, +v19 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "ProcessingActivityRegistryGraphCreateMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "CreateProcessingActivityRegistryPayload", + "kind": "LinkedField", + "name": "createProcessingActivityRegistry", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ProcessingActivityRegistryEdge", + "kind": "LinkedField", + "name": "processingActivityRegistryEdge", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ProcessingActivityRegistry", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + (v4/*: any*/), + (v5/*: any*/), + (v6/*: any*/), + (v7/*: any*/), + (v8/*: any*/), + (v9/*: any*/), + (v10/*: any*/), + (v11/*: any*/), + (v12/*: any*/), + (v13/*: any*/), + (v14/*: any*/), + (v15/*: any*/), + (v16/*: any*/), + (v17/*: any*/), + (v18/*: any*/), + { + "alias": null, + "args": null, + "concreteType": "Audit", + "kind": "LinkedField", + "name": "audit", + "plural": false, + "selections": [ + (v3/*: any*/), + (v4/*: any*/), + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": [ + (v4/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + }, + (v19/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], + "kind": "Operation", + "name": "ProcessingActivityRegistryGraphCreateMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "CreateProcessingActivityRegistryPayload", + "kind": "LinkedField", + "name": "createProcessingActivityRegistry", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ProcessingActivityRegistryEdge", + "kind": "LinkedField", + "name": "processingActivityRegistryEdge", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ProcessingActivityRegistry", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + (v4/*: any*/), + (v5/*: any*/), + (v6/*: any*/), + (v7/*: any*/), + (v8/*: any*/), + (v9/*: any*/), + (v10/*: any*/), + (v11/*: any*/), + (v12/*: any*/), + (v13/*: any*/), + (v14/*: any*/), + (v15/*: any*/), + (v16/*: any*/), + (v17/*: any*/), + (v18/*: any*/), + { + "alias": null, + "args": null, + "concreteType": "Audit", + "kind": "LinkedField", + "name": "audit", + "plural": false, + "selections": [ + (v3/*: any*/), + (v4/*: any*/), + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": [ + (v4/*: any*/), + (v3/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + }, + (v19/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "filters": null, + "handle": "prependEdge", + "key": "", + "kind": "LinkedHandle", + "name": "processingActivityRegistryEdge", + "handleArgs": [ + { + "kind": "Variable", + "name": "connections", + "variableName": "connections" + } + ] + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "9942999c0282d64a6250774f8a26f1f9", + "id": null, + "metadata": {}, + "name": "ProcessingActivityRegistryGraphCreateMutation", + "operationKind": "mutation", + "text": "mutation ProcessingActivityRegistryGraphCreateMutation(\n $input: CreateProcessingActivityRegistryInput!\n) {\n createProcessingActivityRegistry(input: $input) {\n processingActivityRegistryEdge {\n node {\n id\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n audit {\n id\n name\n framework {\n name\n id\n }\n }\n createdAt\n }\n }\n }\n}\n" + } +}; +})(); + +(node as any).hash = "7563c6519bb6f538e3c211322a5a638f"; + +export default node; diff --git a/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphDeleteMutation.graphql.ts b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphDeleteMutation.graphql.ts new file mode 100644 index 000000000..10b314c6e --- /dev/null +++ b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphDeleteMutation.graphql.ts @@ -0,0 +1,132 @@ +/** + * @generated SignedSource<<11633889a4d61df894b88dd483687cf9>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type DeleteProcessingActivityRegistryInput = { + processingActivityRegistryId: string; +}; +export type ProcessingActivityRegistryGraphDeleteMutation$variables = { + connections: ReadonlyArray; + input: DeleteProcessingActivityRegistryInput; +}; +export type ProcessingActivityRegistryGraphDeleteMutation$data = { + readonly deleteProcessingActivityRegistry: { + readonly deletedProcessingActivityRegistryId: string; + }; +}; +export type ProcessingActivityRegistryGraphDeleteMutation = { + response: ProcessingActivityRegistryGraphDeleteMutation$data; + variables: ProcessingActivityRegistryGraphDeleteMutation$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "connections" +}, +v1 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "input" +}, +v2 = [ + { + "kind": "Variable", + "name": "input", + "variableName": "input" + } +], +v3 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "deletedProcessingActivityRegistryId", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "ProcessingActivityRegistryGraphDeleteMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "DeleteProcessingActivityRegistryPayload", + "kind": "LinkedField", + "name": "deleteProcessingActivityRegistry", + "plural": false, + "selections": [ + (v3/*: any*/) + ], + "storageKey": null + } + ], + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], + "kind": "Operation", + "name": "ProcessingActivityRegistryGraphDeleteMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "DeleteProcessingActivityRegistryPayload", + "kind": "LinkedField", + "name": "deleteProcessingActivityRegistry", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "filters": null, + "handle": "deleteEdge", + "key": "", + "kind": "ScalarHandle", + "name": "deletedProcessingActivityRegistryId", + "handleArgs": [ + { + "kind": "Variable", + "name": "connections", + "variableName": "connections" + } + ] + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "7550d138c9636bbe930a5cdad260156b", + "id": null, + "metadata": {}, + "name": "ProcessingActivityRegistryGraphDeleteMutation", + "operationKind": "mutation", + "text": "mutation ProcessingActivityRegistryGraphDeleteMutation(\n $input: DeleteProcessingActivityRegistryInput!\n) {\n deleteProcessingActivityRegistry(input: $input) {\n deletedProcessingActivityRegistryId\n }\n}\n" + } +}; +})(); + +(node as any).hash = "8492e778e152e5910ee4c09c34ea4e68"; + +export default node; diff --git a/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphListQuery.graphql.ts b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphListQuery.graphql.ts new file mode 100644 index 000000000..7fffcff53 --- /dev/null +++ b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphListQuery.graphql.ts @@ -0,0 +1,322 @@ +/** + * @generated SignedSource<<44f708dc14c5476a3b7c8cf751aca32f>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +import { FragmentRefs } from "relay-runtime"; +export type ProcessingActivityRegistryGraphListQuery$variables = { + organizationId: string; +}; +export type ProcessingActivityRegistryGraphListQuery$data = { + readonly node: { + readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivityRegistriesPageFragment">; + }; +}; +export type ProcessingActivityRegistryGraphListQuery = { + response: ProcessingActivityRegistryGraphListQuery$data; + variables: ProcessingActivityRegistryGraphListQuery$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "organizationId" + } +], +v1 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "organizationId" + } +], +v2 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null +}, +v3 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v4 = [ + { + "kind": "Literal", + "name": "first", + "value": 10 + } +], +v5 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "ProcessingActivityRegistryGraphListQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "kind": "InlineFragment", + "selections": [ + { + "args": null, + "kind": "FragmentSpread", + "name": "ProcessingActivityRegistriesPageFragment" + } + ], + "type": "Organization", + "abstractKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "ProcessingActivityRegistryGraphListQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v2/*: any*/), + (v3/*: any*/), + { + "kind": "InlineFragment", + "selections": [ + { + "alias": null, + "args": (v4/*: any*/), + "concreteType": "ProcessingActivityRegistryConnection", + "kind": "LinkedField", + "name": "processingActivityRegistries", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "totalCount", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "ProcessingActivityRegistryEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ProcessingActivityRegistry", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + (v5/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "purpose", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataSubjectCategory", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "personalDataCategory", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "lawfulBasis", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "location", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "internationalTransfers", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Audit", + "kind": "LinkedField", + "name": "audit", + "plural": false, + "selections": [ + (v3/*: any*/), + (v5/*: any*/), + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": [ + (v3/*: any*/), + (v5/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "updatedAt", + "storageKey": null + }, + (v2/*: any*/) + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "cursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "endCursor", + "storageKey": null + } + ], + "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] + } + ], + "storageKey": "processingActivityRegistries(first:10)" + }, + { + "alias": null, + "args": (v4/*: any*/), + "filters": null, + "handle": "connection", + "key": "ProcessingActivityRegistriesPage_processingActivityRegistries", + "kind": "LinkedHandle", + "name": "processingActivityRegistries" + } + ], + "type": "Organization", + "abstractKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "b5b5c645e407c2bfb68aaa717b7d2ae7", + "id": null, + "metadata": {}, + "name": "ProcessingActivityRegistryGraphListQuery", + "operationKind": "query", + "text": "query ProcessingActivityRegistryGraphListQuery(\n $organizationId: ID!\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ProcessingActivityRegistriesPageFragment\n }\n id\n }\n}\n\nfragment ProcessingActivityRegistriesPageFragment on Organization {\n id\n processingActivityRegistries(first: 10) {\n totalCount\n edges {\n node {\n id\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n lawfulBasis\n location\n internationalTransfers\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n" + } +}; +})(); + +(node as any).hash = "c4a1ee426fd64c8605134d80ee873b62"; + +export default node; diff --git a/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphNodeQuery.graphql.ts b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphNodeQuery.graphql.ts new file mode 100644 index 000000000..64ed08a36 --- /dev/null +++ b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphNodeQuery.graphql.ts @@ -0,0 +1,352 @@ +/** + * @generated SignedSource<<681e1d8f8073e0efd781bdf322b893ab>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type ProcessingActivityRegistryDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED"; +export type ProcessingActivityRegistryLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS"; +export type ProcessingActivityRegistrySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES"; +export type ProcessingActivityRegistryTransferImpactAssessment = "NEEDED" | "NOT_NEEDED"; +export type ProcessingActivityRegistryTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES"; +export type ProcessingActivityRegistryGraphNodeQuery$variables = { + processingActivityRegistryId: string; +}; +export type ProcessingActivityRegistryGraphNodeQuery$data = { + readonly node: { + readonly audit?: { + readonly framework: { + readonly id: string; + readonly name: string; + }; + readonly id: string; + readonly name: string | null | undefined; + }; + readonly consentEvidenceLink?: string | null | undefined; + readonly createdAt?: any; + readonly dataProtectionImpactAssessment?: ProcessingActivityRegistryDataProtectionImpactAssessment; + readonly dataSubjectCategory?: string | null | undefined; + readonly id?: string; + readonly internationalTransfers?: boolean; + readonly lawfulBasis?: ProcessingActivityRegistryLawfulBasis; + readonly location?: string | null | undefined; + readonly name?: string; + readonly organization?: { + readonly id: string; + readonly name: string; + }; + readonly personalDataCategory?: string | null | undefined; + readonly purpose?: string | null | undefined; + readonly recipients?: string | null | undefined; + readonly retentionPeriod?: string | null | undefined; + readonly securityMeasures?: string | null | undefined; + readonly specialOrCriminalData?: ProcessingActivityRegistrySpecialOrCriminalData; + readonly transferImpactAssessment?: ProcessingActivityRegistryTransferImpactAssessment; + readonly transferSafeguards?: ProcessingActivityRegistryTransferSafeguards; + readonly updatedAt?: any; + }; +}; +export type ProcessingActivityRegistryGraphNodeQuery = { + response: ProcessingActivityRegistryGraphNodeQuery$data; + variables: ProcessingActivityRegistryGraphNodeQuery$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "processingActivityRegistryId" + } +], +v1 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "processingActivityRegistryId" + } +], +v2 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v3 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}, +v4 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "purpose", + "storageKey": null +}, +v5 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataSubjectCategory", + "storageKey": null +}, +v6 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "personalDataCategory", + "storageKey": null +}, +v7 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "specialOrCriminalData", + "storageKey": null +}, +v8 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "consentEvidenceLink", + "storageKey": null +}, +v9 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "lawfulBasis", + "storageKey": null +}, +v10 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "recipients", + "storageKey": null +}, +v11 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "location", + "storageKey": null +}, +v12 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "internationalTransfers", + "storageKey": null +}, +v13 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "transferSafeguards", + "storageKey": null +}, +v14 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "retentionPeriod", + "storageKey": null +}, +v15 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "securityMeasures", + "storageKey": null +}, +v16 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataProtectionImpactAssessment", + "storageKey": null +}, +v17 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "transferImpactAssessment", + "storageKey": null +}, +v18 = [ + (v2/*: any*/), + (v3/*: any*/) +], +v19 = { + "alias": null, + "args": null, + "concreteType": "Audit", + "kind": "LinkedField", + "name": "audit", + "plural": false, + "selections": [ + (v2/*: any*/), + (v3/*: any*/), + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": (v18/*: any*/), + "storageKey": null + } + ], + "storageKey": null +}, +v20 = { + "alias": null, + "args": null, + "concreteType": "Organization", + "kind": "LinkedField", + "name": "organization", + "plural": false, + "selections": (v18/*: any*/), + "storageKey": null +}, +v21 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null +}, +v22 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "updatedAt", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "ProcessingActivityRegistryGraphNodeQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "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*/), + (v15/*: any*/), + (v16/*: any*/), + (v17/*: any*/), + (v19/*: any*/), + (v20/*: any*/), + (v21/*: any*/), + (v22/*: any*/) + ], + "type": "ProcessingActivityRegistry", + "abstractKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "ProcessingActivityRegistryGraphNodeQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + (v2/*: any*/), + { + "kind": "InlineFragment", + "selections": [ + (v3/*: any*/), + (v4/*: any*/), + (v5/*: any*/), + (v6/*: any*/), + (v7/*: any*/), + (v8/*: any*/), + (v9/*: any*/), + (v10/*: any*/), + (v11/*: any*/), + (v12/*: any*/), + (v13/*: any*/), + (v14/*: any*/), + (v15/*: any*/), + (v16/*: any*/), + (v17/*: any*/), + (v19/*: any*/), + (v20/*: any*/), + (v21/*: any*/), + (v22/*: any*/) + ], + "type": "ProcessingActivityRegistry", + "abstractKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "74eed9b882f3bf3b11af0c15f65ef870", + "id": null, + "metadata": {}, + "name": "ProcessingActivityRegistryGraphNodeQuery", + "operationKind": "query", + "text": "query ProcessingActivityRegistryGraphNodeQuery(\n $processingActivityRegistryId: ID!\n) {\n node(id: $processingActivityRegistryId) {\n __typename\n ... on ProcessingActivityRegistry {\n id\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n" + } +}; +})(); + +(node as any).hash = "979f4b05c845c90dd6359d24821e44fd"; + +export default node; diff --git a/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphUpdateMutation.graphql.ts b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphUpdateMutation.graphql.ts new file mode 100644 index 000000000..e9cb1e5da --- /dev/null +++ b/apps/console/src/hooks/graph/__generated__/ProcessingActivityRegistryGraphUpdateMutation.graphql.ts @@ -0,0 +1,290 @@ +/** + * @generated SignedSource<<945fa4ed1c5bab25f39047b601307e03>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type ProcessingActivityRegistryDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED"; +export type ProcessingActivityRegistryLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS"; +export type ProcessingActivityRegistrySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES"; +export type ProcessingActivityRegistryTransferImpactAssessment = "NEEDED" | "NOT_NEEDED"; +export type ProcessingActivityRegistryTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES"; +export type UpdateProcessingActivityRegistryInput = { + auditId?: string | null | undefined; + consentEvidenceLink?: string | null | undefined; + dataProtectionImpactAssessment?: ProcessingActivityRegistryDataProtectionImpactAssessment | null | undefined; + dataSubjectCategory?: string | null | undefined; + id: string; + internationalTransfers?: boolean | null | undefined; + lawfulBasis?: ProcessingActivityRegistryLawfulBasis | null | undefined; + location?: string | null | undefined; + name?: string | null | undefined; + personalDataCategory?: string | null | undefined; + purpose?: string | null | undefined; + recipients?: string | null | undefined; + retentionPeriod?: string | null | undefined; + securityMeasures?: string | null | undefined; + specialOrCriminalData?: ProcessingActivityRegistrySpecialOrCriminalData | null | undefined; + transferImpactAssessment?: ProcessingActivityRegistryTransferImpactAssessment | null | undefined; + transferSafeguards?: ProcessingActivityRegistryTransferSafeguards | null | undefined; +}; +export type ProcessingActivityRegistryGraphUpdateMutation$variables = { + input: UpdateProcessingActivityRegistryInput; +}; +export type ProcessingActivityRegistryGraphUpdateMutation$data = { + readonly updateProcessingActivityRegistry: { + readonly processingActivityRegistry: { + readonly audit: { + readonly framework: { + readonly id: string; + readonly name: string; + }; + readonly id: string; + readonly name: string | null | undefined; + }; + readonly consentEvidenceLink: string | null | undefined; + readonly dataProtectionImpactAssessment: ProcessingActivityRegistryDataProtectionImpactAssessment; + readonly dataSubjectCategory: string | null | undefined; + readonly id: string; + readonly internationalTransfers: boolean; + readonly lawfulBasis: ProcessingActivityRegistryLawfulBasis; + readonly location: string | null | undefined; + readonly name: string; + readonly personalDataCategory: string | null | undefined; + readonly purpose: string | null | undefined; + readonly recipients: string | null | undefined; + readonly retentionPeriod: string | null | undefined; + readonly securityMeasures: string | null | undefined; + readonly specialOrCriminalData: ProcessingActivityRegistrySpecialOrCriminalData; + readonly transferImpactAssessment: ProcessingActivityRegistryTransferImpactAssessment; + readonly transferSafeguards: ProcessingActivityRegistryTransferSafeguards; + readonly updatedAt: any; + }; + }; +}; +export type ProcessingActivityRegistryGraphUpdateMutation = { + response: ProcessingActivityRegistryGraphUpdateMutation$data; + variables: ProcessingActivityRegistryGraphUpdateMutation$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "input" + } +], +v1 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v2 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}, +v3 = [ + { + "alias": null, + "args": [ + { + "kind": "Variable", + "name": "input", + "variableName": "input" + } + ], + "concreteType": "UpdateProcessingActivityRegistryPayload", + "kind": "LinkedField", + "name": "updateProcessingActivityRegistry", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ProcessingActivityRegistry", + "kind": "LinkedField", + "name": "processingActivityRegistry", + "plural": false, + "selections": [ + (v1/*: any*/), + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "purpose", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataSubjectCategory", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "personalDataCategory", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "specialOrCriminalData", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "consentEvidenceLink", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "lawfulBasis", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "recipients", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "location", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "internationalTransfers", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "transferSafeguards", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "retentionPeriod", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "securityMeasures", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "dataProtectionImpactAssessment", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "transferImpactAssessment", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Audit", + "kind": "LinkedField", + "name": "audit", + "plural": false, + "selections": [ + (v1/*: any*/), + (v2/*: any*/), + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": [ + (v1/*: any*/), + (v2/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "updatedAt", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } +]; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "ProcessingActivityRegistryGraphUpdateMutation", + "selections": (v3/*: any*/), + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "ProcessingActivityRegistryGraphUpdateMutation", + "selections": (v3/*: any*/) + }, + "params": { + "cacheID": "40f01e772e5377add784e6c455b173a9", + "id": null, + "metadata": {}, + "name": "ProcessingActivityRegistryGraphUpdateMutation", + "operationKind": "mutation", + "text": "mutation ProcessingActivityRegistryGraphUpdateMutation(\n $input: UpdateProcessingActivityRegistryInput!\n) {\n updateProcessingActivityRegistry(input: $input) {\n processingActivityRegistry {\n id\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n updatedAt\n }\n }\n}\n" + } +}; +})(); + +(node as any).hash = "0833d096c755275a5255d98276922c04"; + +export default node; diff --git a/apps/console/src/layouts/MainLayout.tsx b/apps/console/src/layouts/MainLayout.tsx index 90df4310c..541452d89 100644 --- a/apps/console/src/layouts/MainLayout.tsx +++ b/apps/console/src/layouts/MainLayout.tsx @@ -19,6 +19,7 @@ import { IconBox, IconShield, IconRotateCw, + IconCircleProgress, Layout, SidebarItem, UserDropdown as UserDropdownRoot, @@ -157,6 +158,11 @@ export function MainLayout() { icon={IconRotateCw} to={`${prefix}/continual-improvement-registries`} /> + ; +} + +const processingActivityRegistriesPageFragment = graphql` + fragment ProcessingActivityRegistriesPageFragment on Organization + @refetchable(queryName: "ProcessingActivityRegistriesPageRefetchQuery") + @argumentDefinitions( + first: { type: "Int", defaultValue: 10 } + after: { type: "CursorKey" } + ) { + id + processingActivityRegistries(first: $first, after: $after) + @connection(key: "ProcessingActivityRegistriesPage_processingActivityRegistries") { + __id + totalCount + edges { + node { + id + name + purpose + dataSubjectCategory + personalDataCategory + lawfulBasis + location + internationalTransfers + audit { + id + name + framework { + id + name + } + } + createdAt + updatedAt + } + } + pageInfo { + hasNextPage + endCursor + } + } + } +`; + +export default function ProcessingActivityRegistriesPage({ queryRef }: ProcessingActivityRegistriesPageProps) { + const { __ } = useTranslate(); + const organizationId = useOrganizationId(); + + usePageTitle(__("Processing Activity Registries")); + + const organization = usePreloadedQuery( + graphql` + query ProcessingActivityRegistriesPageQuery($organizationId: ID!) { + node(id: $organizationId) { + ... on Organization { + ...ProcessingActivityRegistriesPageFragment + } + } + } + `, + queryRef + ); + + const { + data, + loadNext, + hasNext, + isLoadingNext, + } = usePaginationFragment< + ProcessingActivityRegistriesPageQuery, + ProcessingActivityRegistriesPageFragment$key + >(processingActivityRegistriesPageFragment, organization.node); + if (!data) { + return
{__("Organization not found")}
; + } + + const connectionId = ConnectionHandler.getConnectionID( + organizationId, + ProcessingActivityRegistriesConnectionKey + ); + const registries = data?.processingActivityRegistries?.edges?.map((edge) => edge.node) ?? []; + + return ( +
+ + + + + + + {registries.length > 0 ? ( + + + + + + + + + + + + + + + + {registries.map((registry) => ( + + ))} + +
{__("Name")}{__("Purpose")}{__("Data Subject")}{__("Lawful Basis")}{__("Location")}{__("International Transfers")}{__("Audit")}{__("Actions")}
+ + {hasNext && ( +
+ +
+ )} +
+ ) : ( + +
+

+ {__("No processing activity registry entries yet")} +

+

+ {__("Create your first processing activity registry entry to get started with GDPR compliance.")} +

+
+
+ )} +
+ ); +} + +function RegistryRow({ + registry, + connectionId, +}: { + registry: NodeOf>; + connectionId: string; +}) { + const organizationId = useOrganizationId(); + const { __ } = useTranslate(); + const [deleteRegistry] = useMutation(deleteProcessingActivityRegistryMutation); + const confirm = useConfirm(); + + const handleDelete = () => { + confirm( + () => + promisifyMutation(deleteRegistry)({ + variables: { + input: { + processingActivityRegistryId: registry.id, + }, + connections: [connectionId], + }, + }), + { + message: sprintf( + __( + "This will permanently delete the processing activity registry entry %s. This action cannot be undone." + ), + registry.name + ), + } + ); + }; + + return ( + + + {registry.name} + + + + {registry.purpose || "-"} + + + {registry.dataSubjectCategory || "-"} + {getLawfulBasisLabel(registry.lawfulBasis, __)} + {registry.location || "-"} + + + {registry.internationalTransfers ? __("Yes") : __("No")} + + + + {registry.audit.name + ? `${registry.audit.framework.name} - ${registry.audit.name}` + : registry.audit.framework.name + } + + + + + {__("Delete")} + + + + + ); +} diff --git a/apps/console/src/pages/organizations/processingActivityRegistries/ProcessingActivityRegistryDetailsPage.tsx b/apps/console/src/pages/organizations/processingActivityRegistries/ProcessingActivityRegistryDetailsPage.tsx new file mode 100644 index 000000000..3dbebec51 --- /dev/null +++ b/apps/console/src/pages/organizations/processingActivityRegistries/ProcessingActivityRegistryDetailsPage.tsx @@ -0,0 +1,386 @@ +import { + ConnectionHandler, + usePreloadedQuery, + type PreloadedQuery, +} from "react-relay"; +import { + processingActivityRegistryNodeQuery, + useDeleteProcessingActivityRegistry, + useUpdateProcessingActivityRegistry, + ProcessingActivityRegistriesConnectionKey, +} from "../../../hooks/graph/ProcessingActivityRegistryGraph"; +import { + ActionDropdown, + Breadcrumb, + Button, + DropdownItem, + Field, + Card, + Textarea, + useToast, + Label, + Checkbox, + Select, +} from "@probo/ui"; +import { useTranslate } from "@probo/i18n"; +import { useOrganizationId } from "/hooks/useOrganizationId"; +import { AuditSelectField } from "/components/form/AuditSelectField"; +import { useFormWithSchema } from "/hooks/useFormWithSchema"; +import { Controller } from "react-hook-form"; +import z from "zod"; +import { + SpecialOrCriminalDataOptions, + LawfulBasisOptions, + TransferSafeguardsOptions, + DataProtectionImpactAssessmentOptions, + TransferImpactAssessmentOptions, +} from "../../../components/form/ProcessingActivityRegistryEnumOptions"; + +import type { ProcessingActivityRegistryGraphNodeQuery } from "/hooks/graph/__generated__/ProcessingActivityRegistryGraphNodeQuery.graphql"; + +const updateRegistrySchema = z.object({ + name: z.string().min(1, "Name is required"), + purpose: z.string().optional(), + dataSubjectCategory: z.string().optional(), + personalDataCategory: z.string().optional(), + specialOrCriminalData: z.enum(["YES", "NO", "POSSIBLE"] as const), + consentEvidenceLink: z.string().optional(), + lawfulBasis: z.enum(["CONSENT", "CONTRACTUAL_NECESSITY", "LEGAL_OBLIGATION", "LEGITIMATE_INTEREST", "PUBLIC_TASK", "VITAL_INTERESTS"] as const), + recipients: z.string().optional(), + location: z.string().optional(), + internationalTransfers: z.boolean(), + transferSafeguards: z.string(), + retentionPeriod: z.string().optional(), + securityMeasures: z.string().optional(), + dataProtectionImpactAssessment: z.enum(["NEEDED", "NOT_NEEDED"] as const), + transferImpactAssessment: z.enum(["NEEDED", "NOT_NEEDED"] as const), + auditId: z.string().min(1, "Audit is required"), +}); + +type Props = { + queryRef: PreloadedQuery; +}; + +export default function ProcessingActivityRegistryDetailsPage(props: Props) { + const data = usePreloadedQuery(processingActivityRegistryNodeQuery, props.queryRef); + const registry = data.node; + const { __ } = useTranslate(); + const { toast } = useToast(); + const organizationId = useOrganizationId(); + + if (!registry) { + return
{__("Processing activity registry entry not found")}
; + } + + const updateRegistry = useUpdateProcessingActivityRegistry(); + + const connectionId = ConnectionHandler.getConnectionID( + organizationId, + ProcessingActivityRegistriesConnectionKey + ); + + const deleteRegistry = useDeleteProcessingActivityRegistry({ id: registry.id!, name: registry.name! }, connectionId); + + const { register, handleSubmit, formState, control } = useFormWithSchema( + updateRegistrySchema, + { + defaultValues: { + name: registry.name || "", + purpose: registry.purpose || "", + dataSubjectCategory: registry.dataSubjectCategory || "", + personalDataCategory: registry.personalDataCategory || "", + specialOrCriminalData: registry.specialOrCriminalData || "NO" as const, + consentEvidenceLink: registry.consentEvidenceLink || "", + lawfulBasis: registry.lawfulBasis || "LEGITIMATE_INTEREST" as const, + recipients: registry.recipients || "", + location: registry.location || "", + internationalTransfers: registry.internationalTransfers || false, + transferSafeguards: registry.transferSafeguards || "__NONE__", + retentionPeriod: registry.retentionPeriod || "", + securityMeasures: registry.securityMeasures || "", + dataProtectionImpactAssessment: registry.dataProtectionImpactAssessment || "NOT_NEEDED" as const, + transferImpactAssessment: registry.transferImpactAssessment || "NOT_NEEDED" as const, + auditId: registry.audit?.id || "", + }, + } + ); + + const onSubmit = handleSubmit(async (formData) => { + try { + await updateRegistry({ + id: registry.id!, + auditId: formData.auditId || undefined, + name: formData.name, + purpose: formData.purpose || undefined, + dataSubjectCategory: formData.dataSubjectCategory || undefined, + personalDataCategory: formData.personalDataCategory || undefined, + specialOrCriminalData: formData.specialOrCriminalData || undefined, + consentEvidenceLink: formData.consentEvidenceLink || undefined, + lawfulBasis: formData.lawfulBasis || undefined, + recipients: formData.recipients || undefined, + location: formData.location || undefined, + internationalTransfers: formData.internationalTransfers, + transferSafeguards: formData.transferSafeguards === "__NONE__" ? undefined : formData.transferSafeguards || undefined, + retentionPeriod: formData.retentionPeriod || undefined, + securityMeasures: formData.securityMeasures || undefined, + dataProtectionImpactAssessment: formData.dataProtectionImpactAssessment || undefined, + transferImpactAssessment: formData.transferImpactAssessment || undefined, + }); + + toast({ + title: __("Success"), + description: __("Processing activity registry entry updated successfully"), + variant: "success", + }); + } catch (error) { + toast({ + title: __("Error"), + description: __("Failed to update processing activity registry entry"), + variant: "error", + }); + } + }); + + return ( +
+
+ + + + {__("Delete")} + + +
+ + +
+
+
+

{registry.name}

+
+
+ +
+
+
+ + + + +
+ +