From 4bdf941d3a5c1f3b93471c12e4f8702768f935f3 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Wed, 21 Jan 2026 10:35:13 -0800 Subject: [PATCH] Refactor SOA Signed-off-by: Bryan Frimin --- ...tyStatementDialogCreateMutation.graphql.ts | 274 ++ ...tyStatementDialogDeleteMutation.graphql.ts | 132 + ...plicabilityStatementDialogQuery.graphql.ts | 352 ++ ...tyStatementDialogUpdateMutation.graphql.ts | 123 + ...teOfApplicabilityDialogMutation.graphql.ts | 273 ++ .../EditControlDialogLinkMutation.graphql.ts | 194 - ...EditControlDialogUpdateMutation.graphql.ts | 123 + ...achStateOfApplicabilityMutation.graphql.ts | 237 - ...achStateOfApplicabilityMutation.graphql.ts | 153 - .../FrameworkGraphControlNodeQuery.graphql.ts | 323 +- .../LinkControlDialogLinkMutation.graphql.ts | 194 - .../core/LinkControlDialogQuery.graphql.ts | 211 - ...LinkControlDialogUnlinkMutation.graphql.ts | 109 - ...atesOfApplicabilityCardFragment.graphql.ts | 39 +- ...bilityControlsTabDeleteMutation.graphql.ts | 132 + ...pplicabilityControlsTabFragment.graphql.ts | 443 +- ...cabilityControlsTabRefetchQuery.graphql.ts | 273 -- ...bilityControlsTabUnlinkMutation.graphql.ts | 109 - ...abilityDetailPageDeleteMutation.graphql.ts | 132 + ...eOfApplicabilityDetailPageQuery.graphql.ts | 492 ++ ...bilityDetailPageUpdateMutation.graphql.ts} | 24 +- ...pplicabilityGraphCreateMutation.graphql.ts | 200 - ...fApplicabilityGraphForEditQuery.graphql.ts | 218 - ...teOfApplicabilityGraphNodeQuery.graphql.ts | 417 -- ...ApplicabilityRowDeleteMutation.graphql.ts} | 24 +- ...StateOfApplicabilityRowFragment.graphql.ts | 93 + ...tesOfApplicabilityPageFragment.graphql.ts} | 108 +- ...plicabilityPagePaginationQuery.graphql.ts} | 68 +- ...StatesOfApplicabilityPageQuery.graphql.ts} | 68 +- .../LinkedStatesOfApplicabilityCard.tsx | 24 +- .../console/src/hooks/graph/FrameworkGraph.ts | 16 - .../hooks/graph/StateOfApplicabilityGraph.ts | 244 - .../frameworks/FrameworkControlPage.tsx | 300 +- .../StateOfApplicabilityDetailPage.tsx | 144 +- .../StateOfApplicabilityDetailPageLoader.tsx | 30 + .../StatesOfApplicabilityPage.tsx | 149 +- .../StatesOfApplicabilityPageLoader.tsx | 28 + .../_components/StateOfApplicabilityRow.tsx | 127 + .../AddApplicabilityStatementDialog.tsx | 525 ++ .../CreateStateOfApplicabilityDialog.tsx | 38 +- .../dialogs/EditControlDialog.tsx | 251 +- .../dialogs/LinkControlDialog.tsx | 153 +- .../tabs/StateOfApplicabilityControlsTab.tsx | 206 +- .../tabs/StateOfApplicabilityOverviewTab.tsx | 56 - .../src/routes/statesOfApplicabilityRoutes.ts | 54 +- ..._control.go => applicability_statement.go} | 387 +- .../applicability_statement_order_field.go | 52 + pkg/coredata/control.go | 121 +- pkg/coredata/control_obligation.go | 46 +- pkg/coredata/control_obligation_filter.go | 45 + pkg/coredata/entity_type_reg.go | 6 +- pkg/coredata/framework.go | 47 + pkg/coredata/migrations/20260102T134633Z.sql | 22 +- pkg/coredata/migrations/20260121T150000Z.sql | 11 + pkg/coredata/state_of_applicability.go | 14 +- pkg/probo/actions.go | 8 +- pkg/probo/control_service.go | 155 +- pkg/probo/policies.go | 2 +- pkg/probo/state_of_applicability_service.go | 294 +- pkg/server/api/console/v1/schema.graphql | 148 +- pkg/server/api/console/v1/schema/schema.go | 4242 ++++++++--------- .../applicability_statement_connection.go | 84 + ...ate_of_applicability_control_connection.go | 76 - pkg/server/api/console/v1/types/types.go | 166 +- pkg/server/api/console/v1/v1_resolver.go | 268 +- 65 files changed, 7106 insertions(+), 6971 deletions(-) create mode 100644 apps/console/src/__generated__/core/AddApplicabilityStatementDialogCreateMutation.graphql.ts create mode 100644 apps/console/src/__generated__/core/AddApplicabilityStatementDialogDeleteMutation.graphql.ts create mode 100644 apps/console/src/__generated__/core/AddApplicabilityStatementDialogQuery.graphql.ts create mode 100644 apps/console/src/__generated__/core/AddApplicabilityStatementDialogUpdateMutation.graphql.ts create mode 100644 apps/console/src/__generated__/core/CreateStateOfApplicabilityDialogMutation.graphql.ts delete mode 100644 apps/console/src/__generated__/core/EditControlDialogLinkMutation.graphql.ts create mode 100644 apps/console/src/__generated__/core/EditControlDialogUpdateMutation.graphql.ts delete mode 100644 apps/console/src/__generated__/core/FrameworkControlPageAttachStateOfApplicabilityMutation.graphql.ts delete mode 100644 apps/console/src/__generated__/core/FrameworkControlPageDetachStateOfApplicabilityMutation.graphql.ts delete mode 100644 apps/console/src/__generated__/core/LinkControlDialogLinkMutation.graphql.ts delete mode 100644 apps/console/src/__generated__/core/LinkControlDialogQuery.graphql.ts delete mode 100644 apps/console/src/__generated__/core/LinkControlDialogUnlinkMutation.graphql.ts create mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityControlsTabDeleteMutation.graphql.ts delete mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityControlsTabRefetchQuery.graphql.ts delete mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityControlsTabUnlinkMutation.graphql.ts create mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityDetailPageDeleteMutation.graphql.ts create mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityDetailPageQuery.graphql.ts rename apps/console/src/__generated__/core/{StateOfApplicabilityGraphUpdateMutation.graphql.ts => StateOfApplicabilityDetailPageUpdateMutation.graphql.ts} (77%) delete mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityGraphCreateMutation.graphql.ts delete mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityGraphForEditQuery.graphql.ts delete mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityGraphNodeQuery.graphql.ts rename apps/console/src/__generated__/core/{StateOfApplicabilityGraphDeleteMutation.graphql.ts => StateOfApplicabilityRowDeleteMutation.graphql.ts} (74%) create mode 100644 apps/console/src/__generated__/core/StateOfApplicabilityRowFragment.graphql.ts rename apps/console/src/__generated__/core/{StateOfApplicabilityGraphPaginatedFragment.graphql.ts => StatesOfApplicabilityPageFragment.graphql.ts} (57%) rename apps/console/src/__generated__/core/{StateOfApplicabilityListQuery.graphql.ts => StatesOfApplicabilityPagePaginationQuery.graphql.ts} (75%) rename apps/console/src/__generated__/core/{StateOfApplicabilityGraphPaginatedQuery.graphql.ts => StatesOfApplicabilityPageQuery.graphql.ts} (73%) delete mode 100644 apps/console/src/hooks/graph/StateOfApplicabilityGraph.ts create mode 100644 apps/console/src/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPageLoader.tsx create mode 100644 apps/console/src/pages/organizations/states-of-applicability/StatesOfApplicabilityPageLoader.tsx create mode 100644 apps/console/src/pages/organizations/states-of-applicability/_components/StateOfApplicabilityRow.tsx create mode 100644 apps/console/src/pages/organizations/states-of-applicability/dialogs/AddApplicabilityStatementDialog.tsx delete mode 100644 apps/console/src/pages/organizations/states-of-applicability/tabs/StateOfApplicabilityOverviewTab.tsx rename pkg/coredata/{state_of_applicability_control.go => applicability_statement.go} (52%) create mode 100644 pkg/coredata/applicability_statement_order_field.go create mode 100644 pkg/coredata/control_obligation_filter.go create mode 100644 pkg/coredata/migrations/20260121T150000Z.sql create mode 100644 pkg/server/api/console/v1/types/applicability_statement_connection.go delete mode 100644 pkg/server/api/console/v1/types/state_of_applicability_control_connection.go diff --git a/apps/console/src/__generated__/core/AddApplicabilityStatementDialogCreateMutation.graphql.ts b/apps/console/src/__generated__/core/AddApplicabilityStatementDialogCreateMutation.graphql.ts new file mode 100644 index 000000000..f413d8aad --- /dev/null +++ b/apps/console/src/__generated__/core/AddApplicabilityStatementDialogCreateMutation.graphql.ts @@ -0,0 +1,274 @@ +/** + * @generated SignedSource<<4f5d3e4c56b185607505d82119176eb5>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type CreateApplicabilityStatementInput = { + applicability: boolean; + controlId: string; + justification?: string | null | undefined; + stateOfApplicabilityId: string; +}; +export type AddApplicabilityStatementDialogCreateMutation$variables = { + connections: ReadonlyArray; + input: CreateApplicabilityStatementInput; +}; +export type AddApplicabilityStatementDialogCreateMutation$data = { + readonly createApplicabilityStatement: { + readonly applicabilityStatementEdge: { + readonly node: { + readonly applicability: boolean; + readonly control: { + readonly bestPractice: boolean; + readonly contractual: boolean; + readonly framework: { + readonly id: string; + readonly name: string; + }; + readonly id: string; + readonly name: string; + readonly organization: { + readonly id: string; + } | null | undefined; + readonly regulatory: boolean; + readonly riskAssessment: boolean; + readonly sectionTitle: string; + }; + readonly id: string; + readonly justification: string; + }; + }; + }; +}; +export type AddApplicabilityStatementDialogCreateMutation = { + response: AddApplicabilityStatementDialogCreateMutation$data; + variables: AddApplicabilityStatementDialogCreateMutation$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, + "concreteType": "ApplicabilityStatementEdge", + "kind": "LinkedField", + "name": "applicabilityStatementEdge", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ApplicabilityStatement", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "applicability", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "justification", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Control", + "kind": "LinkedField", + "name": "control", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "sectionTitle", + "storageKey": null + }, + (v4/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "bestPractice", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "regulatory", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "contractual", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "riskAssessment", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": [ + (v3/*: any*/), + (v4/*: any*/) + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Organization", + "kind": "LinkedField", + "name": "organization", + "plural": false, + "selections": [ + (v3/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "AddApplicabilityStatementDialogCreateMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "CreateApplicabilityStatementPayload", + "kind": "LinkedField", + "name": "createApplicabilityStatement", + "plural": false, + "selections": [ + (v5/*: any*/) + ], + "storageKey": null + } + ], + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], + "kind": "Operation", + "name": "AddApplicabilityStatementDialogCreateMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "CreateApplicabilityStatementPayload", + "kind": "LinkedField", + "name": "createApplicabilityStatement", + "plural": false, + "selections": [ + (v5/*: any*/), + { + "alias": null, + "args": null, + "filters": null, + "handle": "appendEdge", + "key": "", + "kind": "LinkedHandle", + "name": "applicabilityStatementEdge", + "handleArgs": [ + { + "kind": "Variable", + "name": "connections", + "variableName": "connections" + } + ] + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "df832d2f8d480328039fdcf85bf9187c", + "id": null, + "metadata": {}, + "name": "AddApplicabilityStatementDialogCreateMutation", + "operationKind": "mutation", + "text": "mutation AddApplicabilityStatementDialogCreateMutation(\n $input: CreateApplicabilityStatementInput!\n) {\n createApplicabilityStatement(input: $input) {\n applicabilityStatementEdge {\n node {\n id\n applicability\n justification\n control {\n id\n sectionTitle\n name\n bestPractice\n regulatory\n contractual\n riskAssessment\n framework {\n id\n name\n }\n organization {\n id\n }\n }\n }\n }\n }\n}\n" + } +}; +})(); + +(node as any).hash = "ddf10370932006893422c8cfb47e5587"; + +export default node; diff --git a/apps/console/src/__generated__/core/AddApplicabilityStatementDialogDeleteMutation.graphql.ts b/apps/console/src/__generated__/core/AddApplicabilityStatementDialogDeleteMutation.graphql.ts new file mode 100644 index 000000000..8fbbe8ca2 --- /dev/null +++ b/apps/console/src/__generated__/core/AddApplicabilityStatementDialogDeleteMutation.graphql.ts @@ -0,0 +1,132 @@ +/** + * @generated SignedSource<> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type DeleteApplicabilityStatementInput = { + applicabilityStatementId: string; +}; +export type AddApplicabilityStatementDialogDeleteMutation$variables = { + connections: ReadonlyArray; + input: DeleteApplicabilityStatementInput; +}; +export type AddApplicabilityStatementDialogDeleteMutation$data = { + readonly deleteApplicabilityStatement: { + readonly deletedApplicabilityStatementId: string; + }; +}; +export type AddApplicabilityStatementDialogDeleteMutation = { + response: AddApplicabilityStatementDialogDeleteMutation$data; + variables: AddApplicabilityStatementDialogDeleteMutation$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": "deletedApplicabilityStatementId", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "AddApplicabilityStatementDialogDeleteMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "DeleteApplicabilityStatementPayload", + "kind": "LinkedField", + "name": "deleteApplicabilityStatement", + "plural": false, + "selections": [ + (v3/*: any*/) + ], + "storageKey": null + } + ], + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], + "kind": "Operation", + "name": "AddApplicabilityStatementDialogDeleteMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "DeleteApplicabilityStatementPayload", + "kind": "LinkedField", + "name": "deleteApplicabilityStatement", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "filters": null, + "handle": "deleteEdge", + "key": "", + "kind": "ScalarHandle", + "name": "deletedApplicabilityStatementId", + "handleArgs": [ + { + "kind": "Variable", + "name": "connections", + "variableName": "connections" + } + ] + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "33d1b54d91487d7c3fcbc8ff8bcb68ce", + "id": null, + "metadata": {}, + "name": "AddApplicabilityStatementDialogDeleteMutation", + "operationKind": "mutation", + "text": "mutation AddApplicabilityStatementDialogDeleteMutation(\n $input: DeleteApplicabilityStatementInput!\n) {\n deleteApplicabilityStatement(input: $input) {\n deletedApplicabilityStatementId\n }\n}\n" + } +}; +})(); + +(node as any).hash = "965c5b50e3a2a077fb7dc287b70026f1"; + +export default node; diff --git a/apps/console/src/__generated__/core/AddApplicabilityStatementDialogQuery.graphql.ts b/apps/console/src/__generated__/core/AddApplicabilityStatementDialogQuery.graphql.ts new file mode 100644 index 000000000..6b471de4a --- /dev/null +++ b/apps/console/src/__generated__/core/AddApplicabilityStatementDialogQuery.graphql.ts @@ -0,0 +1,352 @@ +/** + * @generated SignedSource<<0a75f5819022ec5555d7c3d8b4098e1c>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type AddApplicabilityStatementDialogQuery$variables = { + organizationId: string; + stateOfApplicabilityId: string; +}; +export type AddApplicabilityStatementDialogQuery$data = { + readonly organization: { + readonly controls?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly framework: { + readonly id: string; + readonly name: string; + }; + readonly id: string; + readonly name: string; + readonly sectionTitle: string; + }; + }>; + }; + readonly id?: string; + }; + readonly stateOfApplicability: { + readonly applicabilityStatements?: { + readonly edges: ReadonlyArray<{ + readonly node: { + readonly applicability: boolean; + readonly control: { + readonly id: string; + }; + readonly id: string; + readonly justification: string; + }; + }>; + }; + readonly id?: string; + }; +}; +export type AddApplicabilityStatementDialogQuery = { + response: AddApplicabilityStatementDialogQuery$data; + variables: AddApplicabilityStatementDialogQuery$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "organizationId" +}, +v1 = { + "defaultValue": null, + "kind": "LocalArgument", + "name": "stateOfApplicabilityId" +}, +v2 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "stateOfApplicabilityId" + } +], +v3 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v4 = { + "kind": "Literal", + "name": "first", + "value": 10000 +}, +v5 = { + "alias": null, + "args": [ + (v4/*: any*/) + ], + "concreteType": "ApplicabilityStatementConnection", + "kind": "LinkedField", + "name": "applicabilityStatements", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ApplicabilityStatementEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ApplicabilityStatement", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "applicability", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "justification", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Control", + "kind": "LinkedField", + "name": "control", + "plural": false, + "selections": [ + (v3/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": "applicabilityStatements(first:10000)" +}, +v6 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "organizationId" + } +], +v7 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}, +v8 = { + "alias": null, + "args": [ + (v4/*: any*/), + { + "kind": "Literal", + "name": "orderBy", + "value": { + "direction": "ASC", + "field": "CREATED_AT" + } + } + ], + "concreteType": "ControlConnection", + "kind": "LinkedField", + "name": "controls", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ControlEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Control", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "sectionTitle", + "storageKey": null + }, + (v7/*: any*/), + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": [ + (v3/*: any*/), + (v7/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": "controls(first:10000,orderBy:{\"direction\":\"ASC\",\"field\":\"CREATED_AT\"})" +}, +v9 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "AddApplicabilityStatementDialogQuery", + "selections": [ + { + "alias": "stateOfApplicability", + "args": (v2/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "kind": "InlineFragment", + "selections": [ + (v3/*: any*/), + (v5/*: any*/) + ], + "type": "StateOfApplicability", + "abstractKey": null + } + ], + "storageKey": null + }, + { + "alias": "organization", + "args": (v6/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "kind": "InlineFragment", + "selections": [ + (v3/*: any*/), + (v8/*: any*/) + ], + "type": "Organization", + "abstractKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], + "kind": "Operation", + "name": "AddApplicabilityStatementDialogQuery", + "selections": [ + { + "alias": "stateOfApplicability", + "args": (v2/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v9/*: any*/), + (v3/*: any*/), + { + "kind": "InlineFragment", + "selections": [ + (v5/*: any*/) + ], + "type": "StateOfApplicability", + "abstractKey": null + } + ], + "storageKey": null + }, + { + "alias": "organization", + "args": (v6/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v9/*: any*/), + (v3/*: any*/), + { + "kind": "InlineFragment", + "selections": [ + (v8/*: any*/) + ], + "type": "Organization", + "abstractKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "ac6bc824dd185cea6fe2928f8292eff1", + "id": null, + "metadata": {}, + "name": "AddApplicabilityStatementDialogQuery", + "operationKind": "query", + "text": "query AddApplicabilityStatementDialogQuery(\n $stateOfApplicabilityId: ID!\n $organizationId: ID!\n) {\n stateOfApplicability: node(id: $stateOfApplicabilityId) {\n __typename\n ... on StateOfApplicability {\n id\n applicabilityStatements(first: 10000) {\n edges {\n node {\n id\n applicability\n justification\n control {\n id\n }\n }\n }\n }\n }\n id\n }\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n controls(first: 10000, orderBy: {direction: ASC, field: CREATED_AT}) {\n edges {\n node {\n id\n sectionTitle\n name\n framework {\n id\n name\n }\n }\n }\n }\n }\n id\n }\n}\n" + } +}; +})(); + +(node as any).hash = "dd10dd30b76ae39eca5953e71f7d2d02"; + +export default node; diff --git a/apps/console/src/__generated__/core/AddApplicabilityStatementDialogUpdateMutation.graphql.ts b/apps/console/src/__generated__/core/AddApplicabilityStatementDialogUpdateMutation.graphql.ts new file mode 100644 index 000000000..be16f101e --- /dev/null +++ b/apps/console/src/__generated__/core/AddApplicabilityStatementDialogUpdateMutation.graphql.ts @@ -0,0 +1,123 @@ +/** + * @generated SignedSource<<43adbd5c0838293beac5a5f900fe47bd>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type UpdateApplicabilityStatementInput = { + applicability: boolean; + applicabilityStatementId: string; + justification?: string | null | undefined; +}; +export type AddApplicabilityStatementDialogUpdateMutation$variables = { + input: UpdateApplicabilityStatementInput; +}; +export type AddApplicabilityStatementDialogUpdateMutation$data = { + readonly updateApplicabilityStatement: { + readonly applicabilityStatement: { + readonly applicability: boolean; + readonly id: string; + readonly justification: string; + }; + }; +}; +export type AddApplicabilityStatementDialogUpdateMutation = { + response: AddApplicabilityStatementDialogUpdateMutation$data; + variables: AddApplicabilityStatementDialogUpdateMutation$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "input" + } +], +v1 = [ + { + "alias": null, + "args": [ + { + "kind": "Variable", + "name": "input", + "variableName": "input" + } + ], + "concreteType": "UpdateApplicabilityStatementPayload", + "kind": "LinkedField", + "name": "updateApplicabilityStatement", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ApplicabilityStatement", + "kind": "LinkedField", + "name": "applicabilityStatement", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "applicability", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "justification", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } +]; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "AddApplicabilityStatementDialogUpdateMutation", + "selections": (v1/*: any*/), + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "AddApplicabilityStatementDialogUpdateMutation", + "selections": (v1/*: any*/) + }, + "params": { + "cacheID": "b3f6f94a9c59775234d78ac8695211f0", + "id": null, + "metadata": {}, + "name": "AddApplicabilityStatementDialogUpdateMutation", + "operationKind": "mutation", + "text": "mutation AddApplicabilityStatementDialogUpdateMutation(\n $input: UpdateApplicabilityStatementInput!\n) {\n updateApplicabilityStatement(input: $input) {\n applicabilityStatement {\n id\n applicability\n justification\n }\n }\n}\n" + } +}; +})(); + +(node as any).hash = "8c801c1409e926a39c67b1c20741e501"; + +export default node; diff --git a/apps/console/src/__generated__/core/CreateStateOfApplicabilityDialogMutation.graphql.ts b/apps/console/src/__generated__/core/CreateStateOfApplicabilityDialogMutation.graphql.ts new file mode 100644 index 000000000..6ed29028f --- /dev/null +++ b/apps/console/src/__generated__/core/CreateStateOfApplicabilityDialogMutation.graphql.ts @@ -0,0 +1,273 @@ +/** + * @generated SignedSource<> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +import { FragmentRefs } from "relay-runtime"; +export type CreateStateOfApplicabilityInput = { + name: string; + organizationId: string; + ownerId: string; +}; +export type CreateStateOfApplicabilityDialogMutation$variables = { + connections: ReadonlyArray; + input: CreateStateOfApplicabilityInput; +}; +export type CreateStateOfApplicabilityDialogMutation$data = { + readonly createStateOfApplicability: { + readonly stateOfApplicabilityEdge: { + readonly node: { + readonly canDelete: boolean; + readonly createdAt: string; + readonly id: string; + readonly name: string; + readonly snapshotId: string | null | undefined; + readonly sourceId: string | null | undefined; + readonly updatedAt: string; + readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityRowFragment">; + }; + }; + }; +}; +export type CreateStateOfApplicabilityDialogMutation = { + response: CreateStateOfApplicabilityDialogMutation$data; + variables: CreateStateOfApplicabilityDialogMutation$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": "sourceId", + "storageKey": null +}, +v6 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "snapshotId", + "storageKey": null +}, +v7 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null +}, +v8 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "updatedAt", + "storageKey": null +}, +v9 = { + "alias": "canDelete", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:state-of-applicability:delete" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:state-of-applicability:delete\")" +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "CreateStateOfApplicabilityDialogMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "CreateStateOfApplicabilityPayload", + "kind": "LinkedField", + "name": "createStateOfApplicability", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "StateOfApplicabilityEdge", + "kind": "LinkedField", + "name": "stateOfApplicabilityEdge", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "StateOfApplicability", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + (v4/*: any*/), + (v5/*: any*/), + (v6/*: any*/), + (v7/*: any*/), + (v8/*: any*/), + (v9/*: any*/), + { + "args": null, + "kind": "FragmentSpread", + "name": "StateOfApplicabilityRowFragment" + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], + "kind": "Operation", + "name": "CreateStateOfApplicabilityDialogMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "CreateStateOfApplicabilityPayload", + "kind": "LinkedField", + "name": "createStateOfApplicability", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "StateOfApplicabilityEdge", + "kind": "LinkedField", + "name": "stateOfApplicabilityEdge", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "StateOfApplicability", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v3/*: any*/), + (v4/*: any*/), + (v5/*: any*/), + (v6/*: any*/), + (v7/*: any*/), + (v8/*: any*/), + (v9/*: any*/), + { + "alias": "statementsInfo", + "args": null, + "concreteType": "ApplicabilityStatementConnection", + "kind": "LinkedField", + "name": "applicabilityStatements", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "totalCount", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "filters": null, + "handle": "prependEdge", + "key": "", + "kind": "LinkedHandle", + "name": "stateOfApplicabilityEdge", + "handleArgs": [ + { + "kind": "Variable", + "name": "connections", + "variableName": "connections" + } + ] + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "cabae20b2fee98a353eaefaad0a28b4b", + "id": null, + "metadata": {}, + "name": "CreateStateOfApplicabilityDialogMutation", + "operationKind": "mutation", + "text": "mutation CreateStateOfApplicabilityDialogMutation(\n $input: CreateStateOfApplicabilityInput!\n) {\n createStateOfApplicability(input: $input) {\n stateOfApplicabilityEdge {\n node {\n id\n name\n sourceId\n snapshotId\n createdAt\n updatedAt\n canDelete: permission(action: \"core:state-of-applicability:delete\")\n ...StateOfApplicabilityRowFragment\n }\n }\n }\n}\n\nfragment StateOfApplicabilityRowFragment on StateOfApplicability {\n id\n name\n createdAt\n canDelete: permission(action: \"core:state-of-applicability:delete\")\n statementsInfo: applicabilityStatements {\n totalCount\n }\n}\n" + } +}; +})(); + +(node as any).hash = "e5a7d1dc6b0401246d646dde983bc8a0"; + +export default node; diff --git a/apps/console/src/__generated__/core/EditControlDialogLinkMutation.graphql.ts b/apps/console/src/__generated__/core/EditControlDialogLinkMutation.graphql.ts deleted file mode 100644 index 4cab21a6a..000000000 --- a/apps/console/src/__generated__/core/EditControlDialogLinkMutation.graphql.ts +++ /dev/null @@ -1,194 +0,0 @@ -/** - * @generated SignedSource<<100330ea65f9914591271a9a1f78fd2e>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type CreateStateOfApplicabilityControlMappingInput = { - applicability: boolean; - controlId: string; - justification?: string | null | undefined; - stateOfApplicabilityId: string; -}; -export type EditControlDialogLinkMutation$variables = { - input: CreateStateOfApplicabilityControlMappingInput; -}; -export type EditControlDialogLinkMutation$data = { - readonly createStateOfApplicabilityControlMapping: { - readonly stateOfApplicabilityControlEdge: { - readonly node: { - readonly applicability: boolean; - readonly controlId: string; - readonly justification: string | null | undefined; - readonly stateOfApplicabilityId: string; - }; - }; - }; -}; -export type EditControlDialogLinkMutation = { - response: EditControlDialogLinkMutation$data; - variables: EditControlDialogLinkMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" - } -], -v1 = [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } -], -v2 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null -}, -v3 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null -}, -v4 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "applicability", - "storageKey": null -}, -v5 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "justification", - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "EditControlDialogLinkMutation", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": "CreateStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "createStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControlEdge", - "kind": "LinkedField", - "name": "stateOfApplicabilityControlEdge", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControl", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/) - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "EditControlDialogLinkMutation", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": "CreateStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "createStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControlEdge", - "kind": "LinkedField", - "name": "stateOfApplicabilityControlEdge", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControl", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "e15d97ea6b798532fb82fc577cbccd64", - "id": null, - "metadata": {}, - "name": "EditControlDialogLinkMutation", - "operationKind": "mutation", - "text": "mutation EditControlDialogLinkMutation(\n $input: CreateStateOfApplicabilityControlMappingInput!\n) {\n createStateOfApplicabilityControlMapping(input: $input) {\n stateOfApplicabilityControlEdge {\n node {\n stateOfApplicabilityId\n controlId\n applicability\n justification\n id\n }\n }\n }\n}\n" - } -}; -})(); - -(node as any).hash = "e7a83ce3daa0051a0b2bb03b0429f2c4"; - -export default node; diff --git a/apps/console/src/__generated__/core/EditControlDialogUpdateMutation.graphql.ts b/apps/console/src/__generated__/core/EditControlDialogUpdateMutation.graphql.ts new file mode 100644 index 000000000..887d99b4f --- /dev/null +++ b/apps/console/src/__generated__/core/EditControlDialogUpdateMutation.graphql.ts @@ -0,0 +1,123 @@ +/** + * @generated SignedSource<<9a29546b80fe0ae4776de8cf81d600a3>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type UpdateApplicabilityStatementInput = { + applicability: boolean; + applicabilityStatementId: string; + justification?: string | null | undefined; +}; +export type EditControlDialogUpdateMutation$variables = { + input: UpdateApplicabilityStatementInput; +}; +export type EditControlDialogUpdateMutation$data = { + readonly updateApplicabilityStatement: { + readonly applicabilityStatement: { + readonly applicability: boolean; + readonly id: string; + readonly justification: string; + }; + }; +}; +export type EditControlDialogUpdateMutation = { + response: EditControlDialogUpdateMutation$data; + variables: EditControlDialogUpdateMutation$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "input" + } +], +v1 = [ + { + "alias": null, + "args": [ + { + "kind": "Variable", + "name": "input", + "variableName": "input" + } + ], + "concreteType": "UpdateApplicabilityStatementPayload", + "kind": "LinkedField", + "name": "updateApplicabilityStatement", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ApplicabilityStatement", + "kind": "LinkedField", + "name": "applicabilityStatement", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "applicability", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "justification", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } +]; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "EditControlDialogUpdateMutation", + "selections": (v1/*: any*/), + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "EditControlDialogUpdateMutation", + "selections": (v1/*: any*/) + }, + "params": { + "cacheID": "eaddaf695c16db04636c4d8a79ce6346", + "id": null, + "metadata": {}, + "name": "EditControlDialogUpdateMutation", + "operationKind": "mutation", + "text": "mutation EditControlDialogUpdateMutation(\n $input: UpdateApplicabilityStatementInput!\n) {\n updateApplicabilityStatement(input: $input) {\n applicabilityStatement {\n id\n applicability\n justification\n }\n }\n}\n" + } +}; +})(); + +(node as any).hash = "51acae7db47e2eac1afd6a677abca126"; + +export default node; diff --git a/apps/console/src/__generated__/core/FrameworkControlPageAttachStateOfApplicabilityMutation.graphql.ts b/apps/console/src/__generated__/core/FrameworkControlPageAttachStateOfApplicabilityMutation.graphql.ts deleted file mode 100644 index 6d42c4798..000000000 --- a/apps/console/src/__generated__/core/FrameworkControlPageAttachStateOfApplicabilityMutation.graphql.ts +++ /dev/null @@ -1,237 +0,0 @@ -/** - * @generated SignedSource<<6798ad28a0faeedef40b1b0a89f7563e>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type CreateStateOfApplicabilityControlMappingInput = { - applicability: boolean; - controlId: string; - justification?: string | null | undefined; - stateOfApplicabilityId: string; -}; -export type FrameworkControlPageAttachStateOfApplicabilityMutation$variables = { - connections: ReadonlyArray; - input: CreateStateOfApplicabilityControlMappingInput; -}; -export type FrameworkControlPageAttachStateOfApplicabilityMutation$data = { - readonly createStateOfApplicabilityControlMapping: { - readonly stateOfApplicabilityControlEdge: { - readonly node: { - readonly id: string; - readonly " $fragmentSpreads": FragmentRefs<"LinkedStatesOfApplicabilityCardFragment">; - }; - }; - }; -}; -export type FrameworkControlPageAttachStateOfApplicabilityMutation = { - response: FrameworkControlPageAttachStateOfApplicabilityMutation$data; - variables: FrameworkControlPageAttachStateOfApplicabilityMutation$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 -}; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "FrameworkControlPageAttachStateOfApplicabilityMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "CreateStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "createStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControlEdge", - "kind": "LinkedField", - "name": "stateOfApplicabilityControlEdge", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControl", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v3/*: any*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "LinkedStatesOfApplicabilityCardFragment" - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v1/*: any*/), - (v0/*: any*/) - ], - "kind": "Operation", - "name": "FrameworkControlPageAttachStateOfApplicabilityMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "CreateStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "createStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControlEdge", - "kind": "LinkedField", - "name": "stateOfApplicabilityControlEdge", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControl", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v3/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicability", - "kind": "LinkedField", - "name": "stateOfApplicability", - "plural": false, - "selections": [ - (v3/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "applicability", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "justification", - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - }, - { - "alias": null, - "args": null, - "filters": null, - "handle": "prependEdge", - "key": "", - "kind": "LinkedHandle", - "name": "stateOfApplicabilityControlEdge", - "handleArgs": [ - { - "kind": "Variable", - "name": "connections", - "variableName": "connections" - } - ] - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "205bc4f133e268c943ef9df9881350f0", - "id": null, - "metadata": {}, - "name": "FrameworkControlPageAttachStateOfApplicabilityMutation", - "operationKind": "mutation", - "text": "mutation FrameworkControlPageAttachStateOfApplicabilityMutation(\n $input: CreateStateOfApplicabilityControlMappingInput!\n) {\n createStateOfApplicabilityControlMapping(input: $input) {\n stateOfApplicabilityControlEdge {\n node {\n id\n ...LinkedStatesOfApplicabilityCardFragment\n }\n }\n }\n}\n\nfragment LinkedStatesOfApplicabilityCardFragment on StateOfApplicabilityControl {\n id\n stateOfApplicabilityId\n controlId\n stateOfApplicability {\n id\n name\n }\n applicability\n justification\n}\n" - } -}; -})(); - -(node as any).hash = "8da7bd1e22eb2eaf857a4e97cea47e90"; - -export default node; diff --git a/apps/console/src/__generated__/core/FrameworkControlPageDetachStateOfApplicabilityMutation.graphql.ts b/apps/console/src/__generated__/core/FrameworkControlPageDetachStateOfApplicabilityMutation.graphql.ts deleted file mode 100644 index 0a647fe72..000000000 --- a/apps/console/src/__generated__/core/FrameworkControlPageDetachStateOfApplicabilityMutation.graphql.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type DeleteStateOfApplicabilityControlMappingInput = { - controlId: string; - stateOfApplicabilityId: string; -}; -export type FrameworkControlPageDetachStateOfApplicabilityMutation$variables = { - connections: ReadonlyArray; - input: DeleteStateOfApplicabilityControlMappingInput; -}; -export type FrameworkControlPageDetachStateOfApplicabilityMutation$data = { - readonly deleteStateOfApplicabilityControlMapping: { - readonly deletedControlId: string; - readonly deletedStateOfApplicabilityControlId: string; - readonly deletedStateOfApplicabilityId: string; - }; -}; -export type FrameworkControlPageDetachStateOfApplicabilityMutation = { - response: FrameworkControlPageDetachStateOfApplicabilityMutation$data; - variables: FrameworkControlPageDetachStateOfApplicabilityMutation$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": "deletedStateOfApplicabilityId", - "storageKey": null -}, -v4 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedControlId", - "storageKey": null -}, -v5 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedStateOfApplicabilityControlId", - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "FrameworkControlPageDetachStateOfApplicabilityMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "DeleteStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "deleteStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/) - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v1/*: any*/), - (v0/*: any*/) - ], - "kind": "Operation", - "name": "FrameworkControlPageDetachStateOfApplicabilityMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "DeleteStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "deleteStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/), - { - "alias": null, - "args": null, - "filters": null, - "handle": "deleteEdge", - "key": "", - "kind": "ScalarHandle", - "name": "deletedStateOfApplicabilityControlId", - "handleArgs": [ - { - "kind": "Variable", - "name": "connections", - "variableName": "connections" - } - ] - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "f0ec8162516546b2cdd221c0c9832908", - "id": null, - "metadata": {}, - "name": "FrameworkControlPageDetachStateOfApplicabilityMutation", - "operationKind": "mutation", - "text": "mutation FrameworkControlPageDetachStateOfApplicabilityMutation(\n $input: DeleteStateOfApplicabilityControlMappingInput!\n) {\n deleteStateOfApplicabilityControlMapping(input: $input) {\n deletedStateOfApplicabilityId\n deletedControlId\n deletedStateOfApplicabilityControlId\n }\n}\n" - } -}; -})(); - -(node as any).hash = "f1a4efbd039ed9f457905903df50a160"; - -export default node; diff --git a/apps/console/src/__generated__/core/FrameworkGraphControlNodeQuery.graphql.ts b/apps/console/src/__generated__/core/FrameworkGraphControlNodeQuery.graphql.ts index 363fc2dd8..202d89cfa 100644 --- a/apps/console/src/__generated__/core/FrameworkGraphControlNodeQuery.graphql.ts +++ b/apps/console/src/__generated__/core/FrameworkGraphControlNodeQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<194328b415c68a01a447d4646639b3c0>> + * @generated SignedSource<<482fcc03a3fd95b31f5d574a1b03a84c>> * @lightSyntaxTransform * @nogrep */ @@ -30,14 +30,12 @@ export type FrameworkGraphControlNodeQuery$data = { readonly canCreateMeasureMapping?: boolean; readonly canCreateObligationMapping?: boolean; readonly canCreateSnapshotMapping?: boolean; - readonly canCreateStateOfApplicabilityMapping?: boolean; readonly canDelete?: boolean; readonly canDeleteAuditMapping?: boolean; readonly canDeleteDocumentMapping?: boolean; readonly canDeleteMeasureMapping?: boolean; readonly canDeleteObligationMapping?: boolean; readonly canDeleteSnapshotMapping?: boolean; - readonly canDeleteStateOfApplicabilityMapping?: boolean; readonly canUpdate?: boolean; readonly description?: string | null | undefined; readonly documents?: { @@ -80,15 +78,6 @@ export type FrameworkGraphControlNodeQuery$data = { }; }>; }; - readonly stateOfApplicabilityControls?: { - readonly __id: string; - readonly edges: ReadonlyArray<{ - readonly node: { - readonly id: string; - readonly " $fragmentSpreads": FragmentRefs<"LinkedStatesOfApplicabilityCardFragment">; - }; - }>; - }; readonly status?: ControlStatus; readonly " $fragmentSpreads": FragmentRefs<"FrameworkControlDialogFragment">; }; @@ -286,32 +275,6 @@ v17 = { "storageKey": "permission(action:\"core:control:delete-snapshot-mapping\")" }, v18 = { - "alias": "canCreateStateOfApplicabilityMapping", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:control:state-of-applicability-control-mapping:create" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:control:state-of-applicability-control-mapping:create\")" -}, -v19 = { - "alias": "canDeleteStateOfApplicabilityMapping", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:control:state-of-applicability-control-mapping:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:control:state-of-applicability-control-mapping:delete\")" -}, -v20 = { "alias": "canCreateObligationMapping", "args": [ { @@ -324,7 +287,7 @@ v20 = { "name": "permission", "storageKey": "permission(action:\"core:control:obligation-control-mapping:create\")" }, -v21 = { +v19 = { "alias": "canDeleteObligationMapping", "args": [ { @@ -337,21 +300,21 @@ v21 = { "name": "permission", "storageKey": "permission(action:\"core:control:obligation-control-mapping:delete\")" }, -v22 = { +v20 = { "alias": null, "args": null, "kind": "ScalarField", "name": "__typename", "storageKey": null }, -v23 = { +v21 = { "alias": null, "args": null, "kind": "ScalarField", "name": "cursor", "storageKey": null }, -v24 = { +v22 = { "alias": null, "args": null, "concreteType": "PageInfo", @@ -376,7 +339,7 @@ v24 = { ], "storageKey": null }, -v25 = { +v23 = { "kind": "ClientExtension", "selections": [ { @@ -388,25 +351,21 @@ v25 = { } ] }, -v26 = [ +v24 = [ { "kind": "Literal", "name": "first", "value": 100 } ], -v27 = [ - (v2/*: any*/), - (v3/*: any*/) -], -v28 = { +v25 = { "alias": null, "args": null, "kind": "ScalarField", "name": "state", "storageKey": null }, -v29 = { +v26 = { "alias": null, "args": null, "kind": "ScalarField", @@ -449,56 +408,11 @@ return { (v17/*: any*/), (v18/*: any*/), (v19/*: any*/), - (v20/*: any*/), - (v21/*: any*/), { "args": null, "kind": "FragmentSpread", "name": "FrameworkControlDialogFragment" }, - { - "alias": "stateOfApplicabilityControls", - "args": null, - "concreteType": "StateOfApplicabilityControlConnection", - "kind": "LinkedField", - "name": "__FrameworkGraphControl_stateOfApplicabilityControls_connection", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControlEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControl", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "LinkedStatesOfApplicabilityCardFragment" - }, - (v22/*: any*/) - ], - "storageKey": null - }, - (v23/*: any*/) - ], - "storageKey": null - }, - (v24/*: any*/), - (v25/*: any*/) - ], - "storageKey": null - }, { "alias": "measures", "args": null, @@ -529,16 +443,16 @@ return { "kind": "FragmentSpread", "name": "LinkedMeasuresCardFragment" }, - (v22/*: any*/) + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": null }, @@ -572,16 +486,16 @@ return { "kind": "FragmentSpread", "name": "LinkedDocumentsCardFragment" }, - (v22/*: any*/) + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": null }, @@ -615,16 +529,16 @@ return { "kind": "FragmentSpread", "name": "LinkedAuditsCardFragment" }, - (v22/*: any*/) + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": null }, @@ -658,16 +572,16 @@ return { "kind": "FragmentSpread", "name": "LinkedObligationsCardFragment" }, - (v22/*: any*/) + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": null }, @@ -701,16 +615,16 @@ return { "kind": "FragmentSpread", "name": "LinkedSnapshotsCardFragment" }, - (v22/*: any*/) + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": null } @@ -739,7 +653,7 @@ return { "name": "node", "plural": false, "selections": [ - (v22/*: any*/), + (v20/*: any*/), (v2/*: any*/), { "kind": "InlineFragment", @@ -761,8 +675,6 @@ return { (v17/*: any*/), (v18/*: any*/), (v19/*: any*/), - (v20/*: any*/), - (v21/*: any*/), { "alias": null, "args": null, @@ -772,92 +684,7 @@ return { }, { "alias": null, - "args": (v26/*: any*/), - "concreteType": "StateOfApplicabilityControlConnection", - "kind": "LinkedField", - "name": "stateOfApplicabilityControls", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControlEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControl", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicability", - "kind": "LinkedField", - "name": "stateOfApplicability", - "plural": false, - "selections": (v27/*: any*/), - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "applicability", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "justification", - "storageKey": null - }, - (v22/*: any*/) - ], - "storageKey": null - }, - (v23/*: any*/) - ], - "storageKey": null - }, - (v24/*: any*/), - (v25/*: any*/) - ], - "storageKey": "stateOfApplicabilityControls(first:100)" - }, - { - "alias": null, - "args": (v26/*: any*/), - "filters": null, - "handle": "connection", - "key": "FrameworkGraphControl_stateOfApplicabilityControls", - "kind": "LinkedHandle", - "name": "stateOfApplicabilityControls" - }, - { - "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "concreteType": "MeasureConnection", "kind": "LinkedField", "name": "measures", @@ -881,23 +708,23 @@ return { "selections": [ (v2/*: any*/), (v3/*: any*/), - (v28/*: any*/), - (v22/*: any*/) + (v25/*: any*/), + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": "measures(first:100)" }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "filters": null, "handle": "connection", "key": "FrameworkGraphControl_measures", @@ -906,7 +733,7 @@ return { }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "concreteType": "DocumentConnection", "kind": "LinkedField", "name": "documents", @@ -936,7 +763,7 @@ return { "name": "title", "storageKey": null }, - (v29/*: any*/), + (v26/*: any*/), { "alias": null, "args": null, @@ -985,22 +812,22 @@ return { ], "storageKey": "versions(first:1)" }, - (v22/*: any*/) + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": "documents(first:100)" }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "filters": null, "handle": "connection", "key": "FrameworkGraphControl_documents", @@ -1009,7 +836,7 @@ return { }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "concreteType": "AuditConnection", "kind": "LinkedField", "name": "audits", @@ -1033,8 +860,8 @@ return { "selections": [ (v2/*: any*/), (v3/*: any*/), - (v29/*: any*/), - (v28/*: any*/), + (v26/*: any*/), + (v25/*: any*/), { "alias": null, "args": null, @@ -1056,25 +883,28 @@ return { "kind": "LinkedField", "name": "framework", "plural": false, - "selections": (v27/*: any*/), + "selections": [ + (v2/*: any*/), + (v3/*: any*/) + ], "storageKey": null }, - (v22/*: any*/) + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": "audits(first:100)" }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "filters": null, "handle": "connection", "key": "FrameworkGraphControl_audits", @@ -1083,7 +913,7 @@ return { }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "concreteType": "ObligationConnection", "kind": "LinkedField", "name": "obligations", @@ -1147,22 +977,22 @@ return { ], "storageKey": null }, - (v22/*: any*/) + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": "obligations(first:100)" }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "filters": null, "handle": "connection", "key": "FrameworkGraphControl_obligations", @@ -1171,7 +1001,7 @@ return { }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "concreteType": "SnapshotConnection", "kind": "LinkedField", "name": "snapshots", @@ -1203,23 +1033,23 @@ return { "name": "type", "storageKey": null }, - (v29/*: any*/), - (v22/*: any*/) + (v26/*: any*/), + (v20/*: any*/) ], "storageKey": null }, - (v23/*: any*/) + (v21/*: any*/) ], "storageKey": null }, - (v24/*: any*/), - (v25/*: any*/) + (v22/*: any*/), + (v23/*: any*/) ], "storageKey": "snapshots(first:100)" }, { "alias": null, - "args": (v26/*: any*/), + "args": (v24/*: any*/), "filters": null, "handle": "connection", "key": "FrameworkGraphControl_snapshots", @@ -1236,19 +1066,10 @@ return { ] }, "params": { - "cacheID": "83f936f5dced0f50c645aa6ef30efedc", + "cacheID": "edefbc65624dd3df20c5769b4294c010", "id": null, "metadata": { "connection": [ - { - "count": null, - "cursor": null, - "direction": "forward", - "path": [ - "node", - "stateOfApplicabilityControls" - ] - }, { "count": null, "cursor": null, @@ -1298,11 +1119,11 @@ return { }, "name": "FrameworkGraphControlNodeQuery", "operationKind": "query", - "text": "query FrameworkGraphControlNodeQuery(\n $controlId: ID!\n) {\n node(id: $controlId) {\n __typename\n ... on Control {\n id\n name\n sectionTitle\n description\n status\n exclusionJustification\n canUpdate: permission(action: \"core:control:update\")\n canDelete: permission(action: \"core:control:delete\")\n canCreateMeasureMapping: permission(action: \"core:control:create-measure-mapping\")\n canDeleteMeasureMapping: permission(action: \"core:control:delete-measure-mapping\")\n canCreateDocumentMapping: permission(action: \"core:control:create-document-mapping\")\n canDeleteDocumentMapping: permission(action: \"core:control:delete-document-mapping\")\n canCreateAuditMapping: permission(action: \"core:control:create-audit-mapping\")\n canDeleteAuditMapping: permission(action: \"core:control:delete-audit-mapping\")\n canCreateSnapshotMapping: permission(action: \"core:control:create-snapshot-mapping\")\n canDeleteSnapshotMapping: permission(action: \"core:control:delete-snapshot-mapping\")\n canCreateStateOfApplicabilityMapping: permission(action: \"core:control:state-of-applicability-control-mapping:create\")\n canDeleteStateOfApplicabilityMapping: permission(action: \"core:control:state-of-applicability-control-mapping:delete\")\n canCreateObligationMapping: permission(action: \"core:control:obligation-control-mapping:create\")\n canDeleteObligationMapping: permission(action: \"core:control:obligation-control-mapping:delete\")\n ...FrameworkControlDialogFragment\n stateOfApplicabilityControls(first: 100) {\n edges {\n node {\n id\n ...LinkedStatesOfApplicabilityCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n measures(first: 100) {\n edges {\n node {\n id\n ...LinkedMeasuresCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n documents(first: 100) {\n edges {\n node {\n id\n ...LinkedDocumentsCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n audits(first: 100) {\n edges {\n node {\n id\n ...LinkedAuditsCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n obligations(first: 100) {\n edges {\n node {\n id\n ...LinkedObligationsCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n snapshots(first: 100) {\n edges {\n node {\n id\n ...LinkedSnapshotsCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n\nfragment FrameworkControlDialogFragment on Control {\n id\n name\n description\n sectionTitle\n status\n exclusionJustification\n bestPractice\n}\n\nfragment LinkedAuditsCardFragment on Audit {\n id\n name\n createdAt\n state\n validFrom\n validUntil\n framework {\n id\n name\n }\n}\n\nfragment LinkedDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment LinkedMeasuresCardFragment on Measure {\n id\n name\n state\n}\n\nfragment LinkedObligationsCardFragment on Obligation {\n id\n requirement\n area\n source\n status\n owner {\n fullName\n id\n }\n}\n\nfragment LinkedSnapshotsCardFragment on Snapshot {\n id\n name\n description\n type\n createdAt\n}\n\nfragment LinkedStatesOfApplicabilityCardFragment on StateOfApplicabilityControl {\n id\n stateOfApplicabilityId\n controlId\n stateOfApplicability {\n id\n name\n }\n applicability\n justification\n}\n" + "text": "query FrameworkGraphControlNodeQuery(\n $controlId: ID!\n) {\n node(id: $controlId) {\n __typename\n ... on Control {\n id\n name\n sectionTitle\n description\n status\n exclusionJustification\n canUpdate: permission(action: \"core:control:update\")\n canDelete: permission(action: \"core:control:delete\")\n canCreateMeasureMapping: permission(action: \"core:control:create-measure-mapping\")\n canDeleteMeasureMapping: permission(action: \"core:control:delete-measure-mapping\")\n canCreateDocumentMapping: permission(action: \"core:control:create-document-mapping\")\n canDeleteDocumentMapping: permission(action: \"core:control:delete-document-mapping\")\n canCreateAuditMapping: permission(action: \"core:control:create-audit-mapping\")\n canDeleteAuditMapping: permission(action: \"core:control:delete-audit-mapping\")\n canCreateSnapshotMapping: permission(action: \"core:control:create-snapshot-mapping\")\n canDeleteSnapshotMapping: permission(action: \"core:control:delete-snapshot-mapping\")\n canCreateObligationMapping: permission(action: \"core:control:obligation-control-mapping:create\")\n canDeleteObligationMapping: permission(action: \"core:control:obligation-control-mapping:delete\")\n ...FrameworkControlDialogFragment\n measures(first: 100) {\n edges {\n node {\n id\n ...LinkedMeasuresCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n documents(first: 100) {\n edges {\n node {\n id\n ...LinkedDocumentsCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n audits(first: 100) {\n edges {\n node {\n id\n ...LinkedAuditsCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n obligations(first: 100) {\n edges {\n node {\n id\n ...LinkedObligationsCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n snapshots(first: 100) {\n edges {\n node {\n id\n ...LinkedSnapshotsCardFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n\nfragment FrameworkControlDialogFragment on Control {\n id\n name\n description\n sectionTitle\n status\n exclusionJustification\n bestPractice\n}\n\nfragment LinkedAuditsCardFragment on Audit {\n id\n name\n createdAt\n state\n validFrom\n validUntil\n framework {\n id\n name\n }\n}\n\nfragment LinkedDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment LinkedMeasuresCardFragment on Measure {\n id\n name\n state\n}\n\nfragment LinkedObligationsCardFragment on Obligation {\n id\n requirement\n area\n source\n status\n owner {\n fullName\n id\n }\n}\n\nfragment LinkedSnapshotsCardFragment on Snapshot {\n id\n name\n description\n type\n createdAt\n}\n" } }; })(); -(node as any).hash = "755f62f220b1a05bf44dd770974691a9"; +(node as any).hash = "ba18479101d48704a9c2006372e605bb"; export default node; diff --git a/apps/console/src/__generated__/core/LinkControlDialogLinkMutation.graphql.ts b/apps/console/src/__generated__/core/LinkControlDialogLinkMutation.graphql.ts deleted file mode 100644 index f812abd12..000000000 --- a/apps/console/src/__generated__/core/LinkControlDialogLinkMutation.graphql.ts +++ /dev/null @@ -1,194 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type CreateStateOfApplicabilityControlMappingInput = { - applicability: boolean; - controlId: string; - justification?: string | null | undefined; - stateOfApplicabilityId: string; -}; -export type LinkControlDialogLinkMutation$variables = { - input: CreateStateOfApplicabilityControlMappingInput; -}; -export type LinkControlDialogLinkMutation$data = { - readonly createStateOfApplicabilityControlMapping: { - readonly stateOfApplicabilityControlEdge: { - readonly node: { - readonly applicability: boolean; - readonly controlId: string; - readonly justification: string | null | undefined; - readonly stateOfApplicabilityId: string; - }; - }; - }; -}; -export type LinkControlDialogLinkMutation = { - response: LinkControlDialogLinkMutation$data; - variables: LinkControlDialogLinkMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" - } -], -v1 = [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } -], -v2 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null -}, -v3 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null -}, -v4 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "applicability", - "storageKey": null -}, -v5 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "justification", - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "LinkControlDialogLinkMutation", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": "CreateStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "createStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControlEdge", - "kind": "LinkedField", - "name": "stateOfApplicabilityControlEdge", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControl", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/) - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "LinkControlDialogLinkMutation", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": "CreateStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "createStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControlEdge", - "kind": "LinkedField", - "name": "stateOfApplicabilityControlEdge", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityControl", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/), - (v5/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "59e215d4f18e0429cbf813aae4db8c94", - "id": null, - "metadata": {}, - "name": "LinkControlDialogLinkMutation", - "operationKind": "mutation", - "text": "mutation LinkControlDialogLinkMutation(\n $input: CreateStateOfApplicabilityControlMappingInput!\n) {\n createStateOfApplicabilityControlMapping(input: $input) {\n stateOfApplicabilityControlEdge {\n node {\n stateOfApplicabilityId\n controlId\n applicability\n justification\n id\n }\n }\n }\n}\n" - } -}; -})(); - -(node as any).hash = "47757e096c6beeba6be6290a2154f841"; - -export default node; diff --git a/apps/console/src/__generated__/core/LinkControlDialogQuery.graphql.ts b/apps/console/src/__generated__/core/LinkControlDialogQuery.graphql.ts deleted file mode 100644 index 993856949..000000000 --- a/apps/console/src/__generated__/core/LinkControlDialogQuery.graphql.ts +++ /dev/null @@ -1,211 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type LinkControlDialogQuery$variables = { - stateOfApplicabilityId: string; -}; -export type LinkControlDialogQuery$data = { - readonly node: { - readonly availableControls?: ReadonlyArray<{ - readonly applicability: boolean | null | undefined; - readonly controlId: string; - readonly frameworkId: string; - readonly frameworkName: string; - readonly justification: string | null | undefined; - readonly name: string; - readonly organizationId: string; - readonly sectionTitle: string; - readonly stateOfApplicabilityId: string | null | undefined; - }>; - readonly id?: string; - }; -}; -export type LinkControlDialogQuery = { - response: LinkControlDialogQuery$data; - variables: LinkControlDialogQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "stateOfApplicabilityId" - } -], -v1 = [ - { - "kind": "Variable", - "name": "id", - "variableName": "stateOfApplicabilityId" - } -], -v2 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null -}, -v3 = { - "alias": null, - "args": null, - "concreteType": "AvailableStateOfApplicabilityControl", - "kind": "LinkedField", - "name": "availableControls", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sectionTitle", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "frameworkId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "frameworkName", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "organizationId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "applicability", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "justification", - "storageKey": null - } - ], - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "LinkControlDialogQuery", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "kind": "InlineFragment", - "selections": [ - (v2/*: any*/), - (v3/*: any*/) - ], - "type": "StateOfApplicability", - "abstractKey": null - } - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "LinkControlDialogQuery", - "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*/) - ], - "type": "StateOfApplicability", - "abstractKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "a0d70e15a1236fe0e8626e685ea16a15", - "id": null, - "metadata": {}, - "name": "LinkControlDialogQuery", - "operationKind": "query", - "text": "query LinkControlDialogQuery(\n $stateOfApplicabilityId: ID!\n) {\n node(id: $stateOfApplicabilityId) {\n __typename\n ... on StateOfApplicability {\n id\n availableControls {\n controlId\n sectionTitle\n name\n frameworkId\n frameworkName\n organizationId\n stateOfApplicabilityId\n applicability\n justification\n }\n }\n id\n }\n}\n" - } -}; -})(); - -(node as any).hash = "26daf3c064517bdbbf025da7ce5fc30f"; - -export default node; diff --git a/apps/console/src/__generated__/core/LinkControlDialogUnlinkMutation.graphql.ts b/apps/console/src/__generated__/core/LinkControlDialogUnlinkMutation.graphql.ts deleted file mode 100644 index 5beb60c97..000000000 --- a/apps/console/src/__generated__/core/LinkControlDialogUnlinkMutation.graphql.ts +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @generated SignedSource<<3bb4d04e228ac7dbda8ebfb8b7c2567f>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type DeleteStateOfApplicabilityControlMappingInput = { - controlId: string; - stateOfApplicabilityId: string; -}; -export type LinkControlDialogUnlinkMutation$variables = { - input: DeleteStateOfApplicabilityControlMappingInput; -}; -export type LinkControlDialogUnlinkMutation$data = { - readonly deleteStateOfApplicabilityControlMapping: { - readonly deletedControlId: string; - readonly deletedStateOfApplicabilityControlId: string; - readonly deletedStateOfApplicabilityId: string; - }; -}; -export type LinkControlDialogUnlinkMutation = { - response: LinkControlDialogUnlinkMutation$data; - variables: LinkControlDialogUnlinkMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" - } -], -v1 = [ - { - "alias": null, - "args": [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } - ], - "concreteType": "DeleteStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "deleteStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedStateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedControlId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedStateOfApplicabilityControlId", - "storageKey": null - } - ], - "storageKey": null - } -]; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "LinkControlDialogUnlinkMutation", - "selections": (v1/*: any*/), - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "LinkControlDialogUnlinkMutation", - "selections": (v1/*: any*/) - }, - "params": { - "cacheID": "766d15d5071197ed2907d876caf37995", - "id": null, - "metadata": {}, - "name": "LinkControlDialogUnlinkMutation", - "operationKind": "mutation", - "text": "mutation LinkControlDialogUnlinkMutation(\n $input: DeleteStateOfApplicabilityControlMappingInput!\n) {\n deleteStateOfApplicabilityControlMapping(input: $input) {\n deletedStateOfApplicabilityId\n deletedControlId\n deletedStateOfApplicabilityControlId\n }\n}\n" - } -}; -})(); - -(node as any).hash = "a184d521b495bf3ff76796530e9eb0e1"; - -export default node; diff --git a/apps/console/src/__generated__/core/LinkedStatesOfApplicabilityCardFragment.graphql.ts b/apps/console/src/__generated__/core/LinkedStatesOfApplicabilityCardFragment.graphql.ts index fafe0d8cb..eafb497d2 100644 --- a/apps/console/src/__generated__/core/LinkedStatesOfApplicabilityCardFragment.graphql.ts +++ b/apps/console/src/__generated__/core/LinkedStatesOfApplicabilityCardFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -12,14 +12,15 @@ import { ReaderFragment } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; export type LinkedStatesOfApplicabilityCardFragment$data = { readonly applicability: boolean; - readonly controlId: string; + readonly control: { + readonly id: string; + }; readonly id: string; - readonly justification: string | null | undefined; + readonly justification: string; readonly stateOfApplicability: { readonly id: string; readonly name: string; }; - readonly stateOfApplicabilityId: string; readonly " $fragmentType": "LinkedStatesOfApplicabilityCardFragment"; }; export type LinkedStatesOfApplicabilityCardFragment$key = { @@ -42,20 +43,6 @@ return { "name": "LinkedStatesOfApplicabilityCardFragment", "selections": [ (v0/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null - }, { "alias": null, "args": null, @@ -75,6 +62,18 @@ return { ], "storageKey": null }, + { + "alias": null, + "args": null, + "concreteType": "Control", + "kind": "LinkedField", + "name": "control", + "plural": false, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null + }, { "alias": null, "args": null, @@ -90,11 +89,11 @@ return { "storageKey": null } ], - "type": "StateOfApplicabilityControl", + "type": "ApplicabilityStatement", "abstractKey": null }; })(); -(node as any).hash = "b9a9922b27f277a769025f11b0829bdc"; +(node as any).hash = "92dc33d1e220b3433508e55cb05ea39a"; export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabDeleteMutation.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabDeleteMutation.graphql.ts new file mode 100644 index 000000000..7146ce57d --- /dev/null +++ b/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabDeleteMutation.graphql.ts @@ -0,0 +1,132 @@ +/** + * @generated SignedSource<> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type DeleteApplicabilityStatementInput = { + applicabilityStatementId: string; +}; +export type StateOfApplicabilityControlsTabDeleteMutation$variables = { + connections: ReadonlyArray; + input: DeleteApplicabilityStatementInput; +}; +export type StateOfApplicabilityControlsTabDeleteMutation$data = { + readonly deleteApplicabilityStatement: { + readonly deletedApplicabilityStatementId: string; + }; +}; +export type StateOfApplicabilityControlsTabDeleteMutation = { + response: StateOfApplicabilityControlsTabDeleteMutation$data; + variables: StateOfApplicabilityControlsTabDeleteMutation$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": "deletedApplicabilityStatementId", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "StateOfApplicabilityControlsTabDeleteMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "DeleteApplicabilityStatementPayload", + "kind": "LinkedField", + "name": "deleteApplicabilityStatement", + "plural": false, + "selections": [ + (v3/*: any*/) + ], + "storageKey": null + } + ], + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], + "kind": "Operation", + "name": "StateOfApplicabilityControlsTabDeleteMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "DeleteApplicabilityStatementPayload", + "kind": "LinkedField", + "name": "deleteApplicabilityStatement", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "filters": null, + "handle": "deleteEdge", + "key": "", + "kind": "ScalarHandle", + "name": "deletedApplicabilityStatementId", + "handleArgs": [ + { + "kind": "Variable", + "name": "connections", + "variableName": "connections" + } + ] + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "427051073f5e747e828d282a773e4db6", + "id": null, + "metadata": {}, + "name": "StateOfApplicabilityControlsTabDeleteMutation", + "operationKind": "mutation", + "text": "mutation StateOfApplicabilityControlsTabDeleteMutation(\n $input: DeleteApplicabilityStatementInput!\n) {\n deleteApplicabilityStatement(input: $input) {\n deletedApplicabilityStatementId\n }\n}\n" + } +}; +})(); + +(node as any).hash = "860e6ba50b4d8cfd9dd53416d5e3b710"; + +export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabFragment.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabFragment.graphql.ts index 142a9ac37..396166d39 100644 --- a/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabFragment.graphql.ts +++ b/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<1e93345ca5370e4fdf20719ac86b8078>> + * @generated SignedSource<<6a0d32b2293db5f05fee4b79e61db4b6>> * @lightSyntaxTransform * @nogrep */ @@ -11,27 +11,39 @@ import { ReaderFragment } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; export type StateOfApplicabilityControlsTabFragment$data = { - readonly availableControls: ReadonlyArray<{ - readonly applicability: boolean | null | undefined; - readonly bestPractice: boolean; - readonly contractual: boolean; - readonly controlId: string; - readonly frameworkId: string; - readonly frameworkName: string; - readonly justification: string | null | undefined; - readonly name: string; - readonly organizationId: string; - readonly regulatory: boolean; - readonly riskAssessment: boolean; - readonly sectionTitle: string; - readonly stateOfApplicabilityId: string | null | undefined; - }>; - readonly canCreateStateOfApplicabilityControlMapping: boolean; - readonly canDeleteStateOfApplicabilityControlMapping: boolean; - readonly controlsInfo: { - readonly totalCount: number; + readonly applicabilityStatements: { + readonly __id: string; + readonly edges: ReadonlyArray<{ + readonly node: { + readonly applicability: boolean; + readonly control: { + readonly bestPractice: boolean; + readonly contractual: boolean; + readonly framework: { + readonly id: string; + readonly name: string; + }; + readonly id: string; + readonly name: string; + readonly organization: { + readonly id: string; + } | null | undefined; + readonly regulatory: boolean; + readonly riskAssessment: boolean; + readonly sectionTitle: string; + }; + readonly id: string; + readonly justification: string; + }; + }>; }; + readonly canCreateApplicabilityStatement: boolean; + readonly canDeleteApplicabilityStatement: boolean; + readonly canUpdateApplicabilityStatement: boolean; readonly id: string; + readonly organization: { + readonly id: string; + } | null | undefined; readonly " $fragmentType": "StateOfApplicabilityControlsTabFragment"; }; export type StateOfApplicabilityControlsTabFragment$key = { @@ -39,190 +51,267 @@ export type StateOfApplicabilityControlsTabFragment$key = { readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityControlsTabFragment">; }; -import StateOfApplicabilityControlsTabRefetchQuery_graphql from './StateOfApplicabilityControlsTabRefetchQuery.graphql'; - -const node: ReaderFragment = { +const node: ReaderFragment = (function(){ +var v0 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null +}, +v1 = { + "alias": null, + "args": null, + "concreteType": "Organization", + "kind": "LinkedField", + "name": "organization", + "plural": false, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null +}, +v2 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { "argumentDefinitions": [], "kind": "Fragment", "metadata": { - "refetch": { - "connection": null, - "fragmentPathInResult": [ - "node" - ], - "operation": StateOfApplicabilityControlsTabRefetchQuery_graphql, - "identifierInfo": { - "identifierField": "id", - "identifierQueryVariableName": "id" + "connection": [ + { + "count": null, + "cursor": null, + "direction": "forward", + "path": [ + "applicabilityStatements" + ] } - } + ] }, "name": "StateOfApplicabilityControlsTabFragment", "selections": [ + (v0/*: any*/), + (v1/*: any*/), { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null - }, - { - "alias": "controlsInfo", + "alias": "canCreateApplicabilityStatement", "args": [ { "kind": "Literal", - "name": "first", - "value": 0 + "name": "action", + "value": "core:applicability-statement:create" } ], - "concreteType": "ControlConnection", + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:applicability-statement:create\")" + }, + { + "alias": "canUpdateApplicabilityStatement", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:applicability-statement:update" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:applicability-statement:update\")" + }, + { + "alias": "canDeleteApplicabilityStatement", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:applicability-statement:delete" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:applicability-statement:delete\")" + }, + { + "alias": "applicabilityStatements", + "args": [ + { + "kind": "Literal", + "name": "orderBy", + "value": { + "direction": "ASC", + "field": "CREATED_AT" + } + } + ], + "concreteType": "ApplicabilityStatementConnection", "kind": "LinkedField", - "name": "controls", + "name": "__StateOfApplicabilityControlsTab_applicabilityStatements_connection", "plural": false, "selections": [ { "alias": null, "args": null, - "kind": "ScalarField", - "name": "totalCount", + "concreteType": "ApplicabilityStatementEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ApplicabilityStatement", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "applicability", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "justification", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Control", + "kind": "LinkedField", + "name": "control", + "plural": false, + "selections": [ + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "sectionTitle", + "storageKey": null + }, + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "bestPractice", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "regulatory", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "contractual", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "riskAssessment", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": [ + (v0/*: any*/), + (v2/*: any*/) + ], + "storageKey": null + }, + (v1/*: any*/) + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + } + ], + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "cursor", + "storageKey": null + } + ], "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "PageInfo", + "kind": "LinkedField", + "name": "pageInfo", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "endCursor", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null + } + ], + "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] } ], - "storageKey": "controls(first:0)" - }, - { - "alias": "canCreateStateOfApplicabilityControlMapping", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability-control-mapping:create" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability-control-mapping:create\")" - }, - { - "alias": "canDeleteStateOfApplicabilityControlMapping", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability-control-mapping:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability-control-mapping:delete\")" - }, - { - "alias": null, - "args": null, - "concreteType": "AvailableStateOfApplicabilityControl", - "kind": "LinkedField", - "name": "availableControls", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sectionTitle", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "frameworkId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "frameworkName", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "organizationId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "applicability", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "justification", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "bestPractice", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "regulatory", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "contractual", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "riskAssessment", - "storageKey": null - } - ], - "storageKey": null + "storageKey": "__StateOfApplicabilityControlsTab_applicabilityStatements_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"CREATED_AT\"})" } ], "type": "StateOfApplicability", "abstractKey": null }; +})(); -(node as any).hash = "37dd1660caf4dea39bb697b99a8bf511"; +(node as any).hash = "b5a28520cb7a702b208cbfad2c904a99"; export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabRefetchQuery.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabRefetchQuery.graphql.ts deleted file mode 100644 index 9c94454d6..000000000 --- a/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabRefetchQuery.graphql.ts +++ /dev/null @@ -1,273 +0,0 @@ -/** - * @generated SignedSource<<82aac43cc256062befe9f2126eb20c4e>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type StateOfApplicabilityControlsTabRefetchQuery$variables = { - id: string; -}; -export type StateOfApplicabilityControlsTabRefetchQuery$data = { - readonly node: { - readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityControlsTabFragment">; - }; -}; -export type StateOfApplicabilityControlsTabRefetchQuery = { - response: StateOfApplicabilityControlsTabRefetchQuery$data; - variables: StateOfApplicabilityControlsTabRefetchQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "id" - } -], -v1 = [ - { - "kind": "Variable", - "name": "id", - "variableName": "id" - } -]; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "StateOfApplicabilityControlsTabRefetchQuery", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "args": null, - "kind": "FragmentSpread", - "name": "StateOfApplicabilityControlsTabFragment" - } - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "StateOfApplicabilityControlsTabRefetchQuery", - "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 - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null - }, - { - "kind": "InlineFragment", - "selections": [ - { - "alias": "controlsInfo", - "args": [ - { - "kind": "Literal", - "name": "first", - "value": 0 - } - ], - "concreteType": "ControlConnection", - "kind": "LinkedField", - "name": "controls", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "totalCount", - "storageKey": null - } - ], - "storageKey": "controls(first:0)" - }, - { - "alias": "canCreateStateOfApplicabilityControlMapping", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability-control-mapping:create" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability-control-mapping:create\")" - }, - { - "alias": "canDeleteStateOfApplicabilityControlMapping", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability-control-mapping:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability-control-mapping:delete\")" - }, - { - "alias": null, - "args": null, - "concreteType": "AvailableStateOfApplicabilityControl", - "kind": "LinkedField", - "name": "availableControls", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sectionTitle", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "frameworkId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "frameworkName", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "organizationId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "applicability", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "justification", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "bestPractice", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "regulatory", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "contractual", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "riskAssessment", - "storageKey": null - } - ], - "storageKey": null - } - ], - "type": "StateOfApplicability", - "abstractKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "fd5b512b7274ba6a3047960c796c82bf", - "id": null, - "metadata": {}, - "name": "StateOfApplicabilityControlsTabRefetchQuery", - "operationKind": "query", - "text": "query StateOfApplicabilityControlsTabRefetchQuery(\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...StateOfApplicabilityControlsTabFragment\n id\n }\n}\n\nfragment StateOfApplicabilityControlsTabFragment on StateOfApplicability {\n id\n controlsInfo: controls(first: 0) {\n totalCount\n }\n canCreateStateOfApplicabilityControlMapping: permission(action: \"core:state-of-applicability-control-mapping:create\")\n canDeleteStateOfApplicabilityControlMapping: permission(action: \"core:state-of-applicability-control-mapping:delete\")\n availableControls {\n controlId\n sectionTitle\n name\n frameworkId\n frameworkName\n organizationId\n stateOfApplicabilityId\n applicability\n justification\n bestPractice\n regulatory\n contractual\n riskAssessment\n }\n}\n" - } -}; -})(); - -(node as any).hash = "37dd1660caf4dea39bb697b99a8bf511"; - -export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabUnlinkMutation.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabUnlinkMutation.graphql.ts deleted file mode 100644 index df896d5d7..000000000 --- a/apps/console/src/__generated__/core/StateOfApplicabilityControlsTabUnlinkMutation.graphql.ts +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @generated SignedSource<> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type DeleteStateOfApplicabilityControlMappingInput = { - controlId: string; - stateOfApplicabilityId: string; -}; -export type StateOfApplicabilityControlsTabUnlinkMutation$variables = { - input: DeleteStateOfApplicabilityControlMappingInput; -}; -export type StateOfApplicabilityControlsTabUnlinkMutation$data = { - readonly deleteStateOfApplicabilityControlMapping: { - readonly deletedControlId: string; - readonly deletedStateOfApplicabilityControlId: string; - readonly deletedStateOfApplicabilityId: string; - }; -}; -export type StateOfApplicabilityControlsTabUnlinkMutation = { - response: StateOfApplicabilityControlsTabUnlinkMutation$data; - variables: StateOfApplicabilityControlsTabUnlinkMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" - } -], -v1 = [ - { - "alias": null, - "args": [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } - ], - "concreteType": "DeleteStateOfApplicabilityControlMappingPayload", - "kind": "LinkedField", - "name": "deleteStateOfApplicabilityControlMapping", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedStateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedControlId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "deletedStateOfApplicabilityControlId", - "storageKey": null - } - ], - "storageKey": null - } -]; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "StateOfApplicabilityControlsTabUnlinkMutation", - "selections": (v1/*: any*/), - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "StateOfApplicabilityControlsTabUnlinkMutation", - "selections": (v1/*: any*/) - }, - "params": { - "cacheID": "6bf3ac32bd032b215e3e4f48100353d7", - "id": null, - "metadata": {}, - "name": "StateOfApplicabilityControlsTabUnlinkMutation", - "operationKind": "mutation", - "text": "mutation StateOfApplicabilityControlsTabUnlinkMutation(\n $input: DeleteStateOfApplicabilityControlMappingInput!\n) {\n deleteStateOfApplicabilityControlMapping(input: $input) {\n deletedStateOfApplicabilityId\n deletedControlId\n deletedStateOfApplicabilityControlId\n }\n}\n" - } -}; -})(); - -(node as any).hash = "b8c3e0ca44bde75468fcfab09151854d"; - -export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityDetailPageDeleteMutation.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityDetailPageDeleteMutation.graphql.ts new file mode 100644 index 000000000..269f9d750 --- /dev/null +++ b/apps/console/src/__generated__/core/StateOfApplicabilityDetailPageDeleteMutation.graphql.ts @@ -0,0 +1,132 @@ +/** + * @generated SignedSource<<56cf69173dcd665f19c4273ab108f383>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +export type DeleteStateOfApplicabilityInput = { + stateOfApplicabilityId: string; +}; +export type StateOfApplicabilityDetailPageDeleteMutation$variables = { + connections: ReadonlyArray; + input: DeleteStateOfApplicabilityInput; +}; +export type StateOfApplicabilityDetailPageDeleteMutation$data = { + readonly deleteStateOfApplicability: { + readonly deletedStateOfApplicabilityId: string; + }; +}; +export type StateOfApplicabilityDetailPageDeleteMutation = { + response: StateOfApplicabilityDetailPageDeleteMutation$data; + variables: StateOfApplicabilityDetailPageDeleteMutation$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": "deletedStateOfApplicabilityId", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [ + (v0/*: any*/), + (v1/*: any*/) + ], + "kind": "Fragment", + "metadata": null, + "name": "StateOfApplicabilityDetailPageDeleteMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "DeleteStateOfApplicabilityPayload", + "kind": "LinkedField", + "name": "deleteStateOfApplicability", + "plural": false, + "selections": [ + (v3/*: any*/) + ], + "storageKey": null + } + ], + "type": "Mutation", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [ + (v1/*: any*/), + (v0/*: any*/) + ], + "kind": "Operation", + "name": "StateOfApplicabilityDetailPageDeleteMutation", + "selections": [ + { + "alias": null, + "args": (v2/*: any*/), + "concreteType": "DeleteStateOfApplicabilityPayload", + "kind": "LinkedField", + "name": "deleteStateOfApplicability", + "plural": false, + "selections": [ + (v3/*: any*/), + { + "alias": null, + "args": null, + "filters": null, + "handle": "deleteEdge", + "key": "", + "kind": "ScalarHandle", + "name": "deletedStateOfApplicabilityId", + "handleArgs": [ + { + "kind": "Variable", + "name": "connections", + "variableName": "connections" + } + ] + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "13f5a325289c902aca142880e1f30648", + "id": null, + "metadata": {}, + "name": "StateOfApplicabilityDetailPageDeleteMutation", + "operationKind": "mutation", + "text": "mutation StateOfApplicabilityDetailPageDeleteMutation(\n $input: DeleteStateOfApplicabilityInput!\n) {\n deleteStateOfApplicability(input: $input) {\n deletedStateOfApplicabilityId\n }\n}\n" + } +}; +})(); + +(node as any).hash = "b511cc3d55c6ebb1517687f706026333"; + +export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityDetailPageQuery.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityDetailPageQuery.graphql.ts new file mode 100644 index 000000000..5d8d4b2d1 --- /dev/null +++ b/apps/console/src/__generated__/core/StateOfApplicabilityDetailPageQuery.graphql.ts @@ -0,0 +1,492 @@ +/** + * @generated SignedSource<<2f9bc9cc4e848c4b8c88326c2279d94f>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ConcreteRequest } from 'relay-runtime'; +import { FragmentRefs } from "relay-runtime"; +export type StateOfApplicabilityDetailPageQuery$variables = { + stateOfApplicabilityId: string; +}; +export type StateOfApplicabilityDetailPageQuery$data = { + readonly node: { + readonly canDelete?: boolean; + readonly canExport?: boolean; + readonly canUpdate?: boolean; + readonly createdAt?: string; + readonly id?: string; + readonly name?: string; + readonly organization?: { + readonly id: string; + } | null | undefined; + readonly owner?: { + readonly fullName: string; + readonly id: string; + }; + readonly snapshotId?: string | null | undefined; + readonly sourceId?: string | null | undefined; + readonly updatedAt?: string; + readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityControlsTabFragment">; + }; +}; +export type StateOfApplicabilityDetailPageQuery = { + response: StateOfApplicabilityDetailPageQuery$data; + variables: StateOfApplicabilityDetailPageQuery$variables; +}; + +const node: ConcreteRequest = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "stateOfApplicabilityId" + } +], +v1 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "stateOfApplicabilityId" + } +], +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": "sourceId", + "storageKey": null +}, +v5 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "snapshotId", + "storageKey": null +}, +v6 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null +}, +v7 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "updatedAt", + "storageKey": null +}, +v8 = { + "alias": "canUpdate", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:state-of-applicability:update" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:state-of-applicability:update\")" +}, +v9 = { + "alias": "canDelete", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:state-of-applicability:delete" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:state-of-applicability:delete\")" +}, +v10 = { + "alias": "canExport", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:state-of-applicability:export" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:state-of-applicability:export\")" +}, +v11 = { + "alias": null, + "args": null, + "concreteType": "Organization", + "kind": "LinkedField", + "name": "organization", + "plural": false, + "selections": [ + (v2/*: any*/) + ], + "storageKey": null +}, +v12 = { + "alias": null, + "args": null, + "concreteType": "People", + "kind": "LinkedField", + "name": "owner", + "plural": false, + "selections": [ + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "fullName", + "storageKey": null + } + ], + "storageKey": null +}, +v13 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null +}, +v14 = [ + { + "kind": "Literal", + "name": "first", + "value": 1000 + }, + { + "kind": "Literal", + "name": "orderBy", + "value": { + "direction": "ASC", + "field": "CREATED_AT" + } + } +]; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "StateOfApplicabilityDetailPageQuery", + "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*/), + { + "args": null, + "kind": "FragmentSpread", + "name": "StateOfApplicabilityControlsTabFragment" + } + ], + "type": "StateOfApplicability", + "abstractKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "StateOfApplicabilityDetailPageQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v13/*: any*/), + (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*/), + { + "alias": "canCreateApplicabilityStatement", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:applicability-statement:create" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:applicability-statement:create\")" + }, + { + "alias": "canUpdateApplicabilityStatement", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:applicability-statement:update" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:applicability-statement:update\")" + }, + { + "alias": "canDeleteApplicabilityStatement", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:applicability-statement:delete" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:applicability-statement:delete\")" + }, + { + "alias": null, + "args": (v14/*: any*/), + "concreteType": "ApplicabilityStatementConnection", + "kind": "LinkedField", + "name": "applicabilityStatements", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ApplicabilityStatementEdge", + "kind": "LinkedField", + "name": "edges", + "plural": true, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "ApplicabilityStatement", + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "applicability", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "justification", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Control", + "kind": "LinkedField", + "name": "control", + "plural": false, + "selections": [ + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "sectionTitle", + "storageKey": null + }, + (v3/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "bestPractice", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "regulatory", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "contractual", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "riskAssessment", + "storageKey": null + }, + { + "alias": null, + "args": null, + "concreteType": "Framework", + "kind": "LinkedField", + "name": "framework", + "plural": false, + "selections": [ + (v2/*: any*/), + (v3/*: any*/) + ], + "storageKey": null + }, + (v11/*: any*/) + ], + "storageKey": null + }, + (v13/*: 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": "endCursor", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "hasNextPage", + "storageKey": null + } + ], + "storageKey": null + }, + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__id", + "storageKey": null + } + ] + } + ], + "storageKey": "applicabilityStatements(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"CREATED_AT\"})" + }, + { + "alias": null, + "args": (v14/*: any*/), + "filters": [ + "orderBy" + ], + "handle": "connection", + "key": "StateOfApplicabilityControlsTab_applicabilityStatements", + "kind": "LinkedHandle", + "name": "applicabilityStatements" + } + ], + "type": "StateOfApplicability", + "abstractKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "ae9d15bd80281c127b74f1a0a32099ee", + "id": null, + "metadata": {}, + "name": "StateOfApplicabilityDetailPageQuery", + "operationKind": "query", + "text": "query StateOfApplicabilityDetailPageQuery(\n $stateOfApplicabilityId: ID!\n) {\n node(id: $stateOfApplicabilityId) {\n __typename\n ... on StateOfApplicability {\n id\n name\n sourceId\n snapshotId\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:state-of-applicability:update\")\n canDelete: permission(action: \"core:state-of-applicability:delete\")\n canExport: permission(action: \"core:state-of-applicability:export\")\n organization {\n id\n }\n owner {\n id\n fullName\n }\n ...StateOfApplicabilityControlsTabFragment\n }\n id\n }\n}\n\nfragment StateOfApplicabilityControlsTabFragment on StateOfApplicability {\n id\n organization {\n id\n }\n canCreateApplicabilityStatement: permission(action: \"core:applicability-statement:create\")\n canUpdateApplicabilityStatement: permission(action: \"core:applicability-statement:update\")\n canDeleteApplicabilityStatement: permission(action: \"core:applicability-statement:delete\")\n applicabilityStatements(first: 1000, orderBy: {direction: ASC, field: CREATED_AT}) {\n edges {\n node {\n id\n applicability\n justification\n control {\n id\n sectionTitle\n name\n bestPractice\n regulatory\n contractual\n riskAssessment\n framework {\n id\n name\n }\n organization {\n id\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n" + } +}; +})(); + +(node as any).hash = "c5fc32cde9c8e0ce3b8a77c96e0bb7cd"; + +export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityGraphUpdateMutation.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityDetailPageUpdateMutation.graphql.ts similarity index 77% rename from apps/console/src/__generated__/core/StateOfApplicabilityGraphUpdateMutation.graphql.ts rename to apps/console/src/__generated__/core/StateOfApplicabilityDetailPageUpdateMutation.graphql.ts index 3dccf5844..0a5fe61ad 100644 --- a/apps/console/src/__generated__/core/StateOfApplicabilityGraphUpdateMutation.graphql.ts +++ b/apps/console/src/__generated__/core/StateOfApplicabilityDetailPageUpdateMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<00cfb3ae1f26e5b5ab343724f00292b0>> * @lightSyntaxTransform * @nogrep */ @@ -14,10 +14,10 @@ export type UpdateStateOfApplicabilityInput = { name?: string | null | undefined; ownerId?: string | null | undefined; }; -export type StateOfApplicabilityGraphUpdateMutation$variables = { +export type StateOfApplicabilityDetailPageUpdateMutation$variables = { input: UpdateStateOfApplicabilityInput; }; -export type StateOfApplicabilityGraphUpdateMutation$data = { +export type StateOfApplicabilityDetailPageUpdateMutation$data = { readonly updateStateOfApplicability: { readonly stateOfApplicability: { readonly createdAt: string; @@ -33,9 +33,9 @@ export type StateOfApplicabilityGraphUpdateMutation$data = { }; }; }; -export type StateOfApplicabilityGraphUpdateMutation = { - response: StateOfApplicabilityGraphUpdateMutation$data; - variables: StateOfApplicabilityGraphUpdateMutation$variables; +export type StateOfApplicabilityDetailPageUpdateMutation = { + response: StateOfApplicabilityDetailPageUpdateMutation$data; + variables: StateOfApplicabilityDetailPageUpdateMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -143,7 +143,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "StateOfApplicabilityGraphUpdateMutation", + "name": "StateOfApplicabilityDetailPageUpdateMutation", "selections": (v2/*: any*/), "type": "Mutation", "abstractKey": null @@ -152,20 +152,20 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "StateOfApplicabilityGraphUpdateMutation", + "name": "StateOfApplicabilityDetailPageUpdateMutation", "selections": (v2/*: any*/) }, "params": { - "cacheID": "609bd562b84162f2807ee89b3c3273aa", + "cacheID": "0236ac567b08f60ca0773d91fb1b2155", "id": null, "metadata": {}, - "name": "StateOfApplicabilityGraphUpdateMutation", + "name": "StateOfApplicabilityDetailPageUpdateMutation", "operationKind": "mutation", - "text": "mutation StateOfApplicabilityGraphUpdateMutation(\n $input: UpdateStateOfApplicabilityInput!\n) {\n updateStateOfApplicability(input: $input) {\n stateOfApplicability {\n id\n name\n sourceId\n snapshotId\n createdAt\n updatedAt\n owner {\n id\n fullName\n }\n }\n }\n}\n" + "text": "mutation StateOfApplicabilityDetailPageUpdateMutation(\n $input: UpdateStateOfApplicabilityInput!\n) {\n updateStateOfApplicability(input: $input) {\n stateOfApplicability {\n id\n name\n sourceId\n snapshotId\n createdAt\n updatedAt\n owner {\n id\n fullName\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "e8810210629ef7fad113616c06f141ee"; +(node as any).hash = "0213db8aa925819738cea45aa8603d6d"; export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityGraphCreateMutation.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityGraphCreateMutation.graphql.ts deleted file mode 100644 index fbf85a3f1..000000000 --- a/apps/console/src/__generated__/core/StateOfApplicabilityGraphCreateMutation.graphql.ts +++ /dev/null @@ -1,200 +0,0 @@ -/** - * @generated SignedSource<<4c20f255a28d7869f69f484e0e4e2321>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type CreateStateOfApplicabilityInput = { - name: string; - organizationId: string; - ownerId: string; -}; -export type StateOfApplicabilityGraphCreateMutation$variables = { - connections: ReadonlyArray; - input: CreateStateOfApplicabilityInput; -}; -export type StateOfApplicabilityGraphCreateMutation$data = { - readonly createStateOfApplicability: { - readonly stateOfApplicabilityEdge: { - readonly node: { - readonly createdAt: string; - readonly id: string; - readonly name: string; - readonly snapshotId: string | null | undefined; - readonly sourceId: string | null | undefined; - readonly updatedAt: string; - }; - }; - }; -}; -export type StateOfApplicabilityGraphCreateMutation = { - response: StateOfApplicabilityGraphCreateMutation$data; - variables: StateOfApplicabilityGraphCreateMutation$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "connections" -}, -v1 = { - "defaultValue": null, - "kind": "LocalArgument", - "name": "input" -}, -v2 = [ - { - "kind": "Variable", - "name": "input", - "variableName": "input" - } -], -v3 = { - "alias": null, - "args": null, - "concreteType": "StateOfApplicabilityEdge", - "kind": "LinkedField", - "name": "stateOfApplicabilityEdge", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "StateOfApplicability", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "id", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sourceId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "snapshotId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": [ - (v0/*: any*/), - (v1/*: any*/) - ], - "kind": "Fragment", - "metadata": null, - "name": "StateOfApplicabilityGraphCreateMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "CreateStateOfApplicabilityPayload", - "kind": "LinkedField", - "name": "createStateOfApplicability", - "plural": false, - "selections": [ - (v3/*: any*/) - ], - "storageKey": null - } - ], - "type": "Mutation", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": [ - (v1/*: any*/), - (v0/*: any*/) - ], - "kind": "Operation", - "name": "StateOfApplicabilityGraphCreateMutation", - "selections": [ - { - "alias": null, - "args": (v2/*: any*/), - "concreteType": "CreateStateOfApplicabilityPayload", - "kind": "LinkedField", - "name": "createStateOfApplicability", - "plural": false, - "selections": [ - (v3/*: any*/), - { - "alias": null, - "args": null, - "filters": null, - "handle": "prependEdge", - "key": "", - "kind": "LinkedHandle", - "name": "stateOfApplicabilityEdge", - "handleArgs": [ - { - "kind": "Variable", - "name": "connections", - "variableName": "connections" - } - ] - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "c1a3721f591bc17ed455a326eb9edead", - "id": null, - "metadata": {}, - "name": "StateOfApplicabilityGraphCreateMutation", - "operationKind": "mutation", - "text": "mutation StateOfApplicabilityGraphCreateMutation(\n $input: CreateStateOfApplicabilityInput!\n) {\n createStateOfApplicability(input: $input) {\n stateOfApplicabilityEdge {\n node {\n id\n name\n sourceId\n snapshotId\n createdAt\n updatedAt\n }\n }\n }\n}\n" - } -}; -})(); - -(node as any).hash = "294d4fe89f8cbbbb4b8170a46dd3cd7a"; - -export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityGraphForEditQuery.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityGraphForEditQuery.graphql.ts deleted file mode 100644 index 580effdc0..000000000 --- a/apps/console/src/__generated__/core/StateOfApplicabilityGraphForEditQuery.graphql.ts +++ /dev/null @@ -1,218 +0,0 @@ -/** - * @generated SignedSource<<9e7f481aa8c95332bc03c3974a6752f8>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -export type StateOfApplicabilityGraphForEditQuery$variables = { - stateOfApplicabilityId: string; -}; -export type StateOfApplicabilityGraphForEditQuery$data = { - readonly node: { - readonly controls?: { - readonly edges: ReadonlyArray<{ - readonly node: { - readonly framework: { - readonly id: string; - readonly name: string; - }; - readonly id: string; - readonly name: string; - readonly sectionTitle: string; - }; - }>; - }; - readonly id?: string; - readonly name?: string; - }; -}; -export type StateOfApplicabilityGraphForEditQuery = { - response: StateOfApplicabilityGraphForEditQuery$data; - variables: StateOfApplicabilityGraphForEditQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "stateOfApplicabilityId" - } -], -v1 = [ - { - "kind": "Variable", - "name": "id", - "variableName": "stateOfApplicabilityId" - } -], -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": [ - { - "kind": "Literal", - "name": "first", - "value": 1000 - }, - { - "kind": "Literal", - "name": "orderBy", - "value": { - "direction": "ASC", - "field": "SECTION_TITLE" - } - } - ], - "concreteType": "ControlConnection", - "kind": "LinkedField", - "name": "controls", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "ControlEdge", - "kind": "LinkedField", - "name": "edges", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "concreteType": "Control", - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sectionTitle", - "storageKey": null - }, - (v3/*: any*/), - { - "alias": null, - "args": null, - "concreteType": "Framework", - "kind": "LinkedField", - "name": "framework", - "plural": false, - "selections": [ - (v2/*: any*/), - (v3/*: any*/) - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": null - } - ], - "storageKey": "controls(first:1000,orderBy:{\"direction\":\"ASC\",\"field\":\"SECTION_TITLE\"})" -}; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "StateOfApplicabilityGraphForEditQuery", - "selections": [ - { - "alias": null, - "args": (v1/*: any*/), - "concreteType": null, - "kind": "LinkedField", - "name": "node", - "plural": false, - "selections": [ - { - "kind": "InlineFragment", - "selections": [ - (v2/*: any*/), - (v3/*: any*/), - (v4/*: any*/) - ], - "type": "StateOfApplicability", - "abstractKey": null - } - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "StateOfApplicabilityGraphForEditQuery", - "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*/) - ], - "type": "StateOfApplicability", - "abstractKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "b6b5490aa177e6e7e8339060eac14a9c", - "id": null, - "metadata": {}, - "name": "StateOfApplicabilityGraphForEditQuery", - "operationKind": "query", - "text": "query StateOfApplicabilityGraphForEditQuery(\n $stateOfApplicabilityId: ID!\n) {\n node(id: $stateOfApplicabilityId) {\n __typename\n ... on StateOfApplicability {\n id\n name\n controls(first: 1000, orderBy: {field: SECTION_TITLE, direction: ASC}) {\n edges {\n node {\n id\n sectionTitle\n name\n framework {\n id\n name\n }\n }\n }\n }\n }\n id\n }\n}\n" - } -}; -})(); - -(node as any).hash = "e89010d6f8d66b9df856280a59d5f0c8"; - -export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityGraphNodeQuery.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityGraphNodeQuery.graphql.ts deleted file mode 100644 index b07c23f98..000000000 --- a/apps/console/src/__generated__/core/StateOfApplicabilityGraphNodeQuery.graphql.ts +++ /dev/null @@ -1,417 +0,0 @@ -/** - * @generated SignedSource<<4c350f48aeb8f51c9716aed4eeadc735>> - * @lightSyntaxTransform - * @nogrep - */ - -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck - -import { ConcreteRequest } from 'relay-runtime'; -import { FragmentRefs } from "relay-runtime"; -export type StateOfApplicabilityGraphNodeQuery$variables = { - stateOfApplicabilityId: string; -}; -export type StateOfApplicabilityGraphNodeQuery$data = { - readonly node: { - readonly canDelete?: boolean; - readonly canExport?: boolean; - readonly canUpdate?: boolean; - readonly createdAt?: string; - readonly id?: string; - readonly name?: string; - readonly organization?: { - readonly id: string; - } | null | undefined; - readonly owner?: { - readonly fullName: string; - readonly id: string; - }; - readonly snapshotId?: string | null | undefined; - readonly sourceId?: string | null | undefined; - readonly updatedAt?: string; - readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityControlsTabFragment">; - }; -}; -export type StateOfApplicabilityGraphNodeQuery = { - response: StateOfApplicabilityGraphNodeQuery$data; - variables: StateOfApplicabilityGraphNodeQuery$variables; -}; - -const node: ConcreteRequest = (function(){ -var v0 = [ - { - "defaultValue": null, - "kind": "LocalArgument", - "name": "stateOfApplicabilityId" - } -], -v1 = [ - { - "kind": "Variable", - "name": "id", - "variableName": "stateOfApplicabilityId" - } -], -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": "sourceId", - "storageKey": null -}, -v5 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "snapshotId", - "storageKey": null -}, -v6 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null -}, -v7 = { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null -}, -v8 = { - "alias": "canUpdate", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability:update" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability:update\")" -}, -v9 = { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability:delete\")" -}, -v10 = { - "alias": "canExport", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability:export" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability:export\")" -}, -v11 = { - "alias": null, - "args": null, - "concreteType": "Organization", - "kind": "LinkedField", - "name": "organization", - "plural": false, - "selections": [ - (v2/*: any*/) - ], - "storageKey": null -}, -v12 = { - "alias": null, - "args": null, - "concreteType": "People", - "kind": "LinkedField", - "name": "owner", - "plural": false, - "selections": [ - (v2/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "fullName", - "storageKey": null - } - ], - "storageKey": null -}; -return { - "fragment": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Fragment", - "metadata": null, - "name": "StateOfApplicabilityGraphNodeQuery", - "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*/), - { - "args": null, - "kind": "FragmentSpread", - "name": "StateOfApplicabilityControlsTabFragment" - } - ], - "type": "StateOfApplicability", - "abstractKey": null - } - ], - "storageKey": null - } - ], - "type": "Query", - "abstractKey": null - }, - "kind": "Request", - "operation": { - "argumentDefinitions": (v0/*: any*/), - "kind": "Operation", - "name": "StateOfApplicabilityGraphNodeQuery", - "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*/), - { - "alias": "controlsInfo", - "args": [ - { - "kind": "Literal", - "name": "first", - "value": 0 - } - ], - "concreteType": "ControlConnection", - "kind": "LinkedField", - "name": "controls", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "totalCount", - "storageKey": null - } - ], - "storageKey": "controls(first:0)" - }, - { - "alias": "canCreateStateOfApplicabilityControlMapping", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability-control-mapping:create" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability-control-mapping:create\")" - }, - { - "alias": "canDeleteStateOfApplicabilityControlMapping", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability-control-mapping:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability-control-mapping:delete\")" - }, - { - "alias": null, - "args": null, - "concreteType": "AvailableStateOfApplicabilityControl", - "kind": "LinkedField", - "name": "availableControls", - "plural": true, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "controlId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sectionTitle", - "storageKey": null - }, - (v3/*: any*/), - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "frameworkId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "frameworkName", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "organizationId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "stateOfApplicabilityId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "applicability", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "justification", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "bestPractice", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "regulatory", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "contractual", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "riskAssessment", - "storageKey": null - } - ], - "storageKey": null - } - ], - "type": "StateOfApplicability", - "abstractKey": null - } - ], - "storageKey": null - } - ] - }, - "params": { - "cacheID": "529e47a135ba24716b749998d1181d9a", - "id": null, - "metadata": {}, - "name": "StateOfApplicabilityGraphNodeQuery", - "operationKind": "query", - "text": "query StateOfApplicabilityGraphNodeQuery(\n $stateOfApplicabilityId: ID!\n) {\n node(id: $stateOfApplicabilityId) {\n __typename\n ... on StateOfApplicability {\n id\n name\n sourceId\n snapshotId\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:state-of-applicability:update\")\n canDelete: permission(action: \"core:state-of-applicability:delete\")\n canExport: permission(action: \"core:state-of-applicability:export\")\n organization {\n id\n }\n owner {\n id\n fullName\n }\n ...StateOfApplicabilityControlsTabFragment\n }\n id\n }\n}\n\nfragment StateOfApplicabilityControlsTabFragment on StateOfApplicability {\n id\n controlsInfo: controls(first: 0) {\n totalCount\n }\n canCreateStateOfApplicabilityControlMapping: permission(action: \"core:state-of-applicability-control-mapping:create\")\n canDeleteStateOfApplicabilityControlMapping: permission(action: \"core:state-of-applicability-control-mapping:delete\")\n availableControls {\n controlId\n sectionTitle\n name\n frameworkId\n frameworkName\n organizationId\n stateOfApplicabilityId\n applicability\n justification\n bestPractice\n regulatory\n contractual\n riskAssessment\n }\n}\n" - } -}; -})(); - -(node as any).hash = "5ea300f4dd399cafd7985072c2013dbe"; - -export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityGraphDeleteMutation.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityRowDeleteMutation.graphql.ts similarity index 74% rename from apps/console/src/__generated__/core/StateOfApplicabilityGraphDeleteMutation.graphql.ts rename to apps/console/src/__generated__/core/StateOfApplicabilityRowDeleteMutation.graphql.ts index 6eea78f1c..2ed35322f 100644 --- a/apps/console/src/__generated__/core/StateOfApplicabilityGraphDeleteMutation.graphql.ts +++ b/apps/console/src/__generated__/core/StateOfApplicabilityRowDeleteMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<74458c1ec95a320a91f42f0c5cdb0925>> * @lightSyntaxTransform * @nogrep */ @@ -12,18 +12,18 @@ import { ConcreteRequest } from 'relay-runtime'; export type DeleteStateOfApplicabilityInput = { stateOfApplicabilityId: string; }; -export type StateOfApplicabilityGraphDeleteMutation$variables = { +export type StateOfApplicabilityRowDeleteMutation$variables = { connections: ReadonlyArray; input: DeleteStateOfApplicabilityInput; }; -export type StateOfApplicabilityGraphDeleteMutation$data = { +export type StateOfApplicabilityRowDeleteMutation$data = { readonly deleteStateOfApplicability: { readonly deletedStateOfApplicabilityId: string; }; }; -export type StateOfApplicabilityGraphDeleteMutation = { - response: StateOfApplicabilityGraphDeleteMutation$data; - variables: StateOfApplicabilityGraphDeleteMutation$variables; +export type StateOfApplicabilityRowDeleteMutation = { + response: StateOfApplicabilityRowDeleteMutation$data; + variables: StateOfApplicabilityRowDeleteMutation$variables; }; const node: ConcreteRequest = (function(){ @@ -59,7 +59,7 @@ return { ], "kind": "Fragment", "metadata": null, - "name": "StateOfApplicabilityGraphDeleteMutation", + "name": "StateOfApplicabilityRowDeleteMutation", "selections": [ { "alias": null, @@ -84,7 +84,7 @@ return { (v0/*: any*/) ], "kind": "Operation", - "name": "StateOfApplicabilityGraphDeleteMutation", + "name": "StateOfApplicabilityRowDeleteMutation", "selections": [ { "alias": null, @@ -117,16 +117,16 @@ return { ] }, "params": { - "cacheID": "197a2ed2b48d43372e16deae6e9b98c2", + "cacheID": "be77dc47292c3864174f008adb45f910", "id": null, "metadata": {}, - "name": "StateOfApplicabilityGraphDeleteMutation", + "name": "StateOfApplicabilityRowDeleteMutation", "operationKind": "mutation", - "text": "mutation StateOfApplicabilityGraphDeleteMutation(\n $input: DeleteStateOfApplicabilityInput!\n) {\n deleteStateOfApplicability(input: $input) {\n deletedStateOfApplicabilityId\n }\n}\n" + "text": "mutation StateOfApplicabilityRowDeleteMutation(\n $input: DeleteStateOfApplicabilityInput!\n) {\n deleteStateOfApplicability(input: $input) {\n deletedStateOfApplicabilityId\n }\n}\n" } }; })(); -(node as any).hash = "92ec928d4ad0fe7ff4ae78ad9f1f329a"; +(node as any).hash = "c580dcff6800cb372932ec5ed9201417"; export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityRowFragment.graphql.ts b/apps/console/src/__generated__/core/StateOfApplicabilityRowFragment.graphql.ts new file mode 100644 index 000000000..347f1b455 --- /dev/null +++ b/apps/console/src/__generated__/core/StateOfApplicabilityRowFragment.graphql.ts @@ -0,0 +1,93 @@ +/** + * @generated SignedSource<> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ +/* eslint-disable */ +// @ts-nocheck + +import { ReaderFragment } from 'relay-runtime'; +import { FragmentRefs } from "relay-runtime"; +export type StateOfApplicabilityRowFragment$data = { + readonly canDelete: boolean; + readonly createdAt: string; + readonly id: string; + readonly name: string; + readonly statementsInfo: { + readonly totalCount: number; + }; + readonly " $fragmentType": "StateOfApplicabilityRowFragment"; +}; +export type StateOfApplicabilityRowFragment$key = { + readonly " $data"?: StateOfApplicabilityRowFragment$data; + readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityRowFragment">; +}; + +const node: ReaderFragment = { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "StateOfApplicabilityRowFragment", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "createdAt", + "storageKey": null + }, + { + "alias": "canDelete", + "args": [ + { + "kind": "Literal", + "name": "action", + "value": "core:state-of-applicability:delete" + } + ], + "kind": "ScalarField", + "name": "permission", + "storageKey": "permission(action:\"core:state-of-applicability:delete\")" + }, + { + "alias": "statementsInfo", + "args": null, + "concreteType": "ApplicabilityStatementConnection", + "kind": "LinkedField", + "name": "applicabilityStatements", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "totalCount", + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "StateOfApplicability", + "abstractKey": null +}; + +(node as any).hash = "4f393828b72d1b7a4417a8eb2a5415b7"; + +export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityGraphPaginatedFragment.graphql.ts b/apps/console/src/__generated__/core/StatesOfApplicabilityPageFragment.graphql.ts similarity index 57% rename from apps/console/src/__generated__/core/StateOfApplicabilityGraphPaginatedFragment.graphql.ts rename to apps/console/src/__generated__/core/StatesOfApplicabilityPageFragment.graphql.ts index 29aa27b41..e5a9a9476 100644 --- a/apps/console/src/__generated__/core/StateOfApplicabilityGraphPaginatedFragment.graphql.ts +++ b/apps/console/src/__generated__/core/StatesOfApplicabilityPageFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<3472918fdff6205597f39a6310f2ee08>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -10,33 +10,25 @@ import { ReaderFragment } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; -export type StateOfApplicabilityGraphPaginatedFragment$data = { +export type StatesOfApplicabilityPageFragment$data = { readonly id: string; readonly statesOfApplicability: { readonly __id: string; readonly edges: ReadonlyArray<{ readonly node: { - readonly canDelete: boolean; - readonly controlsInfo: { - readonly totalCount: number; - }; - readonly createdAt: string; readonly id: string; - readonly name: string; - readonly snapshotId: string | null | undefined; - readonly sourceId: string | null | undefined; - readonly updatedAt: string; + readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityRowFragment">; }; }>; }; - readonly " $fragmentType": "StateOfApplicabilityGraphPaginatedFragment"; + readonly " $fragmentType": "StatesOfApplicabilityPageFragment"; }; -export type StateOfApplicabilityGraphPaginatedFragment$key = { - readonly " $data"?: StateOfApplicabilityGraphPaginatedFragment$data; - readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityGraphPaginatedFragment">; +export type StatesOfApplicabilityPageFragment$key = { + readonly " $data"?: StatesOfApplicabilityPageFragment$data; + readonly " $fragmentSpreads": FragmentRefs<"StatesOfApplicabilityPageFragment">; }; -import StateOfApplicabilityListQuery_graphql from './StateOfApplicabilityListQuery.graphql'; +import StatesOfApplicabilityPagePaginationQuery_graphql from './StatesOfApplicabilityPagePaginationQuery.graphql'; const node: ReaderFragment = (function(){ var v0 = [ @@ -112,14 +104,14 @@ return { "fragmentPathInResult": [ "node" ], - "operation": StateOfApplicabilityListQuery_graphql, + "operation": StatesOfApplicabilityPagePaginationQuery_graphql, "identifierInfo": { "identifierField": "id", "identifierQueryVariableName": "id" } } }, - "name": "StateOfApplicabilityGraphPaginatedFragment", + "name": "StatesOfApplicabilityPageFragment", "selections": [ { "alias": "statesOfApplicability", @@ -128,16 +120,11 @@ return { "kind": "Variable", "name": "filter", "variableName": "filter" - }, - { - "kind": "Variable", - "name": "orderBy", - "variableName": "order" } ], "concreteType": "StateOfApplicabilityConnection", "kind": "LinkedField", - "name": "__StateOfApplicabilityGraphPaginatedQuery_statesOfApplicability_connection", + "name": "__StatesOfApplicabilityPage_statesOfApplicability_connection", "plural": false, "selections": [ { @@ -158,76 +145,9 @@ return { "selections": [ (v1/*: any*/), { - "alias": null, "args": null, - "kind": "ScalarField", - "name": "name", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sourceId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "snapshotId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "createdAt", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - }, - { - "alias": "canDelete", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:state-of-applicability:delete" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:state-of-applicability:delete\")" - }, - { - "alias": "controlsInfo", - "args": [ - { - "kind": "Literal", - "name": "first", - "value": 0 - } - ], - "concreteType": "ControlConnection", - "kind": "LinkedField", - "name": "controls", - "plural": false, - "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "totalCount", - "storageKey": null - } - ], - "storageKey": "controls(first:0)" + "kind": "FragmentSpread", + "name": "StateOfApplicabilityRowFragment" }, { "alias": null, @@ -310,6 +230,6 @@ return { }; })(); -(node as any).hash = "82cf2a5ce701c34a41f8166371dd75c3"; +(node as any).hash = "30ea5e415eca53b251933d1ce086a9b7"; export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityListQuery.graphql.ts b/apps/console/src/__generated__/core/StatesOfApplicabilityPagePaginationQuery.graphql.ts similarity index 75% rename from apps/console/src/__generated__/core/StateOfApplicabilityListQuery.graphql.ts rename to apps/console/src/__generated__/core/StatesOfApplicabilityPagePaginationQuery.graphql.ts index f5331c7f7..d3db81b5f 100644 --- a/apps/console/src/__generated__/core/StateOfApplicabilityListQuery.graphql.ts +++ b/apps/console/src/__generated__/core/StatesOfApplicabilityPagePaginationQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<8bdd74dfae1b656006a07b2f89fe525d>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -19,7 +19,7 @@ export type StateOfApplicabilityOrder = { direction: OrderDirection; field: StateOfApplicabilityOrderField; }; -export type StateOfApplicabilityListQuery$variables = { +export type StatesOfApplicabilityPagePaginationQuery$variables = { after?: string | null | undefined; before?: string | null | undefined; filter?: StateOfApplicabilityFilter | null | undefined; @@ -28,14 +28,14 @@ export type StateOfApplicabilityListQuery$variables = { last?: number | null | undefined; order?: StateOfApplicabilityOrder | null | undefined; }; -export type StateOfApplicabilityListQuery$data = { +export type StatesOfApplicabilityPagePaginationQuery$data = { readonly node: { - readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityGraphPaginatedFragment">; + readonly " $fragmentSpreads": FragmentRefs<"StatesOfApplicabilityPageFragment">; }; }; -export type StateOfApplicabilityListQuery = { - response: StateOfApplicabilityListQuery$data; - variables: StateOfApplicabilityListQuery$variables; +export type StatesOfApplicabilityPagePaginationQuery = { + response: StatesOfApplicabilityPagePaginationQuery$data; + variables: StatesOfApplicabilityPagePaginationQuery$variables; }; const node: ConcreteRequest = (function(){ @@ -150,7 +150,7 @@ return { ], "kind": "Fragment", "metadata": null, - "name": "StateOfApplicabilityListQuery", + "name": "StatesOfApplicabilityPagePaginationQuery", "selections": [ { "alias": null, @@ -174,7 +174,7 @@ return { } ], "kind": "FragmentSpread", - "name": "StateOfApplicabilityGraphPaginatedFragment" + "name": "StatesOfApplicabilityPageFragment" } ], "storageKey": null @@ -195,7 +195,7 @@ return { (v4/*: any*/) ], "kind": "Operation", - "name": "StateOfApplicabilityListQuery", + "name": "StatesOfApplicabilityPagePaginationQuery", "selections": [ { "alias": null, @@ -242,20 +242,6 @@ return { "name": "name", "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sourceId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "snapshotId", - "storageKey": null - }, { "alias": null, "args": null, @@ -263,13 +249,6 @@ return { "name": "createdAt", "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - }, { "alias": "canDelete", "args": [ @@ -284,17 +263,11 @@ return { "storageKey": "permission(action:\"core:state-of-applicability:delete\")" }, { - "alias": "controlsInfo", - "args": [ - { - "kind": "Literal", - "name": "first", - "value": 0 - } - ], - "concreteType": "ControlConnection", + "alias": "statementsInfo", + "args": null, + "concreteType": "ApplicabilityStatementConnection", "kind": "LinkedField", - "name": "controls", + "name": "applicabilityStatements", "plural": false, "selections": [ { @@ -305,7 +278,7 @@ return { "storageKey": null } ], - "storageKey": "controls(first:0)" + "storageKey": null }, (v13/*: any*/) ], @@ -379,11 +352,10 @@ return { "alias": null, "args": (v15/*: any*/), "filters": [ - "orderBy", "filter" ], "handle": "connection", - "key": "StateOfApplicabilityGraphPaginatedQuery_statesOfApplicability", + "key": "StatesOfApplicabilityPage_statesOfApplicability", "kind": "LinkedHandle", "name": "statesOfApplicability" } @@ -397,16 +369,16 @@ return { ] }, "params": { - "cacheID": "68d8b8bc491e464ea692b6d37952bcbf", + "cacheID": "812dcba28ad3fb441e49e281a199fd62", "id": null, "metadata": {}, - "name": "StateOfApplicabilityListQuery", + "name": "StatesOfApplicabilityPagePaginationQuery", "operationKind": "query", - "text": "query StateOfApplicabilityListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $filter: StateOfApplicabilityFilter = {snapshotId: null}\n $first: Int = 50\n $last: Int = null\n $order: StateOfApplicabilityOrder = {direction: DESC, field: CREATED_AT}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...StateOfApplicabilityGraphPaginatedFragment_4cFWzS\n id\n }\n}\n\nfragment StateOfApplicabilityGraphPaginatedFragment_4cFWzS on Organization {\n statesOfApplicability(first: $first, after: $after, last: $last, before: $before, orderBy: $order, filter: $filter) {\n edges {\n node {\n id\n name\n sourceId\n snapshotId\n createdAt\n updatedAt\n canDelete: permission(action: \"core:state-of-applicability:delete\")\n controlsInfo: controls(first: 0) {\n totalCount\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 StatesOfApplicabilityPagePaginationQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $filter: StateOfApplicabilityFilter = {snapshotId: null}\n $first: Int = 50\n $last: Int = null\n $order: StateOfApplicabilityOrder = {direction: DESC, field: CREATED_AT}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...StatesOfApplicabilityPageFragment_4cFWzS\n id\n }\n}\n\nfragment StateOfApplicabilityRowFragment on StateOfApplicability {\n id\n name\n createdAt\n canDelete: permission(action: \"core:state-of-applicability:delete\")\n statementsInfo: applicabilityStatements {\n totalCount\n }\n}\n\nfragment StatesOfApplicabilityPageFragment_4cFWzS on Organization {\n statesOfApplicability(first: $first, after: $after, last: $last, before: $before, orderBy: $order, filter: $filter) {\n edges {\n node {\n id\n ...StateOfApplicabilityRowFragment\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 = "82cf2a5ce701c34a41f8166371dd75c3"; +(node as any).hash = "30ea5e415eca53b251933d1ce086a9b7"; export default node; diff --git a/apps/console/src/__generated__/core/StateOfApplicabilityGraphPaginatedQuery.graphql.ts b/apps/console/src/__generated__/core/StatesOfApplicabilityPageQuery.graphql.ts similarity index 73% rename from apps/console/src/__generated__/core/StateOfApplicabilityGraphPaginatedQuery.graphql.ts rename to apps/console/src/__generated__/core/StatesOfApplicabilityPageQuery.graphql.ts index 580784546..8cfc32d43 100644 --- a/apps/console/src/__generated__/core/StateOfApplicabilityGraphPaginatedQuery.graphql.ts +++ b/apps/console/src/__generated__/core/StatesOfApplicabilityPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -10,24 +10,24 @@ import { ConcreteRequest } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; -export type StateOfApplicabilityGraphPaginatedQuery$variables = { +export type StatesOfApplicabilityPageQuery$variables = { organizationId: string; }; -export type StateOfApplicabilityGraphPaginatedQuery$data = { +export type StatesOfApplicabilityPageQuery$data = { readonly organization: { readonly __typename: "Organization"; readonly canCreateStateOfApplicability: boolean; readonly id: string; - readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityGraphPaginatedFragment">; + readonly " $fragmentSpreads": FragmentRefs<"StatesOfApplicabilityPageFragment">; } | { // This will never be '%other', but we need some // value in case none of the concrete values match. readonly __typename: "%other"; }; }; -export type StateOfApplicabilityGraphPaginatedQuery = { - response: StateOfApplicabilityGraphPaginatedQuery$data; - variables: StateOfApplicabilityGraphPaginatedQuery$variables; +export type StatesOfApplicabilityPageQuery = { + response: StatesOfApplicabilityPageQuery$data; + variables: StatesOfApplicabilityPageQuery$variables; }; const node: ConcreteRequest = (function(){ @@ -99,7 +99,7 @@ return { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, - "name": "StateOfApplicabilityGraphPaginatedQuery", + "name": "StatesOfApplicabilityPageQuery", "selections": [ { "alias": "organization", @@ -118,7 +118,7 @@ return { { "args": null, "kind": "FragmentSpread", - "name": "StateOfApplicabilityGraphPaginatedFragment" + "name": "StatesOfApplicabilityPageFragment" } ], "type": "Organization", @@ -135,7 +135,7 @@ return { "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", - "name": "StateOfApplicabilityGraphPaginatedQuery", + "name": "StatesOfApplicabilityPageQuery", "selections": [ { "alias": "organization", @@ -183,20 +183,6 @@ return { "name": "name", "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "sourceId", - "storageKey": null - }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "snapshotId", - "storageKey": null - }, { "alias": null, "args": null, @@ -204,13 +190,6 @@ return { "name": "createdAt", "storageKey": null }, - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "updatedAt", - "storageKey": null - }, { "alias": "canDelete", "args": [ @@ -225,17 +204,11 @@ return { "storageKey": "permission(action:\"core:state-of-applicability:delete\")" }, { - "alias": "controlsInfo", - "args": [ - { - "kind": "Literal", - "name": "first", - "value": 0 - } - ], - "concreteType": "ControlConnection", + "alias": "statementsInfo", + "args": null, + "concreteType": "ApplicabilityStatementConnection", "kind": "LinkedField", - "name": "controls", + "name": "applicabilityStatements", "plural": false, "selections": [ { @@ -246,7 +219,7 @@ return { "storageKey": null } ], - "storageKey": "controls(first:0)" + "storageKey": null }, (v2/*: any*/) ], @@ -320,11 +293,10 @@ return { "alias": null, "args": (v5/*: any*/), "filters": [ - "orderBy", "filter" ], "handle": "connection", - "key": "StateOfApplicabilityGraphPaginatedQuery_statesOfApplicability", + "key": "StatesOfApplicabilityPage_statesOfApplicability", "kind": "LinkedHandle", "name": "statesOfApplicability" } @@ -338,16 +310,16 @@ return { ] }, "params": { - "cacheID": "3d53dfeb5366c889e790a88116dd3a4a", + "cacheID": "d0baef050f4750119d752ca5e17b134a", "id": null, "metadata": {}, - "name": "StateOfApplicabilityGraphPaginatedQuery", + "name": "StatesOfApplicabilityPageQuery", "operationKind": "query", - "text": "query StateOfApplicabilityGraphPaginatedQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n canCreateStateOfApplicability: permission(action: \"core:state-of-applicability:create\")\n ...StateOfApplicabilityGraphPaginatedFragment\n }\n id\n }\n}\n\nfragment StateOfApplicabilityGraphPaginatedFragment on Organization {\n statesOfApplicability(first: 50, orderBy: {direction: DESC, field: CREATED_AT}, filter: {snapshotId: null}) {\n edges {\n node {\n id\n name\n sourceId\n snapshotId\n createdAt\n updatedAt\n canDelete: permission(action: \"core:state-of-applicability:delete\")\n controlsInfo: controls(first: 0) {\n totalCount\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 StatesOfApplicabilityPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n canCreateStateOfApplicability: permission(action: \"core:state-of-applicability:create\")\n ...StatesOfApplicabilityPageFragment\n }\n id\n }\n}\n\nfragment StateOfApplicabilityRowFragment on StateOfApplicability {\n id\n name\n createdAt\n canDelete: permission(action: \"core:state-of-applicability:delete\")\n statementsInfo: applicabilityStatements {\n totalCount\n }\n}\n\nfragment StatesOfApplicabilityPageFragment on Organization {\n statesOfApplicability(first: 50, orderBy: {direction: DESC, field: CREATED_AT}, filter: {snapshotId: null}) {\n edges {\n node {\n id\n ...StateOfApplicabilityRowFragment\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 = "2182e7aea21c8eba8b2cfda1e614b6e5"; +(node as any).hash = "10fd3ffd276b002b98c3b9aa437ccbed"; export default node; diff --git a/apps/console/src/components/states-of-applicability/LinkedStatesOfApplicabilityCard.tsx b/apps/console/src/components/states-of-applicability/LinkedStatesOfApplicabilityCard.tsx index 443ee1842..2c6a929b8 100644 --- a/apps/console/src/components/states-of-applicability/LinkedStatesOfApplicabilityCard.tsx +++ b/apps/console/src/components/states-of-applicability/LinkedStatesOfApplicabilityCard.tsx @@ -15,7 +15,7 @@ import { Tr, TrButton, } from "@probo/ui"; -import { clsx } from "clsx"; +import clsx from "clsx"; import { useEffect, useMemo, useState } from "react"; import { useFragment } from "react-relay"; import { graphql } from "relay-runtime"; @@ -26,14 +26,15 @@ import { useOrganizationId } from "#/hooks/useOrganizationId"; import { LinkedStatesOfApplicabilityDialog } from "./LinkedStatesOfApplicabilityDialog"; const linkedStateOfApplicabilityFragment = graphql` - fragment LinkedStatesOfApplicabilityCardFragment on StateOfApplicabilityControl { + fragment LinkedStatesOfApplicabilityCardFragment on ApplicabilityStatement { id - stateOfApplicabilityId - controlId stateOfApplicability { id name } + control { + id + } applicability justification } @@ -233,7 +234,8 @@ function LinkedInfoExtractor(props: { controlId: string; }) => void; }) { - const { fragment, onExtracted } = props; + const { onExtracted, fragment } = props; + const data = useFragment( linkedStateOfApplicabilityFragment, fragment, @@ -241,10 +243,10 @@ function LinkedInfoExtractor(props: { useEffect(() => { onExtracted({ - stateOfApplicabilityId: data.stateOfApplicabilityId, - controlId: data.controlId, + stateOfApplicabilityId: data.stateOfApplicability.id, + controlId: data.control.id, }); - }, [data.stateOfApplicabilityId, data.controlId, onExtracted]); + }, [data.stateOfApplicability.id, data.control.id, onExtracted]); return null; } @@ -265,7 +267,7 @@ function StateOfApplicabilityRow(props: { return ( {soa.stateOfApplicability.name} @@ -282,8 +284,8 @@ function StateOfApplicabilityRow(props: { variant="secondary" onClick={() => props.onClick( - soa.stateOfApplicabilityId, - soa.controlId, + soa.stateOfApplicability.id, + soa.control.id, )} icon={IconTrashCan} > diff --git a/apps/console/src/hooks/graph/FrameworkGraph.ts b/apps/console/src/hooks/graph/FrameworkGraph.ts index 9acbaf11e..3fb0cae21 100644 --- a/apps/console/src/hooks/graph/FrameworkGraph.ts +++ b/apps/console/src/hooks/graph/FrameworkGraph.ts @@ -129,12 +129,6 @@ export const frameworkControlNodeQuery = graphql` canDeleteSnapshotMapping: permission( action: "core:control:delete-snapshot-mapping" ) - canCreateStateOfApplicabilityMapping: permission( - action: "core:control:state-of-applicability-control-mapping:create" - ) - canDeleteStateOfApplicabilityMapping: permission( - action: "core:control:state-of-applicability-control-mapping:delete" - ) canCreateObligationMapping: permission( action: "core:control:obligation-control-mapping:create" ) @@ -142,16 +136,6 @@ export const frameworkControlNodeQuery = graphql` action: "core:control:obligation-control-mapping:delete" ) ...FrameworkControlDialogFragment - stateOfApplicabilityControls(first: 100) - @connection(key: "FrameworkGraphControl_stateOfApplicabilityControls") { - __id - edges { - node { - id - ...LinkedStatesOfApplicabilityCardFragment - } - } - } measures(first: 100) @connection(key: "FrameworkGraphControl_measures") { __id diff --git a/apps/console/src/hooks/graph/StateOfApplicabilityGraph.ts b/apps/console/src/hooks/graph/StateOfApplicabilityGraph.ts deleted file mode 100644 index c5056a4ef..000000000 --- a/apps/console/src/hooks/graph/StateOfApplicabilityGraph.ts +++ /dev/null @@ -1,244 +0,0 @@ -import { - formatError, - type GraphQLError, - promisifyMutation, - sprintf, -} from "@probo/helpers"; -import { useTranslate } from "@probo/i18n"; -import { useConfirm, useToast } from "@probo/ui"; -import { - type PreloadedQuery, - useMutation, - usePaginationFragment, - usePreloadedQuery, -} from "react-relay"; -import { graphql } from "relay-runtime"; - -import type { StateOfApplicabilityGraphDeleteMutation } from "#/__generated__/core/StateOfApplicabilityGraphDeleteMutation.graphql"; -import type { StateOfApplicabilityGraphPaginatedFragment$key } from "#/__generated__/core/StateOfApplicabilityGraphPaginatedFragment.graphql"; -import type { StateOfApplicabilityGraphPaginatedQuery } from "#/__generated__/core/StateOfApplicabilityGraphPaginatedQuery.graphql"; - -export const paginatedStateOfApplicabilityQuery = graphql` - query StateOfApplicabilityGraphPaginatedQuery($organizationId: ID!) { - organization: node(id: $organizationId) { - __typename - ... on Organization { - id - canCreateStateOfApplicability: permission(action: "core:state-of-applicability:create") - ...StateOfApplicabilityGraphPaginatedFragment - } - } - } -`; - -export const paginatedStateOfApplicabilityFragment = graphql` - fragment StateOfApplicabilityGraphPaginatedFragment on Organization - @refetchable(queryName: "StateOfApplicabilityListQuery") - @argumentDefinitions( - first: { type: "Int", defaultValue: 50 } - order: { - type: "StateOfApplicabilityOrder" - defaultValue: { direction: DESC, field: CREATED_AT } - } - after: { type: "CursorKey", defaultValue: null } - before: { type: "CursorKey", defaultValue: null } - last: { type: "Int", defaultValue: null } - filter: { type: "StateOfApplicabilityFilter", defaultValue: { snapshotId: null } } - ) { - statesOfApplicability( - first: $first - after: $after - last: $last - before: $before - orderBy: $order - filter: $filter - ) @connection(key: "StateOfApplicabilityGraphPaginatedQuery_statesOfApplicability") { - __id - edges { - node { - id - name - sourceId - snapshotId - createdAt - updatedAt - - canDelete: permission(action: "core:state-of-applicability:delete") - - controlsInfo: controls(first: 0) { - totalCount - } - } - } - } - } -`; - -export function useStateOfApplicabilityQuery( - queryRef: PreloadedQuery, -) { - const data = usePreloadedQuery(paginatedStateOfApplicabilityQuery, queryRef); - const pagination = usePaginationFragment( - paginatedStateOfApplicabilityFragment, - data.organization as StateOfApplicabilityGraphPaginatedFragment$key, - ); - const statesOfApplicability = pagination.data.statesOfApplicability?.edges.map(edge => edge.node); - return { - ...pagination, - statesOfApplicability, - connectionId: pagination.data.statesOfApplicability.__id, - }; -} - -export const deleteStateOfApplicabilityMutation = graphql` - mutation StateOfApplicabilityGraphDeleteMutation( - $input: DeleteStateOfApplicabilityInput! - $connections: [ID!]! - ) { - deleteStateOfApplicability(input: $input) { - deletedStateOfApplicabilityId @deleteEdge(connections: $connections) - } - } -`; - -export const StateOfApplicabilityConnectionKey = "StateOfApplicabilityGraphPaginatedQuery_statesOfApplicability"; - -export const useDeleteStateOfApplicability = ( - stateOfApplicability: { id?: string; name?: string }, - connectionId: string, - onSuccess?: () => void, -) => { - const [mutate] = useMutation(deleteStateOfApplicabilityMutation); - const confirm = useConfirm(); - const { toast } = useToast(); - const { __ } = useTranslate(); - - return () => { - if (!stateOfApplicability.id || !stateOfApplicability.name) { - return alert(__("Failed to delete state of applicability: missing id or name")); - } - confirm( - () => - promisifyMutation(mutate)({ - variables: { - input: { - stateOfApplicabilityId: stateOfApplicability.id!, - }, - connections: [connectionId], - }, - }) - .then(() => { - onSuccess?.(); - }) - .catch((error) => { - toast({ - title: __("Error"), - description: formatError( - __("Failed to delete state of applicability"), - error as GraphQLError, - ), - variant: "error", - }); - }), - { - message: sprintf( - __( - "This will permanently delete \"%s\". This action cannot be undone.", - ), - stateOfApplicability.name, - ), - }, - ); - }; -}; - -export const createStateOfApplicabilityMutation = graphql` - mutation StateOfApplicabilityGraphCreateMutation( - $input: CreateStateOfApplicabilityInput! - $connections: [ID!]! - ) { - createStateOfApplicability(input: $input) { - stateOfApplicabilityEdge @prependEdge(connections: $connections) { - node { - id - name - sourceId - snapshotId - createdAt - updatedAt - } - } - } - } -`; - -export const updateStateOfApplicabilityMutation = graphql` - mutation StateOfApplicabilityGraphUpdateMutation( - $input: UpdateStateOfApplicabilityInput! - ) { - updateStateOfApplicability(input: $input) { - stateOfApplicability { - id - name - sourceId - snapshotId - createdAt - updatedAt - owner { - id - fullName - } - } - } - } -`; - -export const stateOfApplicabilityNodeQuery = graphql` - query StateOfApplicabilityGraphNodeQuery($stateOfApplicabilityId: ID!) { - node(id: $stateOfApplicabilityId) { - ... on StateOfApplicability { - id - name - sourceId - snapshotId - createdAt - updatedAt - canUpdate: permission(action: "core:state-of-applicability:update") - canDelete: permission(action: "core:state-of-applicability:delete") - canExport: permission(action: "core:state-of-applicability:export") - organization { - id - } - owner { - id - fullName - } - ...StateOfApplicabilityControlsTabFragment - } - } - } -`; - -export const stateOfApplicabilityForEditQuery = graphql` - query StateOfApplicabilityGraphForEditQuery($stateOfApplicabilityId: ID!) { - node(id: $stateOfApplicabilityId) { - ... on StateOfApplicability { - id - name - controls(first: 1000, orderBy: { field: SECTION_TITLE, direction: ASC }) { - edges { - node { - id - sectionTitle - name - framework { - id - name - } - } - } - } - } - } - } -`; diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkControlPage.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkControlPage.tsx index c388be630..329f095da 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkControlPage.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkControlPage.tsx @@ -26,187 +26,155 @@ import { LinkedDocumentsCard } from "#/components/documents/LinkedDocumentsCard" import { LinkedMeasuresCard } from "#/components/measures/LinkedMeasuresCard"; import { LinkedObligationsCard } from "#/components/obligations/LinkedObligationsCard"; import { LinkedSnapshotsCard } from "#/components/snapshots/LinkedSnapshotsCard"; -import { LinkedStatesOfApplicabilityCard } from "#/components/states-of-applicability/LinkedStatesOfApplicabilityCard"; import { frameworkControlNodeQuery } from "#/hooks/graph/FrameworkGraph"; import { useOrganizationId } from "#/hooks/useOrganizationId"; import { FrameworkControlDialog } from "./dialogs/FrameworkControlDialog"; -const attachStateOfApplicabilityMutation = graphql` - mutation FrameworkControlPageAttachStateOfApplicabilityMutation( - $input: CreateStateOfApplicabilityControlMappingInput! - $connections: [ID!]! - ) { - createStateOfApplicabilityControlMapping(input: $input) { - stateOfApplicabilityControlEdge - @prependEdge(connections: $connections) { - node { - id - ...LinkedStatesOfApplicabilityCardFragment - } - } - } - } -`; - -const detachStateOfApplicabilityMutation = graphql` - mutation FrameworkControlPageDetachStateOfApplicabilityMutation( - $input: DeleteStateOfApplicabilityControlMappingInput! - $connections: [ID!]! - ) { - deleteStateOfApplicabilityControlMapping(input: $input) { - deletedStateOfApplicabilityId - deletedControlId - deletedStateOfApplicabilityControlId - @deleteEdge(connections: $connections) - } - } -`; - const attachMeasureMutation = graphql` - mutation FrameworkControlPageAttachMutation( - $input: CreateControlMeasureMappingInput! - $connections: [ID!]! - ) { - createControlMeasureMapping(input: $input) { - measureEdge @prependEdge(connections: $connections) { - node { - id - ...LinkedMeasuresCardFragment - } - } - } - } + mutation FrameworkControlPageAttachMutation( + $input: CreateControlMeasureMappingInput! + $connections: [ID!]! + ) { + createControlMeasureMapping(input: $input) { + measureEdge @prependEdge(connections: $connections) { + node { + id + ...LinkedMeasuresCardFragment + } + } + } + } `; const detachMeasureMutation = graphql` - mutation FrameworkControlPageDetachMutation( - $input: DeleteControlMeasureMappingInput! - $connections: [ID!]! - ) { - deleteControlMeasureMapping(input: $input) { - deletedMeasureId @deleteEdge(connections: $connections) - } - } + mutation FrameworkControlPageDetachMutation( + $input: DeleteControlMeasureMappingInput! + $connections: [ID!]! + ) { + deleteControlMeasureMapping(input: $input) { + deletedMeasureId @deleteEdge(connections: $connections) + } + } `; const attachDocumentMutation = graphql` - mutation FrameworkControlPageAttachDocumentMutation( - $input: CreateControlDocumentMappingInput! - $connections: [ID!]! - ) { - createControlDocumentMapping(input: $input) { - documentEdge @prependEdge(connections: $connections) { - node { - id - ...LinkedDocumentsCardFragment - } - } - } - } + mutation FrameworkControlPageAttachDocumentMutation( + $input: CreateControlDocumentMappingInput! + $connections: [ID!]! + ) { + createControlDocumentMapping(input: $input) { + documentEdge @prependEdge(connections: $connections) { + node { + id + ...LinkedDocumentsCardFragment + } + } + } + } `; const detachDocumentMutation = graphql` - mutation FrameworkControlPageDetachDocumentMutation( - $input: DeleteControlDocumentMappingInput! - $connections: [ID!]! - ) { - deleteControlDocumentMapping(input: $input) { - deletedDocumentId @deleteEdge(connections: $connections) - } - } + mutation FrameworkControlPageDetachDocumentMutation( + $input: DeleteControlDocumentMappingInput! + $connections: [ID!]! + ) { + deleteControlDocumentMapping(input: $input) { + deletedDocumentId @deleteEdge(connections: $connections) + } + } `; const attachAuditMutation = graphql` - mutation FrameworkControlPageAttachAuditMutation( - $input: CreateControlAuditMappingInput! - $connections: [ID!]! - ) { - createControlAuditMapping(input: $input) { - auditEdge @prependEdge(connections: $connections) { - node { - id - ...LinkedAuditsCardFragment - } - } - } - } + mutation FrameworkControlPageAttachAuditMutation( + $input: CreateControlAuditMappingInput! + $connections: [ID!]! + ) { + createControlAuditMapping(input: $input) { + auditEdge @prependEdge(connections: $connections) { + node { + id + ...LinkedAuditsCardFragment + } + } + } + } `; const detachAuditMutation = graphql` - mutation FrameworkControlPageDetachAuditMutation( - $input: DeleteControlAuditMappingInput! - $connections: [ID!]! - ) { - deleteControlAuditMapping(input: $input) { - deletedAuditId @deleteEdge(connections: $connections) - } - } + mutation FrameworkControlPageDetachAuditMutation( + $input: DeleteControlAuditMappingInput! + $connections: [ID!]! + ) { + deleteControlAuditMapping(input: $input) { + deletedAuditId @deleteEdge(connections: $connections) + } + } `; const attachObligationMutation = graphql` - mutation FrameworkControlPageAttachObligationMutation( - $input: CreateControlObligationMappingInput! - $connections: [ID!]! - ) { - createControlObligationMapping(input: $input) { - obligationEdge @prependEdge(connections: $connections) { - node { - id - ...LinkedObligationsCardFragment - } - } - } - } + mutation FrameworkControlPageAttachObligationMutation( + $input: CreateControlObligationMappingInput! + $connections: [ID!]! + ) { + createControlObligationMapping(input: $input) { + obligationEdge @prependEdge(connections: $connections) { + node { + id + ...LinkedObligationsCardFragment + } + } + } + } `; const detachObligationMutation = graphql` - mutation FrameworkControlPageDetachObligationMutation( - $input: DeleteControlObligationMappingInput! - $connections: [ID!]! - ) { - deleteControlObligationMapping(input: $input) { - deletedObligationId @deleteEdge(connections: $connections) - } - } + mutation FrameworkControlPageDetachObligationMutation( + $input: DeleteControlObligationMappingInput! + $connections: [ID!]! + ) { + deleteControlObligationMapping(input: $input) { + deletedObligationId @deleteEdge(connections: $connections) + } + } `; const attachSnapshotMutation = graphql` - mutation FrameworkControlPageAttachSnapshotMutation( - $input: CreateControlSnapshotMappingInput! - $connections: [ID!]! - ) { - createControlSnapshotMapping(input: $input) { - snapshotEdge @prependEdge(connections: $connections) { - node { - id - ...LinkedSnapshotsCardFragment - } - } - } - } + mutation FrameworkControlPageAttachSnapshotMutation( + $input: CreateControlSnapshotMappingInput! + $connections: [ID!]! + ) { + createControlSnapshotMapping(input: $input) { + snapshotEdge @prependEdge(connections: $connections) { + node { + id + ...LinkedSnapshotsCardFragment + } + } + } + } `; const detachSnapshotMutation = graphql` - mutation FrameworkControlPageDetachSnapshotMutation( - $input: DeleteControlSnapshotMappingInput! - $connections: [ID!]! - ) { - deleteControlSnapshotMapping(input: $input) { - deletedSnapshotId @deleteEdge(connections: $connections) - } - } + mutation FrameworkControlPageDetachSnapshotMutation( + $input: DeleteControlSnapshotMappingInput! + $connections: [ID!]! + ) { + deleteControlSnapshotMapping(input: $input) { + deletedSnapshotId @deleteEdge(connections: $connections) + } + } `; const deleteControlMutation = graphql` - mutation FrameworkControlPageDeleteControlMutation( - $input: DeleteControlInput! - $connections: [ID!]! - ) { - deleteControl(input: $input) { - deletedControlId @deleteEdge(connections: $connections) - } - } + mutation FrameworkControlPageDeleteControlMutation( + $input: DeleteControlInput! + $connections: [ID!]! + ) { + deleteControl(input: $input) { + deletedControlId @deleteEdge(connections: $connections) + } + } `; type Props = { @@ -214,8 +182,8 @@ type Props = { }; /** - * Display the control detail on the right panel - */ +* Display the control detail on the right panel +*/ export default function FrameworkControlPage({ queryRef }: Props) { const { __ } = useTranslate(); const { toast } = useToast(); @@ -249,10 +217,6 @@ export default function FrameworkControlPage({ queryRef }: Props) { ); const [deleteControl] = useMutation(deleteControlMutation); - const [attachStateOfApplicability, isAttachingStateOfApplicability] - = useMutation(attachStateOfApplicabilityMutation); - const [detachStateOfApplicability, isDetachingStateOfApplicability] - = useMutation(detachStateOfApplicabilityMutation); const [attachObligation, isAttachingObligation] = useMutation( attachObligationMutation, ); @@ -260,13 +224,6 @@ export default function FrameworkControlPage({ queryRef }: Props) { detachObligationMutation, ); - const canLinkStateOfApplicability - = control.canCreateStateOfApplicabilityMapping; - const canUnlinkStateOfApplicability - = control.canDeleteStateOfApplicabilityMapping; - const statesOfApplicabilityReadOnly - = !canLinkStateOfApplicability && !canUnlinkStateOfApplicability; - const canLinkMeasure = control.canCreateMeasureMapping; const canUnlinkMeasure = control.canDeleteMeasureMapping; const measuresReadOnly = !canLinkMeasure && !canUnlinkMeasure; @@ -396,33 +353,6 @@ export default function FrameworkControlPage({ queryRef }: Props) { )}
{control.name}
-
- edge.node, - ) ?? [] - } - params={{ controlId: control.id }} - connectionId={ - control.stateOfApplicabilityControls?.__id ?? "" - } - onAttach={withErrorHandling( - attachStateOfApplicability, - __("Failed to link state of applicability"), - )} - onDetach={withErrorHandling( - detachStateOfApplicability, - __("Failed to unlink state of applicability"), - )} - disabled={ - isAttachingStateOfApplicability - || isDetachingStateOfApplicability - } - readOnly={statesOfApplicabilityReadOnly} - /> -
; + queryRef: PreloadedQuery; }; export default function StateOfApplicabilityDetailPage(props: Props) { @@ -61,14 +120,13 @@ export default function StateOfApplicabilityDetailPage(props: Props) { snapshotId?: string; }>(); const organizationId = useOrganizationId(); - const data = usePreloadedQuery( - stateOfApplicabilityNodeQuery, - props.queryRef, - ); + const data = usePreloadedQuery(stateOfApplicabilityDetailPageQuery, props.queryRef); const stateOfApplicability = data.node; const { __ } = useTranslate(); const navigate = useNavigate(); const isSnapshotMode = Boolean(snapshotId); + const confirm = useConfirm(); + const { toast } = useToast(); if (!stateOfApplicabilityId || !stateOfApplicability) { throw new Error( @@ -81,23 +139,55 @@ export default function StateOfApplicabilityDetailPage(props: Props) { const connectionId = ConnectionHandler.getConnectionID( organizationId, StateOfApplicabilityConnectionKey, + { filter: { snapshotId: snapshotId ?? null } }, ); - const deleteStateOfApplicability = useDeleteStateOfApplicability( - stateOfApplicability, - connectionId, - () => - void navigate( - `/organizations/${organizationId}/states-of-applicability`, - ), - ); + const [deleteStateOfApplicability] = useMutation(deleteMutation); + + const handleDelete = () => { + if (!stateOfApplicability.id || !stateOfApplicability.name) { + return alert(__("Failed to delete state of applicability: missing id or name")); + } + confirm( + () => + promisifyMutation(deleteStateOfApplicability)({ + variables: { + input: { + stateOfApplicabilityId: stateOfApplicability.id!, + }, + connections: [connectionId], + }, + }) + .then(() => { + void navigate(`/organizations/${organizationId}/states-of-applicability`); + }) + .catch((error) => { + toast({ + title: __("Error"), + description: formatError( + __("Failed to delete state of applicability"), + error as GraphQLError, + ), + variant: "error", + }); + }), + { + message: sprintf( + __( + "This will permanently delete \"%s\". This action cannot be undone.", + ), + stateOfApplicability.name, + ), + }, + ); + }; usePageTitle(stateOfApplicability.name || __("State of Applicability")); const [isEditingName, setIsEditingName] = useState(false); const [isEditingOwner, setIsEditingOwner] = useState(false); - const [updateStateOfApplicability, isUpdating] = useMutationWithToasts( - updateStateOfApplicabilityMutation, + const [updateStateOfApplicability, isUpdating] = useMutationWithToasts( + updateMutation, { successMessage: __("State of Applicability updated successfully."), errorMessage: __("Failed to update State of Applicability"), @@ -109,7 +199,7 @@ export default function StateOfApplicabilityDetailPage(props: Props) { const [exportStateOfApplicabilityPDF, isExporting] = useMutationWithToasts( - exportStateOfApplicabilityPDFMutation, + exportMutation, { successMessage: __( "State of Applicability exported successfully.", @@ -298,7 +388,7 @@ export default function StateOfApplicabilityDetailPage(props: Props) { void deleteStateOfApplicability()} + onClick={handleDelete} > {__("Delete")} @@ -384,7 +474,7 @@ export default function StateOfApplicabilityDetailPage(props: Props) { {stateOfApplicability.id && (

- {__("Controls")} + {__("Statements")}

(); + const [queryRef, loadQuery] + = useQueryLoader(stateOfApplicabilityDetailPageQuery); + + useEffect(() => { + if (stateOfApplicabilityId) { + loadQuery({ stateOfApplicabilityId }); + } + }, [loadQuery, stateOfApplicabilityId]); + + if (!queryRef) { + return ; + } + + return ( + }> + + + ); +} diff --git a/apps/console/src/pages/organizations/states-of-applicability/StatesOfApplicabilityPage.tsx b/apps/console/src/pages/organizations/states-of-applicability/StatesOfApplicabilityPage.tsx index 7d5a16a13..bf333803f 100644 --- a/apps/console/src/pages/organizations/states-of-applicability/StatesOfApplicabilityPage.tsx +++ b/apps/console/src/pages/organizations/states-of-applicability/StatesOfApplicabilityPage.tsx @@ -1,54 +1,83 @@ -import { formatDate } from "@probo/helpers"; import { usePageTitle } from "@probo/hooks"; import { useTranslate } from "@probo/i18n"; import { - ActionDropdown, Button, Card, - DropdownItem, IconPlusLarge, - IconTrashCan, PageHeader, Table, Tbody, - Td, Th, Thead, Tr, } from "@probo/ui"; import { useEffect } from "react"; import { + graphql, type PreloadedQuery, usePaginationFragment, usePreloadedQuery, } from "react-relay"; import { useParams } from "react-router"; -import type { - StateOfApplicabilityGraphPaginatedFragment$data, - StateOfApplicabilityGraphPaginatedFragment$key, -} from "#/__generated__/core/StateOfApplicabilityGraphPaginatedFragment.graphql"; -import type { StateOfApplicabilityGraphPaginatedQuery } from "#/__generated__/core/StateOfApplicabilityGraphPaginatedQuery.graphql"; -import type { StateOfApplicabilityListQuery } from "#/__generated__/core/StateOfApplicabilityListQuery.graphql"; +import type { StatesOfApplicabilityPageFragment$key } from "#/__generated__/core/StatesOfApplicabilityPageFragment.graphql"; +import type { StatesOfApplicabilityPagePaginationQuery } from "#/__generated__/core/StatesOfApplicabilityPagePaginationQuery.graphql"; +import type { StatesOfApplicabilityPageQuery } from "#/__generated__/core/StatesOfApplicabilityPageQuery.graphql"; import { SnapshotBanner } from "#/components/SnapshotBanner"; -import { - paginatedStateOfApplicabilityFragment, - paginatedStateOfApplicabilityQuery, - useDeleteStateOfApplicability, -} from "#/hooks/graph/StateOfApplicabilityGraph"; -import { useOrganizationId } from "#/hooks/useOrganizationId"; -import type { NodeOf } from "#/types"; +import { StateOfApplicabilityRow } from "./_components/StateOfApplicabilityRow"; import { CreateStateOfApplicabilityDialog } from "./dialogs/CreateStateOfApplicabilityDialog"; -type StateOfApplicability = NodeOf< - StateOfApplicabilityGraphPaginatedFragment$data["statesOfApplicability"] ->; +export const statesOfApplicabilityPageQuery = graphql` + query StatesOfApplicabilityPageQuery($organizationId: ID!) { + organization: node(id: $organizationId) { + __typename + ... on Organization { + id + canCreateStateOfApplicability: permission(action: "core:state-of-applicability:create") + ...StatesOfApplicabilityPageFragment + } + } + } +`; + +const paginatedFragment = graphql` + fragment StatesOfApplicabilityPageFragment on Organization + @refetchable(queryName: "StatesOfApplicabilityPagePaginationQuery") + @argumentDefinitions( + first: { type: "Int", defaultValue: 50 } + order: { + type: "StateOfApplicabilityOrder" + defaultValue: { direction: DESC, field: CREATED_AT } + } + after: { type: "CursorKey", defaultValue: null } + before: { type: "CursorKey", defaultValue: null } + last: { type: "Int", defaultValue: null } + filter: { type: "StateOfApplicabilityFilter", defaultValue: { snapshotId: null } } + ) { + statesOfApplicability( + first: $first + after: $after + last: $last + before: $before + orderBy: $order + filter: $filter + ) @connection(key: "StatesOfApplicabilityPage_statesOfApplicability", filters: ["filter"]) { + __id + edges { + node { + id + ...StateOfApplicabilityRowFragment + } + } + } + } +`; export default function StatesOfApplicabilityPage({ queryRef, }: { - queryRef: PreloadedQuery; + queryRef: PreloadedQuery; }) { const { __ } = useTranslate(); const { snapshotId } = useParams<{ snapshotId?: string }>(); @@ -56,11 +85,7 @@ export default function StatesOfApplicabilityPage({ usePageTitle(__("States of Applicability")); - const { organization } - = usePreloadedQuery( - paginatedStateOfApplicabilityQuery, - queryRef, - ); + const { organization } = usePreloadedQuery(statesOfApplicabilityPageQuery, queryRef); if (organization.__typename !== "Organization") { throw new Error("Organization not found"); @@ -73,11 +98,10 @@ export default function StatesOfApplicabilityPage({ refetch, isLoadingNext, } = usePaginationFragment< - StateOfApplicabilityListQuery, - StateOfApplicabilityGraphPaginatedFragment$key - >(paginatedStateOfApplicabilityFragment, organization); + StatesOfApplicabilityPagePaginationQuery, + StatesOfApplicabilityPageFragment$key + >(paginatedFragment, organization); - // Refetch with snapshot filter when in snapshot mode useEffect(() => { if (snapshotId) { refetch( @@ -87,12 +111,6 @@ export default function StatesOfApplicabilityPage({ } }, [snapshotId, refetch]); - const hasAnyAction - = !isSnapshotMode - && statesOfApplicability.edges - .map(edge => edge.node) - .some(({ canDelete }) => canDelete); - return (
{snapshotId && } @@ -123,16 +141,14 @@ export default function StatesOfApplicabilityPage({ {__("Name")} {__("Created at")} {__("Controls")} - {hasAnyAction && {__("Actions")}} {statesOfApplicability.edges.map(edge => ( ))} @@ -170,56 +186,3 @@ export default function StatesOfApplicabilityPage({
); } - -function StateOfApplicabilityRow({ - stateOfApplicability, - connectionId, - hasAnyAction, -}: { - stateOfApplicability: StateOfApplicability; - connectionId: string; - hasAnyAction: boolean; -}) { - const { __ } = useTranslate(); - const organizationId = useOrganizationId(); - const { snapshotId } = useParams<{ snapshotId?: string }>(); - const deleteStateOfApplicability = useDeleteStateOfApplicability( - stateOfApplicability, - connectionId, - ); - - const detailUrl = snapshotId - ? `/organizations/${organizationId}/snapshots/${snapshotId}/states-of-applicability/${stateOfApplicability.id}` - : `/organizations/${organizationId}/states-of-applicability/${stateOfApplicability.id}`; - - return ( - - {stateOfApplicability.name} - - - - {stateOfApplicability.controlsInfo?.totalCount ?? 0} - {hasAnyAction && ( - - - {stateOfApplicability.canDelete && ( - { - e.preventDefault(); - e.stopPropagation(); - deleteStateOfApplicability(); - }} - > - {__("Delete")} - - )} - - - )} - - ); -} diff --git a/apps/console/src/pages/organizations/states-of-applicability/StatesOfApplicabilityPageLoader.tsx b/apps/console/src/pages/organizations/states-of-applicability/StatesOfApplicabilityPageLoader.tsx new file mode 100644 index 000000000..c9e4bba6d --- /dev/null +++ b/apps/console/src/pages/organizations/states-of-applicability/StatesOfApplicabilityPageLoader.tsx @@ -0,0 +1,28 @@ +import { Suspense, useEffect } from "react"; +import { useQueryLoader } from "react-relay"; + +import type { StatesOfApplicabilityPageQuery } from "#/__generated__/core/StatesOfApplicabilityPageQuery.graphql"; +import { PageSkeleton } from "#/components/skeletons/PageSkeleton"; +import { useOrganizationId } from "#/hooks/useOrganizationId"; + +import StatesOfApplicabilityPage, { statesOfApplicabilityPageQuery } from "./StatesOfApplicabilityPage"; + +export default function StatesOfApplicabilityPageLoader() { + const organizationId = useOrganizationId(); + const [queryRef, loadQuery] + = useQueryLoader(statesOfApplicabilityPageQuery); + + useEffect(() => { + loadQuery({ organizationId }); + }, [loadQuery, organizationId]); + + if (!queryRef) { + return ; + } + + return ( + }> + + + ); +} diff --git a/apps/console/src/pages/organizations/states-of-applicability/_components/StateOfApplicabilityRow.tsx b/apps/console/src/pages/organizations/states-of-applicability/_components/StateOfApplicabilityRow.tsx new file mode 100644 index 000000000..426a7e71f --- /dev/null +++ b/apps/console/src/pages/organizations/states-of-applicability/_components/StateOfApplicabilityRow.tsx @@ -0,0 +1,127 @@ +import { formatDate, formatError, type GraphQLError, promisifyMutation, sprintf } from "@probo/helpers"; +import { useTranslate } from "@probo/i18n"; +import { + ActionDropdown, + DropdownItem, + IconTrashCan, + Td, + Tr, + useConfirm, + useToast, +} from "@probo/ui"; +import { useFragment, useMutation } from "react-relay"; +import { useParams } from "react-router"; +import { graphql } from "relay-runtime"; + +import type { StateOfApplicabilityRowDeleteMutation } from "#/__generated__/core/StateOfApplicabilityRowDeleteMutation.graphql"; +import type { StateOfApplicabilityRowFragment$key } from "#/__generated__/core/StateOfApplicabilityRowFragment.graphql"; +import { useOrganizationId } from "#/hooks/useOrganizationId"; + +const fragment = graphql` + fragment StateOfApplicabilityRowFragment on StateOfApplicability { + id + name + createdAt + canDelete: permission(action: "core:state-of-applicability:delete") + statementsInfo: applicabilityStatements { + totalCount + } + } +`; + +const deleteMutation = graphql` + mutation StateOfApplicabilityRowDeleteMutation( + $input: DeleteStateOfApplicabilityInput! + $connections: [ID!]! + ) { + deleteStateOfApplicability(input: $input) { + deletedStateOfApplicabilityId @deleteEdge(connections: $connections) + } + } +`; + +type Props = { + fKey: StateOfApplicabilityRowFragment$key; + connectionId: string; +}; + +export function StateOfApplicabilityRow({ fKey, connectionId }: Props) { + const { __ } = useTranslate(); + const organizationId = useOrganizationId(); + const { snapshotId } = useParams<{ snapshotId?: string }>(); + const confirm = useConfirm(); + const { toast } = useToast(); + const isSnapshotMode = Boolean(snapshotId); + + const stateOfApplicability = useFragment(fragment, fKey); + const canDelete = !isSnapshotMode && stateOfApplicability.canDelete; + + const [deleteStateOfApplicability] = useMutation(deleteMutation); + + const handleDelete = () => { + if (!stateOfApplicability.id || !stateOfApplicability.name) { + return alert(__("Failed to delete state of applicability: missing id or name")); + } + confirm( + () => + promisifyMutation(deleteStateOfApplicability)({ + variables: { + input: { + stateOfApplicabilityId: stateOfApplicability.id, + }, + connections: [connectionId], + }, + }).catch((error) => { + toast({ + title: __("Error"), + description: formatError( + __("Failed to delete state of applicability"), + error as GraphQLError, + ), + variant: "error", + }); + }), + { + message: sprintf( + __( + "This will permanently delete \"%s\". This action cannot be undone.", + ), + stateOfApplicability.name, + ), + }, + ); + }; + + const detailUrl = snapshotId + ? `/organizations/${organizationId}/snapshots/${snapshotId}/states-of-applicability/${stateOfApplicability.id}` + : `/organizations/${organizationId}/states-of-applicability/${stateOfApplicability.id}`; + + return ( + + {stateOfApplicability.name} + + + + {stateOfApplicability.statementsInfo?.totalCount ?? 0} + {canDelete && ( + + + { + e.preventDefault(); + e.stopPropagation(); + handleDelete(); + }} + > + {__("Delete")} + + + + )} + + ); +} diff --git a/apps/console/src/pages/organizations/states-of-applicability/dialogs/AddApplicabilityStatementDialog.tsx b/apps/console/src/pages/organizations/states-of-applicability/dialogs/AddApplicabilityStatementDialog.tsx new file mode 100644 index 000000000..9676db338 --- /dev/null +++ b/apps/console/src/pages/organizations/states-of-applicability/dialogs/AddApplicabilityStatementDialog.tsx @@ -0,0 +1,525 @@ +import { useTranslate } from "@probo/i18n"; +import { + Badge, + Breadcrumb, + Button, + Dialog, + DialogContent, + DialogFooter, + IconCheckmark1, + IconChevronDown, + IconChevronUp, + IconMagnifyingGlass, + Input, + Option, + Select, + Spinner, + Textarea, + useDialogRef, +} from "@probo/ui"; +import { forwardRef, Suspense, useImperativeHandle, useMemo, useState } from "react"; +import { graphql, useLazyLoadQuery } from "react-relay"; + +import type { AddApplicabilityStatementDialogQuery } from "#/__generated__/core/AddApplicabilityStatementDialogQuery.graphql"; +import { useMutationWithToasts } from "#/hooks/useMutationWithToasts"; + +const query = graphql` + query AddApplicabilityStatementDialogQuery($stateOfApplicabilityId: ID!, $organizationId: ID!) { + stateOfApplicability: node(id: $stateOfApplicabilityId) { + ... on StateOfApplicability { + id + applicabilityStatements(first: 10000) { + edges { + node { + id + applicability + justification + control { + id + } + } + } + } + } + } + organization: node(id: $organizationId) { + ... on Organization { + id + controls(first: 10000, orderBy: { direction: ASC, field: CREATED_AT }) { + edges { + node { + id + sectionTitle + name + framework { + id + name + } + } + } + } + } + } + } +`; + +const createApplicabilityStatementMutation = graphql` + mutation AddApplicabilityStatementDialogCreateMutation( + $input: CreateApplicabilityStatementInput! + $connections: [ID!]! + ) { + createApplicabilityStatement(input: $input) { + applicabilityStatementEdge @appendEdge(connections: $connections) { + node { + id + applicability + justification + control { + id + sectionTitle + name + bestPractice + regulatory + contractual + riskAssessment + framework { + id + name + } + organization { + id + } + } + } + } + } + } +`; + +const deleteApplicabilityStatementMutation = graphql` + mutation AddApplicabilityStatementDialogDeleteMutation( + $input: DeleteApplicabilityStatementInput! + $connections: [ID!]! + ) { + deleteApplicabilityStatement(input: $input) { + deletedApplicabilityStatementId @deleteEdge(connections: $connections) + } + } +`; + +const updateApplicabilityStatementMutation = graphql` + mutation AddApplicabilityStatementDialogUpdateMutation( + $input: UpdateApplicabilityStatementInput! + ) { + updateApplicabilityStatement(input: $input) { + applicabilityStatement { + id + applicability + justification + } + } + } +`; + +export type AddApplicabilityStatementDialogRef = { + open: (stateOfApplicabilityId: string, organizationId: string, connectionId: string) => void; +}; + +type ControlWithStatement = { + controlId: string; + sectionTitle: string; + name: string; + frameworkId: string; + frameworkName: string; + applicabilityStatementId: string | null; + applicability: boolean | null; + justification: string | null; +}; + +function ControlRow({ + control, + stateOfApplicabilityId, + connectionId, +}: { + control: ControlWithStatement; + stateOfApplicabilityId: string; + connectionId: string; +}) { + const { __ } = useTranslate(); + const isLinked = control.applicabilityStatementId !== null; + const [selectedState, setSelectedState] = useState(() => { + if (!isLinked) return "not-linked"; + return control.applicability ? "applicable" : "not-applicable"; + }); + const [justification, setJustification] = useState(control.justification || ""); + const [showJustification, setShowJustification] = useState(false); + + const [createApplicabilityStatement, isCreating] = useMutationWithToasts( + createApplicabilityStatementMutation, + { + successMessage: __("Statement created successfully."), + errorMessage: __("Failed to create statement"), + }, + ); + + const [deleteApplicabilityStatement, isDeleting] = useMutationWithToasts( + deleteApplicabilityStatementMutation, + { + successMessage: __("Statement removed successfully."), + errorMessage: __("Failed to remove statement"), + }, + ); + + const [updateApplicabilityStatement, isUpdating] = useMutationWithToasts( + updateApplicabilityStatementMutation, + { + successMessage: __("Statement updated successfully."), + errorMessage: __("Failed to update statement"), + }, + ); + + const handleStateChange = async (newState: string) => { + setSelectedState(newState); + + if (newState === "not-linked") { + if (!control.applicabilityStatementId) return; + await deleteApplicabilityStatement({ + variables: { + input: { + applicabilityStatementId: control.applicabilityStatementId, + }, + connections: [connectionId], + }, + onSuccess: () => { + setShowJustification(false); + }, + }); + } else if (newState === "applicable") { + setShowJustification(false); + if (control.applicabilityStatementId) { + // Statement already exists, use update mutation + await updateApplicabilityStatement({ + variables: { + input: { + applicabilityStatementId: control.applicabilityStatementId, + applicability: true, + justification: null, + }, + }, + }); + } else { + // No statement exists, use create mutation + await createApplicabilityStatement({ + variables: { + input: { + stateOfApplicabilityId, + controlId: control.controlId, + applicability: true, + justification: null, + }, + connections: [connectionId], + }, + }); + } + } else if (newState === "not-applicable") { + setShowJustification(true); + setJustification(control.justification || ""); + } + }; + + const handleSaveJustification = async () => { + if (control.applicabilityStatementId) { + // Statement already exists, use update mutation + await updateApplicabilityStatement({ + variables: { + input: { + applicabilityStatementId: control.applicabilityStatementId, + applicability: false, + justification: justification || null, + }, + }, + onSuccess: () => { + setShowJustification(false); + }, + }); + } else { + // No statement exists, use create mutation + await createApplicabilityStatement({ + variables: { + input: { + stateOfApplicabilityId, + controlId: control.controlId, + applicability: false, + justification: justification || null, + }, + connections: [connectionId], + }, + onSuccess: () => { + setShowJustification(false); + }, + }); + } + }; + + return ( +
+
+
+
+ {control.sectionTitle} + + {control.name} + +
+ {isLinked + && control.applicability !== null + && !showJustification + && control.justification && ( +
+ {control.justification} +
+ )} +
+
+ +
+
+ {showJustification && ( +
+