274
apps/console/src/__generated__/core/AddApplicabilityStatementDialogCreateMutation.graphql.ts
generated
Normal file
274
apps/console/src/__generated__/core/AddApplicabilityStatementDialogCreateMutation.graphql.ts
generated
Normal file
@@ -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<string>;
|
||||
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;
|
||||
132
apps/console/src/__generated__/core/AddApplicabilityStatementDialogDeleteMutation.graphql.ts
generated
Normal file
132
apps/console/src/__generated__/core/AddApplicabilityStatementDialogDeleteMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* @generated SignedSource<<b655b8a8c70af9ceb259e2fed933f397>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteApplicabilityStatementInput = {
|
||||
applicabilityStatementId: string;
|
||||
};
|
||||
export type AddApplicabilityStatementDialogDeleteMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
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;
|
||||
352
apps/console/src/__generated__/core/AddApplicabilityStatementDialogQuery.graphql.ts
generated
Normal file
352
apps/console/src/__generated__/core/AddApplicabilityStatementDialogQuery.graphql.ts
generated
Normal file
@@ -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;
|
||||
123
apps/console/src/__generated__/core/AddApplicabilityStatementDialogUpdateMutation.graphql.ts
generated
Normal file
123
apps/console/src/__generated__/core/AddApplicabilityStatementDialogUpdateMutation.graphql.ts
generated
Normal file
@@ -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;
|
||||
273
apps/console/src/__generated__/core/CreateStateOfApplicabilityDialogMutation.graphql.ts
generated
Normal file
273
apps/console/src/__generated__/core/CreateStateOfApplicabilityDialogMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,273 @@
|
||||
/**
|
||||
* @generated SignedSource<<c9791128a3674bf247b23005471bdc50>>
|
||||
* @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<string>;
|
||||
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;
|
||||
@@ -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;
|
||||
123
apps/console/src/__generated__/core/EditControlDialogUpdateMutation.graphql.ts
generated
Normal file
123
apps/console/src/__generated__/core/EditControlDialogUpdateMutation.graphql.ts
generated
Normal file
@@ -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;
|
||||
@@ -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<string>;
|
||||
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;
|
||||
@@ -1,153 +0,0 @@
|
||||
/**
|
||||
* @generated SignedSource<<b5ac3d2a6151aa858185089d6d979a34>>
|
||||
* @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<string>;
|
||||
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;
|
||||
@@ -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;
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
/**
|
||||
* @generated SignedSource<<ab6168a4560a52cdd137c9090c37dacc>>
|
||||
* @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;
|
||||
@@ -1,211 +0,0 @@
|
||||
/**
|
||||
* @generated SignedSource<<feca91fd2418eba0f5714a2c76346d08>>
|
||||
* @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;
|
||||
@@ -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;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<fa19c3e1b91d31188625e48b8b6db7e9>>
|
||||
* @generated SignedSource<<ab309c7bbc8e33d319f6edafe017e0e9>>
|
||||
* @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;
|
||||
|
||||
132
apps/console/src/__generated__/core/StateOfApplicabilityControlsTabDeleteMutation.graphql.ts
generated
Normal file
132
apps/console/src/__generated__/core/StateOfApplicabilityControlsTabDeleteMutation.graphql.ts
generated
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* @generated SignedSource<<efea63fc9ceccad58af05da557d0ac53>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteApplicabilityStatementInput = {
|
||||
applicabilityStatementId: string;
|
||||
};
|
||||
export type StateOfApplicabilityControlsTabDeleteMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -1,109 +0,0 @@
|
||||
/**
|
||||
* @generated SignedSource<<a9742800c22e683eb17d46d52b7d6aa5>>
|
||||
* @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;
|
||||
132
apps/console/src/__generated__/core/StateOfApplicabilityDetailPageDeleteMutation.graphql.ts
generated
Normal file
132
apps/console/src/__generated__/core/StateOfApplicabilityDetailPageDeleteMutation.graphql.ts
generated
Normal file
@@ -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<string>;
|
||||
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;
|
||||
492
apps/console/src/__generated__/core/StateOfApplicabilityDetailPageQuery.graphql.ts
generated
Normal file
492
apps/console/src/__generated__/core/StateOfApplicabilityDetailPageQuery.graphql.ts
generated
Normal file
@@ -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;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<eb7a62904f0c39bab4289b137c4b8e9b>>
|
||||
* @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;
|
||||
@@ -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<string>;
|
||||
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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<deb6f38f36dc011d0fc4fc060303a57a>>
|
||||
* @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<string>;
|
||||
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;
|
||||
93
apps/console/src/__generated__/core/StateOfApplicabilityRowFragment.graphql.ts
generated
Normal file
93
apps/console/src/__generated__/core/StateOfApplicabilityRowFragment.graphql.ts
generated
Normal file
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* @generated SignedSource<<d044af0467a7f2acf6c390cdcc561c40>>
|
||||
* @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;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<3472918fdff6205597f39a6310f2ee08>>
|
||||
* @generated SignedSource<<d1798d7a1c00385a597093970a92e778>>
|
||||
* @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;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<8bdd74dfae1b656006a07b2f89fe525d>>
|
||||
* @generated SignedSource<<be08976a189938be59196a67454e0a60>>
|
||||
* @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;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<a1b6d40084a5ddfad764dd1f6fa32607>>
|
||||
* @generated SignedSource<<edaa0e98c84869aff4c1b3945fddd09a>>
|
||||
* @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;
|
||||
@@ -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 (
|
||||
<Tr
|
||||
to={`/organizations/${organizationId}/states-of-applicability/${soa.stateOfApplicabilityId}`}
|
||||
to={`/organizations/${organizationId}/states-of-applicability/${soa.stateOfApplicability.id}`}
|
||||
>
|
||||
<Td>{soa.stateOfApplicability.name}</Td>
|
||||
<Td>
|
||||
@@ -282,8 +284,8 @@ function StateOfApplicabilityRow(props: {
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
props.onClick(
|
||||
soa.stateOfApplicabilityId,
|
||||
soa.controlId,
|
||||
soa.stateOfApplicability.id,
|
||||
soa.control.id,
|
||||
)}
|
||||
icon={IconTrashCan}
|
||||
>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<StateOfApplicabilityGraphPaginatedQuery>,
|
||||
) {
|
||||
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<StateOfApplicabilityGraphDeleteMutation>(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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -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) {
|
||||
)}
|
||||
<div className={control.status === "EXCLUDED" ? "opacity-60" : ""}>
|
||||
<div className="text-base mb-4">{control.name}</div>
|
||||
<div className="mb-4">
|
||||
<LinkedStatesOfApplicabilityCard
|
||||
variant="card"
|
||||
statesOfApplicability={
|
||||
control.stateOfApplicabilityControls?.edges.map(
|
||||
edge => 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}
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<LinkedMeasuresCard
|
||||
variant="card"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { formatDate, validateSnapshotConsistency } from "@probo/helpers";
|
||||
import { formatDate, formatError, type GraphQLError, promisifyMutation, sprintf, validateSnapshotConsistency } from "@probo/helpers";
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import {
|
||||
@@ -14,34 +14,59 @@ import {
|
||||
IconTrashCan,
|
||||
Input,
|
||||
PageHeader,
|
||||
useConfirm,
|
||||
useToast,
|
||||
} from "@probo/ui";
|
||||
import { Suspense, useState } from "react";
|
||||
import {
|
||||
ConnectionHandler,
|
||||
graphql,
|
||||
type PreloadedQuery,
|
||||
useMutation,
|
||||
usePreloadedQuery,
|
||||
} from "react-relay";
|
||||
import { useNavigate, useParams } from "react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import type { StateOfApplicabilityDetailPageDeleteMutation } from "#/__generated__/core/StateOfApplicabilityDetailPageDeleteMutation.graphql";
|
||||
import type { StateOfApplicabilityDetailPageExportMutation } from "#/__generated__/core/StateOfApplicabilityDetailPageExportMutation.graphql";
|
||||
import type { StateOfApplicabilityGraphNodeQuery } from "#/__generated__/core/StateOfApplicabilityGraphNodeQuery.graphql";
|
||||
import type { StateOfApplicabilityDetailPageQuery } from "#/__generated__/core/StateOfApplicabilityDetailPageQuery.graphql";
|
||||
import type { StateOfApplicabilityDetailPageUpdateMutation } from "#/__generated__/core/StateOfApplicabilityDetailPageUpdateMutation.graphql";
|
||||
import { PeopleSelectField } from "#/components/form/PeopleSelectField";
|
||||
import { SnapshotBanner } from "#/components/SnapshotBanner";
|
||||
import {
|
||||
StateOfApplicabilityConnectionKey,
|
||||
stateOfApplicabilityNodeQuery,
|
||||
updateStateOfApplicabilityMutation,
|
||||
useDeleteStateOfApplicability,
|
||||
} from "#/hooks/graph/StateOfApplicabilityGraph";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||
|
||||
import StateOfApplicabilityControlsTab from "./tabs/StateOfApplicabilityControlsTab";
|
||||
|
||||
const exportStateOfApplicabilityPDFMutation = graphql`
|
||||
export const stateOfApplicabilityDetailPageQuery = graphql`
|
||||
query StateOfApplicabilityDetailPageQuery($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
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const exportMutation = graphql`
|
||||
mutation StateOfApplicabilityDetailPageExportMutation(
|
||||
$input: ExportStateOfApplicabilityPDFInput!
|
||||
) {
|
||||
@@ -51,8 +76,42 @@ const exportStateOfApplicabilityPDFMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
const updateMutation = graphql`
|
||||
mutation StateOfApplicabilityDetailPageUpdateMutation(
|
||||
$input: UpdateStateOfApplicabilityInput!
|
||||
) {
|
||||
updateStateOfApplicability(input: $input) {
|
||||
stateOfApplicability {
|
||||
id
|
||||
name
|
||||
sourceId
|
||||
snapshotId
|
||||
createdAt
|
||||
updatedAt
|
||||
owner {
|
||||
id
|
||||
fullName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const deleteMutation = graphql`
|
||||
mutation StateOfApplicabilityDetailPageDeleteMutation(
|
||||
$input: DeleteStateOfApplicabilityInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteStateOfApplicability(input: $input) {
|
||||
deletedStateOfApplicabilityId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const StateOfApplicabilityConnectionKey = "StatesOfApplicabilityPage_statesOfApplicability";
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<StateOfApplicabilityGraphNodeQuery>;
|
||||
queryRef: PreloadedQuery<StateOfApplicabilityDetailPageQuery>;
|
||||
};
|
||||
|
||||
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<StateOfApplicabilityDetailPageDeleteMutation>(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<StateOfApplicabilityDetailPageUpdateMutation>(
|
||||
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<StateOfApplicabilityDetailPageExportMutation>(
|
||||
exportStateOfApplicabilityPDFMutation,
|
||||
exportMutation,
|
||||
{
|
||||
successMessage: __(
|
||||
"State of Applicability exported successfully.",
|
||||
@@ -298,7 +388,7 @@ export default function StateOfApplicabilityDetailPage(props: Props) {
|
||||
<DropdownItem
|
||||
variant="danger"
|
||||
icon={IconTrashCan}
|
||||
onClick={() => void deleteStateOfApplicability()}
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{__("Delete")}
|
||||
</DropdownItem>
|
||||
@@ -384,7 +474,7 @@ export default function StateOfApplicabilityDetailPage(props: Props) {
|
||||
{stateOfApplicability.id && (
|
||||
<div className="space-y-4">
|
||||
<h2 className="text-base font-medium">
|
||||
{__("Controls")}
|
||||
{__("Statements")}
|
||||
</h2>
|
||||
<StateOfApplicabilityControlsTab
|
||||
stateOfApplicability={
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Suspense, useEffect } from "react";
|
||||
import { useQueryLoader } from "react-relay";
|
||||
import { useParams } from "react-router";
|
||||
|
||||
import type { StateOfApplicabilityDetailPageQuery } from "#/__generated__/core/StateOfApplicabilityDetailPageQuery.graphql";
|
||||
import { PageSkeleton } from "#/components/skeletons/PageSkeleton";
|
||||
|
||||
import StateOfApplicabilityDetailPage, { stateOfApplicabilityDetailPageQuery } from "./StateOfApplicabilityDetailPage";
|
||||
|
||||
export default function StateOfApplicabilityDetailPageLoader() {
|
||||
const { stateOfApplicabilityId } = useParams<{ stateOfApplicabilityId: string }>();
|
||||
const [queryRef, loadQuery]
|
||||
= useQueryLoader<StateOfApplicabilityDetailPageQuery>(stateOfApplicabilityDetailPageQuery);
|
||||
|
||||
useEffect(() => {
|
||||
if (stateOfApplicabilityId) {
|
||||
loadQuery({ stateOfApplicabilityId });
|
||||
}
|
||||
}, [loadQuery, stateOfApplicabilityId]);
|
||||
|
||||
if (!queryRef) {
|
||||
return <PageSkeleton />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Suspense fallback={<PageSkeleton />}>
|
||||
<StateOfApplicabilityDetailPage queryRef={queryRef} />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
@@ -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<StateOfApplicabilityGraphPaginatedQuery>;
|
||||
queryRef: PreloadedQuery<StatesOfApplicabilityPageQuery>;
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
@@ -56,11 +85,7 @@ export default function StatesOfApplicabilityPage({
|
||||
|
||||
usePageTitle(__("States of Applicability"));
|
||||
|
||||
const { organization }
|
||||
= usePreloadedQuery<StateOfApplicabilityGraphPaginatedQuery>(
|
||||
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 (
|
||||
<div className="space-y-6">
|
||||
{snapshotId && <SnapshotBanner snapshotId={snapshotId} />}
|
||||
@@ -123,16 +141,14 @@ export default function StatesOfApplicabilityPage({
|
||||
<Th>{__("Name")}</Th>
|
||||
<Th>{__("Created at")}</Th>
|
||||
<Th>{__("Controls")}</Th>
|
||||
{hasAnyAction && <Th>{__("Actions")}</Th>}
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{statesOfApplicability.edges.map(edge => (
|
||||
<StateOfApplicabilityRow
|
||||
key={edge.node.id}
|
||||
stateOfApplicability={edge.node}
|
||||
fKey={edge.node}
|
||||
connectionId={statesOfApplicability.__id}
|
||||
hasAnyAction={hasAnyAction}
|
||||
/>
|
||||
))}
|
||||
</Tbody>
|
||||
@@ -170,56 +186,3 @@ export default function StatesOfApplicabilityPage({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
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 (
|
||||
<Tr to={detailUrl}>
|
||||
<Td>{stateOfApplicability.name}</Td>
|
||||
<Td>
|
||||
<time dateTime={stateOfApplicability.createdAt}>
|
||||
{formatDate(stateOfApplicability.createdAt)}
|
||||
</time>
|
||||
</Td>
|
||||
<Td>{stateOfApplicability.controlsInfo?.totalCount ?? 0}</Td>
|
||||
{hasAnyAction && (
|
||||
<Td noLink width={50} className="text-end">
|
||||
<ActionDropdown>
|
||||
{stateOfApplicability.canDelete && (
|
||||
<DropdownItem
|
||||
icon={IconTrashCan}
|
||||
variant="danger"
|
||||
onSelect={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
deleteStateOfApplicability();
|
||||
}}
|
||||
>
|
||||
{__("Delete")}
|
||||
</DropdownItem>
|
||||
)}
|
||||
</ActionDropdown>
|
||||
</Td>
|
||||
)}
|
||||
</Tr>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>(statesOfApplicabilityPageQuery);
|
||||
|
||||
useEffect(() => {
|
||||
loadQuery({ organizationId });
|
||||
}, [loadQuery, organizationId]);
|
||||
|
||||
if (!queryRef) {
|
||||
return <PageSkeleton />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Suspense fallback={<PageSkeleton />}>
|
||||
<StatesOfApplicabilityPage queryRef={queryRef} />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
@@ -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<StateOfApplicabilityRowDeleteMutation>(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 (
|
||||
<Tr to={detailUrl}>
|
||||
<Td>{stateOfApplicability.name}</Td>
|
||||
<Td>
|
||||
<time dateTime={stateOfApplicability.createdAt}>
|
||||
{formatDate(stateOfApplicability.createdAt)}
|
||||
</time>
|
||||
</Td>
|
||||
<Td>{stateOfApplicability.statementsInfo?.totalCount ?? 0}</Td>
|
||||
{canDelete && (
|
||||
<Td noLink width={50} className="text-end">
|
||||
<ActionDropdown>
|
||||
<DropdownItem
|
||||
icon={IconTrashCan}
|
||||
variant="danger"
|
||||
onSelect={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
handleDelete();
|
||||
}}
|
||||
>
|
||||
{__("Delete")}
|
||||
</DropdownItem>
|
||||
</ActionDropdown>
|
||||
</Td>
|
||||
)}
|
||||
</Tr>
|
||||
);
|
||||
}
|
||||
@@ -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<string>(() => {
|
||||
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 (
|
||||
<div className="p-4 border-b border-border-low">
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge size="md">{control.sectionTitle}</Badge>
|
||||
<span className="text-sm font-medium text-txt-primary">
|
||||
{control.name}
|
||||
</span>
|
||||
</div>
|
||||
{isLinked
|
||||
&& control.applicability !== null
|
||||
&& !showJustification
|
||||
&& control.justification && (
|
||||
<div className="mt-2 text-sm text-txt-secondary">
|
||||
{control.justification}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-start gap-2">
|
||||
<Select
|
||||
variant="editor"
|
||||
value={selectedState}
|
||||
onValueChange={value => void handleStateChange(value)}
|
||||
disabled={isCreating || isDeleting || isUpdating}
|
||||
className="w-48"
|
||||
>
|
||||
<Option value="not-linked">{__("Not Linked")}</Option>
|
||||
<Option value="applicable">{__("Applicable")}</Option>
|
||||
<Option value="not-applicable">{__("Not Applicable")}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
{showJustification && (
|
||||
<div className="mt-3 flex items-start gap-2">
|
||||
<Textarea
|
||||
value={justification}
|
||||
onChange={e => setJustification(e.target.value)}
|
||||
placeholder={__("Reason for non-applicability")}
|
||||
className="flex-1"
|
||||
autogrow
|
||||
/>
|
||||
<Button
|
||||
variant="primary"
|
||||
icon={IconCheckmark1}
|
||||
onClick={() => void handleSaveJustification()}
|
||||
disabled={isCreating || isUpdating}
|
||||
aria-label={__("Save")}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddApplicabilityStatementDialogContent({
|
||||
stateOfApplicabilityId,
|
||||
organizationId,
|
||||
connectionId,
|
||||
}: {
|
||||
stateOfApplicabilityId: string;
|
||||
organizationId: string;
|
||||
connectionId: string;
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
const [search, setSearch] = useState("");
|
||||
const [collapsedFrameworks, setCollapsedFrameworks] = useState<Set<string>>(new Set());
|
||||
const data = useLazyLoadQuery<AddApplicabilityStatementDialogQuery>(
|
||||
query,
|
||||
{ stateOfApplicabilityId, organizationId },
|
||||
{ fetchPolicy: "store-or-network" },
|
||||
);
|
||||
|
||||
const applicabilityMap = useMemo(() => {
|
||||
const map = new Map<
|
||||
string,
|
||||
{ id: string; applicability: boolean; justification: string | null }
|
||||
>();
|
||||
data.stateOfApplicability?.applicabilityStatements?.edges.forEach((edge) => {
|
||||
map.set(edge.node.control.id, {
|
||||
id: edge.node.id,
|
||||
applicability: edge.node.applicability,
|
||||
justification: edge.node.justification,
|
||||
});
|
||||
});
|
||||
return map;
|
||||
}, [data.stateOfApplicability?.applicabilityStatements]);
|
||||
|
||||
const allControls = useMemo(() => {
|
||||
return (data.organization?.controls?.edges || []).map((edge) => {
|
||||
const applicability = applicabilityMap.get(edge.node.id);
|
||||
return {
|
||||
controlId: edge.node.id,
|
||||
sectionTitle: edge.node.sectionTitle,
|
||||
name: edge.node.name,
|
||||
frameworkId: edge.node.framework.id,
|
||||
frameworkName: edge.node.framework.name,
|
||||
applicabilityStatementId: applicability?.id ?? null,
|
||||
applicability: applicability?.applicability ?? null,
|
||||
justification: applicability?.justification ?? null,
|
||||
} as ControlWithStatement;
|
||||
});
|
||||
}, [data.organization?.controls, applicabilityMap]);
|
||||
|
||||
const filteredControls = useMemo(() => {
|
||||
if (!search) return allControls;
|
||||
const lowerSearch = search.toLowerCase();
|
||||
return allControls.filter(
|
||||
c =>
|
||||
c.name.toLowerCase().includes(lowerSearch)
|
||||
|| c.sectionTitle.toLowerCase().includes(lowerSearch)
|
||||
|| c.frameworkName.toLowerCase().includes(lowerSearch),
|
||||
);
|
||||
}, [allControls, search]);
|
||||
|
||||
const groupedControls = useMemo(() => {
|
||||
const groups: Record<string, Record<string, ControlWithStatement[]>> = {};
|
||||
filteredControls.forEach((control) => {
|
||||
if (!groups[control.frameworkName]) {
|
||||
groups[control.frameworkName] = {};
|
||||
}
|
||||
if (!groups[control.frameworkName][control.sectionTitle]) {
|
||||
groups[control.frameworkName][control.sectionTitle] = [];
|
||||
}
|
||||
groups[control.frameworkName][control.sectionTitle].push(control);
|
||||
});
|
||||
return groups;
|
||||
}, [filteredControls]);
|
||||
|
||||
const toggleFramework = (frameworkName: string) => {
|
||||
setCollapsedFrameworks((prev) => {
|
||||
const newSet = new Set(prev);
|
||||
if (newSet.has(frameworkName)) {
|
||||
newSet.delete(frameworkName);
|
||||
} else {
|
||||
newSet.add(frameworkName);
|
||||
}
|
||||
return newSet;
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<DialogContent className="p-0">
|
||||
<div className="sticky top-0 bg-level-2 p-4 border-b border-border-low z-10">
|
||||
<Input
|
||||
icon={IconMagnifyingGlass}
|
||||
placeholder={__("Search controls...")}
|
||||
onValueChange={setSearch}
|
||||
/>
|
||||
</div>
|
||||
<div className="max-h-[60vh] overflow-y-auto">
|
||||
{filteredControls.length === 0
|
||||
? (
|
||||
<div className="p-8 text-center text-txt-secondary">
|
||||
{__("No controls found")}
|
||||
</div>
|
||||
)
|
||||
: (
|
||||
Object.entries(groupedControls).map(([frameworkName, sections]) => {
|
||||
const isCollapsed = collapsedFrameworks.has(frameworkName);
|
||||
return (
|
||||
<div key={frameworkName}>
|
||||
<div className="sticky top-0 bg-level-1 px-4 py-2 border-b border-border-low z-10 flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-txt-primary">
|
||||
{frameworkName}
|
||||
</h3>
|
||||
<Button
|
||||
variant="tertiary"
|
||||
icon={isCollapsed ? IconChevronDown : IconChevronUp}
|
||||
onClick={() => toggleFramework(frameworkName)}
|
||||
aria-label={isCollapsed ? __("Expand") : __("Collapse")}
|
||||
/>
|
||||
</div>
|
||||
{!isCollapsed
|
||||
&& Object.entries(sections).map(
|
||||
([sectionTitle, sectionControls]) => (
|
||||
<div key={`${frameworkName}-${sectionTitle}`}>
|
||||
{sectionControls.map(control => (
|
||||
<ControlRow
|
||||
key={control.controlId}
|
||||
control={control}
|
||||
stateOfApplicabilityId={stateOfApplicabilityId}
|
||||
connectionId={connectionId}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
)}
|
||||
</div>
|
||||
</DialogContent>
|
||||
<DialogFooter exitLabel={__("Close")}></DialogFooter>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export const AddApplicabilityStatementDialog = forwardRef<AddApplicabilityStatementDialogRef>(
|
||||
(_props, ref) => {
|
||||
const { __ } = useTranslate();
|
||||
const dialogRef = useDialogRef();
|
||||
const [stateOfApplicabilityId, setStateOfApplicabilityId] = useState<string | null>(null);
|
||||
const [organizationId, setOrganizationId] = useState<string | null>(null);
|
||||
const [connectionId, setConnectionId] = useState<string | null>(null);
|
||||
|
||||
useImperativeHandle(
|
||||
ref,
|
||||
() => ({
|
||||
open: (soaId: string, orgId: string, connId: string) => {
|
||||
setStateOfApplicabilityId(soaId);
|
||||
setOrganizationId(orgId);
|
||||
setConnectionId(connId);
|
||||
dialogRef.current?.open();
|
||||
},
|
||||
}),
|
||||
[dialogRef],
|
||||
);
|
||||
|
||||
const handleClose = () => {
|
||||
setStateOfApplicabilityId(null);
|
||||
setOrganizationId(null);
|
||||
setConnectionId(null);
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
ref={dialogRef}
|
||||
className="max-w-3xl"
|
||||
title={(
|
||||
<Breadcrumb
|
||||
items={[__("States of Applicability"), __("Add Statement")]}
|
||||
/>
|
||||
)}
|
||||
onClose={handleClose}
|
||||
>
|
||||
{stateOfApplicabilityId && organizationId && connectionId
|
||||
? (
|
||||
<Suspense
|
||||
fallback={(
|
||||
<DialogContent
|
||||
padded
|
||||
className="flex items-center justify-center py-8"
|
||||
>
|
||||
<Spinner />
|
||||
</DialogContent>
|
||||
)}
|
||||
>
|
||||
<AddApplicabilityStatementDialogContent
|
||||
stateOfApplicabilityId={stateOfApplicabilityId}
|
||||
organizationId={organizationId}
|
||||
connectionId={connectionId}
|
||||
/>
|
||||
</Suspense>
|
||||
)
|
||||
: null}
|
||||
</Dialog>
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -10,16 +10,38 @@ import {
|
||||
} from "@probo/ui";
|
||||
import type { ReactNode } from "react";
|
||||
import { Suspense } from "react";
|
||||
import { graphql } from "react-relay";
|
||||
import { useNavigate } from "react-router";
|
||||
import { z } from "zod";
|
||||
import z from "zod";
|
||||
|
||||
import type { StateOfApplicabilityGraphCreateMutation } from "#/__generated__/core/StateOfApplicabilityGraphCreateMutation.graphql";
|
||||
import type { CreateStateOfApplicabilityDialogMutation } from "#/__generated__/core/CreateStateOfApplicabilityDialogMutation.graphql";
|
||||
import { PeopleSelectField } from "#/components/form/PeopleSelectField";
|
||||
import { createStateOfApplicabilityMutation } from "#/hooks/graph/StateOfApplicabilityGraph";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||
|
||||
const createMutation = graphql`
|
||||
mutation CreateStateOfApplicabilityDialogMutation(
|
||||
$input: CreateStateOfApplicabilityInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createStateOfApplicability(input: $input) {
|
||||
stateOfApplicabilityEdge @prependEdge(connections: $connections) {
|
||||
node {
|
||||
id
|
||||
name
|
||||
sourceId
|
||||
snapshotId
|
||||
createdAt
|
||||
updatedAt
|
||||
canDelete: permission(action: "core:state-of-applicability:delete")
|
||||
...StateOfApplicabilityRowFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
type Props = {
|
||||
children: ReactNode;
|
||||
connectionId: string;
|
||||
@@ -48,9 +70,9 @@ export function CreateStateOfApplicabilityDialog({
|
||||
);
|
||||
const ref = useDialogRef();
|
||||
|
||||
const [mutate, isMutating]
|
||||
= useMutationWithToasts<StateOfApplicabilityGraphCreateMutation>(
|
||||
createStateOfApplicabilityMutation,
|
||||
const [createStateOfApplicability, isCreating]
|
||||
= useMutationWithToasts<CreateStateOfApplicabilityDialogMutation>(
|
||||
createMutation,
|
||||
{
|
||||
successMessage: __(
|
||||
"State of applicability created successfully.",
|
||||
@@ -60,7 +82,7 @@ export function CreateStateOfApplicabilityDialog({
|
||||
);
|
||||
|
||||
const onSubmit = async (data: z.infer<typeof schema>) => {
|
||||
await mutate({
|
||||
await createStateOfApplicability({
|
||||
variables: {
|
||||
input: {
|
||||
name: data.name,
|
||||
@@ -114,7 +136,7 @@ export function CreateStateOfApplicabilityDialog({
|
||||
</Field>
|
||||
</DialogContent>
|
||||
<DialogFooter>
|
||||
<Button disabled={isMutating} type="submit">
|
||||
<Button disabled={isCreating} type="submit">
|
||||
{__("Create")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
||||
@@ -19,25 +19,21 @@ import { z } from "zod";
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
|
||||
const linkControlMutation = graphql`
|
||||
mutation EditControlDialogLinkMutation($input: CreateStateOfApplicabilityControlMappingInput!) {
|
||||
createStateOfApplicabilityControlMapping(input: $input) {
|
||||
stateOfApplicabilityControlEdge {
|
||||
node {
|
||||
stateOfApplicabilityId
|
||||
controlId
|
||||
applicability
|
||||
justification
|
||||
const updateApplicabilityStatementMutation = graphql`
|
||||
mutation EditControlDialogUpdateMutation($input: UpdateApplicabilityStatementInput!) {
|
||||
updateApplicabilityStatement(input: $input) {
|
||||
applicabilityStatement {
|
||||
id
|
||||
applicability
|
||||
justification
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export type EditControlDialogRef = {
|
||||
open: (control: {
|
||||
stateOfApplicabilityId: string;
|
||||
controlId: string;
|
||||
applicabilityStatementId: string;
|
||||
sectionTitle: string;
|
||||
name: string;
|
||||
frameworkName: string;
|
||||
@@ -51,129 +47,122 @@ const schema = z.object({
|
||||
justification: z.string().optional(),
|
||||
});
|
||||
|
||||
export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?: () => void }>(
|
||||
({ onSuccess }, ref) => {
|
||||
const { __ } = useTranslate();
|
||||
const dialogRef = useDialogRef();
|
||||
const [control, setControl] = useState<{
|
||||
stateOfApplicabilityId: string;
|
||||
controlId: string;
|
||||
sectionTitle: string;
|
||||
name: string;
|
||||
frameworkName: string;
|
||||
applicability: boolean;
|
||||
justification: string | null;
|
||||
} | null>(null);
|
||||
export const EditControlDialog = forwardRef<EditControlDialogRef>((_props, ref) => {
|
||||
const { __ } = useTranslate();
|
||||
const dialogRef = useDialogRef();
|
||||
const [control, setControl] = useState<{
|
||||
applicabilityStatementId: string;
|
||||
sectionTitle: string;
|
||||
name: string;
|
||||
frameworkName: string;
|
||||
applicability: boolean;
|
||||
justification: string | null;
|
||||
} | null>(null);
|
||||
|
||||
const [linkMutate, isLinking] = useMutationWithToasts(linkControlMutation, {
|
||||
successMessage: __("Control updated successfully."),
|
||||
errorMessage: __("Failed to update control"),
|
||||
});
|
||||
const [updateApplicabilityStatement, isUpdating] = useMutationWithToasts(
|
||||
updateApplicabilityStatementMutation,
|
||||
{
|
||||
successMessage: __("Statement updated successfully."),
|
||||
errorMessage: __("Failed to update statement"),
|
||||
},
|
||||
);
|
||||
|
||||
const { register, handleSubmit, setValue, watch } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
applicability: true,
|
||||
justification: "",
|
||||
const { register, handleSubmit, setValue, watch } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
applicability: true,
|
||||
justification: "",
|
||||
},
|
||||
});
|
||||
const applicability = watch("applicability");
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
open: (ctrl) => {
|
||||
setControl(ctrl);
|
||||
setValue("applicability", ctrl.applicability);
|
||||
setValue("justification", ctrl.justification || "");
|
||||
dialogRef.current?.open();
|
||||
},
|
||||
}));
|
||||
|
||||
const onSubmit = async (data: z.infer<typeof schema>) => {
|
||||
if (!control) return;
|
||||
|
||||
await updateApplicabilityStatement({
|
||||
variables: {
|
||||
input: {
|
||||
applicabilityStatementId: control.applicabilityStatementId,
|
||||
applicability: data.applicability,
|
||||
justification: !data.applicability ? data.justification || null : null,
|
||||
},
|
||||
},
|
||||
onSuccess: () => {
|
||||
dialogRef.current?.close();
|
||||
setControl(null);
|
||||
},
|
||||
});
|
||||
const applicability = watch("applicability");
|
||||
};
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
open: (ctrl) => {
|
||||
setControl(ctrl);
|
||||
setValue("applicability", ctrl.applicability);
|
||||
setValue("justification", ctrl.justification || "");
|
||||
dialogRef.current?.open();
|
||||
},
|
||||
}));
|
||||
|
||||
const onSubmit = async (data: z.infer<typeof schema>) => {
|
||||
if (!control) return;
|
||||
|
||||
await linkMutate({
|
||||
variables: {
|
||||
input: {
|
||||
stateOfApplicabilityId: control.stateOfApplicabilityId,
|
||||
controlId: control.controlId,
|
||||
applicability: data.applicability,
|
||||
justification: !data.applicability ? data.justification || null : null,
|
||||
},
|
||||
},
|
||||
onSuccess: () => {
|
||||
dialogRef.current?.close();
|
||||
setControl(null);
|
||||
onSuccess?.();
|
||||
},
|
||||
updater: (store) => {
|
||||
const stateOfApplicability = store.get(control.stateOfApplicabilityId);
|
||||
if (stateOfApplicability) {
|
||||
stateOfApplicability.invalidateRecord();
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
ref={dialogRef}
|
||||
className="max-w-lg"
|
||||
title={(
|
||||
<Breadcrumb
|
||||
items={[__("States of Applicability"), __("Edit Control")]}
|
||||
/>
|
||||
)}
|
||||
>
|
||||
{control
|
||||
? (
|
||||
<form onSubmit={e => void handleSubmit(onSubmit)(e)}>
|
||||
<DialogContent padded className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<div className="text-sm font-medium text-txt-secondary">
|
||||
{control.frameworkName}
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge size="md">{control.sectionTitle}</Badge>
|
||||
<span className="text-base font-medium text-txt-primary">{control.name}</span>
|
||||
</div>
|
||||
return (
|
||||
<Dialog
|
||||
ref={dialogRef}
|
||||
className="max-w-lg"
|
||||
title={
|
||||
<Breadcrumb items={[__("States of Applicability"), __("Edit Statement")]} />
|
||||
}
|
||||
>
|
||||
{control
|
||||
? (
|
||||
<form onSubmit={e => void handleSubmit(onSubmit)(e)}>
|
||||
<DialogContent padded className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<div className="text-sm font-medium text-txt-secondary">
|
||||
{control.frameworkName}
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge size="md">{control.sectionTitle}</Badge>
|
||||
<span className="text-base font-medium text-txt-primary">
|
||||
{control.name}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Field label={__("Applicability")}>
|
||||
<Select
|
||||
variant="editor"
|
||||
value={applicability ? "yes" : "no"}
|
||||
onValueChange={value => setValue("applicability", value === "yes")}
|
||||
>
|
||||
<Option value="yes">{__("Yes")}</Option>
|
||||
<Option value="no">{__("No")}</Option>
|
||||
</Select>
|
||||
</Field>
|
||||
|
||||
{!applicability && (
|
||||
<Field label={__("Justification")}>
|
||||
<Textarea
|
||||
{...register("justification")}
|
||||
placeholder={__("Reason for non-applicability")}
|
||||
autogrow
|
||||
/>
|
||||
</Field>
|
||||
)}
|
||||
</DialogContent>
|
||||
<DialogFooter>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={() => dialogRef.current?.close()}
|
||||
<Field label={__("Applicability")}>
|
||||
<Select
|
||||
variant="editor"
|
||||
value={applicability ? "yes" : "no"}
|
||||
onValueChange={value =>
|
||||
setValue("applicability", value === "yes")}
|
||||
>
|
||||
{__("Cancel")}
|
||||
</Button>
|
||||
<Button type="submit" disabled={isLinking}>
|
||||
{__("Save")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
)
|
||||
: null}
|
||||
</Dialog>
|
||||
);
|
||||
},
|
||||
);
|
||||
<Option value="yes">{__("Yes")}</Option>
|
||||
<Option value="no">{__("No")}</Option>
|
||||
</Select>
|
||||
</Field>
|
||||
|
||||
{!applicability && (
|
||||
<Field label={__("Justification")}>
|
||||
<Textarea
|
||||
{...register("justification")}
|
||||
placeholder={__("Reason for non-applicability")}
|
||||
autogrow
|
||||
/>
|
||||
</Field>
|
||||
)}
|
||||
</DialogContent>
|
||||
<DialogFooter>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={() => dialogRef.current?.close()}
|
||||
>
|
||||
{__("Cancel")}
|
||||
</Button>
|
||||
<Button type="submit" disabled={isUpdating}>
|
||||
{__("Save")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
)
|
||||
: null}
|
||||
</Dialog>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -23,20 +23,39 @@ import { graphql, useLazyLoadQuery } from "react-relay";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
|
||||
const linkControlQuery = graphql`
|
||||
query LinkControlDialogQuery($stateOfApplicabilityId: ID!) {
|
||||
node(id: $stateOfApplicabilityId) {
|
||||
query LinkControlDialogQuery($stateOfApplicabilityId: ID!, $organizationId: ID!) {
|
||||
stateOfApplicability: node(id: $stateOfApplicabilityId) {
|
||||
... on StateOfApplicability {
|
||||
id
|
||||
availableControls {
|
||||
controlId
|
||||
sectionTitle
|
||||
name
|
||||
frameworkId
|
||||
frameworkName
|
||||
organizationId
|
||||
stateOfApplicabilityId
|
||||
applicability
|
||||
justification
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,14 +63,16 @@ const linkControlQuery = graphql`
|
||||
`;
|
||||
|
||||
const linkControlMutation = graphql`
|
||||
mutation LinkControlDialogLinkMutation($input: CreateStateOfApplicabilityControlMappingInput!) {
|
||||
createStateOfApplicabilityControlMapping(input: $input) {
|
||||
stateOfApplicabilityControlEdge {
|
||||
mutation LinkControlDialogLinkMutation($input: CreateApplicabilityStatementInput!) {
|
||||
createApplicabilityStatement(input: $input) {
|
||||
applicabilityStatementEdge {
|
||||
node {
|
||||
stateOfApplicabilityId
|
||||
controlId
|
||||
id
|
||||
applicability
|
||||
justification
|
||||
control {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,17 +80,15 @@ const linkControlMutation = graphql`
|
||||
`;
|
||||
|
||||
const unlinkControlMutation = graphql`
|
||||
mutation LinkControlDialogUnlinkMutation($input: DeleteStateOfApplicabilityControlMappingInput!) {
|
||||
deleteStateOfApplicabilityControlMapping(input: $input) {
|
||||
deletedStateOfApplicabilityId
|
||||
deletedControlId
|
||||
deletedStateOfApplicabilityControlId
|
||||
mutation LinkControlDialogUnlinkMutation($input: DeleteApplicabilityStatementInput!) {
|
||||
deleteApplicabilityStatement(input: $input) {
|
||||
deletedApplicabilityStatementId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export type LinkControlDialogRef = {
|
||||
open: (stateOfApplicabilityId: string, onUpdate?: () => void) => void;
|
||||
open: (stateOfApplicabilityId: string, organizationId: string, onUpdate?: () => void) => void;
|
||||
};
|
||||
|
||||
type Control = {
|
||||
@@ -78,8 +97,7 @@ type Control = {
|
||||
name: string;
|
||||
frameworkId: string;
|
||||
frameworkName: string;
|
||||
organizationId: string;
|
||||
stateOfApplicabilityId: string | null;
|
||||
applicabilityStatementId: string | null;
|
||||
applicability: boolean | null;
|
||||
justification: string | null;
|
||||
};
|
||||
@@ -119,11 +137,11 @@ function ControlRow({
|
||||
setSelectedState(newState);
|
||||
|
||||
if (newState === "not-linked") {
|
||||
if (!control.applicabilityStatementId) return;
|
||||
await unlinkMutate({
|
||||
variables: {
|
||||
input: {
|
||||
stateOfApplicabilityId,
|
||||
controlId: control.controlId,
|
||||
applicabilityStatementId: control.applicabilityStatementId,
|
||||
},
|
||||
},
|
||||
onSuccess: () => {
|
||||
@@ -227,9 +245,11 @@ function ControlRow({
|
||||
|
||||
function LinkControlDialogContent({
|
||||
stateOfApplicabilityId,
|
||||
organizationId,
|
||||
onUpdate,
|
||||
}: {
|
||||
stateOfApplicabilityId: string;
|
||||
organizationId: string;
|
||||
onUpdate?: () => void;
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
@@ -237,25 +257,80 @@ function LinkControlDialogContent({
|
||||
const [collapsedFrameworks, setCollapsedFrameworks] = useState<Set<string>>(new Set());
|
||||
const data = useLazyLoadQuery(
|
||||
linkControlQuery,
|
||||
{ stateOfApplicabilityId },
|
||||
{ stateOfApplicabilityId, organizationId },
|
||||
{ fetchPolicy: "store-or-network" },
|
||||
) as {
|
||||
node: {
|
||||
availableControls?: Control[];
|
||||
stateOfApplicability: {
|
||||
id: string;
|
||||
applicabilityStatements?: {
|
||||
edges: Array<{
|
||||
node: {
|
||||
id: string;
|
||||
applicability: boolean;
|
||||
justification: string | null;
|
||||
control: { id: string };
|
||||
};
|
||||
}>;
|
||||
};
|
||||
} | null;
|
||||
organization: {
|
||||
id: string;
|
||||
controls?: {
|
||||
edges: Array<{
|
||||
node: {
|
||||
id: string;
|
||||
sectionTitle: string;
|
||||
name: string;
|
||||
framework: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
}>;
|
||||
};
|
||||
} | null;
|
||||
};
|
||||
|
||||
// Build a map of control ID -> applicability statement
|
||||
const applicabilityMap = useMemo(() => {
|
||||
const map = new Map<string, { id: string; applicability: boolean; justification: string | null }>();
|
||||
data.stateOfApplicability?.applicabilityStatements?.edges.forEach((edge) => {
|
||||
map.set(edge.node.control.id, {
|
||||
id: edge.node.id,
|
||||
applicability: edge.node.applicability,
|
||||
justification: edge.node.justification,
|
||||
});
|
||||
});
|
||||
return map;
|
||||
}, [data.stateOfApplicability?.applicabilityStatements]);
|
||||
|
||||
// Merge controls with applicability info
|
||||
const allControls = useMemo(() => {
|
||||
return (data.organization?.controls?.edges || []).map((edge) => {
|
||||
const applicability = applicabilityMap.get(edge.node.id);
|
||||
return {
|
||||
controlId: edge.node.id,
|
||||
sectionTitle: edge.node.sectionTitle,
|
||||
name: edge.node.name,
|
||||
frameworkId: edge.node.framework.id,
|
||||
frameworkName: edge.node.framework.name,
|
||||
applicabilityStatementId: applicability?.id ?? null,
|
||||
applicability: applicability?.applicability ?? null,
|
||||
justification: applicability?.justification ?? null,
|
||||
} as Control;
|
||||
});
|
||||
}, [data.organization?.controls, applicabilityMap]);
|
||||
|
||||
const filteredControls = useMemo(() => {
|
||||
const controls = data.node?.availableControls || [];
|
||||
if (!search) return controls;
|
||||
if (!search) return allControls;
|
||||
const lowerSearch = search.toLowerCase();
|
||||
return controls.filter(
|
||||
return allControls.filter(
|
||||
c =>
|
||||
c.name.toLowerCase().includes(lowerSearch)
|
||||
|| c.sectionTitle.toLowerCase().includes(lowerSearch)
|
||||
|| c.frameworkName.toLowerCase().includes(lowerSearch),
|
||||
);
|
||||
}, [data.node?.availableControls, search]);
|
||||
}, [allControls, search]);
|
||||
|
||||
const groupedControls = useMemo(() => {
|
||||
const groups: Record<string, Record<string, Control[]>> = {};
|
||||
@@ -321,7 +396,7 @@ function LinkControlDialogContent({
|
||||
key={control.controlId}
|
||||
control={control}
|
||||
stateOfApplicabilityId={stateOfApplicabilityId}
|
||||
isLinked={control.stateOfApplicabilityId !== null}
|
||||
isLinked={control.applicabilityStatementId !== null}
|
||||
onUpdate={onUpdate}
|
||||
/>
|
||||
))}
|
||||
@@ -342,11 +417,13 @@ export const LinkControlDialog = forwardRef<LinkControlDialogRef>((_props, ref)
|
||||
const { __ } = useTranslate();
|
||||
const dialogRef = useDialogRef();
|
||||
const [stateOfApplicabilityId, setStateOfApplicabilityId] = useState<string | null>(null);
|
||||
const [organizationId, setOrganizationId] = useState<string | null>(null);
|
||||
const [onUpdateCallback, setOnUpdateCallback] = useState<(() => void) | undefined>(undefined);
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
open: (soaId: string, callback?: () => void) => {
|
||||
open: (soaId: string, orgId: string, callback?: () => void) => {
|
||||
setStateOfApplicabilityId(soaId);
|
||||
setOrganizationId(orgId);
|
||||
setOnUpdateCallback(() => callback);
|
||||
dialogRef.current?.open();
|
||||
},
|
||||
@@ -354,6 +431,7 @@ export const LinkControlDialog = forwardRef<LinkControlDialogRef>((_props, ref)
|
||||
|
||||
const handleClose = () => {
|
||||
setStateOfApplicabilityId(null);
|
||||
setOrganizationId(null);
|
||||
setOnUpdateCallback(undefined);
|
||||
};
|
||||
|
||||
@@ -368,7 +446,7 @@ export const LinkControlDialog = forwardRef<LinkControlDialogRef>((_props, ref)
|
||||
)}
|
||||
onClose={handleClose}
|
||||
>
|
||||
{stateOfApplicabilityId
|
||||
{stateOfApplicabilityId && organizationId
|
||||
? (
|
||||
<Suspense
|
||||
fallback={(
|
||||
@@ -379,6 +457,7 @@ export const LinkControlDialog = forwardRef<LinkControlDialogRef>((_props, ref)
|
||||
>
|
||||
<LinkControlDialogContent
|
||||
stateOfApplicabilityId={stateOfApplicabilityId}
|
||||
organizationId={organizationId}
|
||||
onUpdate={onUpdateCallback}
|
||||
/>
|
||||
</Suspense>
|
||||
|
||||
@@ -14,63 +14,76 @@ import {
|
||||
Thead,
|
||||
Tr,
|
||||
} from "@probo/ui";
|
||||
import { Suspense, useMemo, useRef } from "react";
|
||||
import { graphql, useRefetchableFragment } from "react-relay";
|
||||
import { Suspense, useRef } from "react";
|
||||
import { graphql, useFragment } from "react-relay";
|
||||
|
||||
import type { StateOfApplicabilityControlsTabFragment$key } from "#/__generated__/core/StateOfApplicabilityControlsTabFragment.graphql";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||
|
||||
import {
|
||||
AddApplicabilityStatementDialog,
|
||||
type AddApplicabilityStatementDialogRef,
|
||||
} from "../dialogs/AddApplicabilityStatementDialog";
|
||||
import {
|
||||
EditControlDialog,
|
||||
type EditControlDialogRef,
|
||||
} from "../dialogs/EditControlDialog";
|
||||
import {
|
||||
LinkControlDialog,
|
||||
type LinkControlDialogRef,
|
||||
} from "../dialogs/LinkControlDialog";
|
||||
|
||||
export const controlsFragment = graphql`
|
||||
fragment StateOfApplicabilityControlsTabFragment on StateOfApplicability
|
||||
@refetchable(queryName: "StateOfApplicabilityControlsTabRefetchQuery") {
|
||||
fragment StateOfApplicabilityControlsTabFragment on StateOfApplicability {
|
||||
id
|
||||
controlsInfo: controls(first: 0) {
|
||||
totalCount
|
||||
organization {
|
||||
id
|
||||
}
|
||||
|
||||
canCreateStateOfApplicabilityControlMapping: permission(
|
||||
action: "core:state-of-applicability-control-mapping:create"
|
||||
canCreateApplicabilityStatement: permission(
|
||||
action: "core:applicability-statement:create"
|
||||
)
|
||||
canDeleteStateOfApplicabilityControlMapping: permission(
|
||||
action: "core:state-of-applicability-control-mapping:delete"
|
||||
canUpdateApplicabilityStatement: permission(
|
||||
action: "core:applicability-statement:update"
|
||||
)
|
||||
canDeleteApplicabilityStatement: permission(
|
||||
action: "core:applicability-statement:delete"
|
||||
)
|
||||
|
||||
availableControls {
|
||||
controlId
|
||||
sectionTitle
|
||||
name
|
||||
frameworkId
|
||||
frameworkName
|
||||
organizationId
|
||||
stateOfApplicabilityId
|
||||
applicability
|
||||
justification
|
||||
bestPractice
|
||||
regulatory
|
||||
contractual
|
||||
riskAssessment
|
||||
applicabilityStatements(first: 1000, orderBy: { direction: ASC, field: CREATED_AT })
|
||||
@connection(key: "StateOfApplicabilityControlsTab_applicabilityStatements") {
|
||||
__id
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
applicability
|
||||
justification
|
||||
control {
|
||||
id
|
||||
sectionTitle
|
||||
name
|
||||
bestPractice
|
||||
regulatory
|
||||
contractual
|
||||
riskAssessment
|
||||
framework {
|
||||
id
|
||||
name
|
||||
}
|
||||
organization {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const unlinkControlMutation = graphql`
|
||||
mutation StateOfApplicabilityControlsTabUnlinkMutation(
|
||||
$input: DeleteStateOfApplicabilityControlMappingInput!
|
||||
const deleteApplicabilityStatementMutation = graphql`
|
||||
mutation StateOfApplicabilityControlsTabDeleteMutation(
|
||||
$input: DeleteApplicabilityStatementInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteStateOfApplicabilityControlMapping(input: $input) {
|
||||
deletedStateOfApplicabilityId
|
||||
deletedControlId
|
||||
deletedStateOfApplicabilityControlId
|
||||
deleteApplicabilityStatement(input: $input) {
|
||||
deletedApplicabilityStatementId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -85,43 +98,51 @@ export default function StateOfApplicabilityControlsTab({
|
||||
isSnapshotMode?: boolean;
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
const [data, refetch] = useRefetchableFragment(
|
||||
controlsFragment,
|
||||
stateOfApplicability,
|
||||
);
|
||||
const data = useFragment(controlsFragment, stateOfApplicability);
|
||||
const organizationId = useOrganizationId();
|
||||
const manageDialogRef = useRef<LinkControlDialogRef>(null);
|
||||
const addStatementDialogRef = useRef<AddApplicabilityStatementDialogRef>(null);
|
||||
const editDialogRef = useRef<EditControlDialogRef>(null);
|
||||
|
||||
const linkedControls = useMemo(
|
||||
() =>
|
||||
(data.availableControls || []).filter(
|
||||
c => c.stateOfApplicabilityId !== null,
|
||||
),
|
||||
[data.availableControls],
|
||||
);
|
||||
const connectionId = data.applicabilityStatements?.__id;
|
||||
|
||||
const [unlinkControl, isUnlinking] = useMutationWithToasts(
|
||||
unlinkControlMutation,
|
||||
const linkedControls = (data.applicabilityStatements?.edges || []).map(edge => ({
|
||||
applicabilityStatementId: edge.node.id,
|
||||
controlId: edge.node.control.id,
|
||||
sectionTitle: edge.node.control.sectionTitle,
|
||||
name: edge.node.control.name,
|
||||
frameworkId: edge.node.control.framework.id,
|
||||
frameworkName: edge.node.control.framework.name,
|
||||
organizationId: edge.node.control.organization?.id,
|
||||
applicability: edge.node.applicability,
|
||||
justification: edge.node.justification,
|
||||
bestPractice: edge.node.control.bestPractice,
|
||||
regulatory: edge.node.control.regulatory,
|
||||
contractual: edge.node.control.contractual,
|
||||
riskAssessment: edge.node.control.riskAssessment,
|
||||
}));
|
||||
|
||||
const [deleteApplicabilityStatement, isDeleting] = useMutationWithToasts(
|
||||
deleteApplicabilityStatementMutation,
|
||||
{
|
||||
successMessage: __("Control removed successfully."),
|
||||
errorMessage: __("Failed to remove control"),
|
||||
successMessage: __("Statement removed successfully."),
|
||||
errorMessage: __("Failed to remove statement"),
|
||||
},
|
||||
);
|
||||
|
||||
const canLink
|
||||
= !isSnapshotMode && data.canCreateStateOfApplicabilityControlMapping;
|
||||
const canUnlink
|
||||
= !isSnapshotMode && data.canDeleteStateOfApplicabilityControlMapping;
|
||||
const canCreate
|
||||
= !isSnapshotMode && data.canCreateApplicabilityStatement;
|
||||
const canUpdate
|
||||
= !isSnapshotMode && data.canUpdateApplicabilityStatement;
|
||||
const canDelete
|
||||
= !isSnapshotMode && data.canDeleteApplicabilityStatement;
|
||||
|
||||
const handleOpenManageDialog = () => {
|
||||
manageDialogRef.current?.open(data.id, () => {
|
||||
refetch({}, { fetchPolicy: "store-and-network" });
|
||||
});
|
||||
const handleOpenAddStatementDialog = () => {
|
||||
if (!data.organization || !connectionId) return;
|
||||
addStatementDialogRef.current?.open(data.id, data.organization.id, connectionId);
|
||||
};
|
||||
|
||||
const handleOpenEditDialog = (control: {
|
||||
controlId: string;
|
||||
applicabilityStatementId: string;
|
||||
sectionTitle: string;
|
||||
name: string;
|
||||
frameworkName: string;
|
||||
@@ -129,8 +150,7 @@ export default function StateOfApplicabilityControlsTab({
|
||||
justification: string | null;
|
||||
}) => {
|
||||
editDialogRef.current?.open({
|
||||
stateOfApplicabilityId: data.id,
|
||||
controlId: control.controlId,
|
||||
applicabilityStatementId: control.applicabilityStatementId,
|
||||
sectionTitle: control.sectionTitle,
|
||||
name: control.name,
|
||||
frameworkName: control.frameworkName,
|
||||
@@ -139,16 +159,14 @@ export default function StateOfApplicabilityControlsTab({
|
||||
});
|
||||
};
|
||||
|
||||
const handleUnlink = async (controlId: string) => {
|
||||
await unlinkControl({
|
||||
const handleDelete = async (applicabilityStatementId: string) => {
|
||||
if (!connectionId) return;
|
||||
await deleteApplicabilityStatement({
|
||||
variables: {
|
||||
input: {
|
||||
stateOfApplicabilityId: data.id,
|
||||
controlId,
|
||||
applicabilityStatementId,
|
||||
},
|
||||
},
|
||||
onSuccess: () => {
|
||||
refetch({}, { fetchPolicy: "network-only" });
|
||||
connections: [connectionId],
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -156,13 +174,13 @@ export default function StateOfApplicabilityControlsTab({
|
||||
return (
|
||||
<>
|
||||
<div className="space-y-4">
|
||||
{canLink && (
|
||||
{canCreate && (
|
||||
<div className="flex justify-end">
|
||||
<Button
|
||||
icon={IconPlusLarge}
|
||||
onClick={handleOpenManageDialog}
|
||||
onClick={handleOpenAddStatementDialog}
|
||||
>
|
||||
{__("Add Controls")}
|
||||
{__("Create Statement")}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
@@ -188,7 +206,7 @@ export default function StateOfApplicabilityControlsTab({
|
||||
<Th className="w-36 text-center">
|
||||
{__("Risk Assessment")}
|
||||
</Th>
|
||||
{(canLink || canUnlink) && (
|
||||
{(canUpdate || canDelete) && (
|
||||
<Th className="w-12"></Th>
|
||||
)}
|
||||
</Tr>
|
||||
@@ -197,7 +215,7 @@ export default function StateOfApplicabilityControlsTab({
|
||||
{linkedControls.length === 0 && (
|
||||
<Tr>
|
||||
<Td
|
||||
colSpan={canLink || canUnlink ? 9 : 8}
|
||||
colSpan={canUpdate || canDelete ? 9 : 8}
|
||||
className="text-center text-txt-secondary py-12"
|
||||
>
|
||||
{__("No controls linked")}
|
||||
@@ -319,10 +337,10 @@ export default function StateOfApplicabilityControlsTab({
|
||||
</Badge>
|
||||
</div>
|
||||
</Td>
|
||||
{(canLink || canUnlink) && (
|
||||
{(canUpdate || canDelete) && (
|
||||
<Td noLink className="text-end">
|
||||
<ActionDropdown>
|
||||
{canLink && (
|
||||
{canUpdate && control.applicabilityStatementId && (
|
||||
<DropdownItem
|
||||
icon={IconPencil}
|
||||
onClick={(e) => {
|
||||
@@ -331,15 +349,22 @@ export default function StateOfApplicabilityControlsTab({
|
||||
if (
|
||||
typeof control.applicability
|
||||
=== "boolean"
|
||||
&& control.applicabilityStatementId
|
||||
) {
|
||||
handleOpenEditDialog(
|
||||
{
|
||||
controlId: control.controlId,
|
||||
sectionTitle: control.sectionTitle,
|
||||
applicabilityStatementId:
|
||||
control.applicabilityStatementId,
|
||||
sectionTitle:
|
||||
control.sectionTitle,
|
||||
name: control.name,
|
||||
frameworkName: control.frameworkName,
|
||||
applicability: control.applicability,
|
||||
justification: control.justification ?? null,
|
||||
frameworkName:
|
||||
control.frameworkName,
|
||||
applicability:
|
||||
control.applicability,
|
||||
justification:
|
||||
control.justification
|
||||
?? null,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -348,16 +373,20 @@ export default function StateOfApplicabilityControlsTab({
|
||||
{__("Edit")}
|
||||
</DropdownItem>
|
||||
)}
|
||||
{canUnlink && (
|
||||
{canDelete && control.applicabilityStatementId && (
|
||||
<DropdownItem
|
||||
icon={IconTrashCan}
|
||||
variant="danger"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
void handleUnlink(control.controlId);
|
||||
if (control.applicabilityStatementId) {
|
||||
void handleDelete(
|
||||
control.applicabilityStatementId,
|
||||
);
|
||||
}
|
||||
}}
|
||||
disabled={isUnlinking}
|
||||
disabled={isDeleting}
|
||||
>
|
||||
{__("Remove")}
|
||||
</DropdownItem>
|
||||
@@ -372,13 +401,8 @@ export default function StateOfApplicabilityControlsTab({
|
||||
</div>
|
||||
|
||||
<Suspense fallback={null}>
|
||||
<LinkControlDialog ref={manageDialogRef} />
|
||||
<EditControlDialog
|
||||
ref={editDialogRef}
|
||||
onSuccess={() => {
|
||||
refetch({}, { fetchPolicy: "network-only" });
|
||||
}}
|
||||
/>
|
||||
<AddApplicabilityStatementDialog ref={addStatementDialogRef} />
|
||||
<EditControlDialog ref={editDialogRef} />
|
||||
</Suspense>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
import { formatDate } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Card, Field } from "@probo/ui";
|
||||
import { useOutletContext } from "react-router";
|
||||
|
||||
import type { StateOfApplicabilityGraphNodeQuery$data } from "#/__generated__/core/StateOfApplicabilityGraphNodeQuery.graphql";
|
||||
|
||||
type StateOfApplicabilityNode = NonNullable<
|
||||
StateOfApplicabilityGraphNodeQuery$data["node"]
|
||||
>;
|
||||
|
||||
export default function StateOfApplicabilityOverviewTab() {
|
||||
const { stateOfApplicability } = useOutletContext<{
|
||||
stateOfApplicability: StateOfApplicabilityNode;
|
||||
}>();
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<h2 className="text-base font-medium">
|
||||
{__("State of Applicability details")}
|
||||
</h2>
|
||||
<Card className="space-y-4" padded>
|
||||
<Field
|
||||
label={__("Name")}
|
||||
value={stateOfApplicability.name}
|
||||
disabled
|
||||
/>
|
||||
{stateOfApplicability.sourceId && (
|
||||
<Field
|
||||
label={__("Source")}
|
||||
value={stateOfApplicability.sourceId}
|
||||
disabled
|
||||
/>
|
||||
)}
|
||||
{stateOfApplicability.snapshotId && (
|
||||
<Field
|
||||
label={__("Snapshot")}
|
||||
value={stateOfApplicability.snapshotId}
|
||||
disabled
|
||||
/>
|
||||
)}
|
||||
<Field
|
||||
label={__("Created at")}
|
||||
value={formatDate(stateOfApplicability.createdAt)}
|
||||
disabled
|
||||
/>
|
||||
<Field
|
||||
label={__("Updated at")}
|
||||
value={formatDate(stateOfApplicability.updatedAt)}
|
||||
disabled
|
||||
/>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,71 +1,35 @@
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { type AppRoute, loaderFromQueryLoader, withQueryRef } from "@probo/routes";
|
||||
import { loadQuery } from "react-relay";
|
||||
import type { AppRoute } from "@probo/routes";
|
||||
|
||||
import type { StateOfApplicabilityGraphNodeQuery } from "#/__generated__/core/StateOfApplicabilityGraphNodeQuery.graphql";
|
||||
import type { StateOfApplicabilityGraphPaginatedQuery } from "#/__generated__/core/StateOfApplicabilityGraphPaginatedQuery.graphql";
|
||||
import { PageSkeleton } from "#/components/skeletons/PageSkeleton.tsx";
|
||||
import { coreEnvironment } from "#/environments";
|
||||
import {
|
||||
paginatedStateOfApplicabilityQuery,
|
||||
stateOfApplicabilityNodeQuery,
|
||||
} from "#/hooks/graph/StateOfApplicabilityGraph";
|
||||
|
||||
export const statesOfApplicabilityRoutes = [
|
||||
{
|
||||
path: "states-of-applicability",
|
||||
Fallback: PageSkeleton,
|
||||
loader: loaderFromQueryLoader(({ organizationId }) =>
|
||||
loadQuery<StateOfApplicabilityGraphPaginatedQuery>(
|
||||
coreEnvironment,
|
||||
paginatedStateOfApplicabilityQuery,
|
||||
{ organizationId: organizationId },
|
||||
),
|
||||
),
|
||||
Component: withQueryRef(
|
||||
lazy(() => import("#/pages/organizations/states-of-applicability/StatesOfApplicabilityPage")),
|
||||
Component: lazy(
|
||||
() => import("#/pages/organizations/states-of-applicability/StatesOfApplicabilityPageLoader"),
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/states-of-applicability",
|
||||
Fallback: PageSkeleton,
|
||||
loader: loaderFromQueryLoader(({ organizationId }) =>
|
||||
loadQuery<StateOfApplicabilityGraphPaginatedQuery>(
|
||||
coreEnvironment,
|
||||
paginatedStateOfApplicabilityQuery,
|
||||
{ organizationId: organizationId },
|
||||
),
|
||||
),
|
||||
Component: withQueryRef(
|
||||
lazy(() => import("#/pages/organizations/states-of-applicability/StatesOfApplicabilityPage")),
|
||||
Component: lazy(
|
||||
() => import("#/pages/organizations/states-of-applicability/StatesOfApplicabilityPageLoader"),
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "states-of-applicability/:stateOfApplicabilityId",
|
||||
Fallback: PageSkeleton,
|
||||
loader: loaderFromQueryLoader(({ stateOfApplicabilityId }) =>
|
||||
loadQuery<StateOfApplicabilityGraphNodeQuery>(
|
||||
coreEnvironment,
|
||||
stateOfApplicabilityNodeQuery,
|
||||
{ stateOfApplicabilityId: stateOfApplicabilityId },
|
||||
),
|
||||
),
|
||||
Component: withQueryRef(
|
||||
lazy(() => import("#/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPage")),
|
||||
Component: lazy(
|
||||
() => import("#/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPageLoader"),
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/states-of-applicability/:stateOfApplicabilityId",
|
||||
Fallback: PageSkeleton,
|
||||
loader: loaderFromQueryLoader(({ stateOfApplicabilityId }) =>
|
||||
loadQuery<StateOfApplicabilityGraphNodeQuery>(
|
||||
coreEnvironment,
|
||||
stateOfApplicabilityNodeQuery,
|
||||
{ stateOfApplicabilityId: stateOfApplicabilityId },
|
||||
),
|
||||
),
|
||||
Component: withQueryRef(
|
||||
lazy(() => import("#/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPage")),
|
||||
Component: lazy(
|
||||
() => import("#/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPageLoader"),
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
StateOfApplicabilityControl struct {
|
||||
ApplicabilityStatement struct {
|
||||
ID gid.GID `db:"id"`
|
||||
StateOfApplicabilityID gid.GID `db:"state_of_applicability_id"`
|
||||
ControlID gid.GID `db:"control_id"`
|
||||
@@ -41,53 +41,80 @@ type (
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
StateOfApplicabilityControls []*StateOfApplicabilityControl
|
||||
|
||||
AvailableStateOfApplicabilityControl struct {
|
||||
ControlID gid.GID `db:"control_id"`
|
||||
SectionTitle string `db:"section_title"`
|
||||
Name string `db:"name"`
|
||||
FrameworkID gid.GID `db:"framework_id"`
|
||||
FrameworkName string `db:"framework_name"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
StateOfApplicabilityID *gid.GID `db:"state_of_applicability_id"`
|
||||
Applicability *bool `db:"applicability"`
|
||||
Justification *string `db:"justification"`
|
||||
BestPractice bool `db:"best_practice"`
|
||||
Regulatory bool `db:"regulatory"`
|
||||
Contractual bool `db:"contractual"`
|
||||
RiskAssessment bool `db:"risk_assessment"`
|
||||
}
|
||||
|
||||
AvailableStateOfApplicabilityControls []*AvailableStateOfApplicabilityControl
|
||||
ApplicabilityStatements []*ApplicabilityStatement
|
||||
)
|
||||
|
||||
func (s StateOfApplicabilityControl) CursorKey(orderBy StateOfApplicabilityOrderField) page.CursorKey {
|
||||
func (s ApplicabilityStatement) CursorKey(orderBy ApplicabilityStatementOrderField) page.CursorKey {
|
||||
switch orderBy {
|
||||
case StateOfApplicabilityOrderFieldName:
|
||||
return page.NewCursorKey(s.ID, s.StateOfApplicabilityID)
|
||||
case StateOfApplicabilityOrderFieldCreatedAt:
|
||||
case ApplicabilityStatementOrderFieldCreatedAt:
|
||||
return page.NewCursorKey(s.ID, s.CreatedAt)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", orderBy))
|
||||
}
|
||||
|
||||
func (s *StateOfApplicabilityControl) AuthorizationAttributes(ctx context.Context, conn pg.Conn) (map[string]string, error) {
|
||||
q := `SELECT organization_id FROM states_of_applicability_controls WHERE id = $1 LIMIT 1;`
|
||||
func (s *ApplicabilityStatement) AuthorizationAttributes(ctx context.Context, conn pg.Conn) (map[string]string, error) {
|
||||
q := `SELECT organization_id FROM applicability_statements WHERE id = $1 LIMIT 1;`
|
||||
|
||||
var organizationID gid.GID
|
||||
if err := conn.QueryRow(ctx, q, s.ID).Scan(&organizationID); err != nil {
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
return nil, ErrResourceNotFound
|
||||
}
|
||||
return nil, fmt.Errorf("cannot query state of applicability control authorization attributes: %w", err)
|
||||
return nil, fmt.Errorf("cannot query applicability statement authorization attributes: %w", err)
|
||||
}
|
||||
|
||||
return map[string]string{"organization_id": organizationID.String()}, nil
|
||||
}
|
||||
|
||||
func (sac *StateOfApplicabilityControl) LoadByStateOfApplicabilityIDAndControlID(
|
||||
func (sac *ApplicabilityStatement) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
id gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
state_of_applicability_id,
|
||||
control_id,
|
||||
organization_id,
|
||||
snapshot_id,
|
||||
applicability,
|
||||
justification,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
applicability_statements
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
LIMIT 1;
|
||||
`
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"id": id}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query applicability_statements: %w", err)
|
||||
}
|
||||
|
||||
applicabilityStatement, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ApplicabilityStatement])
|
||||
if err != nil {
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
return ErrResourceNotFound
|
||||
}
|
||||
return fmt.Errorf("cannot collect applicability statement: %w", err)
|
||||
}
|
||||
|
||||
*sac = applicabilityStatement
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sac *ApplicabilityStatement) LoadByStateOfApplicabilityIDAndControlID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
@@ -114,7 +141,7 @@ SELECT
|
||||
soac.created_at,
|
||||
soac.updated_at
|
||||
FROM
|
||||
states_of_applicability_controls soac
|
||||
applicability_statements soac
|
||||
INNER JOIN
|
||||
current_soa ON soac.state_of_applicability_id = current_soa.id
|
||||
WHERE
|
||||
@@ -131,29 +158,29 @@ LIMIT 1;
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query states_of_applicability_controls: %w", err)
|
||||
return fmt.Errorf("cannot query applicability_statements: %w", err)
|
||||
}
|
||||
|
||||
control, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[StateOfApplicabilityControl])
|
||||
control, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ApplicabilityStatement])
|
||||
if err != nil {
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
return ErrResourceNotFound
|
||||
}
|
||||
return fmt.Errorf("cannot collect state of applicability control: %w", err)
|
||||
return fmt.Errorf("cannot collect applicability statement: %w", err)
|
||||
}
|
||||
|
||||
*sac = control
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sac *StateOfApplicabilityControl) Insert(
|
||||
func (sac *ApplicabilityStatement) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO
|
||||
states_of_applicability_controls (
|
||||
applicability_statements (
|
||||
id,
|
||||
state_of_applicability_id,
|
||||
control_id,
|
||||
@@ -201,19 +228,19 @@ VALUES (
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("cannot insert state_of_applicability_control: %w", err)
|
||||
return fmt.Errorf("cannot insert applicability_statement: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sac *StateOfApplicabilityControl) Update(
|
||||
func (sac *ApplicabilityStatement) Update(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
UPDATE states_of_applicability_controls
|
||||
UPDATE applicability_statements
|
||||
SET
|
||||
applicability = @applicability,
|
||||
justification = @justification,
|
||||
@@ -236,70 +263,50 @@ WHERE
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update state_of_applicability_control: %w", err)
|
||||
return fmt.Errorf("cannot update applicability_statement: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sac *StateOfApplicabilityControl) Upsert(
|
||||
func (sac *ApplicabilityStatement) UpdateByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO
|
||||
states_of_applicability_controls (
|
||||
id,
|
||||
state_of_applicability_id,
|
||||
control_id,
|
||||
organization_id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
applicability,
|
||||
justification,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
VALUES (
|
||||
@id,
|
||||
@state_of_applicability_id,
|
||||
@control_id,
|
||||
@organization_id,
|
||||
@tenant_id,
|
||||
@snapshot_id,
|
||||
@applicability,
|
||||
@justification,
|
||||
@created_at,
|
||||
@updated_at
|
||||
)
|
||||
ON CONFLICT (state_of_applicability_id, control_id) DO UPDATE SET
|
||||
applicability = EXCLUDED.applicability,
|
||||
justification = EXCLUDED.justification,
|
||||
updated_at = EXCLUDED.updated_at
|
||||
UPDATE applicability_statements
|
||||
SET
|
||||
applicability = @applicability,
|
||||
justification = @justification,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
`
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": sac.ID,
|
||||
"state_of_applicability_id": sac.StateOfApplicabilityID,
|
||||
"control_id": sac.ControlID,
|
||||
"organization_id": sac.OrganizationID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": sac.SnapshotID,
|
||||
"applicability": sac.Applicability,
|
||||
"justification": sac.Justification,
|
||||
"created_at": sac.CreatedAt,
|
||||
"updated_at": sac.UpdatedAt,
|
||||
"id": sac.ID,
|
||||
"applicability": sac.Applicability,
|
||||
"justification": sac.Justification,
|
||||
"updated_at": sac.UpdatedAt,
|
||||
}
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
result, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot upsert state_of_applicability_control: %w", err)
|
||||
return fmt.Errorf("cannot update applicability_statement: %w", err)
|
||||
}
|
||||
|
||||
if result.RowsAffected() == 0 {
|
||||
return ErrResourceNotFound
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sac *StateOfApplicabilityControl) Delete(
|
||||
func (sac *ApplicabilityStatement) Delete(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
@@ -313,7 +320,7 @@ WITH current_soa AS (
|
||||
AND id = @state_of_applicability_id
|
||||
AND snapshot_id IS NULL
|
||||
)
|
||||
DELETE FROM states_of_applicability_controls
|
||||
DELETE FROM applicability_statements
|
||||
WHERE state_of_applicability_id IN (SELECT id FROM current_soa)
|
||||
AND control_id = @control_id;
|
||||
`
|
||||
@@ -329,11 +336,41 @@ WHERE state_of_applicability_id IN (SELECT id FROM current_soa)
|
||||
return err
|
||||
}
|
||||
|
||||
func (sacs *StateOfApplicabilityControls) LoadByStateOfApplicabilityID(
|
||||
func (sac *ApplicabilityStatement) DeleteByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
applicabilityStatementID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM applicability_statements
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id;
|
||||
`
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"id": applicabilityStatementID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
result, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete applicability statement: %w", err)
|
||||
}
|
||||
|
||||
if result.RowsAffected() == 0 {
|
||||
return ErrResourceNotFound
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sacs *ApplicabilityStatements) LoadByStateOfApplicabilityID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
cursor *page.Cursor[ApplicabilityStatementOrderField],
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
@@ -347,39 +384,68 @@ SELECT
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
states_of_applicability_controls
|
||||
applicability_statements
|
||||
WHERE
|
||||
%s
|
||||
%[1]s
|
||||
AND state_of_applicability_id = @state_of_applicability_id
|
||||
ORDER BY created_at ASC
|
||||
AND %[2]s
|
||||
`
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
args := pgx.NamedArgs{
|
||||
"state_of_applicability_id": stateOfApplicabilityID,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query states_of_applicability_controls: %w", err)
|
||||
return fmt.Errorf("cannot query applicability_statements: %w", err)
|
||||
}
|
||||
|
||||
controls, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[StateOfApplicabilityControl])
|
||||
controls, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ApplicabilityStatement])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect states_of_applicability_controls: %w", err)
|
||||
return fmt.Errorf("cannot collect applicability_statements: %w", err)
|
||||
}
|
||||
|
||||
*sacs = controls
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sacs *StateOfApplicabilityControls) LoadByControlID(
|
||||
func (sacs *ApplicabilityStatements) CountByStateOfApplicabilityID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
applicability_statements
|
||||
WHERE
|
||||
%s
|
||||
AND state_of_applicability_id = @state_of_applicability_id;
|
||||
`
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.NamedArgs{"state_of_applicability_id": stateOfApplicabilityID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
var count int
|
||||
if err := conn.QueryRow(ctx, q, args).Scan(&count); err != nil {
|
||||
return 0, fmt.Errorf("cannot count applicability_statements: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (sacs *ApplicabilityStatements) LoadByControlID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
controlID gid.GID,
|
||||
cursor *page.Cursor[StateOfApplicabilityOrderField],
|
||||
cursor *page.Cursor[ApplicabilityStatementOrderField],
|
||||
) error {
|
||||
q := `
|
||||
WITH soac_ctrl AS (
|
||||
@@ -395,7 +461,7 @@ WITH soac_ctrl AS (
|
||||
soac.updated_at,
|
||||
soac.tenant_id
|
||||
FROM
|
||||
states_of_applicability_controls soac
|
||||
applicability_statements soac
|
||||
INNER JOIN
|
||||
states_of_applicability soa ON soac.state_of_applicability_id = soa.id
|
||||
WHERE
|
||||
@@ -427,19 +493,19 @@ WHERE
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query state_of_applicability_controls: %w", err)
|
||||
return fmt.Errorf("cannot query applicability_statements: %w", err)
|
||||
}
|
||||
|
||||
controls, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[StateOfApplicabilityControl])
|
||||
controls, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ApplicabilityStatement])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect state_of_applicability_controls: %w", err)
|
||||
return fmt.Errorf("cannot collect applicability_statements: %w", err)
|
||||
}
|
||||
|
||||
*sacs = controls
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sacs *StateOfApplicabilityControls) CountByControlID(
|
||||
func (sacs *ApplicabilityStatements) CountByControlID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
@@ -452,7 +518,7 @@ WITH soac_ctrl AS (
|
||||
soac.organization_id,
|
||||
soac.tenant_id
|
||||
FROM
|
||||
states_of_applicability_controls soac
|
||||
applicability_statements soac
|
||||
INNER JOIN
|
||||
states_of_applicability soa ON soac.state_of_applicability_id = soa.id
|
||||
WHERE
|
||||
@@ -482,126 +548,3 @@ WHERE
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (acfs *AvailableStateOfApplicabilityControls) LoadAvailableByStateOfApplicabilityID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
WITH soa_info AS (
|
||||
SELECT
|
||||
soa.organization_id,
|
||||
soa.tenant_id AS soa_tenant_id
|
||||
FROM states_of_applicability soa
|
||||
WHERE soa.tenant_id = @tenant_id
|
||||
AND soa.id = @state_of_applicability_id
|
||||
),
|
||||
filtered_controls AS (
|
||||
SELECT
|
||||
c.id AS control_id,
|
||||
c.section_title,
|
||||
c.name,
|
||||
c.framework_id,
|
||||
c.organization_id,
|
||||
c.tenant_id,
|
||||
c.best_practice
|
||||
FROM controls c
|
||||
WHERE
|
||||
%s
|
||||
),
|
||||
all_controls AS (
|
||||
SELECT
|
||||
fc.control_id,
|
||||
fc.section_title,
|
||||
fc.name,
|
||||
fc.framework_id,
|
||||
fc.organization_id,
|
||||
fc.tenant_id,
|
||||
f.name AS framework_name,
|
||||
fc.best_practice
|
||||
FROM filtered_controls fc
|
||||
INNER JOIN frameworks f ON fc.framework_id = f.id
|
||||
CROSS JOIN soa_info si
|
||||
WHERE fc.organization_id = si.organization_id
|
||||
),
|
||||
existing_links AS (
|
||||
SELECT
|
||||
soac.control_id,
|
||||
soac.state_of_applicability_id,
|
||||
soac.applicability,
|
||||
soac.justification
|
||||
FROM states_of_applicability_controls soac
|
||||
CROSS JOIN soa_info si
|
||||
WHERE soac.tenant_id = si.soa_tenant_id
|
||||
AND soac.state_of_applicability_id = @state_of_applicability_id
|
||||
),
|
||||
regulatory_controls AS (
|
||||
SELECT DISTINCT co.control_id
|
||||
FROM controls_obligations co
|
||||
INNER JOIN obligations o ON o.id = co.obligation_id
|
||||
CROSS JOIN soa_info si
|
||||
WHERE co.tenant_id = si.soa_tenant_id
|
||||
AND o.tenant_id = si.soa_tenant_id
|
||||
AND o.type = 'LEGAL'
|
||||
),
|
||||
contractual_controls AS (
|
||||
SELECT DISTINCT co.control_id
|
||||
FROM controls_obligations co
|
||||
INNER JOIN obligations o ON o.id = co.obligation_id
|
||||
CROSS JOIN soa_info si
|
||||
WHERE co.tenant_id = si.soa_tenant_id
|
||||
AND o.tenant_id = si.soa_tenant_id
|
||||
AND o.type = 'CONTRACTUAL'
|
||||
),
|
||||
risk_controls AS (
|
||||
SELECT DISTINCT cm.control_id
|
||||
FROM controls_measures cm
|
||||
INNER JOIN risks_measures rm ON rm.measure_id = cm.measure_id
|
||||
CROSS JOIN soa_info si
|
||||
WHERE cm.tenant_id = si.soa_tenant_id
|
||||
AND rm.tenant_id = si.soa_tenant_id
|
||||
)
|
||||
SELECT
|
||||
ac.control_id,
|
||||
ac.section_title,
|
||||
ac.name,
|
||||
ac.framework_id,
|
||||
ac.organization_id,
|
||||
ac.framework_name,
|
||||
el.state_of_applicability_id,
|
||||
el.applicability,
|
||||
el.justification,
|
||||
ac.best_practice,
|
||||
CASE WHEN reg.control_id IS NOT NULL THEN TRUE ELSE FALSE END AS regulatory,
|
||||
CASE WHEN cont.control_id IS NOT NULL THEN TRUE ELSE FALSE END AS contractual,
|
||||
CASE WHEN risk.control_id IS NOT NULL THEN TRUE ELSE FALSE END AS risk_assessment
|
||||
FROM all_controls ac
|
||||
LEFT JOIN existing_links el ON ac.control_id = el.control_id
|
||||
LEFT JOIN regulatory_controls reg ON reg.control_id = ac.control_id
|
||||
LEFT JOIN contractual_controls cont ON cont.control_id = ac.control_id
|
||||
LEFT JOIN risk_controls risk ON risk.control_id = ac.control_id
|
||||
ORDER BY ac.framework_name, ac.section_title, ac.name
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"state_of_applicability_id": stateOfApplicabilityID,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query available controls: %w", err)
|
||||
}
|
||||
|
||||
controls, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[AvailableStateOfApplicabilityControl])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect available controls: %w", err)
|
||||
}
|
||||
|
||||
*acfs = controls
|
||||
return nil
|
||||
}
|
||||
52
pkg/coredata/applicability_statement_order_field.go
Normal file
52
pkg/coredata/applicability_statement_order_field.go
Normal file
@@ -0,0 +1,52 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ApplicabilityStatementOrderField string
|
||||
|
||||
const (
|
||||
ApplicabilityStatementOrderFieldCreatedAt ApplicabilityStatementOrderField = "CREATED_AT"
|
||||
)
|
||||
|
||||
func (p ApplicabilityStatementOrderField) Column() string {
|
||||
switch p {
|
||||
case ApplicabilityStatementOrderFieldCreatedAt:
|
||||
return "created_at"
|
||||
}
|
||||
|
||||
panic("unknown ApplicabilityStatementOrderField")
|
||||
}
|
||||
|
||||
func (p ApplicabilityStatementOrderField) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ApplicabilityStatementOrderField) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *ApplicabilityStatementOrderField) UnmarshalText(text []byte) error {
|
||||
val := string(text)
|
||||
switch val {
|
||||
case string(ApplicabilityStatementOrderFieldCreatedAt):
|
||||
*p = ApplicabilityStatementOrderField(val)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("invalid ApplicabilityStatementOrderField value: %q", val)
|
||||
}
|
||||
@@ -720,6 +720,54 @@ LIMIT 1;
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Controls) LoadByIDs(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
controlIDs []gid.GID,
|
||||
) error {
|
||||
if len(controlIDs) == 0 {
|
||||
*c = Controls{}
|
||||
return nil
|
||||
}
|
||||
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
section_title,
|
||||
framework_id,
|
||||
organization_id,
|
||||
name,
|
||||
description,
|
||||
status,
|
||||
exclusion_justification,
|
||||
best_practice,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
controls
|
||||
WHERE
|
||||
%s
|
||||
AND id = ANY(@control_ids)
|
||||
`
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"control_ids": controlIDs}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query controls: %w", err)
|
||||
}
|
||||
|
||||
controls, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Control])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect controls: %w", err)
|
||||
}
|
||||
|
||||
*c = controls
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c Control) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
@@ -1098,7 +1146,7 @@ WITH ctrl AS (
|
||||
FROM
|
||||
controls c
|
||||
INNER JOIN
|
||||
states_of_applicability_controls soac ON c.id = soac.control_id
|
||||
applicability_statements soac ON c.id = soac.control_id
|
||||
WHERE
|
||||
soac.state_of_applicability_id = @state_of_applicability_id
|
||||
)
|
||||
@@ -1124,74 +1172,3 @@ WHERE %s
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (c *Controls) LoadByStateOfApplicabilityID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
cursor *page.Cursor[ControlOrderField],
|
||||
filter *ControlFilter,
|
||||
) error {
|
||||
q := `
|
||||
WITH ctrl AS (
|
||||
SELECT
|
||||
c.id,
|
||||
c.section_title,
|
||||
c.framework_id,
|
||||
c.organization_id,
|
||||
c.tenant_id,
|
||||
c.name,
|
||||
c.description,
|
||||
c.status,
|
||||
c.exclusion_justification,
|
||||
c.best_practice,
|
||||
c.created_at,
|
||||
c.updated_at,
|
||||
c.search_vector
|
||||
FROM
|
||||
controls c
|
||||
INNER JOIN
|
||||
states_of_applicability_controls soac ON c.id = soac.control_id
|
||||
WHERE
|
||||
soac.state_of_applicability_id = @state_of_applicability_id
|
||||
)
|
||||
SELECT
|
||||
id,
|
||||
section_title,
|
||||
framework_id,
|
||||
organization_id,
|
||||
name,
|
||||
description,
|
||||
status,
|
||||
exclusion_justification,
|
||||
best_practice,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
ctrl
|
||||
WHERE %s
|
||||
AND %s
|
||||
AND %s
|
||||
`
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.NamedArgs{"state_of_applicability_id": stateOfApplicabilityID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query controls: %w", err)
|
||||
}
|
||||
|
||||
controls, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Control])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect controls: %w", err)
|
||||
}
|
||||
|
||||
*c = controls
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -167,19 +167,13 @@ WHERE
|
||||
return nil
|
||||
}
|
||||
|
||||
type ControlObligationType struct {
|
||||
ControlID gid.GID `db:"control_id"`
|
||||
Type ObligationType `db:"type"`
|
||||
}
|
||||
|
||||
type ControlObligationTypes []*ControlObligationType
|
||||
|
||||
func (cots *ControlObligationTypes) LoadTypesByControlIDs(
|
||||
func (cos *ControlObligations) CountByControlID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
controlIDs []gid.GID,
|
||||
) error {
|
||||
controlID gid.GID,
|
||||
filter *ControlObligationFilter,
|
||||
) (int, error) {
|
||||
q := `
|
||||
WITH control_obls AS (
|
||||
SELECT
|
||||
@@ -191,31 +185,27 @@ WITH control_obls AS (
|
||||
INNER JOIN
|
||||
obligations o ON co.obligation_id = o.id
|
||||
WHERE
|
||||
co.control_id = ANY(@control_ids)
|
||||
co.control_id = @control_id
|
||||
)
|
||||
SELECT DISTINCT
|
||||
control_id,
|
||||
type
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
control_obls
|
||||
WHERE
|
||||
%s
|
||||
WHERE %s
|
||||
AND %s
|
||||
`
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||
|
||||
args := pgx.NamedArgs{"control_ids": controlIDs}
|
||||
args := pgx.StrictNamedArgs{"control_id": controlID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query control obligations: %w", err)
|
||||
row := conn.QueryRow(ctx, q, args)
|
||||
|
||||
var count int
|
||||
if err := row.Scan(&count); err != nil {
|
||||
return 0, fmt.Errorf("cannot count control obligations: %w", err)
|
||||
}
|
||||
|
||||
controlObligationTypes, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ControlObligationType])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect control obligations: %w", err)
|
||||
}
|
||||
|
||||
*cots = controlObligationTypes
|
||||
return nil
|
||||
return count, nil
|
||||
}
|
||||
|
||||
45
pkg/coredata/control_obligation_filter.go
Normal file
45
pkg/coredata/control_obligation_filter.go
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
)
|
||||
|
||||
type ControlObligationFilter struct {
|
||||
obligationType *ObligationType
|
||||
}
|
||||
|
||||
func NewControlObligationFilter(obligationType *ObligationType) *ControlObligationFilter {
|
||||
return &ControlObligationFilter{
|
||||
obligationType: obligationType,
|
||||
}
|
||||
}
|
||||
|
||||
func (f *ControlObligationFilter) SQLArguments() pgx.NamedArgs {
|
||||
args := pgx.NamedArgs{
|
||||
"filter_obligation_type": nil,
|
||||
}
|
||||
|
||||
if f.obligationType != nil {
|
||||
args["filter_obligation_type"] = *f.obligationType
|
||||
}
|
||||
|
||||
return args
|
||||
}
|
||||
|
||||
func (f *ControlObligationFilter) SQLFragment() string {
|
||||
return "(@filter_obligation_type::obligation_type IS NULL OR type = @filter_obligation_type)"
|
||||
}
|
||||
@@ -73,7 +73,7 @@ const (
|
||||
TransferImpactAssessmentEntityType uint16 = 47
|
||||
RightsRequestEntityType uint16 = 48
|
||||
StateOfApplicabilityEntityType uint16 = 49
|
||||
StateOfApplicabilityControlEntityType uint16 = 50
|
||||
ApplicabilityStatementEntityType uint16 = 50
|
||||
MembershipProfileEntityType uint16 = 51
|
||||
SCIMConfigurationEntityType uint16 = 52
|
||||
SCIMEventEntityType uint16 = 53
|
||||
@@ -180,8 +180,8 @@ func NewEntityFromID(id gid.GID) (any, bool) {
|
||||
return &RightsRequest{ID: id}, true
|
||||
case StateOfApplicabilityEntityType:
|
||||
return &StateOfApplicability{ID: id}, true
|
||||
case StateOfApplicabilityControlEntityType:
|
||||
return &StateOfApplicabilityControl{ID: id}, true
|
||||
case ApplicabilityStatementEntityType:
|
||||
return &ApplicabilityStatement{ID: id}, true
|
||||
case MembershipProfileEntityType:
|
||||
return &MembershipProfile{ID: id}, true
|
||||
case SCIMConfigurationEntityType:
|
||||
|
||||
@@ -241,6 +241,53 @@ LIMIT 1;
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *Frameworks) LoadByIDs(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
frameworkIDs []gid.GID,
|
||||
) error {
|
||||
if len(frameworkIDs) == 0 {
|
||||
*f = Frameworks{}
|
||||
return nil
|
||||
}
|
||||
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
name,
|
||||
description,
|
||||
light_logo_file_id,
|
||||
dark_logo_file_id,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
frameworks
|
||||
WHERE
|
||||
%s
|
||||
AND id = ANY(@framework_ids)
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"framework_ids": frameworkIDs}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query frameworks: %w", err)
|
||||
}
|
||||
|
||||
frameworks, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Framework])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect frameworks: %w", err)
|
||||
}
|
||||
|
||||
*f = frameworks
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f Framework) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
|
||||
@@ -109,20 +109,24 @@ WHERE NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM states_of_applicability soa
|
||||
WHERE soa.name = f.name
|
||||
AND soa.tenant_id = f.tenant_id
|
||||
AND soa.snapshot_id IS NULL
|
||||
)
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM peoples WHERE tenant_id = f.tenant_id
|
||||
)
|
||||
-- We only use exclude with ISO 27001 FIXME
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM controls c
|
||||
WHERE c.framework_id = f.id
|
||||
AND c.tenant_id = f.tenant_id
|
||||
AND (
|
||||
c.status = 'EXCLUDED'
|
||||
OR (c.exclusion_justification IS NOT NULL AND c.exclusion_justification != '')
|
||||
)
|
||||
);
|
||||
)
|
||||
AND organization_id = 'e5IaD7ibAAEAAAAAAZZ9aR_Oq_Npymhg';
|
||||
|
||||
INSERT INTO states_of_applicability_controls (
|
||||
id,
|
||||
@@ -151,11 +155,23 @@ SELECT
|
||||
NOW() as created_at,
|
||||
NOW() as updated_at
|
||||
FROM frameworks f
|
||||
JOIN states_of_applicability soa ON soa.name = f.name AND soa.snapshot_id IS NULL
|
||||
JOIN states_of_applicability soa ON soa.name = f.name AND soa.snapshot_id IS NULL AND soa.tenant_id = f.tenant_id
|
||||
JOIN controls c ON c.framework_id = f.id
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM states_of_applicability_controls soac
|
||||
WHERE soac.state_of_applicability_id = soa.id
|
||||
AND soac.control_id = c.id
|
||||
);
|
||||
)
|
||||
AND f.id = 'e5IaD7ibAAEAAQAAAZsNt6Js2dJrgpJG'
|
||||
AND f.organization_id = 'e5IaD7ibAAEAAAAAAZZ9aR_Oq_Npymhg';
|
||||
|
||||
|
||||
|
||||
WITH todelete AS (
|
||||
SELECT soac.id
|
||||
FROM states_of_applicability soa
|
||||
JOIN states_of_applicability_controls soac ON soac.state_of_applicability_id = soa.id
|
||||
WHERE soa.tenant_id != soac.tenant_id
|
||||
)
|
||||
DELETE FROM states_of_applicability_controls WHERE id IN (SELECT id FROM todelete)
|
||||
|
||||
11
pkg/coredata/migrations/20260121T150000Z.sql
Normal file
11
pkg/coredata/migrations/20260121T150000Z.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
ALTER TABLE states_of_applicability_controls RENAME TO applicability_statements;
|
||||
|
||||
ALTER TABLE applicability_statements
|
||||
RENAME CONSTRAINT states_of_applicability_controls_organization_id_fkey
|
||||
TO applicability_statements_organization_id_fkey;
|
||||
|
||||
ALTER TABLE applicability_statements
|
||||
RENAME CONSTRAINT states_of_applicability_controls_snapshot_id_fkey
|
||||
TO applicability_statements_snapshot_id_fkey;
|
||||
|
||||
ALTER INDEX states_of_applicability_controls_pkey RENAME TO applicability_statements_pkey;
|
||||
@@ -414,7 +414,7 @@ snapshot_soa AS (
|
||||
FROM states_of_applicability
|
||||
WHERE snapshot_id = @snapshot_id
|
||||
)
|
||||
INSERT INTO states_of_applicability_controls (
|
||||
INSERT INTO applicability_statements (
|
||||
id,
|
||||
state_of_applicability_id,
|
||||
control_id,
|
||||
@@ -427,7 +427,7 @@ INSERT INTO states_of_applicability_controls (
|
||||
updated_at
|
||||
)
|
||||
SELECT
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @state_of_applicability_control_entity_type),
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @applicability_statement_entity_type),
|
||||
snapshot_soa.id,
|
||||
soac.control_id,
|
||||
soac.organization_id,
|
||||
@@ -437,7 +437,7 @@ SELECT
|
||||
soac.justification,
|
||||
soac.created_at,
|
||||
soac.updated_at
|
||||
FROM states_of_applicability_controls soac
|
||||
FROM applicability_statements soac
|
||||
INNER JOIN source_soa
|
||||
ON soac.state_of_applicability_id = source_soa.id
|
||||
INNER JOIN snapshot_soa
|
||||
@@ -448,10 +448,10 @@ WHERE soac.snapshot_id IS NULL
|
||||
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"state_of_applicability_control_entity_type": StateOfApplicabilityControlEntityType,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"applicability_statement_entity_type": ApplicabilityStatementEntityType,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
|
||||
@@ -312,9 +312,11 @@ const (
|
||||
ActionStateOfApplicabilityDelete = "core:state-of-applicability:delete"
|
||||
ActionStateOfApplicabilityExport = "core:state-of-applicability:export"
|
||||
|
||||
ActionStateOfApplicabilityControlMappingList = "core:state-of-applicability-control-mapping:list"
|
||||
ActionStateOfApplicabilityControlMappingCreate = "core:state-of-applicability-control-mapping:create"
|
||||
ActionStateOfApplicabilityControlMappingDelete = "core:state-of-applicability-control-mapping:delete"
|
||||
ActionApplicabilityStatementGet = "core:applicability-statement:get"
|
||||
ActionApplicabilityStatementList = "core:applicability-statement:list"
|
||||
ActionApplicabilityStatementCreate = "core:applicability-statement:create"
|
||||
ActionApplicabilityStatementUpdate = "core:applicability-statement:update"
|
||||
ActionApplicabilityStatementDelete = "core:applicability-statement:delete"
|
||||
|
||||
ActionControlObligationMappingList = "core:control-obligation-mapping:list"
|
||||
ActionControlObligationMappingCreate = "core:control-obligation-mapping:create"
|
||||
|
||||
@@ -827,36 +827,6 @@ func (s ControlService) CountForStateOfApplicabilityID(
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (s ControlService) ListForStateOfApplicabilityID(
|
||||
ctx context.Context,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
cursor *page.Cursor[coredata.ControlOrderField],
|
||||
filter *coredata.ControlFilter,
|
||||
) (*page.Page[*coredata.Control, coredata.ControlOrderField], error) {
|
||||
var controls coredata.Controls
|
||||
stateOfApplicability := &coredata.StateOfApplicability{}
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
if err := stateOfApplicability.LoadByID(ctx, conn, s.svc.scope, stateOfApplicabilityID); err != nil {
|
||||
return fmt.Errorf("cannot load state of applicability: %w", err)
|
||||
}
|
||||
if err := controls.LoadByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID, cursor, filter); err != nil {
|
||||
return fmt.Errorf("cannot load controls: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return page.NewPage([]*coredata.Control(controls), cursor), nil
|
||||
}
|
||||
|
||||
func (s ControlService) Create(
|
||||
ctx context.Context,
|
||||
req CreateControlRequest,
|
||||
@@ -932,39 +902,42 @@ func (s ControlService) Update(
|
||||
|
||||
control := &coredata.Control{ID: req.ID}
|
||||
|
||||
err := s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
||||
if err := control.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
|
||||
return fmt.Errorf("cannot load control: %w", err)
|
||||
}
|
||||
err := s.svc.pg.WithTx(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
if err := control.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
|
||||
return fmt.Errorf("cannot load control: %w", err)
|
||||
}
|
||||
|
||||
if req.Name != nil {
|
||||
control.Name = *req.Name
|
||||
}
|
||||
if req.Name != nil {
|
||||
control.Name = *req.Name
|
||||
}
|
||||
|
||||
if req.Description != nil {
|
||||
control.Description = *req.Description
|
||||
}
|
||||
if req.Description != nil {
|
||||
control.Description = *req.Description
|
||||
}
|
||||
|
||||
if req.SectionTitle != nil {
|
||||
control.SectionTitle = *req.SectionTitle
|
||||
}
|
||||
if req.SectionTitle != nil {
|
||||
control.SectionTitle = *req.SectionTitle
|
||||
}
|
||||
|
||||
if req.Status != nil {
|
||||
control.Status = *req.Status
|
||||
}
|
||||
if req.Status != nil {
|
||||
control.Status = *req.Status
|
||||
}
|
||||
|
||||
if req.ExclusionJustification != nil {
|
||||
control.ExclusionJustification = req.ExclusionJustification
|
||||
}
|
||||
if req.ExclusionJustification != nil {
|
||||
control.ExclusionJustification = req.ExclusionJustification
|
||||
}
|
||||
|
||||
if req.BestPractice != nil {
|
||||
control.BestPractice = *req.BestPractice
|
||||
}
|
||||
if req.BestPractice != nil {
|
||||
control.BestPractice = *req.BestPractice
|
||||
}
|
||||
|
||||
control.UpdatedAt = time.Now()
|
||||
control.UpdatedAt = time.Now()
|
||||
|
||||
return control.Update(ctx, conn, s.svc.scope)
|
||||
})
|
||||
return control.Update(ctx, conn, s.svc.scope)
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot update control: %w", err)
|
||||
}
|
||||
@@ -985,3 +958,75 @@ func (s ControlService) Delete(
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func (s ControlService) HasRegulatoryObligation(
|
||||
ctx context.Context,
|
||||
controlID gid.GID,
|
||||
) (bool, error) {
|
||||
var hasRegulatory bool
|
||||
|
||||
obligationType := coredata.ObligationTypeLegal
|
||||
filter := coredata.NewControlObligationFilter(&obligationType)
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
var controlObligations coredata.ControlObligations
|
||||
count, err := controlObligations.CountByControlID(ctx, conn, s.svc.scope, controlID, filter)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot count regulatory obligations: %w", err)
|
||||
}
|
||||
hasRegulatory = count > 0
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
return hasRegulatory, err
|
||||
}
|
||||
|
||||
func (s ControlService) HasContractualObligation(
|
||||
ctx context.Context,
|
||||
controlID gid.GID,
|
||||
) (bool, error) {
|
||||
var hasContractual bool
|
||||
|
||||
obligationType := coredata.ObligationTypeContractual
|
||||
filter := coredata.NewControlObligationFilter(&obligationType)
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
var controlObligations coredata.ControlObligations
|
||||
count, err := controlObligations.CountByControlID(ctx, conn, s.svc.scope, controlID, filter)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot count contractual obligations: %w", err)
|
||||
}
|
||||
hasContractual = count > 0
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
return hasContractual, err
|
||||
}
|
||||
|
||||
func (s ControlService) HasRiskAssessment(
|
||||
ctx context.Context,
|
||||
controlID gid.GID,
|
||||
) (bool, error) {
|
||||
var hasRisk bool
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
var controlsWithRisk coredata.ControlsWithRisk
|
||||
if err := controlsWithRisk.LoadByControlIDs(ctx, conn, s.svc.scope, []gid.GID{controlID}); err != nil {
|
||||
return fmt.Errorf("cannot load controls with risk: %w", err)
|
||||
}
|
||||
|
||||
hasRisk = len(controlsWithRisk) > 0
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
return hasRisk, err
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ var ViewerPolicy = policy.NewPolicy(
|
||||
ActionSlackConnectionList,
|
||||
ActionRightsRequestGet, ActionRightsRequestList,
|
||||
ActionStateOfApplicabilityGet, ActionStateOfApplicabilityList,
|
||||
ActionStateOfApplicabilityControlMappingList,
|
||||
ActionApplicabilityStatementGet, ActionApplicabilityStatementList,
|
||||
).WithSID("entity-read-access").When(organizationCondition),
|
||||
|
||||
policy.Allow(
|
||||
|
||||
@@ -272,17 +272,18 @@ func (s StateOfApplicabilityService) Delete(
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s StateOfApplicabilityService) ListAvailableControls(
|
||||
func (s StateOfApplicabilityService) ListApplicabilityStatements(
|
||||
ctx context.Context,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
) ([]*coredata.AvailableStateOfApplicabilityControl, error) {
|
||||
var availableControls coredata.AvailableStateOfApplicabilityControls
|
||||
cursor *page.Cursor[coredata.ApplicabilityStatementOrderField],
|
||||
) (*page.Page[*coredata.ApplicabilityStatement, coredata.ApplicabilityStatementOrderField], error) {
|
||||
var statements coredata.ApplicabilityStatements
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
if err := availableControls.LoadAvailableByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID); err != nil {
|
||||
return fmt.Errorf("cannot load available controls: %w", err)
|
||||
if err := statements.LoadByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID, cursor); err != nil {
|
||||
return fmt.Errorf("cannot load applicability statements: %w", err)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
@@ -292,72 +293,128 @@ func (s StateOfApplicabilityService) ListAvailableControls(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return availableControls, nil
|
||||
return page.NewPage(statements, cursor), nil
|
||||
}
|
||||
|
||||
func (s StateOfApplicabilityService) LinkControl(
|
||||
func (s StateOfApplicabilityService) CountApplicabilityStatements(
|
||||
ctx context.Context,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
) (int, error) {
|
||||
var count int
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) (err error) {
|
||||
statements := &coredata.ApplicabilityStatements{}
|
||||
count, err = statements.CountByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot count applicability statements: %w", err)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (s StateOfApplicabilityService) CreateApplicabilityStatement(
|
||||
ctx context.Context,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
controlID gid.GID,
|
||||
applicability bool,
|
||||
justification *string,
|
||||
) (*coredata.StateOfApplicabilityControl, error) {
|
||||
stateOfApplicability := &coredata.StateOfApplicability{}
|
||||
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
|
||||
return stateOfApplicability.LoadByID(ctx, conn, s.svc.scope, stateOfApplicabilityID)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot load state of applicability: %w", err)
|
||||
}
|
||||
) (*coredata.ApplicabilityStatement, error) {
|
||||
var (
|
||||
stateOfApplicability = &coredata.StateOfApplicability{}
|
||||
applicabilityStatement = &coredata.ApplicabilityStatement{}
|
||||
now = time.Now()
|
||||
)
|
||||
|
||||
now := time.Now()
|
||||
control := &coredata.StateOfApplicabilityControl{
|
||||
ID: gid.New(s.svc.scope.GetTenantID(), coredata.StateOfApplicabilityControlEntityType),
|
||||
StateOfApplicabilityID: stateOfApplicabilityID,
|
||||
ControlID: controlID,
|
||||
OrganizationID: stateOfApplicability.OrganizationID,
|
||||
Applicability: applicability,
|
||||
Justification: justification,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
err := s.svc.pg.WithTx(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
if err := stateOfApplicability.LoadByID(ctx, conn, s.svc.scope, stateOfApplicabilityID); err != nil {
|
||||
return fmt.Errorf("cannot load state of applicability: %w", err)
|
||||
}
|
||||
|
||||
err = s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
||||
return control.Upsert(ctx, conn, s.svc.scope)
|
||||
})
|
||||
applicabilityStatement = &coredata.ApplicabilityStatement{
|
||||
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ApplicabilityStatementEntityType),
|
||||
StateOfApplicabilityID: stateOfApplicabilityID,
|
||||
ControlID: controlID,
|
||||
OrganizationID: stateOfApplicability.OrganizationID,
|
||||
Applicability: applicability,
|
||||
Justification: justification,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
|
||||
if err := applicabilityStatement.Insert(ctx, conn, s.svc.scope); err != nil {
|
||||
return fmt.Errorf("cannot insert applicability statement: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return control, nil
|
||||
return applicabilityStatement, nil
|
||||
}
|
||||
|
||||
func (s StateOfApplicabilityService) DeleteControlLink(
|
||||
func (s StateOfApplicabilityService) UpdateApplicabilityStatement(
|
||||
ctx context.Context,
|
||||
stateOfApplicabilityID gid.GID,
|
||||
controlID gid.GID,
|
||||
) (gid.GID, error) {
|
||||
control := &coredata.StateOfApplicabilityControl{}
|
||||
applicabilityStatementID gid.GID,
|
||||
applicability bool,
|
||||
justification *string,
|
||||
) (*coredata.ApplicabilityStatement, error) {
|
||||
applicabilityStatement := &coredata.ApplicabilityStatement{}
|
||||
|
||||
err := s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
||||
if err := control.LoadByStateOfApplicabilityIDAndControlID(ctx, conn, s.svc.scope, stateOfApplicabilityID, controlID); err != nil {
|
||||
return err
|
||||
}
|
||||
return control.Delete(ctx, conn, s.svc.scope)
|
||||
})
|
||||
err := s.svc.pg.WithTx(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
if err := applicabilityStatement.LoadByID(ctx, conn, s.svc.scope, applicabilityStatementID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
applicabilityStatement.Applicability = applicability
|
||||
applicabilityStatement.Justification = justification
|
||||
applicabilityStatement.UpdatedAt = time.Now()
|
||||
|
||||
return applicabilityStatement.UpdateByID(ctx, conn, s.svc.scope)
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return gid.GID{}, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return control.ID, nil
|
||||
return applicabilityStatement, nil
|
||||
}
|
||||
|
||||
func (s StateOfApplicabilityService) DeleteApplicabilityStatement(
|
||||
ctx context.Context,
|
||||
applicabilityStatementID gid.GID,
|
||||
) error {
|
||||
applicabilityStatement := &coredata.ApplicabilityStatement{}
|
||||
|
||||
return s.svc.pg.WithTx(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
return applicabilityStatement.DeleteByID(ctx, conn, s.svc.scope, applicabilityStatementID)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
func (s StateOfApplicabilityService) ListControlLinks(
|
||||
ctx context.Context,
|
||||
controlID gid.GID,
|
||||
cursor *page.Cursor[coredata.StateOfApplicabilityOrderField],
|
||||
) (*page.Page[*coredata.StateOfApplicabilityControl, coredata.StateOfApplicabilityOrderField], error) {
|
||||
var controls coredata.StateOfApplicabilityControls
|
||||
cursor *page.Cursor[coredata.ApplicabilityStatementOrderField],
|
||||
) (*page.Page[*coredata.ApplicabilityStatement, coredata.ApplicabilityStatementOrderField], error) {
|
||||
var controls coredata.ApplicabilityStatements
|
||||
|
||||
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
|
||||
return controls.LoadByControlID(ctx, conn, s.svc.scope, controlID, cursor)
|
||||
@@ -393,66 +450,83 @@ func (s StateOfApplicabilityService) ExportPDF(
|
||||
return fmt.Errorf("cannot load owner: %w", err)
|
||||
}
|
||||
|
||||
var availableControls coredata.AvailableStateOfApplicabilityControls
|
||||
if err := availableControls.LoadAvailableByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID); err != nil {
|
||||
return fmt.Errorf("cannot load available controls: %w", err)
|
||||
// Load applicability statements
|
||||
var applicabilityStatements coredata.ApplicabilityStatements
|
||||
cursor := page.NewCursor(
|
||||
10000,
|
||||
nil,
|
||||
page.Head,
|
||||
page.OrderBy[coredata.ApplicabilityStatementOrderField]{
|
||||
Field: coredata.ApplicabilityStatementOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
},
|
||||
)
|
||||
if err := applicabilityStatements.LoadByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID, cursor); err != nil {
|
||||
return fmt.Errorf("cannot load applicability statements: %w", err)
|
||||
}
|
||||
|
||||
linkedControls := make([]*coredata.AvailableStateOfApplicabilityControl, 0)
|
||||
for _, ctrl := range availableControls {
|
||||
if ctrl.StateOfApplicabilityID != nil {
|
||||
linkedControls = append(linkedControls, ctrl)
|
||||
}
|
||||
}
|
||||
|
||||
obligationsByControl := make(map[gid.GID][]coredata.ObligationType)
|
||||
if len(linkedControls) > 0 {
|
||||
controlIDs := make([]gid.GID, len(linkedControls))
|
||||
for i, ctrl := range linkedControls {
|
||||
controlIDs[i] = ctrl.ControlID
|
||||
}
|
||||
|
||||
var controlObligationTypes coredata.ControlObligationTypes
|
||||
if err := controlObligationTypes.LoadTypesByControlIDs(ctx, conn, s.svc.scope, controlIDs); err != nil {
|
||||
return fmt.Errorf("cannot load control obligations: %w", err)
|
||||
}
|
||||
|
||||
for _, cot := range controlObligationTypes {
|
||||
obligationsByControl[cot.ControlID] = append(obligationsByControl[cot.ControlID], cot.Type)
|
||||
}
|
||||
}
|
||||
|
||||
controlsWithRisks := make(map[gid.GID]bool)
|
||||
if len(linkedControls) > 0 {
|
||||
controlIDs := make([]gid.GID, len(linkedControls))
|
||||
for i, ctrl := range linkedControls {
|
||||
controlIDs[i] = ctrl.ControlID
|
||||
}
|
||||
|
||||
var controlsWithRisk coredata.ControlsWithRisk
|
||||
if err := controlsWithRisk.LoadByControlIDs(ctx, conn, s.svc.scope, controlIDs); err != nil {
|
||||
return fmt.Errorf("cannot load controls with risks: %w", err)
|
||||
}
|
||||
|
||||
for _, cwr := range controlsWithRisk {
|
||||
controlsWithRisks[cwr.ControlID] = true
|
||||
if len(applicabilityStatements) == 0 {
|
||||
// No linked controls, skip loading additional data
|
||||
documentData = docgen.StateOfApplicabilityData{
|
||||
Title: stateOfApplicability.Name,
|
||||
OrganizationName: organization.Name,
|
||||
CreatedAt: stateOfApplicability.CreatedAt,
|
||||
TotalControls: 0,
|
||||
FrameworkGroups: []docgen.FrameworkControlGroup{},
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
frameworkControlsMap := make(map[string][]docgen.ControlData)
|
||||
frameworkOrder := []string{}
|
||||
|
||||
for _, ctrl := range linkedControls {
|
||||
if _, exists := frameworkControlsMap[ctrl.FrameworkName]; !exists {
|
||||
frameworkOrder = append(frameworkOrder, ctrl.FrameworkName)
|
||||
frameworkControlsMap[ctrl.FrameworkName] = []docgen.ControlData{}
|
||||
for _, stmt := range applicabilityStatements {
|
||||
// Load control
|
||||
control := &coredata.Control{}
|
||||
if err := control.LoadByID(ctx, conn, s.svc.scope, stmt.ControlID); err != nil {
|
||||
return fmt.Errorf("cannot load control: %w", err)
|
||||
}
|
||||
|
||||
// Load framework
|
||||
framework := &coredata.Framework{}
|
||||
if err := framework.LoadByID(ctx, conn, s.svc.scope, control.FrameworkID); err != nil {
|
||||
return fmt.Errorf("cannot load framework: %w", err)
|
||||
}
|
||||
|
||||
// Count legal obligations
|
||||
var controlObligations coredata.ControlObligations
|
||||
legalType := coredata.ObligationTypeLegal
|
||||
legalFilter := coredata.NewControlObligationFilter(&legalType)
|
||||
legalCount, err := controlObligations.CountByControlID(ctx, conn, s.svc.scope, stmt.ControlID, legalFilter)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot count legal obligations: %w", err)
|
||||
}
|
||||
|
||||
// Count contractual obligations
|
||||
contractualType := coredata.ObligationTypeContractual
|
||||
contractualFilter := coredata.NewControlObligationFilter(&contractualType)
|
||||
contractualCount, err := controlObligations.CountByControlID(ctx, conn, s.svc.scope, stmt.ControlID, contractualFilter)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot count contractual obligations: %w", err)
|
||||
}
|
||||
|
||||
// Check if control has risk
|
||||
var controlsWithRisk coredata.ControlsWithRisk
|
||||
if err := controlsWithRisk.LoadByControlIDs(ctx, conn, s.svc.scope, []gid.GID{stmt.ControlID}); err != nil {
|
||||
return fmt.Errorf("cannot load controls with risks: %w", err)
|
||||
}
|
||||
hasRisk := len(controlsWithRisk) > 0
|
||||
|
||||
if _, exists := frameworkControlsMap[framework.Name]; !exists {
|
||||
frameworkOrder = append(frameworkOrder, framework.Name)
|
||||
frameworkControlsMap[framework.Name] = []docgen.ControlData{}
|
||||
}
|
||||
|
||||
var regulatory *bool
|
||||
var contractual *bool
|
||||
var riskAssessment *bool
|
||||
|
||||
if ctrl.Applicability != nil && *ctrl.Applicability {
|
||||
if stmt.Applicability {
|
||||
falseVal := false
|
||||
trueVal := true
|
||||
|
||||
@@ -460,30 +534,28 @@ func (s StateOfApplicabilityService) ExportPDF(
|
||||
contractual = &falseVal
|
||||
riskAssessment = &falseVal
|
||||
|
||||
obligations := obligationsByControl[ctrl.ControlID]
|
||||
for _, obligationType := range obligations {
|
||||
if obligationType == coredata.ObligationTypeLegal {
|
||||
regulatory = &trueVal
|
||||
}
|
||||
if obligationType == coredata.ObligationTypeContractual {
|
||||
contractual = &trueVal
|
||||
}
|
||||
if legalCount > 0 {
|
||||
regulatory = &trueVal
|
||||
}
|
||||
|
||||
if controlsWithRisks[ctrl.ControlID] {
|
||||
if contractualCount > 0 {
|
||||
contractual = &trueVal
|
||||
}
|
||||
if hasRisk {
|
||||
riskAssessment = &trueVal
|
||||
}
|
||||
}
|
||||
|
||||
frameworkControlsMap[ctrl.FrameworkName] = append(
|
||||
frameworkControlsMap[ctrl.FrameworkName],
|
||||
applicability := stmt.Applicability
|
||||
|
||||
frameworkControlsMap[framework.Name] = append(
|
||||
frameworkControlsMap[framework.Name],
|
||||
docgen.ControlData{
|
||||
FrameworkName: ctrl.FrameworkName,
|
||||
SectionTitle: ctrl.SectionTitle,
|
||||
Name: ctrl.Name,
|
||||
Applicability: ctrl.Applicability,
|
||||
Justification: ctrl.Justification,
|
||||
BestPractice: ctrl.BestPractice,
|
||||
FrameworkName: framework.Name,
|
||||
SectionTitle: control.SectionTitle,
|
||||
Name: control.Name,
|
||||
Applicability: &applicability,
|
||||
Justification: stmt.Justification,
|
||||
BestPractice: control.BestPractice,
|
||||
Regulatory: regulatory,
|
||||
Contractual: contractual,
|
||||
RiskAssessment: riskAssessment,
|
||||
@@ -543,7 +615,7 @@ func (s StateOfApplicabilityService) ExportPDF(
|
||||
Title: stateOfApplicability.Name,
|
||||
OrganizationName: organization.Name,
|
||||
CreatedAt: stateOfApplicability.CreatedAt,
|
||||
TotalControls: len(linkedControls),
|
||||
TotalControls: len(applicabilityStatements),
|
||||
FrameworkGroups: frameworkGroups,
|
||||
CompanyHorizontalLogoBase64: horizontalLogoBase64,
|
||||
Version: version,
|
||||
|
||||
@@ -599,6 +599,14 @@ enum DocumentVersionOrderField
|
||||
)
|
||||
}
|
||||
|
||||
enum ApplicabilityStatementOrderField
|
||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.ApplicabilityStatementOrderField") {
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.ApplicabilityStatementOrderFieldCreatedAt"
|
||||
)
|
||||
}
|
||||
|
||||
enum CountryCode
|
||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.CountryCode") {
|
||||
AD @goEnum(value: "go.probo.inc/probo/pkg/coredata.CountryCodeAD")
|
||||
@@ -1475,6 +1483,14 @@ input SnapshotOrder
|
||||
field: SnapshotOrderField!
|
||||
}
|
||||
|
||||
input ApplicabilityStatementOrder
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ApplicabilityStatementOrderBy"
|
||||
) {
|
||||
direction: OrderDirection!
|
||||
field: ApplicabilityStatementOrderField!
|
||||
}
|
||||
|
||||
input DocumentVersionFilter {
|
||||
status: DocumentStatus
|
||||
}
|
||||
@@ -1992,6 +2008,9 @@ type Control implements Node {
|
||||
status: ControlStatus!
|
||||
exclusionJustification: String
|
||||
bestPractice: Boolean!
|
||||
regulatory: Boolean! @goField(forceResolver: true)
|
||||
contractual: Boolean! @goField(forceResolver: true)
|
||||
riskAssessment: Boolean! @goField(forceResolver: true)
|
||||
|
||||
framework: Framework! @goField(forceResolver: true)
|
||||
|
||||
@@ -2038,14 +2057,6 @@ type Control implements Node {
|
||||
orderBy: SnapshotOrder
|
||||
): SnapshotConnection! @goField(forceResolver: true)
|
||||
|
||||
stateOfApplicabilityControls(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: StateOfApplicabilityOrder
|
||||
): StateOfApplicabilityControlConnection! @goField(forceResolver: true)
|
||||
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
|
||||
@@ -2225,17 +2236,39 @@ type StateOfApplicability implements Node {
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
|
||||
controls(
|
||||
applicabilityStatements(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: ControlOrder
|
||||
filter: ControlFilter
|
||||
): ControlConnection! @goField(forceResolver: true)
|
||||
orderBy: ApplicabilityStatementOrder
|
||||
): ApplicabilityStatementConnection! @goField(forceResolver: true)
|
||||
|
||||
availableControls: [AvailableStateOfApplicabilityControl!]!
|
||||
@goField(forceResolver: true)
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type ApplicabilityStatementConnection
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ApplicabilityStatementConnection"
|
||||
) {
|
||||
totalCount: Int! @goField(forceResolver: true)
|
||||
edges: [ApplicabilityStatementEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type ApplicabilityStatementEdge {
|
||||
cursor: CursorKey!
|
||||
node: ApplicabilityStatement!
|
||||
}
|
||||
|
||||
type ApplicabilityStatement implements Node {
|
||||
id: ID!
|
||||
stateOfApplicability: StateOfApplicability! @goField(forceResolver: true)
|
||||
control: Control! @goField(forceResolver: true)
|
||||
applicability: Boolean!
|
||||
justification: String!
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
}
|
||||
@@ -2801,6 +2834,7 @@ type StateOfApplicabilityEdge {
|
||||
node: StateOfApplicability!
|
||||
}
|
||||
|
||||
|
||||
type RiskConnection
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.RiskConnection"
|
||||
@@ -3124,12 +3158,15 @@ type Mutation {
|
||||
deleteControlDocumentMapping(
|
||||
input: DeleteControlDocumentMappingInput!
|
||||
): DeleteControlDocumentMappingPayload!
|
||||
createStateOfApplicabilityControlMapping(
|
||||
input: CreateStateOfApplicabilityControlMappingInput!
|
||||
): CreateStateOfApplicabilityControlMappingPayload!
|
||||
deleteStateOfApplicabilityControlMapping(
|
||||
input: DeleteStateOfApplicabilityControlMappingInput!
|
||||
): DeleteStateOfApplicabilityControlMappingPayload!
|
||||
createApplicabilityStatement(
|
||||
input: CreateApplicabilityStatementInput!
|
||||
): CreateApplicabilityStatementPayload!
|
||||
updateApplicabilityStatement(
|
||||
input: UpdateApplicabilityStatementInput!
|
||||
): UpdateApplicabilityStatementPayload!
|
||||
deleteApplicabilityStatement(
|
||||
input: DeleteApplicabilityStatementInput!
|
||||
): DeleteApplicabilityStatementPayload!
|
||||
createControlAuditMapping(
|
||||
input: CreateControlAuditMappingInput!
|
||||
): CreateControlAuditMappingPayload!
|
||||
@@ -3678,16 +3715,21 @@ input DeleteControlDocumentMappingInput {
|
||||
documentId: ID!
|
||||
}
|
||||
|
||||
input CreateStateOfApplicabilityControlMappingInput {
|
||||
input CreateApplicabilityStatementInput {
|
||||
stateOfApplicabilityId: ID!
|
||||
controlId: ID!
|
||||
applicability: Boolean!
|
||||
justification: String
|
||||
}
|
||||
|
||||
input DeleteStateOfApplicabilityControlMappingInput {
|
||||
stateOfApplicabilityId: ID!
|
||||
controlId: ID!
|
||||
input UpdateApplicabilityStatementInput {
|
||||
applicabilityStatementId: ID!
|
||||
applicability: Boolean!
|
||||
justification: String
|
||||
}
|
||||
|
||||
input DeleteApplicabilityStatementInput {
|
||||
applicabilityStatementId: ID!
|
||||
}
|
||||
|
||||
input CreateControlAuditMappingInput {
|
||||
@@ -3916,58 +3958,16 @@ input UpdateStateOfApplicabilityInput {
|
||||
ownerId: ID
|
||||
}
|
||||
|
||||
input StateOfApplicabilityControlInput {
|
||||
input ApplicabilityStatementInput {
|
||||
controlId: ID!
|
||||
applicability: Boolean!
|
||||
justification: String
|
||||
}
|
||||
|
||||
type AvailableStateOfApplicabilityControl {
|
||||
controlId: ID!
|
||||
sectionTitle: String!
|
||||
name: String!
|
||||
frameworkId: ID!
|
||||
frameworkName: String!
|
||||
organizationId: ID!
|
||||
stateOfApplicabilityId: ID
|
||||
applicability: Boolean
|
||||
justification: String
|
||||
bestPractice: Boolean!
|
||||
regulatory: Boolean!
|
||||
contractual: Boolean!
|
||||
riskAssessment: Boolean!
|
||||
}
|
||||
|
||||
input DeleteStateOfApplicabilityInput {
|
||||
stateOfApplicabilityId: ID!
|
||||
}
|
||||
|
||||
type StateOfApplicabilityControl {
|
||||
id: ID!
|
||||
stateOfApplicabilityId: ID!
|
||||
controlId: ID!
|
||||
stateOfApplicability: StateOfApplicability! @goField(forceResolver: true)
|
||||
applicability: Boolean!
|
||||
justification: String
|
||||
}
|
||||
|
||||
type StateOfApplicabilityControlConnection
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.StateOfApplicabilityControlConnection"
|
||||
) {
|
||||
totalCount: Int!
|
||||
edges: [StateOfApplicabilityControlEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type StateOfApplicabilityControlEdge
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.StateOfApplicabilityControlEdge"
|
||||
) {
|
||||
cursor: CursorKey!
|
||||
node: StateOfApplicabilityControl!
|
||||
}
|
||||
|
||||
input ExportStateOfApplicabilityPDFInput {
|
||||
stateOfApplicabilityId: ID!
|
||||
}
|
||||
@@ -4466,14 +4466,16 @@ type DeleteControlDocumentMappingPayload {
|
||||
deletedDocumentId: ID!
|
||||
}
|
||||
|
||||
type CreateStateOfApplicabilityControlMappingPayload {
|
||||
stateOfApplicabilityControlEdge: StateOfApplicabilityControlEdge!
|
||||
type CreateApplicabilityStatementPayload {
|
||||
applicabilityStatementEdge: ApplicabilityStatementEdge!
|
||||
}
|
||||
|
||||
type DeleteStateOfApplicabilityControlMappingPayload {
|
||||
deletedStateOfApplicabilityId: ID!
|
||||
deletedControlId: ID!
|
||||
deletedStateOfApplicabilityControlId: ID!
|
||||
type UpdateApplicabilityStatementPayload {
|
||||
applicabilityStatement: ApplicabilityStatement!
|
||||
}
|
||||
|
||||
type DeleteApplicabilityStatementPayload {
|
||||
deletedApplicabilityStatementId: ID!
|
||||
}
|
||||
|
||||
type CreateControlAuditMappingPayload {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
"go.probo.inc/probo/pkg/gid"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
type (
|
||||
ApplicabilityStatementOrderBy OrderBy[coredata.ApplicabilityStatementOrderField]
|
||||
|
||||
ApplicabilityStatementConnection struct {
|
||||
TotalCount int
|
||||
Edges []*ApplicabilityStatementEdge
|
||||
PageInfo PageInfo
|
||||
|
||||
Resolver any
|
||||
ParentID gid.GID
|
||||
}
|
||||
)
|
||||
|
||||
func NewApplicabilityStatementConnection(
|
||||
p *page.Page[*coredata.ApplicabilityStatement, coredata.ApplicabilityStatementOrderField],
|
||||
parentType any,
|
||||
parentID gid.GID,
|
||||
) *ApplicabilityStatementConnection {
|
||||
edges := make([]*ApplicabilityStatementEdge, len(p.Data))
|
||||
for i, statement := range p.Data {
|
||||
edges[i] = NewApplicabilityStatementEdge(statement, p.Cursor.OrderBy.Field)
|
||||
}
|
||||
|
||||
return &ApplicabilityStatementConnection{
|
||||
Edges: edges,
|
||||
PageInfo: *NewPageInfo(p),
|
||||
|
||||
Resolver: parentType,
|
||||
ParentID: parentID,
|
||||
}
|
||||
}
|
||||
|
||||
func NewApplicabilityStatementEdge(
|
||||
statement *coredata.ApplicabilityStatement,
|
||||
orderBy coredata.ApplicabilityStatementOrderField,
|
||||
) *ApplicabilityStatementEdge {
|
||||
return &ApplicabilityStatementEdge{
|
||||
Cursor: statement.CursorKey(orderBy),
|
||||
Node: NewApplicabilityStatement(statement),
|
||||
}
|
||||
}
|
||||
|
||||
func NewApplicabilityStatement(as *coredata.ApplicabilityStatement) *ApplicabilityStatement {
|
||||
justification := ""
|
||||
if as.Justification != nil {
|
||||
justification = *as.Justification
|
||||
}
|
||||
|
||||
return &ApplicabilityStatement{
|
||||
ID: as.ID,
|
||||
StateOfApplicability: &StateOfApplicability{
|
||||
ID: as.StateOfApplicabilityID,
|
||||
},
|
||||
Control: &Control{
|
||||
ID: as.ControlID,
|
||||
},
|
||||
Applicability: as.Applicability,
|
||||
Justification: justification,
|
||||
CreatedAt: as.CreatedAt,
|
||||
UpdatedAt: as.UpdatedAt,
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
"go.probo.inc/probo/pkg/gid"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
type (
|
||||
StateOfApplicabilityControlConnection struct {
|
||||
TotalCount int
|
||||
Edges []*StateOfApplicabilityControlEdge
|
||||
PageInfo PageInfo
|
||||
|
||||
Resolver any
|
||||
ParentID gid.GID
|
||||
}
|
||||
|
||||
StateOfApplicabilityControlEdge struct {
|
||||
Cursor page.CursorKey
|
||||
Node *StateOfApplicabilityControl
|
||||
}
|
||||
)
|
||||
|
||||
func NewStateOfApplicabilityControlConnection(
|
||||
p *page.Page[*coredata.StateOfApplicabilityControl, coredata.StateOfApplicabilityOrderField],
|
||||
parentType any,
|
||||
parentID gid.GID,
|
||||
) *StateOfApplicabilityControlConnection {
|
||||
edges := make([]*StateOfApplicabilityControlEdge, len(p.Data))
|
||||
for i, control := range p.Data {
|
||||
edges[i] = NewStateOfApplicabilityControlEdge(control, p.Cursor.OrderBy.Field)
|
||||
}
|
||||
|
||||
return &StateOfApplicabilityControlConnection{
|
||||
Edges: edges,
|
||||
PageInfo: *NewPageInfo(p),
|
||||
|
||||
Resolver: parentType,
|
||||
ParentID: parentID,
|
||||
}
|
||||
}
|
||||
|
||||
func NewStateOfApplicabilityControlEdge(
|
||||
control *coredata.StateOfApplicabilityControl,
|
||||
orderBy coredata.StateOfApplicabilityOrderField,
|
||||
) *StateOfApplicabilityControlEdge {
|
||||
return &StateOfApplicabilityControlEdge{
|
||||
Cursor: control.CursorKey(orderBy),
|
||||
Node: NewStateOfApplicabilityControl(control),
|
||||
}
|
||||
}
|
||||
|
||||
func NewStateOfApplicabilityControl(control *coredata.StateOfApplicabilityControl) *StateOfApplicabilityControl {
|
||||
return &StateOfApplicabilityControl{
|
||||
ID: control.ID,
|
||||
StateOfApplicabilityID: control.StateOfApplicabilityID,
|
||||
ControlID: control.ControlID,
|
||||
Applicability: control.Applicability,
|
||||
Justification: control.Justification,
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,31 @@ type Node interface {
|
||||
GetID() gid.GID
|
||||
}
|
||||
|
||||
type ApplicabilityStatement struct {
|
||||
ID gid.GID `json:"id"`
|
||||
StateOfApplicability *StateOfApplicability `json:"stateOfApplicability"`
|
||||
Control *Control `json:"control"`
|
||||
Applicability bool `json:"applicability"`
|
||||
Justification string `json:"justification"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (ApplicabilityStatement) IsNode() {}
|
||||
func (this ApplicabilityStatement) GetID() gid.GID { return this.ID }
|
||||
|
||||
type ApplicabilityStatementEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *ApplicabilityStatement `json:"node"`
|
||||
}
|
||||
|
||||
type ApplicabilityStatementInput struct {
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
Applicability bool `json:"applicability"`
|
||||
Justification *string `json:"justification,omitempty"`
|
||||
}
|
||||
|
||||
type AssessVendorInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
WebsiteURL string `json:"websiteUrl"`
|
||||
@@ -78,22 +103,6 @@ type AuditEdge struct {
|
||||
Node *Audit `json:"node"`
|
||||
}
|
||||
|
||||
type AvailableStateOfApplicabilityControl struct {
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
SectionTitle string `json:"sectionTitle"`
|
||||
Name string `json:"name"`
|
||||
FrameworkID gid.GID `json:"frameworkId"`
|
||||
FrameworkName string `json:"frameworkName"`
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
StateOfApplicabilityID *gid.GID `json:"stateOfApplicabilityId,omitempty"`
|
||||
Applicability *bool `json:"applicability,omitempty"`
|
||||
Justification *string `json:"justification,omitempty"`
|
||||
BestPractice bool `json:"bestPractice"`
|
||||
Regulatory bool `json:"regulatory"`
|
||||
Contractual bool `json:"contractual"`
|
||||
RiskAssessment bool `json:"riskAssessment"`
|
||||
}
|
||||
|
||||
type BulkDeleteDocumentsInput struct {
|
||||
DocumentIds []gid.GID `json:"documentIds"`
|
||||
}
|
||||
@@ -170,24 +179,26 @@ type ContinualImprovementFilter struct {
|
||||
}
|
||||
|
||||
type Control struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
SectionTitle string `json:"sectionTitle"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Status coredata.ControlStatus `json:"status"`
|
||||
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
||||
BestPractice bool `json:"bestPractice"`
|
||||
Framework *Framework `json:"framework"`
|
||||
Measures *MeasureConnection `json:"measures"`
|
||||
Documents *DocumentConnection `json:"documents"`
|
||||
Audits *AuditConnection `json:"audits"`
|
||||
Obligations *ObligationConnection `json:"obligations"`
|
||||
Snapshots *SnapshotConnection `json:"snapshots"`
|
||||
StateOfApplicabilityControls *StateOfApplicabilityControlConnection `json:"stateOfApplicabilityControls"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Permission bool `json:"permission"`
|
||||
ID gid.GID `json:"id"`
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
SectionTitle string `json:"sectionTitle"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Status coredata.ControlStatus `json:"status"`
|
||||
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
||||
BestPractice bool `json:"bestPractice"`
|
||||
Regulatory bool `json:"regulatory"`
|
||||
Contractual bool `json:"contractual"`
|
||||
RiskAssessment bool `json:"riskAssessment"`
|
||||
Framework *Framework `json:"framework"`
|
||||
Measures *MeasureConnection `json:"measures"`
|
||||
Documents *DocumentConnection `json:"documents"`
|
||||
Audits *AuditConnection `json:"audits"`
|
||||
Obligations *ObligationConnection `json:"obligations"`
|
||||
Snapshots *SnapshotConnection `json:"snapshots"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (Control) IsNode() {}
|
||||
@@ -202,6 +213,17 @@ type ControlFilter struct {
|
||||
Query *string `json:"query,omitempty"`
|
||||
}
|
||||
|
||||
type CreateApplicabilityStatementInput struct {
|
||||
StateOfApplicabilityID gid.GID `json:"stateOfApplicabilityId"`
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
Applicability bool `json:"applicability"`
|
||||
Justification *string `json:"justification,omitempty"`
|
||||
}
|
||||
|
||||
type CreateApplicabilityStatementPayload struct {
|
||||
ApplicabilityStatementEdge *ApplicabilityStatementEdge `json:"applicabilityStatementEdge"`
|
||||
}
|
||||
|
||||
type CreateAssetInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
@@ -552,17 +574,6 @@ type CreateSnapshotPayload struct {
|
||||
SnapshotEdge *SnapshotEdge `json:"snapshotEdge"`
|
||||
}
|
||||
|
||||
type CreateStateOfApplicabilityControlMappingInput struct {
|
||||
StateOfApplicabilityID gid.GID `json:"stateOfApplicabilityId"`
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
Applicability bool `json:"applicability"`
|
||||
Justification *string `json:"justification,omitempty"`
|
||||
}
|
||||
|
||||
type CreateStateOfApplicabilityControlMappingPayload struct {
|
||||
StateOfApplicabilityControlEdge *StateOfApplicabilityControlEdge `json:"stateOfApplicabilityControlEdge"`
|
||||
}
|
||||
|
||||
type CreateStateOfApplicabilityInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
@@ -756,6 +767,14 @@ type DatumFilter struct {
|
||||
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
|
||||
}
|
||||
|
||||
type DeleteApplicabilityStatementInput struct {
|
||||
ApplicabilityStatementID gid.GID `json:"applicabilityStatementId"`
|
||||
}
|
||||
|
||||
type DeleteApplicabilityStatementPayload struct {
|
||||
DeletedApplicabilityStatementID gid.GID `json:"deletedApplicabilityStatementId"`
|
||||
}
|
||||
|
||||
type DeleteAssetInput struct {
|
||||
AssetID gid.GID `json:"assetId"`
|
||||
}
|
||||
@@ -1004,17 +1023,6 @@ type DeleteSnapshotPayload struct {
|
||||
DeletedSnapshotID gid.GID `json:"deletedSnapshotId"`
|
||||
}
|
||||
|
||||
type DeleteStateOfApplicabilityControlMappingInput struct {
|
||||
StateOfApplicabilityID gid.GID `json:"stateOfApplicabilityId"`
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
}
|
||||
|
||||
type DeleteStateOfApplicabilityControlMappingPayload struct {
|
||||
DeletedStateOfApplicabilityID gid.GID `json:"deletedStateOfApplicabilityId"`
|
||||
DeletedControlID gid.GID `json:"deletedControlId"`
|
||||
DeletedStateOfApplicabilityControlID gid.GID `json:"deletedStateOfApplicabilityControlId"`
|
||||
}
|
||||
|
||||
type DeleteStateOfApplicabilityInput struct {
|
||||
StateOfApplicabilityID gid.GID `json:"stateOfApplicabilityId"`
|
||||
}
|
||||
@@ -1746,37 +1754,21 @@ type SnapshotEdge struct {
|
||||
}
|
||||
|
||||
type StateOfApplicability struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
SourceID *gid.GID `json:"sourceId,omitempty"`
|
||||
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
Owner *People `json:"owner"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Controls *ControlConnection `json:"controls"`
|
||||
AvailableControls []*AvailableStateOfApplicabilityControl `json:"availableControls"`
|
||||
Permission bool `json:"permission"`
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
SourceID *gid.GID `json:"sourceId,omitempty"`
|
||||
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
Owner *People `json:"owner"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ApplicabilityStatements *ApplicabilityStatementConnection `json:"applicabilityStatements"`
|
||||
Permission bool `json:"permission"`
|
||||
}
|
||||
|
||||
func (StateOfApplicability) IsNode() {}
|
||||
func (this StateOfApplicability) GetID() gid.GID { return this.ID }
|
||||
|
||||
type StateOfApplicabilityControl struct {
|
||||
ID gid.GID `json:"id"`
|
||||
StateOfApplicabilityID gid.GID `json:"stateOfApplicabilityId"`
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
StateOfApplicability *StateOfApplicability `json:"stateOfApplicability"`
|
||||
Applicability bool `json:"applicability"`
|
||||
Justification *string `json:"justification,omitempty"`
|
||||
}
|
||||
|
||||
type StateOfApplicabilityControlInput struct {
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
Applicability bool `json:"applicability"`
|
||||
Justification *string `json:"justification,omitempty"`
|
||||
}
|
||||
|
||||
type StateOfApplicabilityEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *StateOfApplicability `json:"node"`
|
||||
@@ -1940,6 +1932,16 @@ type TrustCenterReferenceEdge struct {
|
||||
Node *TrustCenterReference `json:"node"`
|
||||
}
|
||||
|
||||
type UpdateApplicabilityStatementInput struct {
|
||||
ApplicabilityStatementID gid.GID `json:"applicabilityStatementId"`
|
||||
Applicability bool `json:"applicability"`
|
||||
Justification *string `json:"justification,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateApplicabilityStatementPayload struct {
|
||||
ApplicabilityStatement *ApplicabilityStatement `json:"applicabilityStatement"`
|
||||
}
|
||||
|
||||
type UpdateAssetInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
|
||||
@@ -26,6 +26,63 @@ import (
|
||||
"go.probo.inc/probo/pkg/server/gqlutils"
|
||||
)
|
||||
|
||||
// StateOfApplicability is the resolver for the stateOfApplicability field.
|
||||
func (r *applicabilityStatementResolver) StateOfApplicability(ctx context.Context, obj *types.ApplicabilityStatement) (*types.StateOfApplicability, error) {
|
||||
if err := r.authorize(ctx, obj.StateOfApplicability.ID, probo.ActionStateOfApplicabilityGet); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, obj.StateOfApplicability.ID.TenantID())
|
||||
|
||||
soa, err := prb.StatesOfApplicability.Get(ctx, obj.StateOfApplicability.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get state of applicability: %w", err))
|
||||
}
|
||||
|
||||
return types.NewStateOfApplicability(soa), nil
|
||||
}
|
||||
|
||||
// Control is the resolver for the control field.
|
||||
func (r *applicabilityStatementResolver) Control(ctx context.Context, obj *types.ApplicabilityStatement) (*types.Control, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionControlGet); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
control, err := prb.Controls.Get(ctx, obj.Control.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get control: %w", err))
|
||||
}
|
||||
|
||||
return types.NewControl(control), nil
|
||||
}
|
||||
|
||||
// Permission is the resolver for the permission field.
|
||||
func (r *applicabilityStatementResolver) Permission(ctx context.Context, obj *types.ApplicabilityStatement, action string) (bool, error) {
|
||||
return r.Resolver.Permission(ctx, obj, action)
|
||||
}
|
||||
|
||||
// TotalCount is the resolver for the totalCount field.
|
||||
func (r *applicabilityStatementConnectionResolver) TotalCount(ctx context.Context, obj *types.ApplicabilityStatementConnection) (int, error) {
|
||||
if err := r.authorize(ctx, obj.ParentID, probo.ActionApplicabilityStatementList); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, obj.ParentID.TenantID())
|
||||
|
||||
switch obj.Resolver.(type) {
|
||||
case *stateOfApplicabilityResolver:
|
||||
count, err := prb.StatesOfApplicability.CountApplicabilityStatements(ctx, obj.ParentID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot count applicability statements: %w", err))
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
panic(fmt.Errorf("not implemented: TotalCount for parent type %T", obj.Resolver))
|
||||
}
|
||||
|
||||
// Owner is the resolver for the owner field.
|
||||
func (r *assetResolver) Owner(ctx context.Context, obj *types.Asset) (*types.People, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionPeopleGet); err != nil {
|
||||
@@ -359,6 +416,42 @@ func (r *controlResolver) Organization(ctx context.Context, obj *types.Control)
|
||||
return types.NewOrganization(organization), nil
|
||||
}
|
||||
|
||||
// Regulatory is the resolver for the regulatory field.
|
||||
func (r *controlResolver) Regulatory(ctx context.Context, obj *types.Control) (bool, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
hasRegulatory, err := prb.Controls.HasRegulatoryObligation(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot check regulatory obligation: %w", err))
|
||||
}
|
||||
|
||||
return hasRegulatory, nil
|
||||
}
|
||||
|
||||
// Contractual is the resolver for the contractual field.
|
||||
func (r *controlResolver) Contractual(ctx context.Context, obj *types.Control) (bool, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
hasContractual, err := prb.Controls.HasContractualObligation(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot check contractual obligation: %w", err))
|
||||
}
|
||||
|
||||
return hasContractual, nil
|
||||
}
|
||||
|
||||
// RiskAssessment is the resolver for the riskAssessment field.
|
||||
func (r *controlResolver) RiskAssessment(ctx context.Context, obj *types.Control) (bool, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
hasRisk, err := prb.Controls.HasRiskAssessment(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot check risk assessment: %w", err))
|
||||
}
|
||||
|
||||
return hasRisk, nil
|
||||
}
|
||||
|
||||
// Framework is the resolver for the framework field.
|
||||
func (r *controlResolver) Framework(ctx context.Context, obj *types.Control) (*types.Framework, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionFrameworkGet); err != nil {
|
||||
@@ -542,35 +635,6 @@ func (r *controlResolver) Snapshots(ctx context.Context, obj *types.Control, fir
|
||||
return types.NewSnapshotConnection(page, r, obj.ID), nil
|
||||
}
|
||||
|
||||
// StateOfApplicabilityControls is the resolver for the stateOfApplicabilityControls field.
|
||||
func (r *controlResolver) StateOfApplicabilityControls(ctx context.Context, obj *types.Control, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.StateOfApplicabilityOrderBy) (*types.StateOfApplicabilityControlConnection, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionStateOfApplicabilityList); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.StateOfApplicabilityOrderField]{
|
||||
Field: coredata.StateOfApplicabilityOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.StateOfApplicabilityOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
p, err := prb.StatesOfApplicability.ListControlLinks(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list state of applicability controls: %w", err))
|
||||
}
|
||||
|
||||
return types.NewStateOfApplicabilityControlConnection(p, r, obj.ID), nil
|
||||
}
|
||||
|
||||
// Permission is the resolver for the permission field.
|
||||
func (r *controlResolver) Permission(ctx context.Context, obj *types.Control, action string) (bool, error) {
|
||||
return r.Resolver.Permission(ctx, obj, action)
|
||||
@@ -2730,41 +2794,57 @@ func (r *mutationResolver) DeleteControlDocumentMapping(ctx context.Context, inp
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateStateOfApplicabilityControlMapping is the resolver for the createStateOfApplicabilityControlMapping field.
|
||||
func (r *mutationResolver) CreateStateOfApplicabilityControlMapping(ctx context.Context, input types.CreateStateOfApplicabilityControlMappingInput) (*types.CreateStateOfApplicabilityControlMappingPayload, error) {
|
||||
if err := r.authorize(ctx, input.ControlID, probo.ActionStateOfApplicabilityControlMappingCreate); err != nil {
|
||||
// CreateApplicabilityStatement is the resolver for the createApplicabilityStatement field.
|
||||
func (r *mutationResolver) CreateApplicabilityStatement(ctx context.Context, input types.CreateApplicabilityStatementInput) (*types.CreateApplicabilityStatementPayload, error) {
|
||||
if err := r.authorize(ctx, input.ControlID, probo.ActionApplicabilityStatementCreate); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, input.StateOfApplicabilityID.TenantID())
|
||||
|
||||
control, err := prb.StatesOfApplicability.LinkControl(ctx, input.StateOfApplicabilityID, input.ControlID, input.Applicability, input.Justification)
|
||||
applicabilityStatement, err := prb.StatesOfApplicability.CreateApplicabilityStatement(ctx, input.StateOfApplicabilityID, input.ControlID, input.Applicability, input.Justification)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot create state of applicability control mapping: %w", err))
|
||||
panic(fmt.Errorf("cannot create applicability statement: %w", err))
|
||||
}
|
||||
|
||||
return &types.CreateStateOfApplicabilityControlMappingPayload{
|
||||
StateOfApplicabilityControlEdge: types.NewStateOfApplicabilityControlEdge(control, coredata.StateOfApplicabilityOrderFieldCreatedAt),
|
||||
return &types.CreateApplicabilityStatementPayload{
|
||||
ApplicabilityStatementEdge: types.NewApplicabilityStatementEdge(applicabilityStatement, coredata.ApplicabilityStatementOrderFieldCreatedAt),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteStateOfApplicabilityControlMapping is the resolver for the deleteStateOfApplicabilityControlMapping field.
|
||||
func (r *mutationResolver) DeleteStateOfApplicabilityControlMapping(ctx context.Context, input types.DeleteStateOfApplicabilityControlMappingInput) (*types.DeleteStateOfApplicabilityControlMappingPayload, error) {
|
||||
if err := r.authorize(ctx, input.StateOfApplicabilityID, probo.ActionStateOfApplicabilityControlMappingDelete); err != nil {
|
||||
// UpdateApplicabilityStatement is the resolver for the updateApplicabilityStatement field.
|
||||
func (r *mutationResolver) UpdateApplicabilityStatement(ctx context.Context, input types.UpdateApplicabilityStatementInput) (*types.UpdateApplicabilityStatementPayload, error) {
|
||||
if err := r.authorize(ctx, input.ApplicabilityStatementID, probo.ActionApplicabilityStatementUpdate); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, input.StateOfApplicabilityID.TenantID())
|
||||
prb := r.ProboService(ctx, input.ApplicabilityStatementID.TenantID())
|
||||
|
||||
deletedID, err := prb.StatesOfApplicability.DeleteControlLink(ctx, input.StateOfApplicabilityID, input.ControlID)
|
||||
applicabilityStatement, err := prb.StatesOfApplicability.UpdateApplicabilityStatement(ctx, input.ApplicabilityStatementID, input.Applicability, input.Justification)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot delete state of applicability control mapping: %w", err))
|
||||
panic(fmt.Errorf("cannot update applicability statement: %w", err))
|
||||
}
|
||||
|
||||
return &types.DeleteStateOfApplicabilityControlMappingPayload{
|
||||
DeletedStateOfApplicabilityID: input.StateOfApplicabilityID,
|
||||
DeletedControlID: input.ControlID,
|
||||
DeletedStateOfApplicabilityControlID: deletedID,
|
||||
return &types.UpdateApplicabilityStatementPayload{
|
||||
ApplicabilityStatement: types.NewApplicabilityStatement(applicabilityStatement),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteApplicabilityStatement is the resolver for the deleteApplicabilityStatement field.
|
||||
func (r *mutationResolver) DeleteApplicabilityStatement(ctx context.Context, input types.DeleteApplicabilityStatementInput) (*types.DeleteApplicabilityStatementPayload, error) {
|
||||
if err := r.authorize(ctx, input.ApplicabilityStatementID, probo.ActionApplicabilityStatementDelete); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, input.ApplicabilityStatementID.TenantID())
|
||||
|
||||
err := prb.StatesOfApplicability.DeleteApplicabilityStatement(ctx, input.ApplicabilityStatementID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot delete applicability statement: %w", err))
|
||||
}
|
||||
|
||||
return &types.DeleteApplicabilityStatementPayload{
|
||||
DeletedApplicabilityStatementID: input.ApplicabilityStatementID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -7201,73 +7281,33 @@ func (r *stateOfApplicabilityResolver) Owner(ctx context.Context, obj *types.Sta
|
||||
return types.NewPeople(people), nil
|
||||
}
|
||||
|
||||
// Controls is the resolver for the controls field.
|
||||
func (r *stateOfApplicabilityResolver) Controls(ctx context.Context, obj *types.StateOfApplicability, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy, filter *types.ControlFilter) (*types.ControlConnection, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionControlList); err != nil {
|
||||
// ApplicabilityStatements is the resolver for the applicabilityStatements field.
|
||||
func (r *stateOfApplicabilityResolver) ApplicabilityStatements(ctx context.Context, obj *types.StateOfApplicability, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ApplicabilityStatementOrderBy) (*types.ApplicabilityStatementConnection, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionApplicabilityStatementList); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: coredata.ControlOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
pageOrderBy := page.OrderBy[coredata.ApplicabilityStatementOrderField]{
|
||||
Field: coredata.ApplicabilityStatementOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
}
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ControlOrderField]{
|
||||
Field: orderBy.Field,
|
||||
pageOrderBy = page.OrderBy[coredata.ApplicabilityStatementOrderField]{
|
||||
Field: coredata.ApplicabilityStatementOrderField(orderBy.Field),
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
var controlFilter = coredata.NewControlFilter(nil)
|
||||
if filter != nil {
|
||||
controlFilter = coredata.NewControlFilter(filter.Query)
|
||||
}
|
||||
|
||||
page, err := prb.Controls.ListForStateOfApplicabilityID(ctx, obj.ID, cursor, controlFilter)
|
||||
p, err := prb.StatesOfApplicability.ListApplicabilityStatements(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list state of applicability controls: %w", err))
|
||||
panic(fmt.Errorf("cannot list applicability statements: %w", err))
|
||||
}
|
||||
|
||||
return types.NewControlConnection(page, r, obj.ID, controlFilter), nil
|
||||
}
|
||||
|
||||
// AvailableControls is the resolver for the availableControls field.
|
||||
func (r *stateOfApplicabilityResolver) AvailableControls(ctx context.Context, obj *types.StateOfApplicability) ([]*types.AvailableStateOfApplicabilityControl, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionControlList); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
availableControls, err := prb.StatesOfApplicability.ListAvailableControls(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list available controls: %w", err))
|
||||
}
|
||||
|
||||
result := make([]*types.AvailableStateOfApplicabilityControl, 0, len(availableControls))
|
||||
for _, ac := range availableControls {
|
||||
result = append(result, &types.AvailableStateOfApplicabilityControl{
|
||||
ControlID: ac.ControlID,
|
||||
SectionTitle: ac.SectionTitle,
|
||||
Name: ac.Name,
|
||||
FrameworkID: ac.FrameworkID,
|
||||
FrameworkName: ac.FrameworkName,
|
||||
OrganizationID: ac.OrganizationID,
|
||||
StateOfApplicabilityID: ac.StateOfApplicabilityID,
|
||||
Applicability: ac.Applicability,
|
||||
Justification: ac.Justification,
|
||||
BestPractice: ac.BestPractice,
|
||||
Regulatory: ac.Regulatory,
|
||||
Contractual: ac.Contractual,
|
||||
RiskAssessment: ac.RiskAssessment,
|
||||
})
|
||||
}
|
||||
|
||||
return result, nil
|
||||
return types.NewApplicabilityStatementConnection(p, r, obj.ID), nil
|
||||
}
|
||||
|
||||
// Permission is the resolver for the permission field.
|
||||
@@ -7291,22 +7331,6 @@ func (r *stateOfApplicabilityConnectionResolver) TotalCount(ctx context.Context,
|
||||
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
|
||||
}
|
||||
|
||||
// StateOfApplicability is the resolver for the stateOfApplicability field.
|
||||
func (r *stateOfApplicabilityControlResolver) StateOfApplicability(ctx context.Context, obj *types.StateOfApplicabilityControl) (*types.StateOfApplicability, error) {
|
||||
if err := r.authorize(ctx, obj.StateOfApplicabilityID, probo.ActionStateOfApplicabilityGet); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
prb := r.ProboService(ctx, obj.StateOfApplicabilityID.TenantID())
|
||||
|
||||
soa, err := prb.StatesOfApplicability.Get(ctx, obj.StateOfApplicabilityID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get state of applicability: %w", err))
|
||||
}
|
||||
|
||||
return types.NewStateOfApplicability(soa), nil
|
||||
}
|
||||
|
||||
// AssignedTo is the resolver for the assignedTo field.
|
||||
func (r *taskResolver) AssignedTo(ctx context.Context, obj *types.Task) (*types.People, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionPeopleGet); err != nil {
|
||||
@@ -8420,6 +8444,16 @@ func (r *viewerResolver) SignableDocument(ctx context.Context, obj *types.Viewer
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ApplicabilityStatement returns schema.ApplicabilityStatementResolver implementation.
|
||||
func (r *Resolver) ApplicabilityStatement() schema.ApplicabilityStatementResolver {
|
||||
return &applicabilityStatementResolver{r}
|
||||
}
|
||||
|
||||
// ApplicabilityStatementConnection returns schema.ApplicabilityStatementConnectionResolver implementation.
|
||||
func (r *Resolver) ApplicabilityStatementConnection() schema.ApplicabilityStatementConnectionResolver {
|
||||
return &applicabilityStatementConnectionResolver{r}
|
||||
}
|
||||
|
||||
// Asset returns schema.AssetResolver implementation.
|
||||
func (r *Resolver) Asset() schema.AssetResolver { return &assetResolver{r} }
|
||||
|
||||
@@ -8611,11 +8645,6 @@ func (r *Resolver) StateOfApplicabilityConnection() schema.StateOfApplicabilityC
|
||||
return &stateOfApplicabilityConnectionResolver{r}
|
||||
}
|
||||
|
||||
// StateOfApplicabilityControl returns schema.StateOfApplicabilityControlResolver implementation.
|
||||
func (r *Resolver) StateOfApplicabilityControl() schema.StateOfApplicabilityControlResolver {
|
||||
return &stateOfApplicabilityControlResolver{r}
|
||||
}
|
||||
|
||||
// Task returns schema.TaskResolver implementation.
|
||||
func (r *Resolver) Task() schema.TaskResolver { return &taskResolver{r} }
|
||||
|
||||
@@ -8707,6 +8736,8 @@ func (r *Resolver) VendorService() schema.VendorServiceResolver { return &vendor
|
||||
// Viewer returns schema.ViewerResolver implementation.
|
||||
func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} }
|
||||
|
||||
type applicabilityStatementResolver struct{ *Resolver }
|
||||
type applicabilityStatementConnectionResolver struct{ *Resolver }
|
||||
type assetResolver struct{ *Resolver }
|
||||
type assetConnectionResolver struct{ *Resolver }
|
||||
type auditResolver struct{ *Resolver }
|
||||
@@ -8754,7 +8785,6 @@ type snapshotResolver struct{ *Resolver }
|
||||
type snapshotConnectionResolver struct{ *Resolver }
|
||||
type stateOfApplicabilityResolver struct{ *Resolver }
|
||||
type stateOfApplicabilityConnectionResolver struct{ *Resolver }
|
||||
type stateOfApplicabilityControlResolver struct{ *Resolver }
|
||||
type taskResolver struct{ *Resolver }
|
||||
type taskConnectionResolver struct{ *Resolver }
|
||||
type transferImpactAssessmentResolver struct{ *Resolver }
|
||||
|
||||
Reference in New Issue
Block a user