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
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -30,14 +30,12 @@ export type FrameworkGraphControlNodeQuery$data = {
|
|||||||
readonly canCreateMeasureMapping?: boolean;
|
readonly canCreateMeasureMapping?: boolean;
|
||||||
readonly canCreateObligationMapping?: boolean;
|
readonly canCreateObligationMapping?: boolean;
|
||||||
readonly canCreateSnapshotMapping?: boolean;
|
readonly canCreateSnapshotMapping?: boolean;
|
||||||
readonly canCreateStateOfApplicabilityMapping?: boolean;
|
|
||||||
readonly canDelete?: boolean;
|
readonly canDelete?: boolean;
|
||||||
readonly canDeleteAuditMapping?: boolean;
|
readonly canDeleteAuditMapping?: boolean;
|
||||||
readonly canDeleteDocumentMapping?: boolean;
|
readonly canDeleteDocumentMapping?: boolean;
|
||||||
readonly canDeleteMeasureMapping?: boolean;
|
readonly canDeleteMeasureMapping?: boolean;
|
||||||
readonly canDeleteObligationMapping?: boolean;
|
readonly canDeleteObligationMapping?: boolean;
|
||||||
readonly canDeleteSnapshotMapping?: boolean;
|
readonly canDeleteSnapshotMapping?: boolean;
|
||||||
readonly canDeleteStateOfApplicabilityMapping?: boolean;
|
|
||||||
readonly canUpdate?: boolean;
|
readonly canUpdate?: boolean;
|
||||||
readonly description?: string | null | undefined;
|
readonly description?: string | null | undefined;
|
||||||
readonly documents?: {
|
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 status?: ControlStatus;
|
||||||
readonly " $fragmentSpreads": FragmentRefs<"FrameworkControlDialogFragment">;
|
readonly " $fragmentSpreads": FragmentRefs<"FrameworkControlDialogFragment">;
|
||||||
};
|
};
|
||||||
@@ -286,32 +275,6 @@ v17 = {
|
|||||||
"storageKey": "permission(action:\"core:control:delete-snapshot-mapping\")"
|
"storageKey": "permission(action:\"core:control:delete-snapshot-mapping\")"
|
||||||
},
|
},
|
||||||
v18 = {
|
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",
|
"alias": "canCreateObligationMapping",
|
||||||
"args": [
|
"args": [
|
||||||
{
|
{
|
||||||
@@ -324,7 +287,7 @@ v20 = {
|
|||||||
"name": "permission",
|
"name": "permission",
|
||||||
"storageKey": "permission(action:\"core:control:obligation-control-mapping:create\")"
|
"storageKey": "permission(action:\"core:control:obligation-control-mapping:create\")"
|
||||||
},
|
},
|
||||||
v21 = {
|
v19 = {
|
||||||
"alias": "canDeleteObligationMapping",
|
"alias": "canDeleteObligationMapping",
|
||||||
"args": [
|
"args": [
|
||||||
{
|
{
|
||||||
@@ -337,21 +300,21 @@ v21 = {
|
|||||||
"name": "permission",
|
"name": "permission",
|
||||||
"storageKey": "permission(action:\"core:control:obligation-control-mapping:delete\")"
|
"storageKey": "permission(action:\"core:control:obligation-control-mapping:delete\")"
|
||||||
},
|
},
|
||||||
v22 = {
|
v20 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "__typename",
|
"name": "__typename",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v23 = {
|
v21 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "cursor",
|
"name": "cursor",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v24 = {
|
v22 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "PageInfo",
|
"concreteType": "PageInfo",
|
||||||
@@ -376,7 +339,7 @@ v24 = {
|
|||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v25 = {
|
v23 = {
|
||||||
"kind": "ClientExtension",
|
"kind": "ClientExtension",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -388,25 +351,21 @@ v25 = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
v26 = [
|
v24 = [
|
||||||
{
|
{
|
||||||
"kind": "Literal",
|
"kind": "Literal",
|
||||||
"name": "first",
|
"name": "first",
|
||||||
"value": 100
|
"value": 100
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v27 = [
|
v25 = {
|
||||||
(v2/*: any*/),
|
|
||||||
(v3/*: any*/)
|
|
||||||
],
|
|
||||||
v28 = {
|
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "state",
|
"name": "state",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v29 = {
|
v26 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
@@ -449,56 +408,11 @@ return {
|
|||||||
(v17/*: any*/),
|
(v17/*: any*/),
|
||||||
(v18/*: any*/),
|
(v18/*: any*/),
|
||||||
(v19/*: any*/),
|
(v19/*: any*/),
|
||||||
(v20/*: any*/),
|
|
||||||
(v21/*: any*/),
|
|
||||||
{
|
{
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "FrameworkControlDialogFragment"
|
"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",
|
"alias": "measures",
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -529,19 +443,19 @@ return {
|
|||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "LinkedMeasuresCardFragment"
|
"name": "LinkedMeasuresCardFragment"
|
||||||
},
|
},
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": "documents",
|
"alias": "documents",
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -572,19 +486,19 @@ return {
|
|||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "LinkedDocumentsCardFragment"
|
"name": "LinkedDocumentsCardFragment"
|
||||||
},
|
},
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": "audits",
|
"alias": "audits",
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -615,19 +529,19 @@ return {
|
|||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "LinkedAuditsCardFragment"
|
"name": "LinkedAuditsCardFragment"
|
||||||
},
|
},
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": "obligations",
|
"alias": "obligations",
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -658,19 +572,19 @@ return {
|
|||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "LinkedObligationsCardFragment"
|
"name": "LinkedObligationsCardFragment"
|
||||||
},
|
},
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": "snapshots",
|
"alias": "snapshots",
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -701,18 +615,18 @@ return {
|
|||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "LinkedSnapshotsCardFragment"
|
"name": "LinkedSnapshotsCardFragment"
|
||||||
},
|
},
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Control",
|
"type": "Control",
|
||||||
@@ -739,7 +653,7 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v22/*: any*/),
|
(v20/*: any*/),
|
||||||
(v2/*: any*/),
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
@@ -761,8 +675,6 @@ return {
|
|||||||
(v17/*: any*/),
|
(v17/*: any*/),
|
||||||
(v18/*: any*/),
|
(v18/*: any*/),
|
||||||
(v19/*: any*/),
|
(v19/*: any*/),
|
||||||
(v20/*: any*/),
|
|
||||||
(v21/*: any*/),
|
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -772,92 +684,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: 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*/),
|
|
||||||
"concreteType": "MeasureConnection",
|
"concreteType": "MeasureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "measures",
|
"name": "measures",
|
||||||
@@ -881,23 +708,23 @@ return {
|
|||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/),
|
(v2/*: any*/),
|
||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
(v28/*: any*/),
|
(v25/*: any*/),
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": "measures(first:100)"
|
"storageKey": "measures(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "FrameworkGraphControl_measures",
|
"key": "FrameworkGraphControl_measures",
|
||||||
@@ -906,7 +733,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"concreteType": "DocumentConnection",
|
"concreteType": "DocumentConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "documents",
|
"name": "documents",
|
||||||
@@ -936,7 +763,7 @@ return {
|
|||||||
"name": "title",
|
"name": "title",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v29/*: any*/),
|
(v26/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -985,22 +812,22 @@ return {
|
|||||||
],
|
],
|
||||||
"storageKey": "versions(first:1)"
|
"storageKey": "versions(first:1)"
|
||||||
},
|
},
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": "documents(first:100)"
|
"storageKey": "documents(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "FrameworkGraphControl_documents",
|
"key": "FrameworkGraphControl_documents",
|
||||||
@@ -1009,7 +836,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"concreteType": "AuditConnection",
|
"concreteType": "AuditConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "audits",
|
"name": "audits",
|
||||||
@@ -1033,8 +860,8 @@ return {
|
|||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/),
|
(v2/*: any*/),
|
||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
(v29/*: any*/),
|
(v26/*: any*/),
|
||||||
(v28/*: any*/),
|
(v25/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -1056,25 +883,28 @@ return {
|
|||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "framework",
|
"name": "framework",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v27/*: any*/),
|
"selections": [
|
||||||
"storageKey": null
|
(v2/*: any*/),
|
||||||
},
|
(v3/*: any*/)
|
||||||
(v22/*: any*/)
|
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v20/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": "audits(first:100)"
|
"storageKey": "audits(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "FrameworkGraphControl_audits",
|
"key": "FrameworkGraphControl_audits",
|
||||||
@@ -1083,7 +913,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"concreteType": "ObligationConnection",
|
"concreteType": "ObligationConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "obligations",
|
"name": "obligations",
|
||||||
@@ -1147,22 +977,22 @@ return {
|
|||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": "obligations(first:100)"
|
"storageKey": "obligations(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "FrameworkGraphControl_obligations",
|
"key": "FrameworkGraphControl_obligations",
|
||||||
@@ -1171,7 +1001,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"concreteType": "SnapshotConnection",
|
"concreteType": "SnapshotConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "snapshots",
|
"name": "snapshots",
|
||||||
@@ -1203,23 +1033,23 @@ return {
|
|||||||
"name": "type",
|
"name": "type",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v29/*: any*/),
|
(v26/*: any*/),
|
||||||
(v22/*: any*/)
|
(v20/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
(v21/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
(v22/*: any*/),
|
||||||
(v23/*: any*/)
|
(v23/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
(v24/*: any*/),
|
|
||||||
(v25/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": "snapshots(first:100)"
|
"storageKey": "snapshots(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v26/*: any*/),
|
"args": (v24/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "FrameworkGraphControl_snapshots",
|
"key": "FrameworkGraphControl_snapshots",
|
||||||
@@ -1236,19 +1066,10 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "83f936f5dced0f50c645aa6ef30efedc",
|
"cacheID": "edefbc65624dd3df20c5769b4294c010",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
{
|
|
||||||
"count": null,
|
|
||||||
"cursor": null,
|
|
||||||
"direction": "forward",
|
|
||||||
"path": [
|
|
||||||
"node",
|
|
||||||
"stateOfApplicabilityControls"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"count": null,
|
"count": null,
|
||||||
"cursor": null,
|
"cursor": null,
|
||||||
@@ -1298,11 +1119,11 @@ return {
|
|||||||
},
|
},
|
||||||
"name": "FrameworkGraphControlNodeQuery",
|
"name": "FrameworkGraphControlNodeQuery",
|
||||||
"operationKind": "query",
|
"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;
|
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
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -12,14 +12,15 @@ import { ReaderFragment } from 'relay-runtime';
|
|||||||
import { FragmentRefs } from "relay-runtime";
|
import { FragmentRefs } from "relay-runtime";
|
||||||
export type LinkedStatesOfApplicabilityCardFragment$data = {
|
export type LinkedStatesOfApplicabilityCardFragment$data = {
|
||||||
readonly applicability: boolean;
|
readonly applicability: boolean;
|
||||||
readonly controlId: string;
|
readonly control: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly justification: string | null | undefined;
|
};
|
||||||
|
readonly id: string;
|
||||||
|
readonly justification: string;
|
||||||
readonly stateOfApplicability: {
|
readonly stateOfApplicability: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
};
|
};
|
||||||
readonly stateOfApplicabilityId: string;
|
|
||||||
readonly " $fragmentType": "LinkedStatesOfApplicabilityCardFragment";
|
readonly " $fragmentType": "LinkedStatesOfApplicabilityCardFragment";
|
||||||
};
|
};
|
||||||
export type LinkedStatesOfApplicabilityCardFragment$key = {
|
export type LinkedStatesOfApplicabilityCardFragment$key = {
|
||||||
@@ -42,20 +43,6 @@ return {
|
|||||||
"name": "LinkedStatesOfApplicabilityCardFragment",
|
"name": "LinkedStatesOfApplicabilityCardFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
(v0/*: any*/),
|
(v0/*: any*/),
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "stateOfApplicabilityId",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "controlId",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -75,6 +62,18 @@ return {
|
|||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"concreteType": "Control",
|
||||||
|
"kind": "LinkedField",
|
||||||
|
"name": "control",
|
||||||
|
"plural": false,
|
||||||
|
"selections": [
|
||||||
|
(v0/*: any*/)
|
||||||
|
],
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -90,11 +89,11 @@ return {
|
|||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "StateOfApplicabilityControl",
|
"type": "ApplicabilityStatement",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "b9a9922b27f277a769025f11b0829bdc";
|
(node as any).hash = "92dc33d1e220b3433508e55cb05ea39a";
|
||||||
|
|
||||||
export default node;
|
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
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -11,27 +11,39 @@
|
|||||||
import { ReaderFragment } from 'relay-runtime';
|
import { ReaderFragment } from 'relay-runtime';
|
||||||
import { FragmentRefs } from "relay-runtime";
|
import { FragmentRefs } from "relay-runtime";
|
||||||
export type StateOfApplicabilityControlsTabFragment$data = {
|
export type StateOfApplicabilityControlsTabFragment$data = {
|
||||||
readonly availableControls: ReadonlyArray<{
|
readonly applicabilityStatements: {
|
||||||
readonly applicability: boolean | null | undefined;
|
readonly __id: string;
|
||||||
|
readonly edges: ReadonlyArray<{
|
||||||
|
readonly node: {
|
||||||
|
readonly applicability: boolean;
|
||||||
|
readonly control: {
|
||||||
readonly bestPractice: boolean;
|
readonly bestPractice: boolean;
|
||||||
readonly contractual: boolean;
|
readonly contractual: boolean;
|
||||||
readonly controlId: string;
|
readonly framework: {
|
||||||
readonly frameworkId: string;
|
readonly id: string;
|
||||||
readonly frameworkName: string;
|
|
||||||
readonly justification: string | null | undefined;
|
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly organizationId: string;
|
};
|
||||||
|
readonly id: string;
|
||||||
|
readonly name: string;
|
||||||
|
readonly organization: {
|
||||||
|
readonly id: string;
|
||||||
|
} | null | undefined;
|
||||||
readonly regulatory: boolean;
|
readonly regulatory: boolean;
|
||||||
readonly riskAssessment: boolean;
|
readonly riskAssessment: boolean;
|
||||||
readonly sectionTitle: string;
|
readonly sectionTitle: string;
|
||||||
readonly stateOfApplicabilityId: string | null | undefined;
|
|
||||||
}>;
|
|
||||||
readonly canCreateStateOfApplicabilityControlMapping: boolean;
|
|
||||||
readonly canDeleteStateOfApplicabilityControlMapping: boolean;
|
|
||||||
readonly controlsInfo: {
|
|
||||||
readonly totalCount: number;
|
|
||||||
};
|
};
|
||||||
readonly id: 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";
|
readonly " $fragmentType": "StateOfApplicabilityControlsTabFragment";
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityControlsTabFragment$key = {
|
export type StateOfApplicabilityControlsTabFragment$key = {
|
||||||
@@ -39,140 +51,125 @@ export type StateOfApplicabilityControlsTabFragment$key = {
|
|||||||
readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityControlsTabFragment">;
|
readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityControlsTabFragment">;
|
||||||
};
|
};
|
||||||
|
|
||||||
import StateOfApplicabilityControlsTabRefetchQuery_graphql from './StateOfApplicabilityControlsTabRefetchQuery.graphql';
|
const node: ReaderFragment = (function(){
|
||||||
|
var v0 = {
|
||||||
const node: ReaderFragment = {
|
|
||||||
"argumentDefinitions": [],
|
|
||||||
"kind": "Fragment",
|
|
||||||
"metadata": {
|
|
||||||
"refetch": {
|
|
||||||
"connection": null,
|
|
||||||
"fragmentPathInResult": [
|
|
||||||
"node"
|
|
||||||
],
|
|
||||||
"operation": StateOfApplicabilityControlsTabRefetchQuery_graphql,
|
|
||||||
"identifierInfo": {
|
|
||||||
"identifierField": "id",
|
|
||||||
"identifierQueryVariableName": "id"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"name": "StateOfApplicabilityControlsTabFragment",
|
|
||||||
"selections": [
|
|
||||||
{
|
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
v1 = {
|
||||||
"alias": "controlsInfo",
|
"alias": null,
|
||||||
"args": [
|
"args": null,
|
||||||
{
|
"concreteType": "Organization",
|
||||||
"kind": "Literal",
|
|
||||||
"name": "first",
|
|
||||||
"value": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"concreteType": "ControlConnection",
|
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "controls",
|
"name": "organization",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
(v0/*: any*/)
|
||||||
"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
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
v2 = {
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "sectionTitle",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "name",
|
"name": "name",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
"argumentDefinitions": [],
|
||||||
|
"kind": "Fragment",
|
||||||
|
"metadata": {
|
||||||
|
"connection": [
|
||||||
|
{
|
||||||
|
"count": null,
|
||||||
|
"cursor": null,
|
||||||
|
"direction": "forward",
|
||||||
|
"path": [
|
||||||
|
"applicabilityStatements"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
|
"name": "StateOfApplicabilityControlsTabFragment",
|
||||||
|
"selections": [
|
||||||
|
(v0/*: any*/),
|
||||||
|
(v1/*: 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": "applicabilityStatements",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"kind": "Literal",
|
||||||
|
"name": "orderBy",
|
||||||
|
"value": {
|
||||||
|
"direction": "ASC",
|
||||||
|
"field": "CREATED_AT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"concreteType": "ApplicabilityStatementConnection",
|
||||||
|
"kind": "LinkedField",
|
||||||
|
"name": "__StateOfApplicabilityControlsTab_applicabilityStatements_connection",
|
||||||
|
"plural": false,
|
||||||
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"concreteType": "ApplicabilityStatementEdge",
|
||||||
"name": "frameworkId",
|
"kind": "LinkedField",
|
||||||
"storageKey": null
|
"name": "edges",
|
||||||
},
|
"plural": true,
|
||||||
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"concreteType": "ApplicabilityStatement",
|
||||||
"name": "frameworkName",
|
"kind": "LinkedField",
|
||||||
"storageKey": null
|
"name": "node",
|
||||||
},
|
"plural": false,
|
||||||
{
|
"selections": [
|
||||||
"alias": null,
|
(v0/*: any*/),
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "organizationId",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "stateOfApplicabilityId",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -187,6 +184,23 @@ const node: ReaderFragment = {
|
|||||||
"name": "justification",
|
"name": "justification",
|
||||||
"storageKey": null
|
"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,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -214,15 +228,90 @@ const node: ReaderFragment = {
|
|||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "riskAssessment",
|
"name": "riskAssessment",
|
||||||
"storageKey": null
|
"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
|
"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": "__StateOfApplicabilityControlsTab_applicabilityStatements_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"CREATED_AT\"})"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "StateOfApplicability",
|
"type": "StateOfApplicability",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
(node as any).hash = "37dd1660caf4dea39bb697b99a8bf511";
|
(node as any).hash = "b5a28520cb7a702b208cbfad2c904a99";
|
||||||
|
|
||||||
export default node;
|
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
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -14,10 +14,10 @@ export type UpdateStateOfApplicabilityInput = {
|
|||||||
name?: string | null | undefined;
|
name?: string | null | undefined;
|
||||||
ownerId?: string | null | undefined;
|
ownerId?: string | null | undefined;
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphUpdateMutation$variables = {
|
export type StateOfApplicabilityDetailPageUpdateMutation$variables = {
|
||||||
input: UpdateStateOfApplicabilityInput;
|
input: UpdateStateOfApplicabilityInput;
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphUpdateMutation$data = {
|
export type StateOfApplicabilityDetailPageUpdateMutation$data = {
|
||||||
readonly updateStateOfApplicability: {
|
readonly updateStateOfApplicability: {
|
||||||
readonly stateOfApplicability: {
|
readonly stateOfApplicability: {
|
||||||
readonly createdAt: string;
|
readonly createdAt: string;
|
||||||
@@ -33,9 +33,9 @@ export type StateOfApplicabilityGraphUpdateMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphUpdateMutation = {
|
export type StateOfApplicabilityDetailPageUpdateMutation = {
|
||||||
response: StateOfApplicabilityGraphUpdateMutation$data;
|
response: StateOfApplicabilityDetailPageUpdateMutation$data;
|
||||||
variables: StateOfApplicabilityGraphUpdateMutation$variables;
|
variables: StateOfApplicabilityDetailPageUpdateMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -143,7 +143,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "StateOfApplicabilityGraphUpdateMutation",
|
"name": "StateOfApplicabilityDetailPageUpdateMutation",
|
||||||
"selections": (v2/*: any*/),
|
"selections": (v2/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -152,20 +152,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "StateOfApplicabilityGraphUpdateMutation",
|
"name": "StateOfApplicabilityDetailPageUpdateMutation",
|
||||||
"selections": (v2/*: any*/)
|
"selections": (v2/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "609bd562b84162f2807ee89b3c3273aa",
|
"cacheID": "0236ac567b08f60ca0773d91fb1b2155",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "StateOfApplicabilityGraphUpdateMutation",
|
"name": "StateOfApplicabilityDetailPageUpdateMutation",
|
||||||
"operationKind": "mutation",
|
"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;
|
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
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -12,18 +12,18 @@ import { ConcreteRequest } from 'relay-runtime';
|
|||||||
export type DeleteStateOfApplicabilityInput = {
|
export type DeleteStateOfApplicabilityInput = {
|
||||||
stateOfApplicabilityId: string;
|
stateOfApplicabilityId: string;
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphDeleteMutation$variables = {
|
export type StateOfApplicabilityRowDeleteMutation$variables = {
|
||||||
connections: ReadonlyArray<string>;
|
connections: ReadonlyArray<string>;
|
||||||
input: DeleteStateOfApplicabilityInput;
|
input: DeleteStateOfApplicabilityInput;
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphDeleteMutation$data = {
|
export type StateOfApplicabilityRowDeleteMutation$data = {
|
||||||
readonly deleteStateOfApplicability: {
|
readonly deleteStateOfApplicability: {
|
||||||
readonly deletedStateOfApplicabilityId: string;
|
readonly deletedStateOfApplicabilityId: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphDeleteMutation = {
|
export type StateOfApplicabilityRowDeleteMutation = {
|
||||||
response: StateOfApplicabilityGraphDeleteMutation$data;
|
response: StateOfApplicabilityRowDeleteMutation$data;
|
||||||
variables: StateOfApplicabilityGraphDeleteMutation$variables;
|
variables: StateOfApplicabilityRowDeleteMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -59,7 +59,7 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "StateOfApplicabilityGraphDeleteMutation",
|
"name": "StateOfApplicabilityRowDeleteMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -84,7 +84,7 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "StateOfApplicabilityGraphDeleteMutation",
|
"name": "StateOfApplicabilityRowDeleteMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -117,16 +117,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "197a2ed2b48d43372e16deae6e9b98c2",
|
"cacheID": "be77dc47292c3864174f008adb45f910",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "StateOfApplicabilityGraphDeleteMutation",
|
"name": "StateOfApplicabilityRowDeleteMutation",
|
||||||
"operationKind": "mutation",
|
"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;
|
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
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -10,33 +10,25 @@
|
|||||||
|
|
||||||
import { ReaderFragment } from 'relay-runtime';
|
import { ReaderFragment } from 'relay-runtime';
|
||||||
import { FragmentRefs } from "relay-runtime";
|
import { FragmentRefs } from "relay-runtime";
|
||||||
export type StateOfApplicabilityGraphPaginatedFragment$data = {
|
export type StatesOfApplicabilityPageFragment$data = {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly statesOfApplicability: {
|
readonly statesOfApplicability: {
|
||||||
readonly __id: string;
|
readonly __id: string;
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly canDelete: boolean;
|
|
||||||
readonly controlsInfo: {
|
|
||||||
readonly totalCount: number;
|
|
||||||
};
|
|
||||||
readonly createdAt: string;
|
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name: string;
|
readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityRowFragment">;
|
||||||
readonly snapshotId: string | null | undefined;
|
|
||||||
readonly sourceId: string | null | undefined;
|
|
||||||
readonly updatedAt: string;
|
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
readonly " $fragmentType": "StateOfApplicabilityGraphPaginatedFragment";
|
readonly " $fragmentType": "StatesOfApplicabilityPageFragment";
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphPaginatedFragment$key = {
|
export type StatesOfApplicabilityPageFragment$key = {
|
||||||
readonly " $data"?: StateOfApplicabilityGraphPaginatedFragment$data;
|
readonly " $data"?: StatesOfApplicabilityPageFragment$data;
|
||||||
readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityGraphPaginatedFragment">;
|
readonly " $fragmentSpreads": FragmentRefs<"StatesOfApplicabilityPageFragment">;
|
||||||
};
|
};
|
||||||
|
|
||||||
import StateOfApplicabilityListQuery_graphql from './StateOfApplicabilityListQuery.graphql';
|
import StatesOfApplicabilityPagePaginationQuery_graphql from './StatesOfApplicabilityPagePaginationQuery.graphql';
|
||||||
|
|
||||||
const node: ReaderFragment = (function(){
|
const node: ReaderFragment = (function(){
|
||||||
var v0 = [
|
var v0 = [
|
||||||
@@ -112,14 +104,14 @@ return {
|
|||||||
"fragmentPathInResult": [
|
"fragmentPathInResult": [
|
||||||
"node"
|
"node"
|
||||||
],
|
],
|
||||||
"operation": StateOfApplicabilityListQuery_graphql,
|
"operation": StatesOfApplicabilityPagePaginationQuery_graphql,
|
||||||
"identifierInfo": {
|
"identifierInfo": {
|
||||||
"identifierField": "id",
|
"identifierField": "id",
|
||||||
"identifierQueryVariableName": "id"
|
"identifierQueryVariableName": "id"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "StateOfApplicabilityGraphPaginatedFragment",
|
"name": "StatesOfApplicabilityPageFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "statesOfApplicability",
|
"alias": "statesOfApplicability",
|
||||||
@@ -128,16 +120,11 @@ return {
|
|||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
"name": "filter",
|
"name": "filter",
|
||||||
"variableName": "filter"
|
"variableName": "filter"
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "Variable",
|
|
||||||
"name": "orderBy",
|
|
||||||
"variableName": "order"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "StateOfApplicabilityConnection",
|
"concreteType": "StateOfApplicabilityConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__StateOfApplicabilityGraphPaginatedQuery_statesOfApplicability_connection",
|
"name": "__StatesOfApplicabilityPage_statesOfApplicability_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -158,76 +145,9 @@ return {
|
|||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v1/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "FragmentSpread",
|
||||||
"name": "name",
|
"name": "StateOfApplicabilityRowFragment"
|
||||||
"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)"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -310,6 +230,6 @@ return {
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "82cf2a5ce701c34a41f8166371dd75c3";
|
(node as any).hash = "30ea5e415eca53b251933d1ce086a9b7";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<8bdd74dfae1b656006a07b2f89fe525d>>
|
* @generated SignedSource<<be08976a189938be59196a67454e0a60>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -19,7 +19,7 @@ export type StateOfApplicabilityOrder = {
|
|||||||
direction: OrderDirection;
|
direction: OrderDirection;
|
||||||
field: StateOfApplicabilityOrderField;
|
field: StateOfApplicabilityOrderField;
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityListQuery$variables = {
|
export type StatesOfApplicabilityPagePaginationQuery$variables = {
|
||||||
after?: string | null | undefined;
|
after?: string | null | undefined;
|
||||||
before?: string | null | undefined;
|
before?: string | null | undefined;
|
||||||
filter?: StateOfApplicabilityFilter | null | undefined;
|
filter?: StateOfApplicabilityFilter | null | undefined;
|
||||||
@@ -28,14 +28,14 @@ export type StateOfApplicabilityListQuery$variables = {
|
|||||||
last?: number | null | undefined;
|
last?: number | null | undefined;
|
||||||
order?: StateOfApplicabilityOrder | null | undefined;
|
order?: StateOfApplicabilityOrder | null | undefined;
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityListQuery$data = {
|
export type StatesOfApplicabilityPagePaginationQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityGraphPaginatedFragment">;
|
readonly " $fragmentSpreads": FragmentRefs<"StatesOfApplicabilityPageFragment">;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityListQuery = {
|
export type StatesOfApplicabilityPagePaginationQuery = {
|
||||||
response: StateOfApplicabilityListQuery$data;
|
response: StatesOfApplicabilityPagePaginationQuery$data;
|
||||||
variables: StateOfApplicabilityListQuery$variables;
|
variables: StatesOfApplicabilityPagePaginationQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -150,7 +150,7 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "StateOfApplicabilityListQuery",
|
"name": "StatesOfApplicabilityPagePaginationQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -174,7 +174,7 @@ return {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "StateOfApplicabilityGraphPaginatedFragment"
|
"name": "StatesOfApplicabilityPageFragment"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -195,7 +195,7 @@ return {
|
|||||||
(v4/*: any*/)
|
(v4/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "StateOfApplicabilityListQuery",
|
"name": "StatesOfApplicabilityPagePaginationQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -242,20 +242,6 @@ return {
|
|||||||
"name": "name",
|
"name": "name",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "sourceId",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "snapshotId",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -263,13 +249,6 @@ return {
|
|||||||
"name": "createdAt",
|
"name": "createdAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "updatedAt",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": "canDelete",
|
"alias": "canDelete",
|
||||||
"args": [
|
"args": [
|
||||||
@@ -284,17 +263,11 @@ return {
|
|||||||
"storageKey": "permission(action:\"core:state-of-applicability:delete\")"
|
"storageKey": "permission(action:\"core:state-of-applicability:delete\")"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": "controlsInfo",
|
"alias": "statementsInfo",
|
||||||
"args": [
|
"args": null,
|
||||||
{
|
"concreteType": "ApplicabilityStatementConnection",
|
||||||
"kind": "Literal",
|
|
||||||
"name": "first",
|
|
||||||
"value": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"concreteType": "ControlConnection",
|
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "controls",
|
"name": "applicabilityStatements",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -305,7 +278,7 @@ return {
|
|||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": "controls(first:0)"
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v13/*: any*/)
|
(v13/*: any*/)
|
||||||
],
|
],
|
||||||
@@ -379,11 +352,10 @@ return {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v15/*: any*/),
|
"args": (v15/*: any*/),
|
||||||
"filters": [
|
"filters": [
|
||||||
"orderBy",
|
|
||||||
"filter"
|
"filter"
|
||||||
],
|
],
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "StateOfApplicabilityGraphPaginatedQuery_statesOfApplicability",
|
"key": "StatesOfApplicabilityPage_statesOfApplicability",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "statesOfApplicability"
|
"name": "statesOfApplicability"
|
||||||
}
|
}
|
||||||
@@ -397,16 +369,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "68d8b8bc491e464ea692b6d37952bcbf",
|
"cacheID": "812dcba28ad3fb441e49e281a199fd62",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "StateOfApplicabilityListQuery",
|
"name": "StatesOfApplicabilityPagePaginationQuery",
|
||||||
"operationKind": "query",
|
"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;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<a1b6d40084a5ddfad764dd1f6fa32607>>
|
* @generated SignedSource<<edaa0e98c84869aff4c1b3945fddd09a>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -10,24 +10,24 @@
|
|||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
import { FragmentRefs } from "relay-runtime";
|
import { FragmentRefs } from "relay-runtime";
|
||||||
export type StateOfApplicabilityGraphPaginatedQuery$variables = {
|
export type StatesOfApplicabilityPageQuery$variables = {
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphPaginatedQuery$data = {
|
export type StatesOfApplicabilityPageQuery$data = {
|
||||||
readonly organization: {
|
readonly organization: {
|
||||||
readonly __typename: "Organization";
|
readonly __typename: "Organization";
|
||||||
readonly canCreateStateOfApplicability: boolean;
|
readonly canCreateStateOfApplicability: boolean;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly " $fragmentSpreads": FragmentRefs<"StateOfApplicabilityGraphPaginatedFragment">;
|
readonly " $fragmentSpreads": FragmentRefs<"StatesOfApplicabilityPageFragment">;
|
||||||
} | {
|
} | {
|
||||||
// This will never be '%other', but we need some
|
// This will never be '%other', but we need some
|
||||||
// value in case none of the concrete values match.
|
// value in case none of the concrete values match.
|
||||||
readonly __typename: "%other";
|
readonly __typename: "%other";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type StateOfApplicabilityGraphPaginatedQuery = {
|
export type StatesOfApplicabilityPageQuery = {
|
||||||
response: StateOfApplicabilityGraphPaginatedQuery$data;
|
response: StatesOfApplicabilityPageQuery$data;
|
||||||
variables: StateOfApplicabilityGraphPaginatedQuery$variables;
|
variables: StatesOfApplicabilityPageQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -99,7 +99,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "StateOfApplicabilityGraphPaginatedQuery",
|
"name": "StatesOfApplicabilityPageQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -118,7 +118,7 @@ return {
|
|||||||
{
|
{
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "StateOfApplicabilityGraphPaginatedFragment"
|
"name": "StatesOfApplicabilityPageFragment"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Organization",
|
"type": "Organization",
|
||||||
@@ -135,7 +135,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "StateOfApplicabilityGraphPaginatedQuery",
|
"name": "StatesOfApplicabilityPageQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -183,20 +183,6 @@ return {
|
|||||||
"name": "name",
|
"name": "name",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "sourceId",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "snapshotId",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -204,13 +190,6 @@ return {
|
|||||||
"name": "createdAt",
|
"name": "createdAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "updatedAt",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": "canDelete",
|
"alias": "canDelete",
|
||||||
"args": [
|
"args": [
|
||||||
@@ -225,17 +204,11 @@ return {
|
|||||||
"storageKey": "permission(action:\"core:state-of-applicability:delete\")"
|
"storageKey": "permission(action:\"core:state-of-applicability:delete\")"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": "controlsInfo",
|
"alias": "statementsInfo",
|
||||||
"args": [
|
"args": null,
|
||||||
{
|
"concreteType": "ApplicabilityStatementConnection",
|
||||||
"kind": "Literal",
|
|
||||||
"name": "first",
|
|
||||||
"value": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"concreteType": "ControlConnection",
|
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "controls",
|
"name": "applicabilityStatements",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -246,7 +219,7 @@ return {
|
|||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": "controls(first:0)"
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v2/*: any*/)
|
(v2/*: any*/)
|
||||||
],
|
],
|
||||||
@@ -320,11 +293,10 @@ return {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"filters": [
|
"filters": [
|
||||||
"orderBy",
|
|
||||||
"filter"
|
"filter"
|
||||||
],
|
],
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "StateOfApplicabilityGraphPaginatedQuery_statesOfApplicability",
|
"key": "StatesOfApplicabilityPage_statesOfApplicability",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "statesOfApplicability"
|
"name": "statesOfApplicability"
|
||||||
}
|
}
|
||||||
@@ -338,16 +310,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "3d53dfeb5366c889e790a88116dd3a4a",
|
"cacheID": "d0baef050f4750119d752ca5e17b134a",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "StateOfApplicabilityGraphPaginatedQuery",
|
"name": "StatesOfApplicabilityPageQuery",
|
||||||
"operationKind": "query",
|
"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;
|
export default node;
|
||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
Tr,
|
Tr,
|
||||||
TrButton,
|
TrButton,
|
||||||
} from "@probo/ui";
|
} from "@probo/ui";
|
||||||
import { clsx } from "clsx";
|
import clsx from "clsx";
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { useFragment } from "react-relay";
|
import { useFragment } from "react-relay";
|
||||||
import { graphql } from "relay-runtime";
|
import { graphql } from "relay-runtime";
|
||||||
@@ -26,14 +26,15 @@ import { useOrganizationId } from "#/hooks/useOrganizationId";
|
|||||||
import { LinkedStatesOfApplicabilityDialog } from "./LinkedStatesOfApplicabilityDialog";
|
import { LinkedStatesOfApplicabilityDialog } from "./LinkedStatesOfApplicabilityDialog";
|
||||||
|
|
||||||
const linkedStateOfApplicabilityFragment = graphql`
|
const linkedStateOfApplicabilityFragment = graphql`
|
||||||
fragment LinkedStatesOfApplicabilityCardFragment on StateOfApplicabilityControl {
|
fragment LinkedStatesOfApplicabilityCardFragment on ApplicabilityStatement {
|
||||||
id
|
id
|
||||||
stateOfApplicabilityId
|
|
||||||
controlId
|
|
||||||
stateOfApplicability {
|
stateOfApplicability {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
}
|
}
|
||||||
|
control {
|
||||||
|
id
|
||||||
|
}
|
||||||
applicability
|
applicability
|
||||||
justification
|
justification
|
||||||
}
|
}
|
||||||
@@ -233,7 +234,8 @@ function LinkedInfoExtractor(props: {
|
|||||||
controlId: string;
|
controlId: string;
|
||||||
}) => void;
|
}) => void;
|
||||||
}) {
|
}) {
|
||||||
const { fragment, onExtracted } = props;
|
const { onExtracted, fragment } = props;
|
||||||
|
|
||||||
const data = useFragment(
|
const data = useFragment(
|
||||||
linkedStateOfApplicabilityFragment,
|
linkedStateOfApplicabilityFragment,
|
||||||
fragment,
|
fragment,
|
||||||
@@ -241,10 +243,10 @@ function LinkedInfoExtractor(props: {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onExtracted({
|
onExtracted({
|
||||||
stateOfApplicabilityId: data.stateOfApplicabilityId,
|
stateOfApplicabilityId: data.stateOfApplicability.id,
|
||||||
controlId: data.controlId,
|
controlId: data.control.id,
|
||||||
});
|
});
|
||||||
}, [data.stateOfApplicabilityId, data.controlId, onExtracted]);
|
}, [data.stateOfApplicability.id, data.control.id, onExtracted]);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -265,7 +267,7 @@ function StateOfApplicabilityRow(props: {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tr
|
<Tr
|
||||||
to={`/organizations/${organizationId}/states-of-applicability/${soa.stateOfApplicabilityId}`}
|
to={`/organizations/${organizationId}/states-of-applicability/${soa.stateOfApplicability.id}`}
|
||||||
>
|
>
|
||||||
<Td>{soa.stateOfApplicability.name}</Td>
|
<Td>{soa.stateOfApplicability.name}</Td>
|
||||||
<Td>
|
<Td>
|
||||||
@@ -282,8 +284,8 @@ function StateOfApplicabilityRow(props: {
|
|||||||
variant="secondary"
|
variant="secondary"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
props.onClick(
|
props.onClick(
|
||||||
soa.stateOfApplicabilityId,
|
soa.stateOfApplicability.id,
|
||||||
soa.controlId,
|
soa.control.id,
|
||||||
)}
|
)}
|
||||||
icon={IconTrashCan}
|
icon={IconTrashCan}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -129,12 +129,6 @@ export const frameworkControlNodeQuery = graphql`
|
|||||||
canDeleteSnapshotMapping: permission(
|
canDeleteSnapshotMapping: permission(
|
||||||
action: "core:control:delete-snapshot-mapping"
|
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(
|
canCreateObligationMapping: permission(
|
||||||
action: "core:control:obligation-control-mapping:create"
|
action: "core:control:obligation-control-mapping:create"
|
||||||
)
|
)
|
||||||
@@ -142,16 +136,6 @@ export const frameworkControlNodeQuery = graphql`
|
|||||||
action: "core:control:obligation-control-mapping:delete"
|
action: "core:control:obligation-control-mapping:delete"
|
||||||
)
|
)
|
||||||
...FrameworkControlDialogFragment
|
...FrameworkControlDialogFragment
|
||||||
stateOfApplicabilityControls(first: 100)
|
|
||||||
@connection(key: "FrameworkGraphControl_stateOfApplicabilityControls") {
|
|
||||||
__id
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
id
|
|
||||||
...LinkedStatesOfApplicabilityCardFragment
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
measures(first: 100)
|
measures(first: 100)
|
||||||
@connection(key: "FrameworkGraphControl_measures") {
|
@connection(key: "FrameworkGraphControl_measures") {
|
||||||
__id
|
__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,43 +26,11 @@ import { LinkedDocumentsCard } from "#/components/documents/LinkedDocumentsCard"
|
|||||||
import { LinkedMeasuresCard } from "#/components/measures/LinkedMeasuresCard";
|
import { LinkedMeasuresCard } from "#/components/measures/LinkedMeasuresCard";
|
||||||
import { LinkedObligationsCard } from "#/components/obligations/LinkedObligationsCard";
|
import { LinkedObligationsCard } from "#/components/obligations/LinkedObligationsCard";
|
||||||
import { LinkedSnapshotsCard } from "#/components/snapshots/LinkedSnapshotsCard";
|
import { LinkedSnapshotsCard } from "#/components/snapshots/LinkedSnapshotsCard";
|
||||||
import { LinkedStatesOfApplicabilityCard } from "#/components/states-of-applicability/LinkedStatesOfApplicabilityCard";
|
|
||||||
import { frameworkControlNodeQuery } from "#/hooks/graph/FrameworkGraph";
|
import { frameworkControlNodeQuery } from "#/hooks/graph/FrameworkGraph";
|
||||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||||
|
|
||||||
import { FrameworkControlDialog } from "./dialogs/FrameworkControlDialog";
|
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`
|
const attachMeasureMutation = graphql`
|
||||||
mutation FrameworkControlPageAttachMutation(
|
mutation FrameworkControlPageAttachMutation(
|
||||||
$input: CreateControlMeasureMappingInput!
|
$input: CreateControlMeasureMappingInput!
|
||||||
@@ -249,10 +217,6 @@ export default function FrameworkControlPage({ queryRef }: Props) {
|
|||||||
);
|
);
|
||||||
const [deleteControl] = useMutation(deleteControlMutation);
|
const [deleteControl] = useMutation(deleteControlMutation);
|
||||||
|
|
||||||
const [attachStateOfApplicability, isAttachingStateOfApplicability]
|
|
||||||
= useMutation(attachStateOfApplicabilityMutation);
|
|
||||||
const [detachStateOfApplicability, isDetachingStateOfApplicability]
|
|
||||||
= useMutation(detachStateOfApplicabilityMutation);
|
|
||||||
const [attachObligation, isAttachingObligation] = useMutation(
|
const [attachObligation, isAttachingObligation] = useMutation(
|
||||||
attachObligationMutation,
|
attachObligationMutation,
|
||||||
);
|
);
|
||||||
@@ -260,13 +224,6 @@ export default function FrameworkControlPage({ queryRef }: Props) {
|
|||||||
detachObligationMutation,
|
detachObligationMutation,
|
||||||
);
|
);
|
||||||
|
|
||||||
const canLinkStateOfApplicability
|
|
||||||
= control.canCreateStateOfApplicabilityMapping;
|
|
||||||
const canUnlinkStateOfApplicability
|
|
||||||
= control.canDeleteStateOfApplicabilityMapping;
|
|
||||||
const statesOfApplicabilityReadOnly
|
|
||||||
= !canLinkStateOfApplicability && !canUnlinkStateOfApplicability;
|
|
||||||
|
|
||||||
const canLinkMeasure = control.canCreateMeasureMapping;
|
const canLinkMeasure = control.canCreateMeasureMapping;
|
||||||
const canUnlinkMeasure = control.canDeleteMeasureMapping;
|
const canUnlinkMeasure = control.canDeleteMeasureMapping;
|
||||||
const measuresReadOnly = !canLinkMeasure && !canUnlinkMeasure;
|
const measuresReadOnly = !canLinkMeasure && !canUnlinkMeasure;
|
||||||
@@ -396,33 +353,6 @@ export default function FrameworkControlPage({ queryRef }: Props) {
|
|||||||
)}
|
)}
|
||||||
<div className={control.status === "EXCLUDED" ? "opacity-60" : ""}>
|
<div className={control.status === "EXCLUDED" ? "opacity-60" : ""}>
|
||||||
<div className="text-base mb-4">{control.name}</div>
|
<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">
|
<div className="mb-4">
|
||||||
<LinkedMeasuresCard
|
<LinkedMeasuresCard
|
||||||
variant="card"
|
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 { usePageTitle } from "@probo/hooks";
|
||||||
import { useTranslate } from "@probo/i18n";
|
import { useTranslate } from "@probo/i18n";
|
||||||
import {
|
import {
|
||||||
@@ -14,34 +14,59 @@ import {
|
|||||||
IconTrashCan,
|
IconTrashCan,
|
||||||
Input,
|
Input,
|
||||||
PageHeader,
|
PageHeader,
|
||||||
|
useConfirm,
|
||||||
|
useToast,
|
||||||
} from "@probo/ui";
|
} from "@probo/ui";
|
||||||
import { Suspense, useState } from "react";
|
import { Suspense, useState } from "react";
|
||||||
import {
|
import {
|
||||||
ConnectionHandler,
|
ConnectionHandler,
|
||||||
graphql,
|
graphql,
|
||||||
type PreloadedQuery,
|
type PreloadedQuery,
|
||||||
|
useMutation,
|
||||||
usePreloadedQuery,
|
usePreloadedQuery,
|
||||||
} from "react-relay";
|
} from "react-relay";
|
||||||
import { useNavigate, useParams } from "react-router";
|
import { useNavigate, useParams } from "react-router";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
|
import type { StateOfApplicabilityDetailPageDeleteMutation } from "#/__generated__/core/StateOfApplicabilityDetailPageDeleteMutation.graphql";
|
||||||
import type { StateOfApplicabilityDetailPageExportMutation } from "#/__generated__/core/StateOfApplicabilityDetailPageExportMutation.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 { PeopleSelectField } from "#/components/form/PeopleSelectField";
|
||||||
import { SnapshotBanner } from "#/components/SnapshotBanner";
|
import { SnapshotBanner } from "#/components/SnapshotBanner";
|
||||||
import {
|
|
||||||
StateOfApplicabilityConnectionKey,
|
|
||||||
stateOfApplicabilityNodeQuery,
|
|
||||||
updateStateOfApplicabilityMutation,
|
|
||||||
useDeleteStateOfApplicability,
|
|
||||||
} from "#/hooks/graph/StateOfApplicabilityGraph";
|
|
||||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||||
|
|
||||||
import StateOfApplicabilityControlsTab from "./tabs/StateOfApplicabilityControlsTab";
|
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(
|
mutation StateOfApplicabilityDetailPageExportMutation(
|
||||||
$input: ExportStateOfApplicabilityPDFInput!
|
$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 = {
|
type Props = {
|
||||||
queryRef: PreloadedQuery<StateOfApplicabilityGraphNodeQuery>;
|
queryRef: PreloadedQuery<StateOfApplicabilityDetailPageQuery>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function StateOfApplicabilityDetailPage(props: Props) {
|
export default function StateOfApplicabilityDetailPage(props: Props) {
|
||||||
@@ -61,14 +120,13 @@ export default function StateOfApplicabilityDetailPage(props: Props) {
|
|||||||
snapshotId?: string;
|
snapshotId?: string;
|
||||||
}>();
|
}>();
|
||||||
const organizationId = useOrganizationId();
|
const organizationId = useOrganizationId();
|
||||||
const data = usePreloadedQuery(
|
const data = usePreloadedQuery(stateOfApplicabilityDetailPageQuery, props.queryRef);
|
||||||
stateOfApplicabilityNodeQuery,
|
|
||||||
props.queryRef,
|
|
||||||
);
|
|
||||||
const stateOfApplicability = data.node;
|
const stateOfApplicability = data.node;
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const isSnapshotMode = Boolean(snapshotId);
|
const isSnapshotMode = Boolean(snapshotId);
|
||||||
|
const confirm = useConfirm();
|
||||||
|
const { toast } = useToast();
|
||||||
|
|
||||||
if (!stateOfApplicabilityId || !stateOfApplicability) {
|
if (!stateOfApplicabilityId || !stateOfApplicability) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -81,23 +139,55 @@ export default function StateOfApplicabilityDetailPage(props: Props) {
|
|||||||
const connectionId = ConnectionHandler.getConnectionID(
|
const connectionId = ConnectionHandler.getConnectionID(
|
||||||
organizationId,
|
organizationId,
|
||||||
StateOfApplicabilityConnectionKey,
|
StateOfApplicabilityConnectionKey,
|
||||||
|
{ filter: { snapshotId: snapshotId ?? null } },
|
||||||
);
|
);
|
||||||
|
|
||||||
const deleteStateOfApplicability = useDeleteStateOfApplicability(
|
const [deleteStateOfApplicability] = useMutation<StateOfApplicabilityDetailPageDeleteMutation>(deleteMutation);
|
||||||
stateOfApplicability,
|
|
||||||
connectionId,
|
const handleDelete = () => {
|
||||||
|
if (!stateOfApplicability.id || !stateOfApplicability.name) {
|
||||||
|
return alert(__("Failed to delete state of applicability: missing id or name"));
|
||||||
|
}
|
||||||
|
confirm(
|
||||||
() =>
|
() =>
|
||||||
void navigate(
|
promisifyMutation(deleteStateOfApplicability)({
|
||||||
`/organizations/${organizationId}/states-of-applicability`,
|
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"));
|
usePageTitle(stateOfApplicability.name || __("State of Applicability"));
|
||||||
|
|
||||||
const [isEditingName, setIsEditingName] = useState(false);
|
const [isEditingName, setIsEditingName] = useState(false);
|
||||||
const [isEditingOwner, setIsEditingOwner] = useState(false);
|
const [isEditingOwner, setIsEditingOwner] = useState(false);
|
||||||
const [updateStateOfApplicability, isUpdating] = useMutationWithToasts(
|
const [updateStateOfApplicability, isUpdating] = useMutationWithToasts<StateOfApplicabilityDetailPageUpdateMutation>(
|
||||||
updateStateOfApplicabilityMutation,
|
updateMutation,
|
||||||
{
|
{
|
||||||
successMessage: __("State of Applicability updated successfully."),
|
successMessage: __("State of Applicability updated successfully."),
|
||||||
errorMessage: __("Failed to update State of Applicability"),
|
errorMessage: __("Failed to update State of Applicability"),
|
||||||
@@ -109,7 +199,7 @@ export default function StateOfApplicabilityDetailPage(props: Props) {
|
|||||||
|
|
||||||
const [exportStateOfApplicabilityPDF, isExporting]
|
const [exportStateOfApplicabilityPDF, isExporting]
|
||||||
= useMutationWithToasts<StateOfApplicabilityDetailPageExportMutation>(
|
= useMutationWithToasts<StateOfApplicabilityDetailPageExportMutation>(
|
||||||
exportStateOfApplicabilityPDFMutation,
|
exportMutation,
|
||||||
{
|
{
|
||||||
successMessage: __(
|
successMessage: __(
|
||||||
"State of Applicability exported successfully.",
|
"State of Applicability exported successfully.",
|
||||||
@@ -298,7 +388,7 @@ export default function StateOfApplicabilityDetailPage(props: Props) {
|
|||||||
<DropdownItem
|
<DropdownItem
|
||||||
variant="danger"
|
variant="danger"
|
||||||
icon={IconTrashCan}
|
icon={IconTrashCan}
|
||||||
onClick={() => void deleteStateOfApplicability()}
|
onClick={handleDelete}
|
||||||
>
|
>
|
||||||
{__("Delete")}
|
{__("Delete")}
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
@@ -384,7 +474,7 @@ export default function StateOfApplicabilityDetailPage(props: Props) {
|
|||||||
{stateOfApplicability.id && (
|
{stateOfApplicability.id && (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<h2 className="text-base font-medium">
|
<h2 className="text-base font-medium">
|
||||||
{__("Controls")}
|
{__("Statements")}
|
||||||
</h2>
|
</h2>
|
||||||
<StateOfApplicabilityControlsTab
|
<StateOfApplicabilityControlsTab
|
||||||
stateOfApplicability={
|
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 { usePageTitle } from "@probo/hooks";
|
||||||
import { useTranslate } from "@probo/i18n";
|
import { useTranslate } from "@probo/i18n";
|
||||||
import {
|
import {
|
||||||
ActionDropdown,
|
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
DropdownItem,
|
|
||||||
IconPlusLarge,
|
IconPlusLarge,
|
||||||
IconTrashCan,
|
|
||||||
PageHeader,
|
PageHeader,
|
||||||
Table,
|
Table,
|
||||||
Tbody,
|
Tbody,
|
||||||
Td,
|
|
||||||
Th,
|
Th,
|
||||||
Thead,
|
Thead,
|
||||||
Tr,
|
Tr,
|
||||||
} from "@probo/ui";
|
} from "@probo/ui";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
|
graphql,
|
||||||
type PreloadedQuery,
|
type PreloadedQuery,
|
||||||
usePaginationFragment,
|
usePaginationFragment,
|
||||||
usePreloadedQuery,
|
usePreloadedQuery,
|
||||||
} from "react-relay";
|
} from "react-relay";
|
||||||
import { useParams } from "react-router";
|
import { useParams } from "react-router";
|
||||||
|
|
||||||
import type {
|
import type { StatesOfApplicabilityPageFragment$key } from "#/__generated__/core/StatesOfApplicabilityPageFragment.graphql";
|
||||||
StateOfApplicabilityGraphPaginatedFragment$data,
|
import type { StatesOfApplicabilityPagePaginationQuery } from "#/__generated__/core/StatesOfApplicabilityPagePaginationQuery.graphql";
|
||||||
StateOfApplicabilityGraphPaginatedFragment$key,
|
import type { StatesOfApplicabilityPageQuery } from "#/__generated__/core/StatesOfApplicabilityPageQuery.graphql";
|
||||||
} from "#/__generated__/core/StateOfApplicabilityGraphPaginatedFragment.graphql";
|
|
||||||
import type { StateOfApplicabilityGraphPaginatedQuery } from "#/__generated__/core/StateOfApplicabilityGraphPaginatedQuery.graphql";
|
|
||||||
import type { StateOfApplicabilityListQuery } from "#/__generated__/core/StateOfApplicabilityListQuery.graphql";
|
|
||||||
import { SnapshotBanner } from "#/components/SnapshotBanner";
|
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";
|
import { CreateStateOfApplicabilityDialog } from "./dialogs/CreateStateOfApplicabilityDialog";
|
||||||
|
|
||||||
type StateOfApplicability = NodeOf<
|
export const statesOfApplicabilityPageQuery = graphql`
|
||||||
StateOfApplicabilityGraphPaginatedFragment$data["statesOfApplicability"]
|
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({
|
export default function StatesOfApplicabilityPage({
|
||||||
queryRef,
|
queryRef,
|
||||||
}: {
|
}: {
|
||||||
queryRef: PreloadedQuery<StateOfApplicabilityGraphPaginatedQuery>;
|
queryRef: PreloadedQuery<StatesOfApplicabilityPageQuery>;
|
||||||
}) {
|
}) {
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||||
@@ -56,11 +85,7 @@ export default function StatesOfApplicabilityPage({
|
|||||||
|
|
||||||
usePageTitle(__("States of Applicability"));
|
usePageTitle(__("States of Applicability"));
|
||||||
|
|
||||||
const { organization }
|
const { organization } = usePreloadedQuery(statesOfApplicabilityPageQuery, queryRef);
|
||||||
= usePreloadedQuery<StateOfApplicabilityGraphPaginatedQuery>(
|
|
||||||
paginatedStateOfApplicabilityQuery,
|
|
||||||
queryRef,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (organization.__typename !== "Organization") {
|
if (organization.__typename !== "Organization") {
|
||||||
throw new Error("Organization not found");
|
throw new Error("Organization not found");
|
||||||
@@ -73,11 +98,10 @@ export default function StatesOfApplicabilityPage({
|
|||||||
refetch,
|
refetch,
|
||||||
isLoadingNext,
|
isLoadingNext,
|
||||||
} = usePaginationFragment<
|
} = usePaginationFragment<
|
||||||
StateOfApplicabilityListQuery,
|
StatesOfApplicabilityPagePaginationQuery,
|
||||||
StateOfApplicabilityGraphPaginatedFragment$key
|
StatesOfApplicabilityPageFragment$key
|
||||||
>(paginatedStateOfApplicabilityFragment, organization);
|
>(paginatedFragment, organization);
|
||||||
|
|
||||||
// Refetch with snapshot filter when in snapshot mode
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (snapshotId) {
|
if (snapshotId) {
|
||||||
refetch(
|
refetch(
|
||||||
@@ -87,12 +111,6 @@ export default function StatesOfApplicabilityPage({
|
|||||||
}
|
}
|
||||||
}, [snapshotId, refetch]);
|
}, [snapshotId, refetch]);
|
||||||
|
|
||||||
const hasAnyAction
|
|
||||||
= !isSnapshotMode
|
|
||||||
&& statesOfApplicability.edges
|
|
||||||
.map(edge => edge.node)
|
|
||||||
.some(({ canDelete }) => canDelete);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
{snapshotId && <SnapshotBanner snapshotId={snapshotId} />}
|
{snapshotId && <SnapshotBanner snapshotId={snapshotId} />}
|
||||||
@@ -123,16 +141,14 @@ export default function StatesOfApplicabilityPage({
|
|||||||
<Th>{__("Name")}</Th>
|
<Th>{__("Name")}</Th>
|
||||||
<Th>{__("Created at")}</Th>
|
<Th>{__("Created at")}</Th>
|
||||||
<Th>{__("Controls")}</Th>
|
<Th>{__("Controls")}</Th>
|
||||||
{hasAnyAction && <Th>{__("Actions")}</Th>}
|
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
<Tbody>
|
<Tbody>
|
||||||
{statesOfApplicability.edges.map(edge => (
|
{statesOfApplicability.edges.map(edge => (
|
||||||
<StateOfApplicabilityRow
|
<StateOfApplicabilityRow
|
||||||
key={edge.node.id}
|
key={edge.node.id}
|
||||||
stateOfApplicability={edge.node}
|
fKey={edge.node}
|
||||||
connectionId={statesOfApplicability.__id}
|
connectionId={statesOfApplicability.__id}
|
||||||
hasAnyAction={hasAnyAction}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Tbody>
|
</Tbody>
|
||||||
@@ -170,56 +186,3 @@ export default function StatesOfApplicabilityPage({
|
|||||||
</div>
|
</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";
|
} from "@probo/ui";
|
||||||
import type { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
|
import { graphql } from "react-relay";
|
||||||
import { useNavigate } from "react-router";
|
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 { PeopleSelectField } from "#/components/form/PeopleSelectField";
|
||||||
import { createStateOfApplicabilityMutation } from "#/hooks/graph/StateOfApplicabilityGraph";
|
|
||||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
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 = {
|
type Props = {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
connectionId: string;
|
connectionId: string;
|
||||||
@@ -48,9 +70,9 @@ export function CreateStateOfApplicabilityDialog({
|
|||||||
);
|
);
|
||||||
const ref = useDialogRef();
|
const ref = useDialogRef();
|
||||||
|
|
||||||
const [mutate, isMutating]
|
const [createStateOfApplicability, isCreating]
|
||||||
= useMutationWithToasts<StateOfApplicabilityGraphCreateMutation>(
|
= useMutationWithToasts<CreateStateOfApplicabilityDialogMutation>(
|
||||||
createStateOfApplicabilityMutation,
|
createMutation,
|
||||||
{
|
{
|
||||||
successMessage: __(
|
successMessage: __(
|
||||||
"State of applicability created successfully.",
|
"State of applicability created successfully.",
|
||||||
@@ -60,7 +82,7 @@ export function CreateStateOfApplicabilityDialog({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const onSubmit = async (data: z.infer<typeof schema>) => {
|
const onSubmit = async (data: z.infer<typeof schema>) => {
|
||||||
await mutate({
|
await createStateOfApplicability({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
name: data.name,
|
name: data.name,
|
||||||
@@ -114,7 +136,7 @@ export function CreateStateOfApplicabilityDialog({
|
|||||||
</Field>
|
</Field>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<Button disabled={isMutating} type="submit">
|
<Button disabled={isCreating} type="submit">
|
||||||
{__("Create")}
|
{__("Create")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
|
|||||||
@@ -19,25 +19,21 @@ import { z } from "zod";
|
|||||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||||
|
|
||||||
const linkControlMutation = graphql`
|
const updateApplicabilityStatementMutation = graphql`
|
||||||
mutation EditControlDialogLinkMutation($input: CreateStateOfApplicabilityControlMappingInput!) {
|
mutation EditControlDialogUpdateMutation($input: UpdateApplicabilityStatementInput!) {
|
||||||
createStateOfApplicabilityControlMapping(input: $input) {
|
updateApplicabilityStatement(input: $input) {
|
||||||
stateOfApplicabilityControlEdge {
|
applicabilityStatement {
|
||||||
node {
|
id
|
||||||
stateOfApplicabilityId
|
|
||||||
controlId
|
|
||||||
applicability
|
applicability
|
||||||
justification
|
justification
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export type EditControlDialogRef = {
|
export type EditControlDialogRef = {
|
||||||
open: (control: {
|
open: (control: {
|
||||||
stateOfApplicabilityId: string;
|
applicabilityStatementId: string;
|
||||||
controlId: string;
|
|
||||||
sectionTitle: string;
|
sectionTitle: string;
|
||||||
name: string;
|
name: string;
|
||||||
frameworkName: string;
|
frameworkName: string;
|
||||||
@@ -51,13 +47,11 @@ const schema = z.object({
|
|||||||
justification: z.string().optional(),
|
justification: z.string().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?: () => void }>(
|
export const EditControlDialog = forwardRef<EditControlDialogRef>((_props, ref) => {
|
||||||
({ onSuccess }, ref) => {
|
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const dialogRef = useDialogRef();
|
const dialogRef = useDialogRef();
|
||||||
const [control, setControl] = useState<{
|
const [control, setControl] = useState<{
|
||||||
stateOfApplicabilityId: string;
|
applicabilityStatementId: string;
|
||||||
controlId: string;
|
|
||||||
sectionTitle: string;
|
sectionTitle: string;
|
||||||
name: string;
|
name: string;
|
||||||
frameworkName: string;
|
frameworkName: string;
|
||||||
@@ -65,10 +59,13 @@ export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?:
|
|||||||
justification: string | null;
|
justification: string | null;
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
const [linkMutate, isLinking] = useMutationWithToasts(linkControlMutation, {
|
const [updateApplicabilityStatement, isUpdating] = useMutationWithToasts(
|
||||||
successMessage: __("Control updated successfully."),
|
updateApplicabilityStatementMutation,
|
||||||
errorMessage: __("Failed to update control"),
|
{
|
||||||
});
|
successMessage: __("Statement updated successfully."),
|
||||||
|
errorMessage: __("Failed to update statement"),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const { register, handleSubmit, setValue, watch } = useFormWithSchema(schema, {
|
const { register, handleSubmit, setValue, watch } = useFormWithSchema(schema, {
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
@@ -90,11 +87,10 @@ export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?:
|
|||||||
const onSubmit = async (data: z.infer<typeof schema>) => {
|
const onSubmit = async (data: z.infer<typeof schema>) => {
|
||||||
if (!control) return;
|
if (!control) return;
|
||||||
|
|
||||||
await linkMutate({
|
await updateApplicabilityStatement({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
stateOfApplicabilityId: control.stateOfApplicabilityId,
|
applicabilityStatementId: control.applicabilityStatementId,
|
||||||
controlId: control.controlId,
|
|
||||||
applicability: data.applicability,
|
applicability: data.applicability,
|
||||||
justification: !data.applicability ? data.justification || null : null,
|
justification: !data.applicability ? data.justification || null : null,
|
||||||
},
|
},
|
||||||
@@ -102,13 +98,6 @@ export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?:
|
|||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
dialogRef.current?.close();
|
dialogRef.current?.close();
|
||||||
setControl(null);
|
setControl(null);
|
||||||
onSuccess?.();
|
|
||||||
},
|
|
||||||
updater: (store) => {
|
|
||||||
const stateOfApplicability = store.get(control.stateOfApplicabilityId);
|
|
||||||
if (stateOfApplicability) {
|
|
||||||
stateOfApplicability.invalidateRecord();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -117,11 +106,9 @@ export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?:
|
|||||||
<Dialog
|
<Dialog
|
||||||
ref={dialogRef}
|
ref={dialogRef}
|
||||||
className="max-w-lg"
|
className="max-w-lg"
|
||||||
title={(
|
title={
|
||||||
<Breadcrumb
|
<Breadcrumb items={[__("States of Applicability"), __("Edit Statement")]} />
|
||||||
items={[__("States of Applicability"), __("Edit Control")]}
|
}
|
||||||
/>
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
{control
|
{control
|
||||||
? (
|
? (
|
||||||
@@ -133,7 +120,9 @@ export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?:
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Badge size="md">{control.sectionTitle}</Badge>
|
<Badge size="md">{control.sectionTitle}</Badge>
|
||||||
<span className="text-base font-medium text-txt-primary">{control.name}</span>
|
<span className="text-base font-medium text-txt-primary">
|
||||||
|
{control.name}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -141,7 +130,8 @@ export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?:
|
|||||||
<Select
|
<Select
|
||||||
variant="editor"
|
variant="editor"
|
||||||
value={applicability ? "yes" : "no"}
|
value={applicability ? "yes" : "no"}
|
||||||
onValueChange={value => setValue("applicability", value === "yes")}
|
onValueChange={value =>
|
||||||
|
setValue("applicability", value === "yes")}
|
||||||
>
|
>
|
||||||
<Option value="yes">{__("Yes")}</Option>
|
<Option value="yes">{__("Yes")}</Option>
|
||||||
<Option value="no">{__("No")}</Option>
|
<Option value="no">{__("No")}</Option>
|
||||||
@@ -166,7 +156,7 @@ export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?:
|
|||||||
>
|
>
|
||||||
{__("Cancel")}
|
{__("Cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit" disabled={isLinking}>
|
<Button type="submit" disabled={isUpdating}>
|
||||||
{__("Save")}
|
{__("Save")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
@@ -175,5 +165,4 @@ export const EditControlDialog = forwardRef<EditControlDialogRef, { onSuccess?:
|
|||||||
: null}
|
: null}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
|||||||
@@ -23,20 +23,39 @@ import { graphql, useLazyLoadQuery } from "react-relay";
|
|||||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||||
|
|
||||||
const linkControlQuery = graphql`
|
const linkControlQuery = graphql`
|
||||||
query LinkControlDialogQuery($stateOfApplicabilityId: ID!) {
|
query LinkControlDialogQuery($stateOfApplicabilityId: ID!, $organizationId: ID!) {
|
||||||
node(id: $stateOfApplicabilityId) {
|
stateOfApplicability: node(id: $stateOfApplicabilityId) {
|
||||||
... on StateOfApplicability {
|
... on StateOfApplicability {
|
||||||
id
|
id
|
||||||
availableControls {
|
applicabilityStatements(first: 10000) {
|
||||||
controlId
|
edges {
|
||||||
sectionTitle
|
node {
|
||||||
name
|
id
|
||||||
frameworkId
|
|
||||||
frameworkName
|
|
||||||
organizationId
|
|
||||||
stateOfApplicabilityId
|
|
||||||
applicability
|
applicability
|
||||||
justification
|
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`
|
const linkControlMutation = graphql`
|
||||||
mutation LinkControlDialogLinkMutation($input: CreateStateOfApplicabilityControlMappingInput!) {
|
mutation LinkControlDialogLinkMutation($input: CreateApplicabilityStatementInput!) {
|
||||||
createStateOfApplicabilityControlMapping(input: $input) {
|
createApplicabilityStatement(input: $input) {
|
||||||
stateOfApplicabilityControlEdge {
|
applicabilityStatementEdge {
|
||||||
node {
|
node {
|
||||||
stateOfApplicabilityId
|
id
|
||||||
controlId
|
|
||||||
applicability
|
applicability
|
||||||
justification
|
justification
|
||||||
|
control {
|
||||||
|
id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,17 +80,15 @@ const linkControlMutation = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const unlinkControlMutation = graphql`
|
const unlinkControlMutation = graphql`
|
||||||
mutation LinkControlDialogUnlinkMutation($input: DeleteStateOfApplicabilityControlMappingInput!) {
|
mutation LinkControlDialogUnlinkMutation($input: DeleteApplicabilityStatementInput!) {
|
||||||
deleteStateOfApplicabilityControlMapping(input: $input) {
|
deleteApplicabilityStatement(input: $input) {
|
||||||
deletedStateOfApplicabilityId
|
deletedApplicabilityStatementId
|
||||||
deletedControlId
|
|
||||||
deletedStateOfApplicabilityControlId
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export type LinkControlDialogRef = {
|
export type LinkControlDialogRef = {
|
||||||
open: (stateOfApplicabilityId: string, onUpdate?: () => void) => void;
|
open: (stateOfApplicabilityId: string, organizationId: string, onUpdate?: () => void) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Control = {
|
type Control = {
|
||||||
@@ -78,8 +97,7 @@ type Control = {
|
|||||||
name: string;
|
name: string;
|
||||||
frameworkId: string;
|
frameworkId: string;
|
||||||
frameworkName: string;
|
frameworkName: string;
|
||||||
organizationId: string;
|
applicabilityStatementId: string | null;
|
||||||
stateOfApplicabilityId: string | null;
|
|
||||||
applicability: boolean | null;
|
applicability: boolean | null;
|
||||||
justification: string | null;
|
justification: string | null;
|
||||||
};
|
};
|
||||||
@@ -119,11 +137,11 @@ function ControlRow({
|
|||||||
setSelectedState(newState);
|
setSelectedState(newState);
|
||||||
|
|
||||||
if (newState === "not-linked") {
|
if (newState === "not-linked") {
|
||||||
|
if (!control.applicabilityStatementId) return;
|
||||||
await unlinkMutate({
|
await unlinkMutate({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
stateOfApplicabilityId,
|
applicabilityStatementId: control.applicabilityStatementId,
|
||||||
controlId: control.controlId,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
@@ -227,9 +245,11 @@ function ControlRow({
|
|||||||
|
|
||||||
function LinkControlDialogContent({
|
function LinkControlDialogContent({
|
||||||
stateOfApplicabilityId,
|
stateOfApplicabilityId,
|
||||||
|
organizationId,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
}: {
|
}: {
|
||||||
stateOfApplicabilityId: string;
|
stateOfApplicabilityId: string;
|
||||||
|
organizationId: string;
|
||||||
onUpdate?: () => void;
|
onUpdate?: () => void;
|
||||||
}) {
|
}) {
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
@@ -237,25 +257,80 @@ function LinkControlDialogContent({
|
|||||||
const [collapsedFrameworks, setCollapsedFrameworks] = useState<Set<string>>(new Set());
|
const [collapsedFrameworks, setCollapsedFrameworks] = useState<Set<string>>(new Set());
|
||||||
const data = useLazyLoadQuery(
|
const data = useLazyLoadQuery(
|
||||||
linkControlQuery,
|
linkControlQuery,
|
||||||
{ stateOfApplicabilityId },
|
{ stateOfApplicabilityId, organizationId },
|
||||||
{ fetchPolicy: "store-or-network" },
|
{ fetchPolicy: "store-or-network" },
|
||||||
) as {
|
) as {
|
||||||
|
stateOfApplicability: {
|
||||||
|
id: string;
|
||||||
|
applicabilityStatements?: {
|
||||||
|
edges: Array<{
|
||||||
node: {
|
node: {
|
||||||
availableControls?: Control[];
|
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;
|
} | 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 filteredControls = useMemo(() => {
|
||||||
const controls = data.node?.availableControls || [];
|
if (!search) return allControls;
|
||||||
if (!search) return controls;
|
|
||||||
const lowerSearch = search.toLowerCase();
|
const lowerSearch = search.toLowerCase();
|
||||||
return controls.filter(
|
return allControls.filter(
|
||||||
c =>
|
c =>
|
||||||
c.name.toLowerCase().includes(lowerSearch)
|
c.name.toLowerCase().includes(lowerSearch)
|
||||||
|| c.sectionTitle.toLowerCase().includes(lowerSearch)
|
|| c.sectionTitle.toLowerCase().includes(lowerSearch)
|
||||||
|| c.frameworkName.toLowerCase().includes(lowerSearch),
|
|| c.frameworkName.toLowerCase().includes(lowerSearch),
|
||||||
);
|
);
|
||||||
}, [data.node?.availableControls, search]);
|
}, [allControls, search]);
|
||||||
|
|
||||||
const groupedControls = useMemo(() => {
|
const groupedControls = useMemo(() => {
|
||||||
const groups: Record<string, Record<string, Control[]>> = {};
|
const groups: Record<string, Record<string, Control[]>> = {};
|
||||||
@@ -321,7 +396,7 @@ function LinkControlDialogContent({
|
|||||||
key={control.controlId}
|
key={control.controlId}
|
||||||
control={control}
|
control={control}
|
||||||
stateOfApplicabilityId={stateOfApplicabilityId}
|
stateOfApplicabilityId={stateOfApplicabilityId}
|
||||||
isLinked={control.stateOfApplicabilityId !== null}
|
isLinked={control.applicabilityStatementId !== null}
|
||||||
onUpdate={onUpdate}
|
onUpdate={onUpdate}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@@ -342,11 +417,13 @@ export const LinkControlDialog = forwardRef<LinkControlDialogRef>((_props, ref)
|
|||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const dialogRef = useDialogRef();
|
const dialogRef = useDialogRef();
|
||||||
const [stateOfApplicabilityId, setStateOfApplicabilityId] = useState<string | null>(null);
|
const [stateOfApplicabilityId, setStateOfApplicabilityId] = useState<string | null>(null);
|
||||||
|
const [organizationId, setOrganizationId] = useState<string | null>(null);
|
||||||
const [onUpdateCallback, setOnUpdateCallback] = useState<(() => void) | undefined>(undefined);
|
const [onUpdateCallback, setOnUpdateCallback] = useState<(() => void) | undefined>(undefined);
|
||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
open: (soaId: string, callback?: () => void) => {
|
open: (soaId: string, orgId: string, callback?: () => void) => {
|
||||||
setStateOfApplicabilityId(soaId);
|
setStateOfApplicabilityId(soaId);
|
||||||
|
setOrganizationId(orgId);
|
||||||
setOnUpdateCallback(() => callback);
|
setOnUpdateCallback(() => callback);
|
||||||
dialogRef.current?.open();
|
dialogRef.current?.open();
|
||||||
},
|
},
|
||||||
@@ -354,6 +431,7 @@ export const LinkControlDialog = forwardRef<LinkControlDialogRef>((_props, ref)
|
|||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
setStateOfApplicabilityId(null);
|
setStateOfApplicabilityId(null);
|
||||||
|
setOrganizationId(null);
|
||||||
setOnUpdateCallback(undefined);
|
setOnUpdateCallback(undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -368,7 +446,7 @@ export const LinkControlDialog = forwardRef<LinkControlDialogRef>((_props, ref)
|
|||||||
)}
|
)}
|
||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
>
|
>
|
||||||
{stateOfApplicabilityId
|
{stateOfApplicabilityId && organizationId
|
||||||
? (
|
? (
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={(
|
fallback={(
|
||||||
@@ -379,6 +457,7 @@ export const LinkControlDialog = forwardRef<LinkControlDialogRef>((_props, ref)
|
|||||||
>
|
>
|
||||||
<LinkControlDialogContent
|
<LinkControlDialogContent
|
||||||
stateOfApplicabilityId={stateOfApplicabilityId}
|
stateOfApplicabilityId={stateOfApplicabilityId}
|
||||||
|
organizationId={organizationId}
|
||||||
onUpdate={onUpdateCallback}
|
onUpdate={onUpdateCallback}
|
||||||
/>
|
/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@@ -14,63 +14,76 @@ import {
|
|||||||
Thead,
|
Thead,
|
||||||
Tr,
|
Tr,
|
||||||
} from "@probo/ui";
|
} from "@probo/ui";
|
||||||
import { Suspense, useMemo, useRef } from "react";
|
import { Suspense, useRef } from "react";
|
||||||
import { graphql, useRefetchableFragment } from "react-relay";
|
import { graphql, useFragment } from "react-relay";
|
||||||
|
|
||||||
import type { StateOfApplicabilityControlsTabFragment$key } from "#/__generated__/core/StateOfApplicabilityControlsTabFragment.graphql";
|
import type { StateOfApplicabilityControlsTabFragment$key } from "#/__generated__/core/StateOfApplicabilityControlsTabFragment.graphql";
|
||||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||||
|
|
||||||
|
import {
|
||||||
|
AddApplicabilityStatementDialog,
|
||||||
|
type AddApplicabilityStatementDialogRef,
|
||||||
|
} from "../dialogs/AddApplicabilityStatementDialog";
|
||||||
import {
|
import {
|
||||||
EditControlDialog,
|
EditControlDialog,
|
||||||
type EditControlDialogRef,
|
type EditControlDialogRef,
|
||||||
} from "../dialogs/EditControlDialog";
|
} from "../dialogs/EditControlDialog";
|
||||||
import {
|
|
||||||
LinkControlDialog,
|
|
||||||
type LinkControlDialogRef,
|
|
||||||
} from "../dialogs/LinkControlDialog";
|
|
||||||
|
|
||||||
export const controlsFragment = graphql`
|
export const controlsFragment = graphql`
|
||||||
fragment StateOfApplicabilityControlsTabFragment on StateOfApplicability
|
fragment StateOfApplicabilityControlsTabFragment on StateOfApplicability {
|
||||||
@refetchable(queryName: "StateOfApplicabilityControlsTabRefetchQuery") {
|
id
|
||||||
|
organization {
|
||||||
id
|
id
|
||||||
controlsInfo: controls(first: 0) {
|
|
||||||
totalCount
|
|
||||||
}
|
}
|
||||||
|
|
||||||
canCreateStateOfApplicabilityControlMapping: permission(
|
canCreateApplicabilityStatement: permission(
|
||||||
action: "core:state-of-applicability-control-mapping:create"
|
action: "core:applicability-statement:create"
|
||||||
)
|
)
|
||||||
canDeleteStateOfApplicabilityControlMapping: permission(
|
canUpdateApplicabilityStatement: permission(
|
||||||
action: "core:state-of-applicability-control-mapping:delete"
|
action: "core:applicability-statement:update"
|
||||||
|
)
|
||||||
|
canDeleteApplicabilityStatement: permission(
|
||||||
|
action: "core:applicability-statement:delete"
|
||||||
)
|
)
|
||||||
|
|
||||||
availableControls {
|
applicabilityStatements(first: 1000, orderBy: { direction: ASC, field: CREATED_AT })
|
||||||
controlId
|
@connection(key: "StateOfApplicabilityControlsTab_applicabilityStatements") {
|
||||||
sectionTitle
|
__id
|
||||||
name
|
edges {
|
||||||
frameworkId
|
node {
|
||||||
frameworkName
|
id
|
||||||
organizationId
|
|
||||||
stateOfApplicabilityId
|
|
||||||
applicability
|
applicability
|
||||||
justification
|
justification
|
||||||
|
control {
|
||||||
|
id
|
||||||
|
sectionTitle
|
||||||
|
name
|
||||||
bestPractice
|
bestPractice
|
||||||
regulatory
|
regulatory
|
||||||
contractual
|
contractual
|
||||||
riskAssessment
|
riskAssessment
|
||||||
|
framework {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
organization {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const unlinkControlMutation = graphql`
|
const deleteApplicabilityStatementMutation = graphql`
|
||||||
mutation StateOfApplicabilityControlsTabUnlinkMutation(
|
mutation StateOfApplicabilityControlsTabDeleteMutation(
|
||||||
$input: DeleteStateOfApplicabilityControlMappingInput!
|
$input: DeleteApplicabilityStatementInput!
|
||||||
|
$connections: [ID!]!
|
||||||
) {
|
) {
|
||||||
deleteStateOfApplicabilityControlMapping(input: $input) {
|
deleteApplicabilityStatement(input: $input) {
|
||||||
deletedStateOfApplicabilityId
|
deletedApplicabilityStatementId @deleteEdge(connections: $connections)
|
||||||
deletedControlId
|
|
||||||
deletedStateOfApplicabilityControlId
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -85,43 +98,51 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
isSnapshotMode?: boolean;
|
isSnapshotMode?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [data, refetch] = useRefetchableFragment(
|
const data = useFragment(controlsFragment, stateOfApplicability);
|
||||||
controlsFragment,
|
|
||||||
stateOfApplicability,
|
|
||||||
);
|
|
||||||
const organizationId = useOrganizationId();
|
const organizationId = useOrganizationId();
|
||||||
const manageDialogRef = useRef<LinkControlDialogRef>(null);
|
const addStatementDialogRef = useRef<AddApplicabilityStatementDialogRef>(null);
|
||||||
const editDialogRef = useRef<EditControlDialogRef>(null);
|
const editDialogRef = useRef<EditControlDialogRef>(null);
|
||||||
|
|
||||||
const linkedControls = useMemo(
|
const connectionId = data.applicabilityStatements?.__id;
|
||||||
() =>
|
|
||||||
(data.availableControls || []).filter(
|
|
||||||
c => c.stateOfApplicabilityId !== null,
|
|
||||||
),
|
|
||||||
[data.availableControls],
|
|
||||||
);
|
|
||||||
|
|
||||||
const [unlinkControl, isUnlinking] = useMutationWithToasts(
|
const linkedControls = (data.applicabilityStatements?.edges || []).map(edge => ({
|
||||||
unlinkControlMutation,
|
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."),
|
successMessage: __("Statement removed successfully."),
|
||||||
errorMessage: __("Failed to remove control"),
|
errorMessage: __("Failed to remove statement"),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const canLink
|
const canCreate
|
||||||
= !isSnapshotMode && data.canCreateStateOfApplicabilityControlMapping;
|
= !isSnapshotMode && data.canCreateApplicabilityStatement;
|
||||||
const canUnlink
|
const canUpdate
|
||||||
= !isSnapshotMode && data.canDeleteStateOfApplicabilityControlMapping;
|
= !isSnapshotMode && data.canUpdateApplicabilityStatement;
|
||||||
|
const canDelete
|
||||||
|
= !isSnapshotMode && data.canDeleteApplicabilityStatement;
|
||||||
|
|
||||||
const handleOpenManageDialog = () => {
|
const handleOpenAddStatementDialog = () => {
|
||||||
manageDialogRef.current?.open(data.id, () => {
|
if (!data.organization || !connectionId) return;
|
||||||
refetch({}, { fetchPolicy: "store-and-network" });
|
addStatementDialogRef.current?.open(data.id, data.organization.id, connectionId);
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOpenEditDialog = (control: {
|
const handleOpenEditDialog = (control: {
|
||||||
controlId: string;
|
applicabilityStatementId: string;
|
||||||
sectionTitle: string;
|
sectionTitle: string;
|
||||||
name: string;
|
name: string;
|
||||||
frameworkName: string;
|
frameworkName: string;
|
||||||
@@ -129,8 +150,7 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
justification: string | null;
|
justification: string | null;
|
||||||
}) => {
|
}) => {
|
||||||
editDialogRef.current?.open({
|
editDialogRef.current?.open({
|
||||||
stateOfApplicabilityId: data.id,
|
applicabilityStatementId: control.applicabilityStatementId,
|
||||||
controlId: control.controlId,
|
|
||||||
sectionTitle: control.sectionTitle,
|
sectionTitle: control.sectionTitle,
|
||||||
name: control.name,
|
name: control.name,
|
||||||
frameworkName: control.frameworkName,
|
frameworkName: control.frameworkName,
|
||||||
@@ -139,16 +159,14 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUnlink = async (controlId: string) => {
|
const handleDelete = async (applicabilityStatementId: string) => {
|
||||||
await unlinkControl({
|
if (!connectionId) return;
|
||||||
|
await deleteApplicabilityStatement({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
stateOfApplicabilityId: data.id,
|
applicabilityStatementId,
|
||||||
controlId,
|
|
||||||
},
|
},
|
||||||
},
|
connections: [connectionId],
|
||||||
onSuccess: () => {
|
|
||||||
refetch({}, { fetchPolicy: "network-only" });
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -156,13 +174,13 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{canLink && (
|
{canCreate && (
|
||||||
<div className="flex justify-end">
|
<div className="flex justify-end">
|
||||||
<Button
|
<Button
|
||||||
icon={IconPlusLarge}
|
icon={IconPlusLarge}
|
||||||
onClick={handleOpenManageDialog}
|
onClick={handleOpenAddStatementDialog}
|
||||||
>
|
>
|
||||||
{__("Add Controls")}
|
{__("Create Statement")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -188,7 +206,7 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
<Th className="w-36 text-center">
|
<Th className="w-36 text-center">
|
||||||
{__("Risk Assessment")}
|
{__("Risk Assessment")}
|
||||||
</Th>
|
</Th>
|
||||||
{(canLink || canUnlink) && (
|
{(canUpdate || canDelete) && (
|
||||||
<Th className="w-12"></Th>
|
<Th className="w-12"></Th>
|
||||||
)}
|
)}
|
||||||
</Tr>
|
</Tr>
|
||||||
@@ -197,7 +215,7 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
{linkedControls.length === 0 && (
|
{linkedControls.length === 0 && (
|
||||||
<Tr>
|
<Tr>
|
||||||
<Td
|
<Td
|
||||||
colSpan={canLink || canUnlink ? 9 : 8}
|
colSpan={canUpdate || canDelete ? 9 : 8}
|
||||||
className="text-center text-txt-secondary py-12"
|
className="text-center text-txt-secondary py-12"
|
||||||
>
|
>
|
||||||
{__("No controls linked")}
|
{__("No controls linked")}
|
||||||
@@ -319,10 +337,10 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
</Td>
|
</Td>
|
||||||
{(canLink || canUnlink) && (
|
{(canUpdate || canDelete) && (
|
||||||
<Td noLink className="text-end">
|
<Td noLink className="text-end">
|
||||||
<ActionDropdown>
|
<ActionDropdown>
|
||||||
{canLink && (
|
{canUpdate && control.applicabilityStatementId && (
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
icon={IconPencil}
|
icon={IconPencil}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
@@ -331,15 +349,22 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
if (
|
if (
|
||||||
typeof control.applicability
|
typeof control.applicability
|
||||||
=== "boolean"
|
=== "boolean"
|
||||||
|
&& control.applicabilityStatementId
|
||||||
) {
|
) {
|
||||||
handleOpenEditDialog(
|
handleOpenEditDialog(
|
||||||
{
|
{
|
||||||
controlId: control.controlId,
|
applicabilityStatementId:
|
||||||
sectionTitle: control.sectionTitle,
|
control.applicabilityStatementId,
|
||||||
|
sectionTitle:
|
||||||
|
control.sectionTitle,
|
||||||
name: control.name,
|
name: control.name,
|
||||||
frameworkName: control.frameworkName,
|
frameworkName:
|
||||||
applicability: control.applicability,
|
control.frameworkName,
|
||||||
justification: control.justification ?? null,
|
applicability:
|
||||||
|
control.applicability,
|
||||||
|
justification:
|
||||||
|
control.justification
|
||||||
|
?? null,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -348,16 +373,20 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
{__("Edit")}
|
{__("Edit")}
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
)}
|
)}
|
||||||
{canUnlink && (
|
{canDelete && control.applicabilityStatementId && (
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
icon={IconTrashCan}
|
icon={IconTrashCan}
|
||||||
variant="danger"
|
variant="danger"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
void handleUnlink(control.controlId);
|
if (control.applicabilityStatementId) {
|
||||||
|
void handleDelete(
|
||||||
|
control.applicabilityStatementId,
|
||||||
|
);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
disabled={isUnlinking}
|
disabled={isDeleting}
|
||||||
>
|
>
|
||||||
{__("Remove")}
|
{__("Remove")}
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
@@ -372,13 +401,8 @@ export default function StateOfApplicabilityControlsTab({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<LinkControlDialog ref={manageDialogRef} />
|
<AddApplicabilityStatementDialog ref={addStatementDialogRef} />
|
||||||
<EditControlDialog
|
<EditControlDialog ref={editDialogRef} />
|
||||||
ref={editDialogRef}
|
|
||||||
onSuccess={() => {
|
|
||||||
refetch({}, { fetchPolicy: "network-only" });
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Suspense>
|
</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 { lazy } from "@probo/react-lazy";
|
||||||
import { type AppRoute, loaderFromQueryLoader, withQueryRef } from "@probo/routes";
|
import type { AppRoute } from "@probo/routes";
|
||||||
import { loadQuery } from "react-relay";
|
|
||||||
|
|
||||||
import type { StateOfApplicabilityGraphNodeQuery } from "#/__generated__/core/StateOfApplicabilityGraphNodeQuery.graphql";
|
|
||||||
import type { StateOfApplicabilityGraphPaginatedQuery } from "#/__generated__/core/StateOfApplicabilityGraphPaginatedQuery.graphql";
|
|
||||||
import { PageSkeleton } from "#/components/skeletons/PageSkeleton.tsx";
|
import { PageSkeleton } from "#/components/skeletons/PageSkeleton.tsx";
|
||||||
import { coreEnvironment } from "#/environments";
|
|
||||||
import {
|
|
||||||
paginatedStateOfApplicabilityQuery,
|
|
||||||
stateOfApplicabilityNodeQuery,
|
|
||||||
} from "#/hooks/graph/StateOfApplicabilityGraph";
|
|
||||||
|
|
||||||
export const statesOfApplicabilityRoutes = [
|
export const statesOfApplicabilityRoutes = [
|
||||||
{
|
{
|
||||||
path: "states-of-applicability",
|
path: "states-of-applicability",
|
||||||
Fallback: PageSkeleton,
|
Fallback: PageSkeleton,
|
||||||
loader: loaderFromQueryLoader(({ organizationId }) =>
|
Component: lazy(
|
||||||
loadQuery<StateOfApplicabilityGraphPaginatedQuery>(
|
() => import("#/pages/organizations/states-of-applicability/StatesOfApplicabilityPageLoader"),
|
||||||
coreEnvironment,
|
|
||||||
paginatedStateOfApplicabilityQuery,
|
|
||||||
{ organizationId: organizationId },
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Component: withQueryRef(
|
|
||||||
lazy(() => import("#/pages/organizations/states-of-applicability/StatesOfApplicabilityPage")),
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "snapshots/:snapshotId/states-of-applicability",
|
path: "snapshots/:snapshotId/states-of-applicability",
|
||||||
Fallback: PageSkeleton,
|
Fallback: PageSkeleton,
|
||||||
loader: loaderFromQueryLoader(({ organizationId }) =>
|
Component: lazy(
|
||||||
loadQuery<StateOfApplicabilityGraphPaginatedQuery>(
|
() => import("#/pages/organizations/states-of-applicability/StatesOfApplicabilityPageLoader"),
|
||||||
coreEnvironment,
|
|
||||||
paginatedStateOfApplicabilityQuery,
|
|
||||||
{ organizationId: organizationId },
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Component: withQueryRef(
|
|
||||||
lazy(() => import("#/pages/organizations/states-of-applicability/StatesOfApplicabilityPage")),
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "states-of-applicability/:stateOfApplicabilityId",
|
path: "states-of-applicability/:stateOfApplicabilityId",
|
||||||
Fallback: PageSkeleton,
|
Fallback: PageSkeleton,
|
||||||
loader: loaderFromQueryLoader(({ stateOfApplicabilityId }) =>
|
Component: lazy(
|
||||||
loadQuery<StateOfApplicabilityGraphNodeQuery>(
|
() => import("#/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPageLoader"),
|
||||||
coreEnvironment,
|
|
||||||
stateOfApplicabilityNodeQuery,
|
|
||||||
{ stateOfApplicabilityId: stateOfApplicabilityId },
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Component: withQueryRef(
|
|
||||||
lazy(() => import("#/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPage")),
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "snapshots/:snapshotId/states-of-applicability/:stateOfApplicabilityId",
|
path: "snapshots/:snapshotId/states-of-applicability/:stateOfApplicabilityId",
|
||||||
Fallback: PageSkeleton,
|
Fallback: PageSkeleton,
|
||||||
loader: loaderFromQueryLoader(({ stateOfApplicabilityId }) =>
|
Component: lazy(
|
||||||
loadQuery<StateOfApplicabilityGraphNodeQuery>(
|
() => import("#/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPageLoader"),
|
||||||
coreEnvironment,
|
|
||||||
stateOfApplicabilityNodeQuery,
|
|
||||||
{ stateOfApplicabilityId: stateOfApplicabilityId },
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Component: withQueryRef(
|
|
||||||
lazy(() => import("#/pages/organizations/states-of-applicability/StateOfApplicabilityDetailPage")),
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
] satisfies AppRoute[];
|
] satisfies AppRoute[];
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
StateOfApplicabilityControl struct {
|
ApplicabilityStatement struct {
|
||||||
ID gid.GID `db:"id"`
|
ID gid.GID `db:"id"`
|
||||||
StateOfApplicabilityID gid.GID `db:"state_of_applicability_id"`
|
StateOfApplicabilityID gid.GID `db:"state_of_applicability_id"`
|
||||||
ControlID gid.GID `db:"control_id"`
|
ControlID gid.GID `db:"control_id"`
|
||||||
@@ -41,53 +41,80 @@ type (
|
|||||||
UpdatedAt time.Time `db:"updated_at"`
|
UpdatedAt time.Time `db:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
StateOfApplicabilityControls []*StateOfApplicabilityControl
|
ApplicabilityStatements []*ApplicabilityStatement
|
||||||
|
|
||||||
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
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s StateOfApplicabilityControl) CursorKey(orderBy StateOfApplicabilityOrderField) page.CursorKey {
|
func (s ApplicabilityStatement) CursorKey(orderBy ApplicabilityStatementOrderField) page.CursorKey {
|
||||||
switch orderBy {
|
switch orderBy {
|
||||||
case StateOfApplicabilityOrderFieldName:
|
case ApplicabilityStatementOrderFieldCreatedAt:
|
||||||
return page.NewCursorKey(s.ID, s.StateOfApplicabilityID)
|
|
||||||
case StateOfApplicabilityOrderFieldCreatedAt:
|
|
||||||
return page.NewCursorKey(s.ID, s.CreatedAt)
|
return page.NewCursorKey(s.ID, s.CreatedAt)
|
||||||
}
|
}
|
||||||
|
|
||||||
panic(fmt.Sprintf("unsupported order by: %s", orderBy))
|
panic(fmt.Sprintf("unsupported order by: %s", orderBy))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StateOfApplicabilityControl) AuthorizationAttributes(ctx context.Context, conn pg.Conn) (map[string]string, error) {
|
func (s *ApplicabilityStatement) 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;`
|
q := `SELECT organization_id FROM applicability_statements WHERE id = $1 LIMIT 1;`
|
||||||
|
|
||||||
var organizationID gid.GID
|
var organizationID gid.GID
|
||||||
if err := conn.QueryRow(ctx, q, s.ID).Scan(&organizationID); err != nil {
|
if err := conn.QueryRow(ctx, q, s.ID).Scan(&organizationID); err != nil {
|
||||||
if errors.Is(err, pgx.ErrNoRows) {
|
if errors.Is(err, pgx.ErrNoRows) {
|
||||||
return nil, ErrResourceNotFound
|
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
|
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,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
@@ -114,7 +141,7 @@ SELECT
|
|||||||
soac.created_at,
|
soac.created_at,
|
||||||
soac.updated_at
|
soac.updated_at
|
||||||
FROM
|
FROM
|
||||||
states_of_applicability_controls soac
|
applicability_statements soac
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
current_soa ON soac.state_of_applicability_id = current_soa.id
|
current_soa ON soac.state_of_applicability_id = current_soa.id
|
||||||
WHERE
|
WHERE
|
||||||
@@ -131,29 +158,29 @@ LIMIT 1;
|
|||||||
|
|
||||||
rows, err := conn.Query(ctx, q, args)
|
rows, err := conn.Query(ctx, q, args)
|
||||||
if err != nil {
|
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 err != nil {
|
||||||
if errors.Is(err, pgx.ErrNoRows) {
|
if errors.Is(err, pgx.ErrNoRows) {
|
||||||
return ErrResourceNotFound
|
return ErrResourceNotFound
|
||||||
}
|
}
|
||||||
return fmt.Errorf("cannot collect state of applicability control: %w", err)
|
return fmt.Errorf("cannot collect applicability statement: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
*sac = control
|
*sac = control
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sac *StateOfApplicabilityControl) Insert(
|
func (sac *ApplicabilityStatement) Insert(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
states_of_applicability_controls (
|
applicability_statements (
|
||||||
id,
|
id,
|
||||||
state_of_applicability_id,
|
state_of_applicability_id,
|
||||||
control_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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sac *StateOfApplicabilityControl) Update(
|
func (sac *ApplicabilityStatement) Update(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
UPDATE states_of_applicability_controls
|
UPDATE applicability_statements
|
||||||
SET
|
SET
|
||||||
applicability = @applicability,
|
applicability = @applicability,
|
||||||
justification = @justification,
|
justification = @justification,
|
||||||
@@ -236,70 +263,50 @@ WHERE
|
|||||||
|
|
||||||
_, err := conn.Exec(ctx, q, args)
|
_, err := conn.Exec(ctx, q, args)
|
||||||
if err != nil {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sac *StateOfApplicabilityControl) Upsert(
|
func (sac *ApplicabilityStatement) UpdateByID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
INSERT INTO
|
UPDATE applicability_statements
|
||||||
states_of_applicability_controls (
|
SET
|
||||||
id,
|
applicability = @applicability,
|
||||||
state_of_applicability_id,
|
justification = @justification,
|
||||||
control_id,
|
updated_at = @updated_at
|
||||||
organization_id,
|
WHERE
|
||||||
tenant_id,
|
%s
|
||||||
snapshot_id,
|
AND id = @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
|
|
||||||
`
|
`
|
||||||
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"id": sac.ID,
|
"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,
|
"applicability": sac.Applicability,
|
||||||
"justification": sac.Justification,
|
"justification": sac.Justification,
|
||||||
"created_at": sac.CreatedAt,
|
|
||||||
"updated_at": sac.UpdatedAt,
|
"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 {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sac *StateOfApplicabilityControl) Delete(
|
func (sac *ApplicabilityStatement) Delete(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
@@ -313,7 +320,7 @@ WITH current_soa AS (
|
|||||||
AND id = @state_of_applicability_id
|
AND id = @state_of_applicability_id
|
||||||
AND snapshot_id IS NULL
|
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)
|
WHERE state_of_applicability_id IN (SELECT id FROM current_soa)
|
||||||
AND control_id = @control_id;
|
AND control_id = @control_id;
|
||||||
`
|
`
|
||||||
@@ -329,11 +336,41 @@ WHERE state_of_applicability_id IN (SELECT id FROM current_soa)
|
|||||||
return err
|
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,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
stateOfApplicabilityID gid.GID,
|
stateOfApplicabilityID gid.GID,
|
||||||
|
cursor *page.Cursor[ApplicabilityStatementOrderField],
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
SELECT
|
SELECT
|
||||||
@@ -347,39 +384,68 @@ SELECT
|
|||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
states_of_applicability_controls
|
applicability_statements
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%[1]s
|
||||||
AND state_of_applicability_id = @state_of_applicability_id
|
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,
|
"state_of_applicability_id": stateOfApplicabilityID,
|
||||||
}
|
}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
maps.Copy(args, cursor.SQLArguments())
|
||||||
|
|
||||||
rows, err := conn.Query(ctx, q, args)
|
rows, err := conn.Query(ctx, q, args)
|
||||||
if err != nil {
|
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 {
|
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
|
*sacs = controls
|
||||||
return nil
|
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,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
cursor *page.Cursor[StateOfApplicabilityOrderField],
|
cursor *page.Cursor[ApplicabilityStatementOrderField],
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
WITH soac_ctrl AS (
|
WITH soac_ctrl AS (
|
||||||
@@ -395,7 +461,7 @@ WITH soac_ctrl AS (
|
|||||||
soac.updated_at,
|
soac.updated_at,
|
||||||
soac.tenant_id
|
soac.tenant_id
|
||||||
FROM
|
FROM
|
||||||
states_of_applicability_controls soac
|
applicability_statements soac
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
states_of_applicability soa ON soac.state_of_applicability_id = soa.id
|
states_of_applicability soa ON soac.state_of_applicability_id = soa.id
|
||||||
WHERE
|
WHERE
|
||||||
@@ -427,19 +493,19 @@ WHERE
|
|||||||
|
|
||||||
rows, err := conn.Query(ctx, q, args)
|
rows, err := conn.Query(ctx, q, args)
|
||||||
if err != nil {
|
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 {
|
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
|
*sacs = controls
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sacs *StateOfApplicabilityControls) CountByControlID(
|
func (sacs *ApplicabilityStatements) CountByControlID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
@@ -452,7 +518,7 @@ WITH soac_ctrl AS (
|
|||||||
soac.organization_id,
|
soac.organization_id,
|
||||||
soac.tenant_id
|
soac.tenant_id
|
||||||
FROM
|
FROM
|
||||||
states_of_applicability_controls soac
|
applicability_statements soac
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
states_of_applicability soa ON soac.state_of_applicability_id = soa.id
|
states_of_applicability soa ON soac.state_of_applicability_id = soa.id
|
||||||
WHERE
|
WHERE
|
||||||
@@ -482,126 +548,3 @@ WHERE
|
|||||||
|
|
||||||
return count, nil
|
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
|
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(
|
func (c Control) Insert(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
@@ -1098,7 +1146,7 @@ WITH ctrl AS (
|
|||||||
FROM
|
FROM
|
||||||
controls c
|
controls c
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
states_of_applicability_controls soac ON c.id = soac.control_id
|
applicability_statements soac ON c.id = soac.control_id
|
||||||
WHERE
|
WHERE
|
||||||
soac.state_of_applicability_id = @state_of_applicability_id
|
soac.state_of_applicability_id = @state_of_applicability_id
|
||||||
)
|
)
|
||||||
@@ -1124,74 +1172,3 @@ WHERE %s
|
|||||||
|
|
||||||
return count, nil
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type ControlObligationType struct {
|
func (cos *ControlObligations) CountByControlID(
|
||||||
ControlID gid.GID `db:"control_id"`
|
|
||||||
Type ObligationType `db:"type"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ControlObligationTypes []*ControlObligationType
|
|
||||||
|
|
||||||
func (cots *ControlObligationTypes) LoadTypesByControlIDs(
|
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
controlIDs []gid.GID,
|
controlID gid.GID,
|
||||||
) error {
|
filter *ControlObligationFilter,
|
||||||
|
) (int, error) {
|
||||||
q := `
|
q := `
|
||||||
WITH control_obls AS (
|
WITH control_obls AS (
|
||||||
SELECT
|
SELECT
|
||||||
@@ -191,31 +185,27 @@ WITH control_obls AS (
|
|||||||
INNER JOIN
|
INNER JOIN
|
||||||
obligations o ON co.obligation_id = o.id
|
obligations o ON co.obligation_id = o.id
|
||||||
WHERE
|
WHERE
|
||||||
co.control_id = ANY(@control_ids)
|
co.control_id = @control_id
|
||||||
)
|
)
|
||||||
SELECT DISTINCT
|
SELECT
|
||||||
control_id,
|
COUNT(*)
|
||||||
type
|
|
||||||
FROM
|
FROM
|
||||||
control_obls
|
control_obls
|
||||||
WHERE
|
WHERE %s
|
||||||
%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, scope.SQLArguments())
|
||||||
|
maps.Copy(args, filter.SQLArguments())
|
||||||
|
|
||||||
rows, err := conn.Query(ctx, q, args)
|
row := conn.QueryRow(ctx, q, args)
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("cannot query control obligations: %w", err)
|
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])
|
return count, nil
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("cannot collect control obligations: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
*cots = controlObligationTypes
|
|
||||||
return 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
|
TransferImpactAssessmentEntityType uint16 = 47
|
||||||
RightsRequestEntityType uint16 = 48
|
RightsRequestEntityType uint16 = 48
|
||||||
StateOfApplicabilityEntityType uint16 = 49
|
StateOfApplicabilityEntityType uint16 = 49
|
||||||
StateOfApplicabilityControlEntityType uint16 = 50
|
ApplicabilityStatementEntityType uint16 = 50
|
||||||
MembershipProfileEntityType uint16 = 51
|
MembershipProfileEntityType uint16 = 51
|
||||||
SCIMConfigurationEntityType uint16 = 52
|
SCIMConfigurationEntityType uint16 = 52
|
||||||
SCIMEventEntityType uint16 = 53
|
SCIMEventEntityType uint16 = 53
|
||||||
@@ -180,8 +180,8 @@ func NewEntityFromID(id gid.GID) (any, bool) {
|
|||||||
return &RightsRequest{ID: id}, true
|
return &RightsRequest{ID: id}, true
|
||||||
case StateOfApplicabilityEntityType:
|
case StateOfApplicabilityEntityType:
|
||||||
return &StateOfApplicability{ID: id}, true
|
return &StateOfApplicability{ID: id}, true
|
||||||
case StateOfApplicabilityControlEntityType:
|
case ApplicabilityStatementEntityType:
|
||||||
return &StateOfApplicabilityControl{ID: id}, true
|
return &ApplicabilityStatement{ID: id}, true
|
||||||
case MembershipProfileEntityType:
|
case MembershipProfileEntityType:
|
||||||
return &MembershipProfile{ID: id}, true
|
return &MembershipProfile{ID: id}, true
|
||||||
case SCIMConfigurationEntityType:
|
case SCIMConfigurationEntityType:
|
||||||
|
|||||||
@@ -241,6 +241,53 @@ LIMIT 1;
|
|||||||
return nil
|
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(
|
func (f Framework) Insert(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
|
|||||||
@@ -109,20 +109,24 @@ WHERE NOT EXISTS (
|
|||||||
SELECT 1
|
SELECT 1
|
||||||
FROM states_of_applicability soa
|
FROM states_of_applicability soa
|
||||||
WHERE soa.name = f.name
|
WHERE soa.name = f.name
|
||||||
|
AND soa.tenant_id = f.tenant_id
|
||||||
AND soa.snapshot_id IS NULL
|
AND soa.snapshot_id IS NULL
|
||||||
)
|
)
|
||||||
AND EXISTS (
|
AND EXISTS (
|
||||||
SELECT 1 FROM peoples WHERE tenant_id = f.tenant_id
|
SELECT 1 FROM peoples WHERE tenant_id = f.tenant_id
|
||||||
)
|
)
|
||||||
|
-- We only use exclude with ISO 27001 FIXME
|
||||||
AND EXISTS (
|
AND EXISTS (
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM controls c
|
FROM controls c
|
||||||
WHERE c.framework_id = f.id
|
WHERE c.framework_id = f.id
|
||||||
|
AND c.tenant_id = f.tenant_id
|
||||||
AND (
|
AND (
|
||||||
c.status = 'EXCLUDED'
|
c.status = 'EXCLUDED'
|
||||||
OR (c.exclusion_justification IS NOT NULL AND c.exclusion_justification != '')
|
OR (c.exclusion_justification IS NOT NULL AND c.exclusion_justification != '')
|
||||||
)
|
)
|
||||||
);
|
)
|
||||||
|
AND organization_id = 'e5IaD7ibAAEAAAAAAZZ9aR_Oq_Npymhg';
|
||||||
|
|
||||||
INSERT INTO states_of_applicability_controls (
|
INSERT INTO states_of_applicability_controls (
|
||||||
id,
|
id,
|
||||||
@@ -151,11 +155,23 @@ SELECT
|
|||||||
NOW() as created_at,
|
NOW() as created_at,
|
||||||
NOW() as updated_at
|
NOW() as updated_at
|
||||||
FROM frameworks f
|
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
|
JOIN controls c ON c.framework_id = f.id
|
||||||
WHERE NOT EXISTS (
|
WHERE NOT EXISTS (
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM states_of_applicability_controls soac
|
FROM states_of_applicability_controls soac
|
||||||
WHERE soac.state_of_applicability_id = soa.id
|
WHERE soac.state_of_applicability_id = soa.id
|
||||||
AND soac.control_id = c.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
|
FROM states_of_applicability
|
||||||
WHERE snapshot_id = @snapshot_id
|
WHERE snapshot_id = @snapshot_id
|
||||||
)
|
)
|
||||||
INSERT INTO states_of_applicability_controls (
|
INSERT INTO applicability_statements (
|
||||||
id,
|
id,
|
||||||
state_of_applicability_id,
|
state_of_applicability_id,
|
||||||
control_id,
|
control_id,
|
||||||
@@ -427,7 +427,7 @@ INSERT INTO states_of_applicability_controls (
|
|||||||
updated_at
|
updated_at
|
||||||
)
|
)
|
||||||
SELECT
|
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,
|
snapshot_soa.id,
|
||||||
soac.control_id,
|
soac.control_id,
|
||||||
soac.organization_id,
|
soac.organization_id,
|
||||||
@@ -437,7 +437,7 @@ SELECT
|
|||||||
soac.justification,
|
soac.justification,
|
||||||
soac.created_at,
|
soac.created_at,
|
||||||
soac.updated_at
|
soac.updated_at
|
||||||
FROM states_of_applicability_controls soac
|
FROM applicability_statements soac
|
||||||
INNER JOIN source_soa
|
INNER JOIN source_soa
|
||||||
ON soac.state_of_applicability_id = source_soa.id
|
ON soac.state_of_applicability_id = source_soa.id
|
||||||
INNER JOIN snapshot_soa
|
INNER JOIN snapshot_soa
|
||||||
@@ -451,7 +451,7 @@ WHERE soac.snapshot_id IS NULL
|
|||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"snapshot_id": snapshotID,
|
"snapshot_id": snapshotID,
|
||||||
"organization_id": organizationID,
|
"organization_id": organizationID,
|
||||||
"state_of_applicability_control_entity_type": StateOfApplicabilityControlEntityType,
|
"applicability_statement_entity_type": ApplicabilityStatementEntityType,
|
||||||
}
|
}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
|
||||||
|
|||||||
@@ -312,9 +312,11 @@ const (
|
|||||||
ActionStateOfApplicabilityDelete = "core:state-of-applicability:delete"
|
ActionStateOfApplicabilityDelete = "core:state-of-applicability:delete"
|
||||||
ActionStateOfApplicabilityExport = "core:state-of-applicability:export"
|
ActionStateOfApplicabilityExport = "core:state-of-applicability:export"
|
||||||
|
|
||||||
ActionStateOfApplicabilityControlMappingList = "core:state-of-applicability-control-mapping:list"
|
ActionApplicabilityStatementGet = "core:applicability-statement:get"
|
||||||
ActionStateOfApplicabilityControlMappingCreate = "core:state-of-applicability-control-mapping:create"
|
ActionApplicabilityStatementList = "core:applicability-statement:list"
|
||||||
ActionStateOfApplicabilityControlMappingDelete = "core:state-of-applicability-control-mapping:delete"
|
ActionApplicabilityStatementCreate = "core:applicability-statement:create"
|
||||||
|
ActionApplicabilityStatementUpdate = "core:applicability-statement:update"
|
||||||
|
ActionApplicabilityStatementDelete = "core:applicability-statement:delete"
|
||||||
|
|
||||||
ActionControlObligationMappingList = "core:control-obligation-mapping:list"
|
ActionControlObligationMappingList = "core:control-obligation-mapping:list"
|
||||||
ActionControlObligationMappingCreate = "core:control-obligation-mapping:create"
|
ActionControlObligationMappingCreate = "core:control-obligation-mapping:create"
|
||||||
|
|||||||
@@ -827,36 +827,6 @@ func (s ControlService) CountForStateOfApplicabilityID(
|
|||||||
return count, nil
|
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(
|
func (s ControlService) Create(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req CreateControlRequest,
|
req CreateControlRequest,
|
||||||
@@ -932,7 +902,9 @@ func (s ControlService) Update(
|
|||||||
|
|
||||||
control := &coredata.Control{ID: req.ID}
|
control := &coredata.Control{ID: req.ID}
|
||||||
|
|
||||||
err := s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
err := s.svc.pg.WithTx(
|
||||||
|
ctx,
|
||||||
|
func(conn pg.Conn) error {
|
||||||
if err := control.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
|
if err := control.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
|
||||||
return fmt.Errorf("cannot load control: %w", err)
|
return fmt.Errorf("cannot load control: %w", err)
|
||||||
}
|
}
|
||||||
@@ -964,7 +936,8 @@ func (s ControlService) Update(
|
|||||||
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 {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot update control: %w", err)
|
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,
|
ActionSlackConnectionList,
|
||||||
ActionRightsRequestGet, ActionRightsRequestList,
|
ActionRightsRequestGet, ActionRightsRequestList,
|
||||||
ActionStateOfApplicabilityGet, ActionStateOfApplicabilityList,
|
ActionStateOfApplicabilityGet, ActionStateOfApplicabilityList,
|
||||||
ActionStateOfApplicabilityControlMappingList,
|
ActionApplicabilityStatementGet, ActionApplicabilityStatementList,
|
||||||
).WithSID("entity-read-access").When(organizationCondition),
|
).WithSID("entity-read-access").When(organizationCondition),
|
||||||
|
|
||||||
policy.Allow(
|
policy.Allow(
|
||||||
|
|||||||
@@ -272,17 +272,18 @@ func (s StateOfApplicabilityService) Delete(
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s StateOfApplicabilityService) ListAvailableControls(
|
func (s StateOfApplicabilityService) ListApplicabilityStatements(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
stateOfApplicabilityID gid.GID,
|
stateOfApplicabilityID gid.GID,
|
||||||
) ([]*coredata.AvailableStateOfApplicabilityControl, error) {
|
cursor *page.Cursor[coredata.ApplicabilityStatementOrderField],
|
||||||
var availableControls coredata.AvailableStateOfApplicabilityControls
|
) (*page.Page[*coredata.ApplicabilityStatement, coredata.ApplicabilityStatementOrderField], error) {
|
||||||
|
var statements coredata.ApplicabilityStatements
|
||||||
|
|
||||||
err := s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
if err := availableControls.LoadAvailableByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID); err != nil {
|
if err := statements.LoadByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID, cursor); err != nil {
|
||||||
return fmt.Errorf("cannot load available controls: %w", err)
|
return fmt.Errorf("cannot load applicability statements: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
@@ -292,27 +293,56 @@ func (s StateOfApplicabilityService) ListAvailableControls(
|
|||||||
return nil, err
|
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,
|
ctx context.Context,
|
||||||
stateOfApplicabilityID gid.GID,
|
stateOfApplicabilityID gid.GID,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
applicability bool,
|
applicability bool,
|
||||||
justification *string,
|
justification *string,
|
||||||
) (*coredata.StateOfApplicabilityControl, error) {
|
) (*coredata.ApplicabilityStatement, error) {
|
||||||
stateOfApplicability := &coredata.StateOfApplicability{}
|
var (
|
||||||
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
|
stateOfApplicability = &coredata.StateOfApplicability{}
|
||||||
return stateOfApplicability.LoadByID(ctx, conn, s.svc.scope, stateOfApplicabilityID)
|
applicabilityStatement = &coredata.ApplicabilityStatement{}
|
||||||
})
|
now = time.Now()
|
||||||
if err != nil {
|
)
|
||||||
return nil, fmt.Errorf("cannot load state of applicability: %w", err)
|
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
now := time.Now()
|
applicabilityStatement = &coredata.ApplicabilityStatement{
|
||||||
control := &coredata.StateOfApplicabilityControl{
|
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ApplicabilityStatementEntityType),
|
||||||
ID: gid.New(s.svc.scope.GetTenantID(), coredata.StateOfApplicabilityControlEntityType),
|
|
||||||
StateOfApplicabilityID: stateOfApplicabilityID,
|
StateOfApplicabilityID: stateOfApplicabilityID,
|
||||||
ControlID: controlID,
|
ControlID: controlID,
|
||||||
OrganizationID: stateOfApplicability.OrganizationID,
|
OrganizationID: stateOfApplicability.OrganizationID,
|
||||||
@@ -322,42 +352,69 @@ func (s StateOfApplicabilityService) LinkControl(
|
|||||||
UpdatedAt: now,
|
UpdatedAt: now,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
if err := applicabilityStatement.Insert(ctx, conn, s.svc.scope); err != nil {
|
||||||
return control.Upsert(ctx, conn, s.svc.scope)
|
return fmt.Errorf("cannot insert applicability statement: %w", err)
|
||||||
})
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return control, nil
|
return applicabilityStatement, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s StateOfApplicabilityService) DeleteControlLink(
|
func (s StateOfApplicabilityService) UpdateApplicabilityStatement(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
stateOfApplicabilityID gid.GID,
|
applicabilityStatementID gid.GID,
|
||||||
controlID gid.GID,
|
applicability bool,
|
||||||
) (gid.GID, error) {
|
justification *string,
|
||||||
control := &coredata.StateOfApplicabilityControl{}
|
) (*coredata.ApplicabilityStatement, error) {
|
||||||
|
applicabilityStatement := &coredata.ApplicabilityStatement{}
|
||||||
|
|
||||||
err := s.svc.pg.WithTx(ctx, func(conn pg.Conn) error {
|
err := s.svc.pg.WithTx(
|
||||||
if err := control.LoadByStateOfApplicabilityIDAndControlID(ctx, conn, s.svc.scope, stateOfApplicabilityID, controlID); err != nil {
|
ctx,
|
||||||
|
func(conn pg.Conn) error {
|
||||||
|
if err := applicabilityStatement.LoadByID(ctx, conn, s.svc.scope, applicabilityStatementID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return control.Delete(ctx, conn, s.svc.scope)
|
|
||||||
})
|
applicabilityStatement.Applicability = applicability
|
||||||
|
applicabilityStatement.Justification = justification
|
||||||
|
applicabilityStatement.UpdatedAt = time.Now()
|
||||||
|
|
||||||
|
return applicabilityStatement.UpdateByID(ctx, conn, s.svc.scope)
|
||||||
|
},
|
||||||
|
)
|
||||||
if err != nil {
|
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(
|
func (s StateOfApplicabilityService) ListControlLinks(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
cursor *page.Cursor[coredata.StateOfApplicabilityOrderField],
|
cursor *page.Cursor[coredata.ApplicabilityStatementOrderField],
|
||||||
) (*page.Page[*coredata.StateOfApplicabilityControl, coredata.StateOfApplicabilityOrderField], error) {
|
) (*page.Page[*coredata.ApplicabilityStatement, coredata.ApplicabilityStatementOrderField], error) {
|
||||||
var controls coredata.StateOfApplicabilityControls
|
var controls coredata.ApplicabilityStatements
|
||||||
|
|
||||||
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
|
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
|
||||||
return controls.LoadByControlID(ctx, conn, s.svc.scope, controlID, cursor)
|
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)
|
return fmt.Errorf("cannot load owner: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var availableControls coredata.AvailableStateOfApplicabilityControls
|
// Load applicability statements
|
||||||
if err := availableControls.LoadAvailableByStateOfApplicabilityID(ctx, conn, s.svc.scope, stateOfApplicabilityID); err != nil {
|
var applicabilityStatements coredata.ApplicabilityStatements
|
||||||
return fmt.Errorf("cannot load available controls: %w", err)
|
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)
|
if len(applicabilityStatements) == 0 {
|
||||||
for _, ctrl := range availableControls {
|
// No linked controls, skip loading additional data
|
||||||
if ctrl.StateOfApplicabilityID != nil {
|
documentData = docgen.StateOfApplicabilityData{
|
||||||
linkedControls = append(linkedControls, ctrl)
|
Title: stateOfApplicability.Name,
|
||||||
}
|
OrganizationName: organization.Name,
|
||||||
}
|
CreatedAt: stateOfApplicability.CreatedAt,
|
||||||
|
TotalControls: 0,
|
||||||
obligationsByControl := make(map[gid.GID][]coredata.ObligationType)
|
FrameworkGroups: []docgen.FrameworkControlGroup{},
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
frameworkControlsMap := make(map[string][]docgen.ControlData)
|
frameworkControlsMap := make(map[string][]docgen.ControlData)
|
||||||
frameworkOrder := []string{}
|
frameworkOrder := []string{}
|
||||||
|
|
||||||
for _, ctrl := range linkedControls {
|
for _, stmt := range applicabilityStatements {
|
||||||
if _, exists := frameworkControlsMap[ctrl.FrameworkName]; !exists {
|
// Load control
|
||||||
frameworkOrder = append(frameworkOrder, ctrl.FrameworkName)
|
control := &coredata.Control{}
|
||||||
frameworkControlsMap[ctrl.FrameworkName] = []docgen.ControlData{}
|
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 regulatory *bool
|
||||||
var contractual *bool
|
var contractual *bool
|
||||||
var riskAssessment *bool
|
var riskAssessment *bool
|
||||||
|
|
||||||
if ctrl.Applicability != nil && *ctrl.Applicability {
|
if stmt.Applicability {
|
||||||
falseVal := false
|
falseVal := false
|
||||||
trueVal := true
|
trueVal := true
|
||||||
|
|
||||||
@@ -460,30 +534,28 @@ func (s StateOfApplicabilityService) ExportPDF(
|
|||||||
contractual = &falseVal
|
contractual = &falseVal
|
||||||
riskAssessment = &falseVal
|
riskAssessment = &falseVal
|
||||||
|
|
||||||
obligations := obligationsByControl[ctrl.ControlID]
|
if legalCount > 0 {
|
||||||
for _, obligationType := range obligations {
|
|
||||||
if obligationType == coredata.ObligationTypeLegal {
|
|
||||||
regulatory = &trueVal
|
regulatory = &trueVal
|
||||||
}
|
}
|
||||||
if obligationType == coredata.ObligationTypeContractual {
|
if contractualCount > 0 {
|
||||||
contractual = &trueVal
|
contractual = &trueVal
|
||||||
}
|
}
|
||||||
}
|
if hasRisk {
|
||||||
|
|
||||||
if controlsWithRisks[ctrl.ControlID] {
|
|
||||||
riskAssessment = &trueVal
|
riskAssessment = &trueVal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
frameworkControlsMap[ctrl.FrameworkName] = append(
|
applicability := stmt.Applicability
|
||||||
frameworkControlsMap[ctrl.FrameworkName],
|
|
||||||
|
frameworkControlsMap[framework.Name] = append(
|
||||||
|
frameworkControlsMap[framework.Name],
|
||||||
docgen.ControlData{
|
docgen.ControlData{
|
||||||
FrameworkName: ctrl.FrameworkName,
|
FrameworkName: framework.Name,
|
||||||
SectionTitle: ctrl.SectionTitle,
|
SectionTitle: control.SectionTitle,
|
||||||
Name: ctrl.Name,
|
Name: control.Name,
|
||||||
Applicability: ctrl.Applicability,
|
Applicability: &applicability,
|
||||||
Justification: ctrl.Justification,
|
Justification: stmt.Justification,
|
||||||
BestPractice: ctrl.BestPractice,
|
BestPractice: control.BestPractice,
|
||||||
Regulatory: regulatory,
|
Regulatory: regulatory,
|
||||||
Contractual: contractual,
|
Contractual: contractual,
|
||||||
RiskAssessment: riskAssessment,
|
RiskAssessment: riskAssessment,
|
||||||
@@ -543,7 +615,7 @@ func (s StateOfApplicabilityService) ExportPDF(
|
|||||||
Title: stateOfApplicability.Name,
|
Title: stateOfApplicability.Name,
|
||||||
OrganizationName: organization.Name,
|
OrganizationName: organization.Name,
|
||||||
CreatedAt: stateOfApplicability.CreatedAt,
|
CreatedAt: stateOfApplicability.CreatedAt,
|
||||||
TotalControls: len(linkedControls),
|
TotalControls: len(applicabilityStatements),
|
||||||
FrameworkGroups: frameworkGroups,
|
FrameworkGroups: frameworkGroups,
|
||||||
CompanyHorizontalLogoBase64: horizontalLogoBase64,
|
CompanyHorizontalLogoBase64: horizontalLogoBase64,
|
||||||
Version: version,
|
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
|
enum CountryCode
|
||||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.CountryCode") {
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.CountryCode") {
|
||||||
AD @goEnum(value: "go.probo.inc/probo/pkg/coredata.CountryCodeAD")
|
AD @goEnum(value: "go.probo.inc/probo/pkg/coredata.CountryCodeAD")
|
||||||
@@ -1475,6 +1483,14 @@ input SnapshotOrder
|
|||||||
field: SnapshotOrderField!
|
field: SnapshotOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input ApplicabilityStatementOrder
|
||||||
|
@goModel(
|
||||||
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ApplicabilityStatementOrderBy"
|
||||||
|
) {
|
||||||
|
direction: OrderDirection!
|
||||||
|
field: ApplicabilityStatementOrderField!
|
||||||
|
}
|
||||||
|
|
||||||
input DocumentVersionFilter {
|
input DocumentVersionFilter {
|
||||||
status: DocumentStatus
|
status: DocumentStatus
|
||||||
}
|
}
|
||||||
@@ -1992,6 +2008,9 @@ type Control implements Node {
|
|||||||
status: ControlStatus!
|
status: ControlStatus!
|
||||||
exclusionJustification: String
|
exclusionJustification: String
|
||||||
bestPractice: Boolean!
|
bestPractice: Boolean!
|
||||||
|
regulatory: Boolean! @goField(forceResolver: true)
|
||||||
|
contractual: Boolean! @goField(forceResolver: true)
|
||||||
|
riskAssessment: Boolean! @goField(forceResolver: true)
|
||||||
|
|
||||||
framework: Framework! @goField(forceResolver: true)
|
framework: Framework! @goField(forceResolver: true)
|
||||||
|
|
||||||
@@ -2038,14 +2057,6 @@ type Control implements Node {
|
|||||||
orderBy: SnapshotOrder
|
orderBy: SnapshotOrder
|
||||||
): SnapshotConnection! @goField(forceResolver: true)
|
): SnapshotConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
stateOfApplicabilityControls(
|
|
||||||
first: Int
|
|
||||||
after: CursorKey
|
|
||||||
last: Int
|
|
||||||
before: CursorKey
|
|
||||||
orderBy: StateOfApplicabilityOrder
|
|
||||||
): StateOfApplicabilityControlConnection! @goField(forceResolver: true)
|
|
||||||
|
|
||||||
createdAt: Datetime!
|
createdAt: Datetime!
|
||||||
updatedAt: Datetime!
|
updatedAt: Datetime!
|
||||||
|
|
||||||
@@ -2225,17 +2236,39 @@ type StateOfApplicability implements Node {
|
|||||||
createdAt: Datetime!
|
createdAt: Datetime!
|
||||||
updatedAt: Datetime!
|
updatedAt: Datetime!
|
||||||
|
|
||||||
controls(
|
applicabilityStatements(
|
||||||
first: Int
|
first: Int
|
||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: ControlOrder
|
orderBy: ApplicabilityStatementOrder
|
||||||
filter: ControlFilter
|
): ApplicabilityStatementConnection! @goField(forceResolver: true)
|
||||||
): ControlConnection! @goField(forceResolver: true)
|
|
||||||
|
|
||||||
availableControls: [AvailableStateOfApplicabilityControl!]!
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||||
@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)
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
@@ -2801,6 +2834,7 @@ type StateOfApplicabilityEdge {
|
|||||||
node: StateOfApplicability!
|
node: StateOfApplicability!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type RiskConnection
|
type RiskConnection
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.RiskConnection"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.RiskConnection"
|
||||||
@@ -3124,12 +3158,15 @@ type Mutation {
|
|||||||
deleteControlDocumentMapping(
|
deleteControlDocumentMapping(
|
||||||
input: DeleteControlDocumentMappingInput!
|
input: DeleteControlDocumentMappingInput!
|
||||||
): DeleteControlDocumentMappingPayload!
|
): DeleteControlDocumentMappingPayload!
|
||||||
createStateOfApplicabilityControlMapping(
|
createApplicabilityStatement(
|
||||||
input: CreateStateOfApplicabilityControlMappingInput!
|
input: CreateApplicabilityStatementInput!
|
||||||
): CreateStateOfApplicabilityControlMappingPayload!
|
): CreateApplicabilityStatementPayload!
|
||||||
deleteStateOfApplicabilityControlMapping(
|
updateApplicabilityStatement(
|
||||||
input: DeleteStateOfApplicabilityControlMappingInput!
|
input: UpdateApplicabilityStatementInput!
|
||||||
): DeleteStateOfApplicabilityControlMappingPayload!
|
): UpdateApplicabilityStatementPayload!
|
||||||
|
deleteApplicabilityStatement(
|
||||||
|
input: DeleteApplicabilityStatementInput!
|
||||||
|
): DeleteApplicabilityStatementPayload!
|
||||||
createControlAuditMapping(
|
createControlAuditMapping(
|
||||||
input: CreateControlAuditMappingInput!
|
input: CreateControlAuditMappingInput!
|
||||||
): CreateControlAuditMappingPayload!
|
): CreateControlAuditMappingPayload!
|
||||||
@@ -3678,16 +3715,21 @@ input DeleteControlDocumentMappingInput {
|
|||||||
documentId: ID!
|
documentId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateStateOfApplicabilityControlMappingInput {
|
input CreateApplicabilityStatementInput {
|
||||||
stateOfApplicabilityId: ID!
|
stateOfApplicabilityId: ID!
|
||||||
controlId: ID!
|
controlId: ID!
|
||||||
applicability: Boolean!
|
applicability: Boolean!
|
||||||
justification: String
|
justification: String
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteStateOfApplicabilityControlMappingInput {
|
input UpdateApplicabilityStatementInput {
|
||||||
stateOfApplicabilityId: ID!
|
applicabilityStatementId: ID!
|
||||||
controlId: ID!
|
applicability: Boolean!
|
||||||
|
justification: String
|
||||||
|
}
|
||||||
|
|
||||||
|
input DeleteApplicabilityStatementInput {
|
||||||
|
applicabilityStatementId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateControlAuditMappingInput {
|
input CreateControlAuditMappingInput {
|
||||||
@@ -3916,58 +3958,16 @@ input UpdateStateOfApplicabilityInput {
|
|||||||
ownerId: ID
|
ownerId: ID
|
||||||
}
|
}
|
||||||
|
|
||||||
input StateOfApplicabilityControlInput {
|
input ApplicabilityStatementInput {
|
||||||
controlId: ID!
|
controlId: ID!
|
||||||
applicability: Boolean!
|
applicability: Boolean!
|
||||||
justification: String
|
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 {
|
input DeleteStateOfApplicabilityInput {
|
||||||
stateOfApplicabilityId: ID!
|
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 {
|
input ExportStateOfApplicabilityPDFInput {
|
||||||
stateOfApplicabilityId: ID!
|
stateOfApplicabilityId: ID!
|
||||||
}
|
}
|
||||||
@@ -4466,14 +4466,16 @@ type DeleteControlDocumentMappingPayload {
|
|||||||
deletedDocumentId: ID!
|
deletedDocumentId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateStateOfApplicabilityControlMappingPayload {
|
type CreateApplicabilityStatementPayload {
|
||||||
stateOfApplicabilityControlEdge: StateOfApplicabilityControlEdge!
|
applicabilityStatementEdge: ApplicabilityStatementEdge!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteStateOfApplicabilityControlMappingPayload {
|
type UpdateApplicabilityStatementPayload {
|
||||||
deletedStateOfApplicabilityId: ID!
|
applicabilityStatement: ApplicabilityStatement!
|
||||||
deletedControlId: ID!
|
}
|
||||||
deletedStateOfApplicabilityControlId: ID!
|
|
||||||
|
type DeleteApplicabilityStatementPayload {
|
||||||
|
deletedApplicabilityStatementId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlAuditMappingPayload {
|
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
|
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 {
|
type AssessVendorInput struct {
|
||||||
ID gid.GID `json:"id"`
|
ID gid.GID `json:"id"`
|
||||||
WebsiteURL string `json:"websiteUrl"`
|
WebsiteURL string `json:"websiteUrl"`
|
||||||
@@ -78,22 +103,6 @@ type AuditEdge struct {
|
|||||||
Node *Audit `json:"node"`
|
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 {
|
type BulkDeleteDocumentsInput struct {
|
||||||
DocumentIds []gid.GID `json:"documentIds"`
|
DocumentIds []gid.GID `json:"documentIds"`
|
||||||
}
|
}
|
||||||
@@ -178,13 +187,15 @@ type Control struct {
|
|||||||
Status coredata.ControlStatus `json:"status"`
|
Status coredata.ControlStatus `json:"status"`
|
||||||
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
||||||
BestPractice bool `json:"bestPractice"`
|
BestPractice bool `json:"bestPractice"`
|
||||||
|
Regulatory bool `json:"regulatory"`
|
||||||
|
Contractual bool `json:"contractual"`
|
||||||
|
RiskAssessment bool `json:"riskAssessment"`
|
||||||
Framework *Framework `json:"framework"`
|
Framework *Framework `json:"framework"`
|
||||||
Measures *MeasureConnection `json:"measures"`
|
Measures *MeasureConnection `json:"measures"`
|
||||||
Documents *DocumentConnection `json:"documents"`
|
Documents *DocumentConnection `json:"documents"`
|
||||||
Audits *AuditConnection `json:"audits"`
|
Audits *AuditConnection `json:"audits"`
|
||||||
Obligations *ObligationConnection `json:"obligations"`
|
Obligations *ObligationConnection `json:"obligations"`
|
||||||
Snapshots *SnapshotConnection `json:"snapshots"`
|
Snapshots *SnapshotConnection `json:"snapshots"`
|
||||||
StateOfApplicabilityControls *StateOfApplicabilityControlConnection `json:"stateOfApplicabilityControls"`
|
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
Permission bool `json:"permission"`
|
Permission bool `json:"permission"`
|
||||||
@@ -202,6 +213,17 @@ type ControlFilter struct {
|
|||||||
Query *string `json:"query,omitempty"`
|
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 {
|
type CreateAssetInput struct {
|
||||||
OrganizationID gid.GID `json:"organizationId"`
|
OrganizationID gid.GID `json:"organizationId"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@@ -552,17 +574,6 @@ type CreateSnapshotPayload struct {
|
|||||||
SnapshotEdge *SnapshotEdge `json:"snapshotEdge"`
|
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 {
|
type CreateStateOfApplicabilityInput struct {
|
||||||
OrganizationID gid.GID `json:"organizationId"`
|
OrganizationID gid.GID `json:"organizationId"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@@ -756,6 +767,14 @@ type DatumFilter struct {
|
|||||||
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
|
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 {
|
type DeleteAssetInput struct {
|
||||||
AssetID gid.GID `json:"assetId"`
|
AssetID gid.GID `json:"assetId"`
|
||||||
}
|
}
|
||||||
@@ -1004,17 +1023,6 @@ type DeleteSnapshotPayload struct {
|
|||||||
DeletedSnapshotID gid.GID `json:"deletedSnapshotId"`
|
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 {
|
type DeleteStateOfApplicabilityInput struct {
|
||||||
StateOfApplicabilityID gid.GID `json:"stateOfApplicabilityId"`
|
StateOfApplicabilityID gid.GID `json:"stateOfApplicabilityId"`
|
||||||
}
|
}
|
||||||
@@ -1754,29 +1762,13 @@ type StateOfApplicability struct {
|
|||||||
Owner *People `json:"owner"`
|
Owner *People `json:"owner"`
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
Controls *ControlConnection `json:"controls"`
|
ApplicabilityStatements *ApplicabilityStatementConnection `json:"applicabilityStatements"`
|
||||||
AvailableControls []*AvailableStateOfApplicabilityControl `json:"availableControls"`
|
|
||||||
Permission bool `json:"permission"`
|
Permission bool `json:"permission"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (StateOfApplicability) IsNode() {}
|
func (StateOfApplicability) IsNode() {}
|
||||||
func (this StateOfApplicability) GetID() gid.GID { return this.ID }
|
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 {
|
type StateOfApplicabilityEdge struct {
|
||||||
Cursor page.CursorKey `json:"cursor"`
|
Cursor page.CursorKey `json:"cursor"`
|
||||||
Node *StateOfApplicability `json:"node"`
|
Node *StateOfApplicability `json:"node"`
|
||||||
@@ -1940,6 +1932,16 @@ type TrustCenterReferenceEdge struct {
|
|||||||
Node *TrustCenterReference `json:"node"`
|
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 {
|
type UpdateAssetInput struct {
|
||||||
ID gid.GID `json:"id"`
|
ID gid.GID `json:"id"`
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
|
|||||||
@@ -26,6 +26,63 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/server/gqlutils"
|
"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.
|
// Owner is the resolver for the owner field.
|
||||||
func (r *assetResolver) Owner(ctx context.Context, obj *types.Asset) (*types.People, error) {
|
func (r *assetResolver) Owner(ctx context.Context, obj *types.Asset) (*types.People, error) {
|
||||||
if err := r.authorize(ctx, obj.ID, probo.ActionPeopleGet); err != nil {
|
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
|
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.
|
// Framework is the resolver for the framework field.
|
||||||
func (r *controlResolver) Framework(ctx context.Context, obj *types.Control) (*types.Framework, error) {
|
func (r *controlResolver) Framework(ctx context.Context, obj *types.Control) (*types.Framework, error) {
|
||||||
if err := r.authorize(ctx, obj.ID, probo.ActionFrameworkGet); err != nil {
|
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
|
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.
|
// Permission is the resolver for the permission field.
|
||||||
func (r *controlResolver) Permission(ctx context.Context, obj *types.Control, action string) (bool, error) {
|
func (r *controlResolver) Permission(ctx context.Context, obj *types.Control, action string) (bool, error) {
|
||||||
return r.Resolver.Permission(ctx, obj, action)
|
return r.Resolver.Permission(ctx, obj, action)
|
||||||
@@ -2730,41 +2794,57 @@ func (r *mutationResolver) DeleteControlDocumentMapping(ctx context.Context, inp
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateStateOfApplicabilityControlMapping is the resolver for the createStateOfApplicabilityControlMapping field.
|
// CreateApplicabilityStatement is the resolver for the createApplicabilityStatement field.
|
||||||
func (r *mutationResolver) CreateStateOfApplicabilityControlMapping(ctx context.Context, input types.CreateStateOfApplicabilityControlMappingInput) (*types.CreateStateOfApplicabilityControlMappingPayload, error) {
|
func (r *mutationResolver) CreateApplicabilityStatement(ctx context.Context, input types.CreateApplicabilityStatementInput) (*types.CreateApplicabilityStatementPayload, error) {
|
||||||
if err := r.authorize(ctx, input.ControlID, probo.ActionStateOfApplicabilityControlMappingCreate); err != nil {
|
if err := r.authorize(ctx, input.ControlID, probo.ActionApplicabilityStatementCreate); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.ProboService(ctx, input.StateOfApplicabilityID.TenantID())
|
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 {
|
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{
|
return &types.CreateApplicabilityStatementPayload{
|
||||||
StateOfApplicabilityControlEdge: types.NewStateOfApplicabilityControlEdge(control, coredata.StateOfApplicabilityOrderFieldCreatedAt),
|
ApplicabilityStatementEdge: types.NewApplicabilityStatementEdge(applicabilityStatement, coredata.ApplicabilityStatementOrderFieldCreatedAt),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteStateOfApplicabilityControlMapping is the resolver for the deleteStateOfApplicabilityControlMapping field.
|
// UpdateApplicabilityStatement is the resolver for the updateApplicabilityStatement field.
|
||||||
func (r *mutationResolver) DeleteStateOfApplicabilityControlMapping(ctx context.Context, input types.DeleteStateOfApplicabilityControlMappingInput) (*types.DeleteStateOfApplicabilityControlMappingPayload, error) {
|
func (r *mutationResolver) UpdateApplicabilityStatement(ctx context.Context, input types.UpdateApplicabilityStatementInput) (*types.UpdateApplicabilityStatementPayload, error) {
|
||||||
if err := r.authorize(ctx, input.StateOfApplicabilityID, probo.ActionStateOfApplicabilityControlMappingDelete); err != nil {
|
if err := r.authorize(ctx, input.ApplicabilityStatementID, probo.ActionApplicabilityStatementUpdate); err != nil {
|
||||||
return nil, err
|
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 {
|
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{
|
return &types.UpdateApplicabilityStatementPayload{
|
||||||
DeletedStateOfApplicabilityID: input.StateOfApplicabilityID,
|
ApplicabilityStatement: types.NewApplicabilityStatement(applicabilityStatement),
|
||||||
DeletedControlID: input.ControlID,
|
}, nil
|
||||||
DeletedStateOfApplicabilityControlID: deletedID,
|
}
|
||||||
|
|
||||||
|
// 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
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7201,73 +7281,33 @@ func (r *stateOfApplicabilityResolver) Owner(ctx context.Context, obj *types.Sta
|
|||||||
return types.NewPeople(people), nil
|
return types.NewPeople(people), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controls is the resolver for the controls field.
|
// ApplicabilityStatements is the resolver for the applicabilityStatements 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) {
|
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.ActionControlList); err != nil {
|
if err := r.authorize(ctx, obj.ID, probo.ActionApplicabilityStatementList); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.ControlOrderField]{
|
pageOrderBy := page.OrderBy[coredata.ApplicabilityStatementOrderField]{
|
||||||
Field: coredata.ControlOrderFieldCreatedAt,
|
Field: coredata.ApplicabilityStatementOrderFieldCreatedAt,
|
||||||
Direction: page.OrderDirectionDesc,
|
Direction: page.OrderDirectionAsc,
|
||||||
}
|
}
|
||||||
if orderBy != nil {
|
if orderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.ControlOrderField]{
|
pageOrderBy = page.OrderBy[coredata.ApplicabilityStatementOrderField]{
|
||||||
Field: orderBy.Field,
|
Field: coredata.ApplicabilityStatementOrderField(orderBy.Field),
|
||||||
Direction: orderBy.Direction,
|
Direction: orderBy.Direction,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
var controlFilter = coredata.NewControlFilter(nil)
|
p, err := prb.StatesOfApplicability.ListApplicabilityStatements(ctx, obj.ID, cursor)
|
||||||
if filter != nil {
|
|
||||||
controlFilter = coredata.NewControlFilter(filter.Query)
|
|
||||||
}
|
|
||||||
|
|
||||||
page, err := prb.Controls.ListForStateOfApplicabilityID(ctx, obj.ID, cursor, controlFilter)
|
|
||||||
if err != nil {
|
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
|
return types.NewApplicabilityStatementConnection(p, r, obj.ID), 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Permission is the resolver for the permission field.
|
// 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))
|
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.
|
// AssignedTo is the resolver for the assignedTo field.
|
||||||
func (r *taskResolver) AssignedTo(ctx context.Context, obj *types.Task) (*types.People, error) {
|
func (r *taskResolver) AssignedTo(ctx context.Context, obj *types.Task) (*types.People, error) {
|
||||||
if err := r.authorize(ctx, obj.ID, probo.ActionPeopleGet); err != nil {
|
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
|
}, 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.
|
// Asset returns schema.AssetResolver implementation.
|
||||||
func (r *Resolver) Asset() schema.AssetResolver { return &assetResolver{r} }
|
func (r *Resolver) Asset() schema.AssetResolver { return &assetResolver{r} }
|
||||||
|
|
||||||
@@ -8611,11 +8645,6 @@ func (r *Resolver) StateOfApplicabilityConnection() schema.StateOfApplicabilityC
|
|||||||
return &stateOfApplicabilityConnectionResolver{r}
|
return &stateOfApplicabilityConnectionResolver{r}
|
||||||
}
|
}
|
||||||
|
|
||||||
// StateOfApplicabilityControl returns schema.StateOfApplicabilityControlResolver implementation.
|
|
||||||
func (r *Resolver) StateOfApplicabilityControl() schema.StateOfApplicabilityControlResolver {
|
|
||||||
return &stateOfApplicabilityControlResolver{r}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Task returns schema.TaskResolver implementation.
|
// Task returns schema.TaskResolver implementation.
|
||||||
func (r *Resolver) Task() schema.TaskResolver { return &taskResolver{r} }
|
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.
|
// Viewer returns schema.ViewerResolver implementation.
|
||||||
func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} }
|
func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} }
|
||||||
|
|
||||||
|
type applicabilityStatementResolver struct{ *Resolver }
|
||||||
|
type applicabilityStatementConnectionResolver struct{ *Resolver }
|
||||||
type assetResolver struct{ *Resolver }
|
type assetResolver struct{ *Resolver }
|
||||||
type assetConnectionResolver struct{ *Resolver }
|
type assetConnectionResolver struct{ *Resolver }
|
||||||
type auditResolver struct{ *Resolver }
|
type auditResolver struct{ *Resolver }
|
||||||
@@ -8754,7 +8785,6 @@ type snapshotResolver struct{ *Resolver }
|
|||||||
type snapshotConnectionResolver struct{ *Resolver }
|
type snapshotConnectionResolver struct{ *Resolver }
|
||||||
type stateOfApplicabilityResolver struct{ *Resolver }
|
type stateOfApplicabilityResolver struct{ *Resolver }
|
||||||
type stateOfApplicabilityConnectionResolver struct{ *Resolver }
|
type stateOfApplicabilityConnectionResolver struct{ *Resolver }
|
||||||
type stateOfApplicabilityControlResolver struct{ *Resolver }
|
|
||||||
type taskResolver struct{ *Resolver }
|
type taskResolver struct{ *Resolver }
|
||||||
type taskConnectionResolver struct{ *Resolver }
|
type taskConnectionResolver struct{ *Resolver }
|
||||||
type transferImpactAssessmentResolver struct{ *Resolver }
|
type transferImpactAssessmentResolver struct{ *Resolver }
|
||||||
|
|||||||
Reference in New Issue
Block a user