Rename mitigation into mesure
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Rename "Mitigation" in "Mesure"
|
||||||
|
|
||||||
## [0.9.0] - 2025-04-12
|
## [0.9.0] - 2025-04-12
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -134,10 +134,10 @@ export function NavMain() {
|
|||||||
function getNavItems(organizationId?: string): NavItem[] {
|
function getNavItems(organizationId?: string): NavItem[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
title: "Mitigations",
|
title: "Mesures",
|
||||||
icon: ClipboardList,
|
icon: ClipboardList,
|
||||||
url: organizationId
|
url: organizationId
|
||||||
? `/organizations/${organizationId}/mitigations`
|
? `/organizations/${organizationId}/mesures`
|
||||||
: undefined,
|
: undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const SidebarProvider = React.forwardRef<
|
|||||||
const [openMobile, setOpenMobile] = React.useState(false);
|
const [openMobile, setOpenMobile] = React.useState(false);
|
||||||
|
|
||||||
// This is the internal state of the sidebar.
|
// This is the internal state of the sidebar.
|
||||||
// We use openProp and setOpenProp for mitigation from outside the component.
|
// We use openProp and setOpenProp for mesure from outside the component.
|
||||||
const [_open, _setOpen] = React.useState(defaultOpen);
|
const [_open, _setOpen] = React.useState(defaultOpen);
|
||||||
const open = openProp ?? _open;
|
const open = openProp ?? _open;
|
||||||
const setOpen = React.useCallback(
|
const setOpen = React.useCallback(
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ import { Navigate, useParams } from "react-router";
|
|||||||
|
|
||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
const { organizationId } = useParams();
|
const { organizationId } = useParams();
|
||||||
return <Navigate to={`/organizations/${organizationId}/mitigations`} />;
|
return <Navigate to={`/organizations/${organizationId}/mesures`} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { OrganizationBreadcrumbBreadcrumbPeopleOverviewQuery } from "./__generat
|
|||||||
import { OrganizationBreadcrumbBreadcrumbPolicyOverviewQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbPolicyOverviewQuery.graphql";
|
import { OrganizationBreadcrumbBreadcrumbPolicyOverviewQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbPolicyOverviewQuery.graphql";
|
||||||
import { OrganizationBreadcrumbBreadcrumbVendorOverviewQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbVendorOverviewQuery.graphql";
|
import { OrganizationBreadcrumbBreadcrumbVendorOverviewQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbVendorOverviewQuery.graphql";
|
||||||
import { OrganizationBreadcrumbOrganizationQuery } from "./__generated__/OrganizationBreadcrumbOrganizationQuery.graphql";
|
import { OrganizationBreadcrumbOrganizationQuery } from "./__generated__/OrganizationBreadcrumbOrganizationQuery.graphql";
|
||||||
import { OrganizationBreadcrumbBreadcrumbMitigationViewQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbMitigationViewQuery.graphql";
|
import { OrganizationBreadcrumbBreadcrumbMesureViewQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbMesureViewQuery.graphql";
|
||||||
import { OrganizationBreadcrumbBreadcrumbControlQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbControlQuery.graphql";
|
import { OrganizationBreadcrumbBreadcrumbControlQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbControlQuery.graphql";
|
||||||
import { OrganizationBreadcrumbBreadcrumbRiskShowQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbRiskShowQuery.graphql";
|
import { OrganizationBreadcrumbBreadcrumbRiskShowQuery } from "./__generated__/OrganizationBreadcrumbBreadcrumbRiskShowQuery.graphql";
|
||||||
import ErrorBoundary from "@/components/ErrorBoundary";
|
import ErrorBoundary from "@/components/ErrorBoundary";
|
||||||
@@ -314,15 +314,15 @@ function BreadcrumbPolicyOverview() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function BreadcrumbMitigationList() {
|
function BreadcrumbMesureList() {
|
||||||
const { organizationId } = useParams();
|
const { organizationId } = useParams();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BreadcrumbSeparator />
|
<BreadcrumbSeparator />
|
||||||
<BreadcrumbItem>
|
<BreadcrumbItem>
|
||||||
<BreadcrumbNavLink to={`/organizations/${organizationId}/mitigations`}>
|
<BreadcrumbNavLink to={`/organizations/${organizationId}/mesures`}>
|
||||||
Mitigations
|
Mesures
|
||||||
</BreadcrumbNavLink>
|
</BreadcrumbNavLink>
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
<Outlet />
|
<Outlet />
|
||||||
@@ -330,24 +330,22 @@ function BreadcrumbMitigationList() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function BreadcrumbMitigationView() {
|
function BreadcrumbMesureView() {
|
||||||
const { organizationId, mitigationId } = useParams();
|
const { organizationId, mesureId } = useParams();
|
||||||
const data =
|
const data =
|
||||||
useLazyLoadQuery<OrganizationBreadcrumbBreadcrumbMitigationViewQuery>(
|
useLazyLoadQuery<OrganizationBreadcrumbBreadcrumbMesureViewQuery>(
|
||||||
graphql`
|
graphql`
|
||||||
query OrganizationBreadcrumbBreadcrumbMitigationViewQuery(
|
query OrganizationBreadcrumbBreadcrumbMesureViewQuery($mesureId: ID!) {
|
||||||
$mitigationId: ID!
|
mesure: node(id: $mesureId) {
|
||||||
) {
|
|
||||||
mitigation: node(id: $mitigationId) {
|
|
||||||
id
|
id
|
||||||
... on Mitigation {
|
... on Mesure {
|
||||||
name
|
name
|
||||||
category
|
category
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{ mitigationId: mitigationId! }
|
{ mesureId: mesureId! }
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -355,17 +353,17 @@ function BreadcrumbMitigationView() {
|
|||||||
<BreadcrumbSeparator />
|
<BreadcrumbSeparator />
|
||||||
<BreadcrumbItem>
|
<BreadcrumbItem>
|
||||||
<BreadcrumbNavLink
|
<BreadcrumbNavLink
|
||||||
to={`/organizations/${organizationId}/mitigations#${data.mitigation.category}`}
|
to={`/organizations/${organizationId}/mesures#${data.mesure.category}`}
|
||||||
>
|
>
|
||||||
{data.mitigation.category}
|
{data.mesure.category}
|
||||||
</BreadcrumbNavLink>
|
</BreadcrumbNavLink>
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
<BreadcrumbSeparator />
|
<BreadcrumbSeparator />
|
||||||
<BreadcrumbItem>
|
<BreadcrumbItem>
|
||||||
<BreadcrumbNavLink
|
<BreadcrumbNavLink
|
||||||
to={`/organizations/${organizationId}/mitigations/${mitigationId}`}
|
to={`/organizations/${organizationId}/mesures/${mesureId}`}
|
||||||
>
|
>
|
||||||
{data.mitigation.name}
|
{data.mesure.name}
|
||||||
</BreadcrumbNavLink>
|
</BreadcrumbNavLink>
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
<Outlet />
|
<Outlet />
|
||||||
@@ -463,13 +461,13 @@ export function BreadCrumb() {
|
|||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Route path="mitigations" element={<BreadcrumbMitigationList />}>
|
<Route path="mesures" element={<BreadcrumbMesureList />}>
|
||||||
<Route path="new" element={<New />} />
|
<Route path="new" element={<New />} />
|
||||||
<Route
|
<Route
|
||||||
path=":mitigationId"
|
path=":mesureId"
|
||||||
element={
|
element={
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<BreadcrumbMitigationView />
|
<BreadcrumbMesureView />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import { FrameworkListPage } from "./frameworks/FrameworkListPage";
|
|||||||
import { FrameworkPage } from "./frameworks/FrameworkPage";
|
import { FrameworkPage } from "./frameworks/FrameworkPage";
|
||||||
import { NewFrameworkPage } from "./frameworks/NewFrameworkPage";
|
import { NewFrameworkPage } from "./frameworks/NewFrameworkPage";
|
||||||
import { ControlPage } from "./frameworks/controls/ControlPage";
|
import { ControlPage } from "./frameworks/controls/ControlPage";
|
||||||
import { EditMitigationPage } from "./mitigations/EditMitigationPage";
|
import { EditMesurePage } from "./mesures/EditMesurePage";
|
||||||
import { MitigationListPage } from "./mitigations/MitigationListPage";
|
import { MesureListPage } from "./mesures/MesureListPage";
|
||||||
import { MitigationPage } from "./mitigations/MitigationPage";
|
import { MesurePage } from "./mesures/MesurePage";
|
||||||
import { NewMitigationPage } from "./mitigations/NewMitigationPage";
|
import { NewMesurePage } from "./mesures/NewMesurePage";
|
||||||
import { NewPeoplePage } from "./people/NewPeoplePage";
|
import { NewPeoplePage } from "./people/NewPeoplePage";
|
||||||
import { PeopleListPage } from "./people/PeopleListPage";
|
import { PeopleListPage } from "./people/PeopleListPage";
|
||||||
import { PeoplePage } from "./people/PeoplePage";
|
import { PeoplePage } from "./people/PeoplePage";
|
||||||
@@ -48,13 +48,10 @@ export function OrganizationsRoutes() {
|
|||||||
<Route path="edit" element={<EditFrameworkPage />} />
|
<Route path="edit" element={<EditFrameworkPage />} />
|
||||||
<Route path="*" element={<NotFoundPage />} />
|
<Route path="*" element={<NotFoundPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="mitigations" element={<MitigationListPage />} />
|
<Route path="mesures" element={<MesureListPage />} />
|
||||||
<Route path="mitigations/new" element={<NewMitigationPage />} />
|
<Route path="mesures/new" element={<NewMesurePage />} />
|
||||||
<Route path="mitigations/:mitigationId" element={<MitigationPage />} />
|
<Route path="mesures/:mesureId" element={<MesurePage />} />
|
||||||
<Route
|
<Route path="mesures/:mesureId/edit" element={<EditMesurePage />} />
|
||||||
path="mitigations/:mitigationId/edit"
|
|
||||||
element={<EditMitigationPage />}
|
|
||||||
/>
|
|
||||||
<Route path="vendors/:vendorId" element={<VendorPage />} />
|
<Route path="vendors/:vendorId" element={<VendorPage />} />
|
||||||
<Route path="policies" element={<PolicyListPage />} />
|
<Route path="policies" element={<PolicyListPage />} />
|
||||||
<Route path="policies/new" element={<NewPolicyPage />} />
|
<Route path="policies/new" element={<NewPolicyPage />} />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<5297fe6c58e18534c0e9684cfea6b319>>
|
* @generated SignedSource<<a8e66e7606187f54d173cddac8bcd316>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,19 +9,19 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type OrganizationBreadcrumbBreadcrumbMitigationViewQuery$variables = {
|
export type OrganizationBreadcrumbBreadcrumbMesureViewQuery$variables = {
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type OrganizationBreadcrumbBreadcrumbMitigationViewQuery$data = {
|
export type OrganizationBreadcrumbBreadcrumbMesureViewQuery$data = {
|
||||||
readonly mitigation: {
|
readonly mesure: {
|
||||||
readonly category?: string;
|
readonly category?: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name?: string;
|
readonly name?: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type OrganizationBreadcrumbBreadcrumbMitigationViewQuery = {
|
export type OrganizationBreadcrumbBreadcrumbMesureViewQuery = {
|
||||||
response: OrganizationBreadcrumbBreadcrumbMitigationViewQuery$data;
|
response: OrganizationBreadcrumbBreadcrumbMesureViewQuery$data;
|
||||||
variables: OrganizationBreadcrumbBreadcrumbMitigationViewQuery$variables;
|
variables: OrganizationBreadcrumbBreadcrumbMesureViewQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -29,14 +29,14 @@ var v0 = [
|
|||||||
{
|
{
|
||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "mitigationId"
|
"name": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = [
|
v1 = [
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"variableName": "mitigationId"
|
"variableName": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v2 = {
|
v2 = {
|
||||||
@@ -64,7 +64,7 @@ v3 = {
|
|||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
@@ -72,10 +72,10 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "OrganizationBreadcrumbBreadcrumbMitigationViewQuery",
|
"name": "OrganizationBreadcrumbBreadcrumbMesureViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigation",
|
"alias": "mesure",
|
||||||
"args": (v1/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
@@ -95,10 +95,10 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "OrganizationBreadcrumbBreadcrumbMitigationViewQuery",
|
"name": "OrganizationBreadcrumbBreadcrumbMesureViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigation",
|
"alias": "mesure",
|
||||||
"args": (v1/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
@@ -120,16 +120,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "dcc05f69cfc1d38fae2488aa4740f109",
|
"cacheID": "f6183e3013438a1cff8e91c6ff80f452",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "OrganizationBreadcrumbBreadcrumbMitigationViewQuery",
|
"name": "OrganizationBreadcrumbBreadcrumbMesureViewQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query OrganizationBreadcrumbBreadcrumbMitigationViewQuery(\n $mitigationId: ID!\n) {\n mitigation: node(id: $mitigationId) {\n __typename\n id\n ... on Mitigation {\n name\n category\n }\n }\n}\n"
|
"text": "query OrganizationBreadcrumbBreadcrumbMesureViewQuery(\n $mesureId: ID!\n) {\n mesure: node(id: $mesureId) {\n __typename\n id\n ... on Mesure {\n name\n category\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "0b8d38ad84bd4c5a684711285c29e5a4";
|
(node as any).hash = "67fd3d426bbfcbe90457c3033dade1b3";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -10,7 +10,7 @@ export function NewFrameworkViewSkeleton() {
|
|||||||
return (
|
return (
|
||||||
<PageTemplateSkeleton
|
<PageTemplateSkeleton
|
||||||
title="Create Framework"
|
title="Create Framework"
|
||||||
description="Create a new framework to organize your mitigations"
|
description="Create a new framework to organize your mesures"
|
||||||
>
|
>
|
||||||
<div className="max-w-2xl aspect-square bg-subtle-bg rounded-xl animate-pulse" />
|
<div className="max-w-2xl aspect-square bg-subtle-bg rounded-xl animate-pulse" />
|
||||||
</PageTemplateSkeleton>
|
</PageTemplateSkeleton>
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ function NewFrameworkViewContent() {
|
|||||||
return (
|
return (
|
||||||
<PageTemplate
|
<PageTemplate
|
||||||
title="Create Framework"
|
title="Create Framework"
|
||||||
description="Create a new framework to organize your mitigations"
|
description="Create a new framework to organize your mesures"
|
||||||
>
|
>
|
||||||
<Card className="max-w-2xl">
|
<Card className="max-w-2xl">
|
||||||
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ import {
|
|||||||
} from "react-relay";
|
} from "react-relay";
|
||||||
import { useParams, Link } from "react-router";
|
import { useParams, Link } from "react-router";
|
||||||
import {
|
import {
|
||||||
ControlLinkedMitigationsQuery$data,
|
ControlLinkedMesuresQuery$data,
|
||||||
ControlLinkedMitigationsQuery,
|
ControlLinkedMesuresQuery,
|
||||||
} from "./__generated__/ControlLinkedMitigationsQuery.graphql";
|
} from "./__generated__/ControlLinkedMesuresQuery.graphql";
|
||||||
import {
|
import {
|
||||||
ControlOrganizationMitigationsQuery$data,
|
ControlOrganizationMesuresQuery$data,
|
||||||
ControlOrganizationMitigationsQuery,
|
ControlOrganizationMesuresQuery,
|
||||||
} from "./__generated__/ControlOrganizationMitigationsQuery.graphql";
|
} from "./__generated__/ControlOrganizationMesuresQuery.graphql";
|
||||||
import { ControlFragment_Control$key } from "./__generated__/ControlFragment_Control.graphql";
|
import { ControlFragment_Control$key } from "./__generated__/ControlFragment_Control.graphql";
|
||||||
import {
|
import {
|
||||||
ControlLinkedPoliciesQuery$data,
|
ControlLinkedPoliciesQuery$data,
|
||||||
@@ -52,13 +52,13 @@ const controlFragment = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// New query to fetch linked mitigations
|
// New query to fetch linked mesures
|
||||||
const linkedMitigationsQuery = graphql`
|
const linkedMesuresQuery = graphql`
|
||||||
query ControlLinkedMitigationsQuery($controlId: ID!) {
|
query ControlLinkedMesuresQuery($controlId: ID!) {
|
||||||
control: node(id: $controlId) {
|
control: node(id: $controlId) {
|
||||||
id
|
id
|
||||||
... on Control {
|
... on Control {
|
||||||
mitigations(first: 100) @connection(key: "Control__mitigations") {
|
mesures(first: 100) @connection(key: "Control__mesures") {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -75,13 +75,13 @@ const linkedMitigationsQuery = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Query to fetch all mitigations for the organization
|
// Query to fetch all mesures for the organization
|
||||||
const organizationMitigationsQuery = graphql`
|
const organizationMesuresQuery = graphql`
|
||||||
query ControlOrganizationMitigationsQuery($organizationId: ID!) {
|
query ControlOrganizationMesuresQuery($organizationId: ID!) {
|
||||||
organization: node(id: $organizationId) {
|
organization: node(id: $organizationId) {
|
||||||
id
|
id
|
||||||
... on Organization {
|
... on Organization {
|
||||||
mitigations(first: 100) @connection(key: "Organization__mitigations") {
|
mesures(first: 100) @connection(key: "Organization__mesures") {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -142,23 +142,23 @@ const organizationPoliciesQuery = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Mutation to create a mapping between a control and a mitigation
|
// Mutation to create a mapping between a control and a mesure
|
||||||
const createMitigationMappingMutation = graphql`
|
const createMesureMappingMutation = graphql`
|
||||||
mutation ControlCreateMitigationMappingMutation(
|
mutation ControlCreateMesureMappingMutation(
|
||||||
$input: CreateControlMitigationMappingInput!
|
$input: CreateControlMesureMappingInput!
|
||||||
) {
|
) {
|
||||||
createControlMitigationMapping(input: $input) {
|
createControlMesureMapping(input: $input) {
|
||||||
success
|
success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Mutation to delete a mapping between a control and a mitigation
|
// Mutation to delete a mapping between a control and a mesure
|
||||||
const deleteMitigationMappingMutation = graphql`
|
const deleteMesureMappingMutation = graphql`
|
||||||
mutation ControlDeleteMitigationMappingMutation(
|
mutation ControlDeleteMesureMappingMutation(
|
||||||
$input: DeleteControlMitigationMappingInput!
|
$input: DeleteControlMesureMappingInput!
|
||||||
) {
|
) {
|
||||||
deleteControlMitigationMapping(input: $input) {
|
deleteControlMesureMapping(input: $input) {
|
||||||
success
|
success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,17 +199,17 @@ export function Control({
|
|||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const environment = useRelayEnvironment();
|
const environment = useRelayEnvironment();
|
||||||
|
|
||||||
// State for mitigation mapping
|
// State for mesure mapping
|
||||||
const [isMitigationMappingDialogOpen, setIsMitigationMappingDialogOpen] =
|
const [isMesureMappingDialogOpen, setIsMesureMappingDialogOpen] =
|
||||||
useState(false);
|
useState(false);
|
||||||
const [linkedMitigationsData, setLinkedMitigationsData] =
|
const [linkedMesuresData, setLinkedMesuresData] =
|
||||||
useState<ControlLinkedMitigationsQuery$data | null>(null);
|
useState<ControlLinkedMesuresQuery$data | null>(null);
|
||||||
const [organizationMitigationsData, setOrganizationMitigationsData] =
|
const [organizationMesuresData, setOrganizationMesuresData] =
|
||||||
useState<ControlOrganizationMitigationsQuery$data | null>(null);
|
useState<ControlOrganizationMesuresQuery$data | null>(null);
|
||||||
const [mitigationSearchQuery, setMitigationSearchQuery] = useState("");
|
const [mesureSearchQuery, setMesureSearchQuery] = useState("");
|
||||||
const [isLoadingMitigations, setIsLoadingMitigations] = useState(false);
|
const [isLoadingMesures, setIsLoadingMesures] = useState(false);
|
||||||
const [isLinkingMitigation, setIsLinkingMitigation] = useState(false);
|
const [isLinkingMesure, setIsLinkingMesure] = useState(false);
|
||||||
const [isUnlinkingMitigation, setIsUnlinkingMitigation] = useState(false);
|
const [isUnlinkingMesure, setIsUnlinkingMesure] = useState(false);
|
||||||
const [categoryFilter, setCategoryFilter] = useState<string | null>(null);
|
const [categoryFilter, setCategoryFilter] = useState<string | null>(null);
|
||||||
|
|
||||||
// Policy state
|
// Policy state
|
||||||
@@ -225,85 +225,73 @@ export function Control({
|
|||||||
const [isUnlinkingPolicy, setIsUnlinkingPolicy] = useState(false);
|
const [isUnlinkingPolicy, setIsUnlinkingPolicy] = useState(false);
|
||||||
|
|
||||||
// Create mutation hooks
|
// Create mutation hooks
|
||||||
const [commitCreateMitigationMapping] = useMutation(
|
const [commitCreateMesureMapping] = useMutation(createMesureMappingMutation);
|
||||||
createMitigationMappingMutation
|
const [commitDeleteMesureMapping] = useMutation(deleteMesureMappingMutation);
|
||||||
);
|
|
||||||
const [commitDeleteMitigationMapping] = useMutation(
|
|
||||||
deleteMitigationMappingMutation
|
|
||||||
);
|
|
||||||
const [commitCreatePolicyMapping] = useMutation(createPolicyMappingMutation);
|
const [commitCreatePolicyMapping] = useMutation(createPolicyMappingMutation);
|
||||||
const [commitDeletePolicyMapping] = useMutation(deletePolicyMappingMutation);
|
const [commitDeletePolicyMapping] = useMutation(deletePolicyMappingMutation);
|
||||||
|
|
||||||
// Load initial linked mitigations data
|
// Load initial linked mesures data
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (control.id) {
|
if (control.id) {
|
||||||
setIsLoadingMitigations(true);
|
setIsLoadingMesures(true);
|
||||||
fetchQuery<ControlLinkedMitigationsQuery>(
|
fetchQuery<ControlLinkedMesuresQuery>(environment, linkedMesuresQuery, {
|
||||||
environment,
|
|
||||||
linkedMitigationsQuery,
|
|
||||||
{
|
|
||||||
controlId: control.id,
|
controlId: control.id,
|
||||||
}
|
}).subscribe({
|
||||||
).subscribe({
|
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
setLinkedMitigationsData(data);
|
setLinkedMesuresData(data);
|
||||||
setIsLoadingMitigations(false);
|
setIsLoadingMesures(false);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error loading initial mitigations:", error);
|
console.error("Error loading initial mesures:", error);
|
||||||
setIsLoadingMitigations(false);
|
setIsLoadingMesures(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [control.id, environment]);
|
}, [control.id, environment]);
|
||||||
|
|
||||||
// Load mitigations data
|
// Load mesures data
|
||||||
const loadMitigationsData = useCallback(() => {
|
const loadMesuresData = useCallback(() => {
|
||||||
if (!organizationId || !control.id) return;
|
if (!organizationId || !control.id) return;
|
||||||
|
|
||||||
setIsLoadingMitigations(true);
|
setIsLoadingMesures(true);
|
||||||
|
|
||||||
// Fetch all mitigations for the organization
|
// Fetch all mesures for the organization
|
||||||
fetchQuery<ControlOrganizationMitigationsQuery>(
|
fetchQuery<ControlOrganizationMesuresQuery>(
|
||||||
environment,
|
environment,
|
||||||
organizationMitigationsQuery,
|
organizationMesuresQuery,
|
||||||
{
|
{
|
||||||
organizationId,
|
organizationId,
|
||||||
}
|
}
|
||||||
).subscribe({
|
).subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
setOrganizationMitigationsData(data);
|
setOrganizationMesuresData(data);
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
// Fetch linked mitigations for this control
|
// Fetch linked mesures for this control
|
||||||
fetchQuery<ControlLinkedMitigationsQuery>(
|
fetchQuery<ControlLinkedMesuresQuery>(environment, linkedMesuresQuery, {
|
||||||
environment,
|
|
||||||
linkedMitigationsQuery,
|
|
||||||
{
|
|
||||||
controlId: control.id,
|
controlId: control.id,
|
||||||
}
|
}).subscribe({
|
||||||
).subscribe({
|
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
setLinkedMitigationsData(data);
|
setLinkedMesuresData(data);
|
||||||
setIsLoadingMitigations(false);
|
setIsLoadingMesures(false);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error fetching linked mitigations:", error);
|
console.error("Error fetching linked mesures:", error);
|
||||||
setIsLoadingMitigations(false);
|
setIsLoadingMesures(false);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to load linked mitigations.",
|
description: "Failed to load linked mesures.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error fetching organization mitigations:", error);
|
console.error("Error fetching organization mesures:", error);
|
||||||
setIsLoadingMitigations(false);
|
setIsLoadingMesures(false);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to load mitigations.",
|
description: "Failed to load mesures.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -311,197 +299,190 @@ export function Control({
|
|||||||
}, [control.id, environment, organizationId, toast]);
|
}, [control.id, environment, organizationId, toast]);
|
||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
const getMitigations = useCallback(() => {
|
const getMesures = useCallback(() => {
|
||||||
if (!organizationMitigationsData?.organization?.mitigations?.edges)
|
if (!organizationMesuresData?.organization?.mesures?.edges) return [];
|
||||||
return [];
|
return organizationMesuresData.organization.mesures.edges.map(
|
||||||
return organizationMitigationsData.organization.mitigations.edges.map(
|
|
||||||
(edge) => edge.node
|
(edge) => edge.node
|
||||||
);
|
);
|
||||||
}, [organizationMitigationsData]);
|
}, [organizationMesuresData]);
|
||||||
|
|
||||||
const getLinkedMitigations = useCallback(() => {
|
const getLinkedMesures = useCallback(() => {
|
||||||
if (!linkedMitigationsData?.control?.mitigations?.edges) return [];
|
if (!linkedMesuresData?.control?.mesures?.edges) return [];
|
||||||
return linkedMitigationsData.control.mitigations.edges.map(
|
return linkedMesuresData.control.mesures.edges.map((edge) => edge.node);
|
||||||
(edge) => edge.node
|
}, [linkedMesuresData]);
|
||||||
);
|
|
||||||
}, [linkedMitigationsData]);
|
|
||||||
|
|
||||||
const isMitigationLinked = useCallback(
|
const isMesureLinked = useCallback(
|
||||||
(mitigationId: string) => {
|
(mesureId: string) => {
|
||||||
const linkedMitigations = getLinkedMitigations();
|
const linkedMesures = getLinkedMesures();
|
||||||
return linkedMitigations.some(
|
return linkedMesures.some((mesure) => mesure.id === mesureId);
|
||||||
(mitigation) => mitigation.id === mitigationId
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
[getLinkedMitigations]
|
[getLinkedMesures]
|
||||||
);
|
);
|
||||||
|
|
||||||
const getMitigationCategories = useCallback(() => {
|
const getMesureCategories = useCallback(() => {
|
||||||
const mitigations = getMitigations();
|
const mesures = getMesures();
|
||||||
const categories = new Set<string>();
|
const categories = new Set<string>();
|
||||||
|
|
||||||
mitigations.forEach((mitigation) => {
|
mesures.forEach((mesure) => {
|
||||||
if (mitigation.category) {
|
if (mesure.category) {
|
||||||
categories.add(mitigation.category);
|
categories.add(mesure.category);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return Array.from(categories).sort();
|
return Array.from(categories).sort();
|
||||||
}, [getMitigations]);
|
}, [getMesures]);
|
||||||
|
|
||||||
const filteredMitigations = useCallback(() => {
|
const filteredMesures = useCallback(() => {
|
||||||
const mitigations = getMitigations();
|
const mesures = getMesures();
|
||||||
if (!mitigationSearchQuery && !categoryFilter) return mitigations;
|
if (!mesureSearchQuery && !categoryFilter) return mesures;
|
||||||
|
|
||||||
return mitigations.filter((mitigation) => {
|
return mesures.filter((mesure) => {
|
||||||
// Filter by search query
|
// Filter by search query
|
||||||
const matchesSearch =
|
const matchesSearch =
|
||||||
!mitigationSearchQuery ||
|
!mesureSearchQuery ||
|
||||||
mitigation.name
|
mesure.name.toLowerCase().includes(mesureSearchQuery.toLowerCase()) ||
|
||||||
|
(mesure.description &&
|
||||||
|
mesure.description
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(mitigationSearchQuery.toLowerCase()) ||
|
.includes(mesureSearchQuery.toLowerCase()));
|
||||||
(mitigation.description &&
|
|
||||||
mitigation.description
|
|
||||||
.toLowerCase()
|
|
||||||
.includes(mitigationSearchQuery.toLowerCase()));
|
|
||||||
|
|
||||||
// Filter by category
|
// Filter by category
|
||||||
const matchesCategory =
|
const matchesCategory =
|
||||||
!categoryFilter ||
|
!categoryFilter ||
|
||||||
categoryFilter === "all" ||
|
categoryFilter === "all" ||
|
||||||
mitigation.category === categoryFilter;
|
mesure.category === categoryFilter;
|
||||||
|
|
||||||
return matchesSearch && matchesCategory;
|
return matchesSearch && matchesCategory;
|
||||||
});
|
});
|
||||||
}, [categoryFilter, getMitigations, mitigationSearchQuery]);
|
}, [categoryFilter, getMesures, mesureSearchQuery]);
|
||||||
|
|
||||||
// Handle link/unlink functions
|
// Handle link/unlink functions
|
||||||
const handleLinkMitigation = useCallback(
|
const handleLinkMesure = useCallback(
|
||||||
(mitigationId: string) => {
|
(mesureId: string) => {
|
||||||
if (!control.id) return;
|
if (!control.id) return;
|
||||||
|
|
||||||
setIsLinkingMitigation(true);
|
setIsLinkingMesure(true);
|
||||||
|
|
||||||
commitCreateMitigationMapping({
|
commitCreateMesureMapping({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
controlId: control.id,
|
controlId: control.id,
|
||||||
mitigationId: mitigationId,
|
mesureId: mesureId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: (_, errors) => {
|
onCompleted: (_, errors) => {
|
||||||
setIsLinkingMitigation(false);
|
setIsLinkingMesure(false);
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
console.error("Error linking mitigation:", errors);
|
console.error("Error linking mesure:", errors);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to link mitigation. Please try again.",
|
description: "Failed to link mesure. Please try again.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh linked mitigations data
|
// Refresh linked mesures data
|
||||||
fetchQuery<ControlLinkedMitigationsQuery>(
|
fetchQuery<ControlLinkedMesuresQuery>(
|
||||||
environment,
|
environment,
|
||||||
linkedMitigationsQuery,
|
linkedMesuresQuery,
|
||||||
{
|
{
|
||||||
controlId: control.id,
|
controlId: control.id,
|
||||||
}
|
}
|
||||||
).subscribe({
|
).subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
setLinkedMitigationsData(data);
|
setLinkedMesuresData(data);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error refreshing linked mitigations:", error);
|
console.error("Error refreshing linked mesures:", error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
description: "Mitigation successfully linked to control.",
|
description: "Mesure successfully linked to control.",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
setIsLinkingMitigation(false);
|
setIsLinkingMesure(false);
|
||||||
console.error("Error linking mitigation:", error);
|
console.error("Error linking mesure:", error);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to link mitigation. Please try again.",
|
description: "Failed to link mesure. Please try again.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[commitCreateMitigationMapping, control.id, environment, toast]
|
[commitCreateMesureMapping, control.id, environment, toast]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleUnlinkMitigation = useCallback(
|
const handleUnlinkMesure = useCallback(
|
||||||
(mitigationId: string) => {
|
(mesureId: string) => {
|
||||||
if (!control.id) return;
|
if (!control.id) return;
|
||||||
|
|
||||||
setIsUnlinkingMitigation(true);
|
setIsUnlinkingMesure(true);
|
||||||
|
|
||||||
commitDeleteMitigationMapping({
|
commitDeleteMesureMapping({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
controlId: control.id,
|
controlId: control.id,
|
||||||
mitigationId: mitigationId,
|
mesureId: mesureId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: (_, errors) => {
|
onCompleted: (_, errors) => {
|
||||||
setIsUnlinkingMitigation(false);
|
setIsUnlinkingMesure(false);
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
console.error("Error unlinking mitigation:", errors);
|
console.error("Error unlinking mesure:", errors);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to unlink mitigation. Please try again.",
|
description: "Failed to unlink mesure. Please try again.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh linked mitigations data
|
// Refresh linked mesures data
|
||||||
fetchQuery<ControlLinkedMitigationsQuery>(
|
fetchQuery<ControlLinkedMesuresQuery>(
|
||||||
environment,
|
environment,
|
||||||
linkedMitigationsQuery,
|
linkedMesuresQuery,
|
||||||
{
|
{
|
||||||
controlId: control.id,
|
controlId: control.id,
|
||||||
}
|
}
|
||||||
).subscribe({
|
).subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
setLinkedMitigationsData(data);
|
setLinkedMesuresData(data);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error refreshing linked mitigations:", error);
|
console.error("Error refreshing linked mesures:", error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
description: "Mitigation successfully unlinked from control.",
|
description: "Mesure successfully unlinked from control.",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
setIsUnlinkingMitigation(false);
|
setIsUnlinkingMesure(false);
|
||||||
console.error("Error unlinking mitigation:", error);
|
console.error("Error unlinking mesure:", error);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to unlink mitigation. Please try again.",
|
description: "Failed to unlink mesure. Please try again.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[commitDeleteMitigationMapping, control.id, environment, toast]
|
[commitDeleteMesureMapping, control.id, environment, toast]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleOpenMitigationMappingDialog = useCallback(() => {
|
const handleOpenMesureMappingDialog = useCallback(() => {
|
||||||
loadMitigationsData();
|
loadMesuresData();
|
||||||
setIsMitigationMappingDialogOpen(true);
|
setIsMesureMappingDialogOpen(true);
|
||||||
}, [loadMitigationsData]);
|
}, [loadMesuresData]);
|
||||||
|
|
||||||
// Load initial linked policies data
|
// Load initial linked policies data
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -824,10 +805,10 @@ export function Control({
|
|||||||
|
|
||||||
{/* Security Measures Section */}
|
{/* Security Measures Section */}
|
||||||
<div className="mt-8">
|
<div className="mt-8">
|
||||||
{/* Mitigation Mapping Dialog */}
|
{/* Mesure Mapping Dialog */}
|
||||||
<Dialog
|
<Dialog
|
||||||
open={isMitigationMappingDialogOpen}
|
open={isMesureMappingDialogOpen}
|
||||||
onOpenChange={setIsMitigationMappingDialogOpen}
|
onOpenChange={setIsMesureMappingDialogOpen}
|
||||||
>
|
>
|
||||||
<DialogContent className="max-w-3xl max-h-[80vh] overflow-hidden flex flex-col">
|
<DialogContent className="max-w-3xl max-h-[80vh] overflow-hidden flex flex-col">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
@@ -844,8 +825,8 @@ export function Control({
|
|||||||
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-tertiary" />
|
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-tertiary" />
|
||||||
<Input
|
<Input
|
||||||
placeholder="Search security measures by name or description..."
|
placeholder="Search security measures by name or description..."
|
||||||
value={mitigationSearchQuery}
|
value={mesureSearchQuery}
|
||||||
onChange={(e) => setMitigationSearchQuery(e.target.value)}
|
onChange={(e) => setMesureSearchQuery(e.target.value)}
|
||||||
className="w-full pl-10"
|
className="w-full pl-10"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -862,7 +843,7 @@ export function Control({
|
|||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="all">All categories</SelectItem>
|
<SelectItem value="all">All categories</SelectItem>
|
||||||
{getMitigationCategories().map((category) => (
|
{getMesureCategories().map((category) => (
|
||||||
<SelectItem key={category} value={category}>
|
<SelectItem key={category} value={category}>
|
||||||
{category}
|
{category}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
@@ -873,14 +854,14 @@ export function Control({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex-1 overflow-hidden">
|
<div className="flex-1 overflow-hidden">
|
||||||
{isLoadingMitigations ? (
|
{isLoadingMesures ? (
|
||||||
<div className="flex items-center justify-center h-full">
|
<div className="flex items-center justify-center h-full">
|
||||||
<Loader2 className="w-8 h-8 animate-spin text-info" />
|
<Loader2 className="w-8 h-8 animate-spin text-info" />
|
||||||
<span className="ml-2">Loading security measures...</span>
|
<span className="ml-2">Loading security measures...</span>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="max-h-[50vh] overflow-y-auto pr-2">
|
<div className="max-h-[50vh] overflow-y-auto pr-2">
|
||||||
{filteredMitigations().length === 0 ? (
|
{filteredMesures().length === 0 ? (
|
||||||
<div className="text-center py-8 text-secondary">
|
<div className="text-center py-8 text-secondary">
|
||||||
No security measures found. Try adjusting your search or
|
No security measures found. Try adjusting your search or
|
||||||
select a different category.
|
select a different category.
|
||||||
@@ -900,39 +881,39 @@ export function Control({
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{filteredMitigations().map((mitigation) => {
|
{filteredMesures().map((mesure) => {
|
||||||
const isLinked = isMitigationLinked(mitigation.id);
|
const isLinked = isMesureLinked(mesure.id);
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={mitigation.id}
|
key={mesure.id}
|
||||||
className="border-b hover:bg-invert-bg"
|
className="border-b hover:bg-invert-bg"
|
||||||
>
|
>
|
||||||
<td className="py-3 px-4">
|
<td className="py-3 px-4">
|
||||||
<div className="font-medium">
|
<div className="font-medium">
|
||||||
{mitigation.name}
|
{mesure.name}
|
||||||
</div>
|
</div>
|
||||||
{mitigation.description && (
|
{mesure.description && (
|
||||||
<div className="text-xs text-secondary line-clamp-1 mt-0.5">
|
<div className="text-xs text-secondary line-clamp-1 mt-0.5">
|
||||||
{mitigation.description}
|
{mesure.description}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td className="py-3 px-4">
|
<td className="py-3 px-4">
|
||||||
<div
|
<div
|
||||||
className={`px-2 py-0.5 rounded-full text-xs ${getImportanceColor(
|
className={`px-2 py-0.5 rounded-full text-xs ${getImportanceColor(
|
||||||
mitigation.importance
|
mesure.importance
|
||||||
)} inline-block`}
|
)} inline-block`}
|
||||||
>
|
>
|
||||||
{formatImportance(mitigation.importance)}
|
{formatImportance(mesure.importance)}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="py-3 px-4">
|
<td className="py-3 px-4">
|
||||||
<div
|
<div
|
||||||
className={`px-2 py-0.5 rounded-full text-xs ${getStateColor(
|
className={`px-2 py-0.5 rounded-full text-xs ${getStateColor(
|
||||||
mitigation.state
|
mesure.state
|
||||||
)} inline-block`}
|
)} inline-block`}
|
||||||
>
|
>
|
||||||
{formatState(mitigation.state)}
|
{formatState(mesure.state)}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="py-3 px-4 text-right whitespace-nowrap">
|
<td className="py-3 px-4 text-right whitespace-nowrap">
|
||||||
@@ -941,12 +922,12 @@ export function Control({
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
handleUnlinkMitigation(mitigation.id)
|
handleUnlinkMesure(mesure.id)
|
||||||
}
|
}
|
||||||
disabled={isUnlinkingMitigation}
|
disabled={isUnlinkingMesure}
|
||||||
className="text-xs h-7 text-danger border-danger-b hover:bg-h-danger-bg"
|
className="text-xs h-7 text-danger border-danger-b hover:bg-h-danger-bg"
|
||||||
>
|
>
|
||||||
{isUnlinkingMitigation ? (
|
{isUnlinkingMesure ? (
|
||||||
<Loader2 className="w-4 h-4 animate-spin" />
|
<Loader2 className="w-4 h-4 animate-spin" />
|
||||||
) : (
|
) : (
|
||||||
<X className="w-4 h-4" />
|
<X className="w-4 h-4" />
|
||||||
@@ -958,12 +939,12 @@ export function Control({
|
|||||||
variant="secondary"
|
variant="secondary"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
handleLinkMitigation(mitigation.id)
|
handleLinkMesure(mesure.id)
|
||||||
}
|
}
|
||||||
disabled={isLinkingMitigation}
|
disabled={isLinkingMesure}
|
||||||
className="text-xs h-7 text-info border-info-b hover:bg-h-info-bg"
|
className="text-xs h-7 text-info border-info-b hover:bg-h-info-bg"
|
||||||
>
|
>
|
||||||
{isLinkingMitigation ? (
|
{isLinkingMesure ? (
|
||||||
<Loader2 className="w-4 h-4 animate-spin" />
|
<Loader2 className="w-4 h-4 animate-spin" />
|
||||||
) : (
|
) : (
|
||||||
<LinkIcon className="w-4 h-4" />
|
<LinkIcon className="w-4 h-4" />
|
||||||
@@ -983,14 +964,14 @@ export function Control({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DialogFooter className="mt-4">
|
<DialogFooter className="mt-4">
|
||||||
<Button onClick={() => setIsMitigationMappingDialogOpen(false)}>
|
<Button onClick={() => setIsMesureMappingDialogOpen(false)}>
|
||||||
Close
|
Close
|
||||||
</Button>
|
</Button>
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
{/* Linked Mitigations List */}
|
{/* Linked Mesures List */}
|
||||||
<div>
|
<div>
|
||||||
<div className="flex justify-between items-center mb-4">
|
<div className="flex justify-between items-center mb-4">
|
||||||
<h3 className="text-xl font-medium text-secondary">
|
<h3 className="text-xl font-medium text-secondary">
|
||||||
@@ -1000,20 +981,20 @@ export function Control({
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="flex items-center gap-1"
|
className="flex items-center gap-1"
|
||||||
onClick={handleOpenMitigationMappingDialog}
|
onClick={handleOpenMesureMappingDialog}
|
||||||
>
|
>
|
||||||
<LinkIcon className="w-4 h-4" />
|
<LinkIcon className="w-4 h-4" />
|
||||||
<span>Link Security Measures</span>
|
<span>Link Security Measures</span>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isLoadingMitigations ? (
|
{isLoadingMesures ? (
|
||||||
<div className="flex items-center justify-center h-24">
|
<div className="flex items-center justify-center h-24">
|
||||||
<Loader2 className="w-6 h-6 animate-spin text-info" />
|
<Loader2 className="w-6 h-6 animate-spin text-info" />
|
||||||
<span className="ml-2">Loading security measures...</span>
|
<span className="ml-2">Loading security measures...</span>
|
||||||
</div>
|
</div>
|
||||||
) : linkedMitigationsData?.control?.mitigations?.edges &&
|
) : linkedMesuresData?.control?.mesures?.edges &&
|
||||||
linkedMitigationsData.control.mitigations.edges.length > 0 ? (
|
linkedMesuresData.control.mesures.edges.length > 0 ? (
|
||||||
<div className="overflow-x-auto border rounded-md">
|
<div className="overflow-x-auto border rounded-md">
|
||||||
<table className="w-full">
|
<table className="w-full">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -1027,35 +1008,35 @@ export function Control({
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{getLinkedMitigations().map((mitigation) => (
|
{getLinkedMesures().map((mesure) => (
|
||||||
<tr
|
<tr
|
||||||
key={mitigation.id}
|
key={mesure.id}
|
||||||
className="border-b hover:bg-invert-bg"
|
className="border-b hover:bg-invert-bg"
|
||||||
>
|
>
|
||||||
<td className="py-3 px-4">
|
<td className="py-3 px-4">
|
||||||
<div className="font-medium">{mitigation.name}</div>
|
<div className="font-medium">{mesure.name}</div>
|
||||||
{mitigation.description && (
|
{mesure.description && (
|
||||||
<div className="text-xs text-secondary line-clamp-1 mt-0.5">
|
<div className="text-xs text-secondary line-clamp-1 mt-0.5">
|
||||||
{mitigation.description}
|
{mesure.description}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td className="py-3 px-4">
|
<td className="py-3 px-4">
|
||||||
<div
|
<div
|
||||||
className={`px-2 py-0.5 rounded-full text-xs ${getImportanceColor(
|
className={`px-2 py-0.5 rounded-full text-xs ${getImportanceColor(
|
||||||
mitigation.importance
|
mesure.importance
|
||||||
)} inline-block`}
|
)} inline-block`}
|
||||||
>
|
>
|
||||||
{formatImportance(mitigation.importance)}
|
{formatImportance(mesure.importance)}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="py-3 px-4">
|
<td className="py-3 px-4">
|
||||||
<div
|
<div
|
||||||
className={`px-2 py-0.5 rounded-full text-xs ${getStateColor(
|
className={`px-2 py-0.5 rounded-full text-xs ${getStateColor(
|
||||||
mitigation.state
|
mesure.state
|
||||||
)} inline-block`}
|
)} inline-block`}
|
||||||
>
|
>
|
||||||
{formatState(mitigation.state)}
|
{formatState(mesure.state)}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="py-3 px-4 text-right whitespace-nowrap">
|
<td className="py-3 px-4 text-right whitespace-nowrap">
|
||||||
@@ -1067,7 +1048,7 @@ export function Control({
|
|||||||
className="text-xs h-7"
|
className="text-xs h-7"
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
to={`/organizations/${organizationId}/mitigations/${mitigation.id}`}
|
to={`/organizations/${organizationId}/mesures/${mesure.id}`}
|
||||||
>
|
>
|
||||||
View
|
View
|
||||||
</Link>
|
</Link>
|
||||||
@@ -1075,10 +1056,8 @@ export function Control({
|
|||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() =>
|
onClick={() => handleUnlinkMesure(mesure.id)}
|
||||||
handleUnlinkMitigation(mitigation.id)
|
disabled={isUnlinkingMesure}
|
||||||
}
|
|
||||||
disabled={isUnlinkingMitigation}
|
|
||||||
className="text-xs h-7 text-danger border-danger-b hover:bg-h-danger-bg"
|
className="text-xs h-7 text-danger border-danger-b hover:bg-h-danger-bg"
|
||||||
>
|
>
|
||||||
Unlink
|
Unlink
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<53f255c3852774870c7d294d64e6808d>>
|
* @generated SignedSource<<aad63785dac93ad7f8db05ee4f219109>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,21 +9,21 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type CreateControlMitigationMappingInput = {
|
export type CreateControlMesureMappingInput = {
|
||||||
controlId: string;
|
controlId: string;
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateControlMappingMutation$variables = {
|
export type ControlCreateMesureMappingMutation$variables = {
|
||||||
input: CreateControlMitigationMappingInput;
|
input: CreateControlMesureMappingInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateControlMappingMutation$data = {
|
export type ControlCreateMesureMappingMutation$data = {
|
||||||
readonly createControlMitigationMapping: {
|
readonly createControlMesureMapping: {
|
||||||
readonly success: boolean;
|
readonly success: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateControlMappingMutation = {
|
export type ControlCreateMesureMappingMutation = {
|
||||||
response: MitigationViewCreateControlMappingMutation$data;
|
response: ControlCreateMesureMappingMutation$data;
|
||||||
variables: MitigationViewCreateControlMappingMutation$variables;
|
variables: ControlCreateMesureMappingMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -44,9 +44,9 @@ v1 = [
|
|||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "CreateControlMitigationMappingPayload",
|
"concreteType": "CreateControlMesureMappingPayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "createControlMitigationMapping",
|
"name": "createControlMesureMapping",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -65,7 +65,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewCreateControlMappingMutation",
|
"name": "ControlCreateMesureMappingMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -74,20 +74,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewCreateControlMappingMutation",
|
"name": "ControlCreateMesureMappingMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "fa46c5cf8b96b70117d12cf985247824",
|
"cacheID": "589fad9dec58fb2efe52e8e587c8ce85",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewCreateControlMappingMutation",
|
"name": "ControlCreateMesureMappingMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewCreateControlMappingMutation(\n $input: CreateControlMitigationMappingInput!\n) {\n createControlMitigationMapping(input: $input) {\n success\n }\n}\n"
|
"text": "mutation ControlCreateMesureMappingMutation(\n $input: CreateControlMesureMappingInput!\n) {\n createControlMesureMapping(input: $input) {\n success\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "af6e4d7933e5c428eec0e97cdf0b73dd";
|
(node as any).hash = "8974d4f4025f6e1eaba2a6b30e357486";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<f34a09cd4eda414409384386a4cea5b4>>
|
* @generated SignedSource<<272b7b4a8bc0c81baa4a8d8f3656be0c>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,21 +9,21 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type DeleteControlMitigationMappingInput = {
|
export type DeleteControlMesureMappingInput = {
|
||||||
controlId: string;
|
controlId: string;
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteControlMappingMutation$variables = {
|
export type ControlDeleteMesureMappingMutation$variables = {
|
||||||
input: DeleteControlMitigationMappingInput;
|
input: DeleteControlMesureMappingInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteControlMappingMutation$data = {
|
export type ControlDeleteMesureMappingMutation$data = {
|
||||||
readonly deleteControlMitigationMapping: {
|
readonly deleteControlMesureMapping: {
|
||||||
readonly success: boolean;
|
readonly success: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteControlMappingMutation = {
|
export type ControlDeleteMesureMappingMutation = {
|
||||||
response: MitigationViewDeleteControlMappingMutation$data;
|
response: ControlDeleteMesureMappingMutation$data;
|
||||||
variables: MitigationViewDeleteControlMappingMutation$variables;
|
variables: ControlDeleteMesureMappingMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -44,9 +44,9 @@ v1 = [
|
|||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "DeleteControlMitigationMappingPayload",
|
"concreteType": "DeleteControlMesureMappingPayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "deleteControlMitigationMapping",
|
"name": "deleteControlMesureMapping",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -65,7 +65,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewDeleteControlMappingMutation",
|
"name": "ControlDeleteMesureMappingMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -74,20 +74,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewDeleteControlMappingMutation",
|
"name": "ControlDeleteMesureMappingMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "b18a11215ba33a6c770cc08c88a28769",
|
"cacheID": "66b2b12e57f8a150825f0e3f25494093",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewDeleteControlMappingMutation",
|
"name": "ControlDeleteMesureMappingMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewDeleteControlMappingMutation(\n $input: DeleteControlMitigationMappingInput!\n) {\n deleteControlMitigationMapping(input: $input) {\n success\n }\n}\n"
|
"text": "mutation ControlDeleteMesureMappingMutation(\n $input: DeleteControlMesureMappingInput!\n) {\n deleteControlMesureMapping(input: $input) {\n success\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "f4f01abb45a3288558d7e8a1d19ce1ed";
|
(node as any).hash = "64e6f03a12a22a87e4893a335e58379b";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<d03d81a6969d83d42491f33bcbd1fc00>>
|
* @generated SignedSource<<03360061cfc99eaa1ec9921a815f9fa0>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,31 +9,31 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type ControlLinkedMitigationsQuery$variables = {
|
export type ControlLinkedMesuresQuery$variables = {
|
||||||
controlId: string;
|
controlId: string;
|
||||||
};
|
};
|
||||||
export type ControlLinkedMitigationsQuery$data = {
|
export type ControlLinkedMesuresQuery$data = {
|
||||||
readonly control: {
|
readonly control: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly mitigations?: {
|
readonly mesures?: {
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly category: string;
|
readonly category: string;
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly importance: MitigationImportance;
|
readonly importance: MesureImportance;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly state: MitigationState;
|
readonly state: MesureState;
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type ControlLinkedMitigationsQuery = {
|
export type ControlLinkedMesuresQuery = {
|
||||||
response: ControlLinkedMitigationsQuery$data;
|
response: ControlLinkedMesuresQuery$data;
|
||||||
variables: ControlLinkedMitigationsQuery$variables;
|
variables: ControlLinkedMesuresQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -69,7 +69,7 @@ v4 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationEdge",
|
"concreteType": "MesureEdge",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "edges",
|
"name": "edges",
|
||||||
"plural": true,
|
"plural": true,
|
||||||
@@ -77,7 +77,7 @@ v4 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
@@ -170,7 +170,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ControlLinkedMitigationsQuery",
|
"name": "ControlLinkedMesuresQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "control",
|
"alias": "control",
|
||||||
@@ -185,11 +185,11 @@ return {
|
|||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigations",
|
"alias": "mesures",
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__Control__mitigations_connection",
|
"name": "__Control__mesures_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v4/*: any*/),
|
"selections": (v4/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -209,7 +209,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "ControlLinkedMitigationsQuery",
|
"name": "ControlLinkedMesuresQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "control",
|
"alias": "control",
|
||||||
@@ -227,21 +227,21 @@ return {
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigations",
|
"name": "mesures",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v4/*: any*/),
|
"selections": (v4/*: any*/),
|
||||||
"storageKey": "mitigations(first:100)"
|
"storageKey": "mesures(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "Control__mitigations",
|
"key": "Control__mesures",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "mitigations"
|
"name": "mesures"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Control",
|
"type": "Control",
|
||||||
@@ -253,7 +253,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "082617925f3db2937654823bd7dc8833",
|
"cacheID": "19d9240a60b26d765a93e00be9e1e83f",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -263,18 +263,18 @@ return {
|
|||||||
"direction": "forward",
|
"direction": "forward",
|
||||||
"path": [
|
"path": [
|
||||||
"control",
|
"control",
|
||||||
"mitigations"
|
"mesures"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "ControlLinkedMitigationsQuery",
|
"name": "ControlLinkedMesuresQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query ControlLinkedMitigationsQuery(\n $controlId: ID!\n) {\n control: node(id: $controlId) {\n __typename\n id\n ... on Control {\n mitigations(first: 100) {\n edges {\n node {\n id\n name\n description\n category\n importance\n state\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query ControlLinkedMesuresQuery(\n $controlId: ID!\n) {\n control: node(id: $controlId) {\n __typename\n id\n ... on Control {\n mesures(first: 100) {\n edges {\n node {\n id\n name\n description\n category\n importance\n state\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "3d61e207c8a46a72f19e3414152438b8";
|
(node as any).hash = "acb01a862fb268c4b4b557edc3090a0e";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<3c11f3c5fa5a298493ba19d950baa7d2>>
|
* @generated SignedSource<<345a2b05f66a0bb630eea3c12f549e52>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,31 +9,31 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type ControlOrganizationMitigationsQuery$variables = {
|
export type ControlOrganizationMesuresQuery$variables = {
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
};
|
};
|
||||||
export type ControlOrganizationMitigationsQuery$data = {
|
export type ControlOrganizationMesuresQuery$data = {
|
||||||
readonly organization: {
|
readonly organization: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly mitigations?: {
|
readonly mesures?: {
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly category: string;
|
readonly category: string;
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly importance: MitigationImportance;
|
readonly importance: MesureImportance;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly state: MitigationState;
|
readonly state: MesureState;
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type ControlOrganizationMitigationsQuery = {
|
export type ControlOrganizationMesuresQuery = {
|
||||||
response: ControlOrganizationMitigationsQuery$data;
|
response: ControlOrganizationMesuresQuery$data;
|
||||||
variables: ControlOrganizationMitigationsQuery$variables;
|
variables: ControlOrganizationMesuresQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -69,7 +69,7 @@ v4 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationEdge",
|
"concreteType": "MesureEdge",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "edges",
|
"name": "edges",
|
||||||
"plural": true,
|
"plural": true,
|
||||||
@@ -77,7 +77,7 @@ v4 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
@@ -170,7 +170,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ControlOrganizationMitigationsQuery",
|
"name": "ControlOrganizationMesuresQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -185,11 +185,11 @@ return {
|
|||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigations",
|
"alias": "mesures",
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__Organization__mitigations_connection",
|
"name": "__Organization__mesures_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v4/*: any*/),
|
"selections": (v4/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -209,7 +209,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "ControlOrganizationMitigationsQuery",
|
"name": "ControlOrganizationMesuresQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -227,21 +227,21 @@ return {
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigations",
|
"name": "mesures",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v4/*: any*/),
|
"selections": (v4/*: any*/),
|
||||||
"storageKey": "mitigations(first:100)"
|
"storageKey": "mesures(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "Organization__mitigations",
|
"key": "Organization__mesures",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "mitigations"
|
"name": "mesures"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Organization",
|
"type": "Organization",
|
||||||
@@ -253,7 +253,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "21e0815f3ed8b62621aa0d7824a93036",
|
"cacheID": "59ceb60db60754876774a3856686b35c",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -263,18 +263,18 @@ return {
|
|||||||
"direction": "forward",
|
"direction": "forward",
|
||||||
"path": [
|
"path": [
|
||||||
"organization",
|
"organization",
|
||||||
"mitigations"
|
"mesures"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "ControlOrganizationMitigationsQuery",
|
"name": "ControlOrganizationMesuresQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query ControlOrganizationMitigationsQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n mitigations(first: 100) {\n edges {\n node {\n id\n name\n description\n category\n importance\n state\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query ControlOrganizationMesuresQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n mesures(first: 100) {\n edges {\n node {\n id\n name\n description\n category\n importance\n state\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "54b1b5a6966cf761d49739da3a988db8";
|
(node as any).hash = "cc43b07a1a1f5831f5d09fbd13d8805d";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -4,26 +4,26 @@ import { lazy } from "@probo/react-lazy";
|
|||||||
import { useLocation } from "react-router";
|
import { useLocation } from "react-router";
|
||||||
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
||||||
|
|
||||||
const NewMitigationView = lazy(() => import("./NewMitigationView"));
|
const EditMesureView = lazy(() => import("./EditMesureView"));
|
||||||
|
|
||||||
export function NewMitigationViewSkeleton() {
|
export function EditMesureViewSkeleton() {
|
||||||
return (
|
return (
|
||||||
<PageTemplateSkeleton
|
<PageTemplateSkeleton
|
||||||
title="New Mitigation"
|
title="Edit Mesure"
|
||||||
description="Add a new mitigation. You will be able to link it to control and risks"
|
description="Edit a Mesure. You will be able to link it to control and risks"
|
||||||
>
|
>
|
||||||
<div className="max-w-2xl aspect-square bg-subtle-bg rounded-xl animate-pulse" />
|
<div className="max-w-2xl aspect-square bg-subtle-bg rounded-xl animate-pulse" />
|
||||||
</PageTemplateSkeleton>
|
</PageTemplateSkeleton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function NewMitigationPage() {
|
export function EditMesurePage() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense key={location.pathname} fallback={<NewMitigationViewSkeleton />}>
|
<Suspense key={location.pathname} fallback={<EditMesureViewSkeleton />}>
|
||||||
<ErrorBoundaryWithLocation>
|
<ErrorBoundaryWithLocation>
|
||||||
<NewMitigationView />
|
<EditMesureView />
|
||||||
</ErrorBoundaryWithLocation>
|
</ErrorBoundaryWithLocation>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
@@ -9,19 +9,19 @@ import {
|
|||||||
import { useParams, useNavigate } from "react-router";
|
import { useParams, useNavigate } from "react-router";
|
||||||
import { PageTemplate } from "@/components/PageTemplate";
|
import { PageTemplate } from "@/components/PageTemplate";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
import { EditMitigationViewUpdateMitigationMutation } from "./__generated__/EditMitigationViewUpdateMitigationMutation.graphql";
|
import { EditMesureViewUpdateMesureMutation } from "./__generated__/EditMesureViewUpdateMesureMutation.graphql";
|
||||||
import { EditableField } from "@/components/EditableField";
|
import { EditableField } from "@/components/EditableField";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Card } from "@/components/ui/card";
|
import { Card } from "@/components/ui/card";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { EditMitigationViewSkeleton } from "./EditMitigationPage";
|
import { EditMesureViewSkeleton } from "./EditMesurePage";
|
||||||
import { EditMitigationViewQuery } from "./__generated__/EditMitigationViewQuery.graphql";
|
import { EditMesureViewQuery } from "./__generated__/EditMesureViewQuery.graphql";
|
||||||
|
|
||||||
const editMitigationQuery = graphql`
|
const editMesureQuery = graphql`
|
||||||
query EditMitigationViewQuery($mitigationId: ID!) {
|
query EditMesureViewQuery($mesureId: ID!) {
|
||||||
node(id: $mitigationId) {
|
node(id: $mesureId) {
|
||||||
... on Mitigation {
|
... on Mesure {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
description
|
description
|
||||||
@@ -32,12 +32,10 @@ const editMitigationQuery = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const updateMitigationMutation = graphql`
|
const updateMesureMutation = graphql`
|
||||||
mutation EditMitigationViewUpdateMitigationMutation(
|
mutation EditMesureViewUpdateMesureMutation($input: UpdateMesureInput!) {
|
||||||
$input: UpdateMitigationInput!
|
updateMesure(input: $input) {
|
||||||
) {
|
mesure {
|
||||||
updateMitigation(input: $input) {
|
|
||||||
mitigation {
|
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
description
|
description
|
||||||
@@ -46,29 +44,27 @@ const updateMitigationMutation = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function EditMitigationViewContent({
|
function EditMesureViewContent({
|
||||||
queryRef,
|
queryRef,
|
||||||
}: {
|
}: {
|
||||||
queryRef: PreloadedQuery<EditMitigationViewQuery>;
|
queryRef: PreloadedQuery<EditMesureViewQuery>;
|
||||||
}) {
|
}) {
|
||||||
const { organizationId } = useParams<{
|
const { organizationId } = useParams<{
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
}>();
|
}>();
|
||||||
const { mitigationId } = useParams();
|
const { mesureId } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const { node: mitigation } = usePreloadedQuery(editMitigationQuery, queryRef);
|
const { node: mesure } = usePreloadedQuery(editMesureQuery, queryRef);
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
name: mitigation.name ?? "",
|
name: mesure.name ?? "",
|
||||||
description: mitigation.description ?? "",
|
description: mesure.description ?? "",
|
||||||
category: mitigation.category ?? "",
|
category: mesure.category ?? "",
|
||||||
importance: mitigation.importance,
|
importance: mesure.importance,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [commit, isInFlight] =
|
const [commit, isInFlight] =
|
||||||
useMutation<EditMitigationViewUpdateMitigationMutation>(
|
useMutation<EditMesureViewUpdateMesureMutation>(updateMesureMutation);
|
||||||
updateMitigationMutation
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleFieldChange = (field: keyof typeof formData, value: unknown) => {
|
const handleFieldChange = (field: keyof typeof formData, value: unknown) => {
|
||||||
setFormData((prev) => ({
|
setFormData((prev) => ({
|
||||||
@@ -92,7 +88,7 @@ function EditMitigationViewContent({
|
|||||||
commit({
|
commit({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
id: mitigationId!,
|
id: mesureId!,
|
||||||
name: formData.name,
|
name: formData.name,
|
||||||
description: formData.description,
|
description: formData.description,
|
||||||
category: formData.category,
|
category: formData.category,
|
||||||
@@ -103,7 +99,7 @@ function EditMitigationViewContent({
|
|||||||
if (errors) {
|
if (errors) {
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: errors[0]?.message || "Failed to update mitigation",
|
description: errors[0]?.message || "Failed to update mesure",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -111,12 +107,10 @@ function EditMitigationViewContent({
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
description: "Mitigation updated successfully",
|
description: "Mesure updated successfully",
|
||||||
});
|
});
|
||||||
|
|
||||||
navigate(
|
navigate(`/organizations/${organizationId}/mesures/${mesureId}`);
|
||||||
`/organizations/${organizationId}/mitigations/${mitigationId}`
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
onError(error) {
|
onError(error) {
|
||||||
toast({
|
toast({
|
||||||
@@ -130,8 +124,8 @@ function EditMitigationViewContent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageTemplate
|
<PageTemplate
|
||||||
title="Edit Mitigation"
|
title="Edit Mesure"
|
||||||
description="Edit a mitigation. You will be able to link it to control and risks"
|
description="Edit a mesure. You will be able to link it to control and risks"
|
||||||
>
|
>
|
||||||
<Card className="max-w-2xl">
|
<Card className="max-w-2xl">
|
||||||
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
||||||
@@ -148,7 +142,7 @@ function EditMitigationViewContent({
|
|||||||
onChange={(value) => handleFieldChange("description", value)}
|
onChange={(value) => handleFieldChange("description", value)}
|
||||||
required
|
required
|
||||||
multiline
|
multiline
|
||||||
helpText="Provide a detailed description of the mitigation"
|
helpText="Provide a detailed description of the mesure"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<EditableField
|
<EditableField
|
||||||
@@ -209,15 +203,13 @@ function EditMitigationViewContent({
|
|||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
navigate(
|
navigate(`/organizations/${organizationId}/mesures/${mesureId}`)
|
||||||
`/organizations/${organizationId}/mitigations/${mitigationId}`
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit" disabled={isInFlight}>
|
<Button type="submit" disabled={isInFlight}>
|
||||||
{isInFlight ? "Updating..." : "Update Mitigation"}
|
{isInFlight ? "Updating..." : "Update Mesure"}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -226,24 +218,24 @@ function EditMitigationViewContent({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function EditMitigationView() {
|
export default function EditMesureView() {
|
||||||
const { mitigationId } = useParams();
|
const { mesureId } = useParams();
|
||||||
const [queryRef, loadQuery] =
|
const [queryRef, loadQuery] =
|
||||||
useQueryLoader<EditMitigationViewQuery>(editMitigationQuery);
|
useQueryLoader<EditMesureViewQuery>(editMesureQuery);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mitigationId) {
|
if (mesureId) {
|
||||||
loadQuery({ mitigationId });
|
loadQuery({ mesureId });
|
||||||
}
|
}
|
||||||
}, [mitigationId, loadQuery]);
|
}, [mesureId, loadQuery]);
|
||||||
|
|
||||||
if (!queryRef) {
|
if (!queryRef) {
|
||||||
return <EditMitigationViewSkeleton />;
|
return <EditMesureViewSkeleton />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<EditMitigationViewSkeleton />}>
|
<Suspense fallback={<EditMesureViewSkeleton />}>
|
||||||
<EditMitigationViewContent queryRef={queryRef} />
|
<EditMesureViewContent queryRef={queryRef} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -4,13 +4,13 @@ import { lazy } from "@probo/react-lazy";
|
|||||||
import { useLocation } from "react-router";
|
import { useLocation } from "react-router";
|
||||||
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
||||||
|
|
||||||
const MitigationListView = lazy(() => import("./MitigationListView"));
|
const MesureListView = lazy(() => import("./MesureListView"));
|
||||||
|
|
||||||
export function MitigationListViewSkeleton() {
|
export function MesureListViewSkeleton() {
|
||||||
return (
|
return (
|
||||||
<PageTemplateSkeleton
|
<PageTemplateSkeleton
|
||||||
title="Mitigations"
|
title="Mesures"
|
||||||
description="Mitigations are actions taken to reduce the risk of a risk."
|
description="Mesures are actions taken to reduce the risk of a risk."
|
||||||
>
|
>
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div className="h-[72px] bg-subtle-bg animate-pulse rounded-xl" />
|
<div className="h-[72px] bg-subtle-bg animate-pulse rounded-xl" />
|
||||||
@@ -31,13 +31,13 @@ export function MitigationListViewSkeleton() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function MitigationListPage() {
|
export function MesureListPage() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense key={location.pathname} fallback={<MitigationListViewSkeleton />}>
|
<Suspense key={location.pathname} fallback={<MesureListViewSkeleton />}>
|
||||||
<ErrorBoundaryWithLocation>
|
<ErrorBoundaryWithLocation>
|
||||||
<MitigationListView />
|
<MesureListView />
|
||||||
</ErrorBoundaryWithLocation>
|
</ErrorBoundaryWithLocation>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
@@ -21,11 +21,11 @@ import {
|
|||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { PageTemplate } from "@/components/PageTemplate";
|
import { PageTemplate } from "@/components/PageTemplate";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { MitigationListViewQuery as MitigationListViewQueryType } from "./__generated__/MitigationListViewQuery.graphql";
|
import { MesureListViewQuery as MesureListViewQueryType } from "./__generated__/MesureListViewQuery.graphql";
|
||||||
import { MitigationListViewSkeleton } from "./MitigationListPage";
|
import { MesureListViewSkeleton } from "./MesureListPage";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
import { MitigationListViewImportMitigationMutation as MitigationListViewImportMitigationMutationType } from "./__generated__/MitigationListViewImportMitigationMutation.graphql";
|
import { MesureListViewImportMesureMutation as MesureListViewImportMesureMutationType } from "./__generated__/MesureListViewImportMesureMutation.graphql";
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
TooltipContent,
|
TooltipContent,
|
||||||
@@ -38,13 +38,12 @@ import {
|
|||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
|
|
||||||
const mitigationListViewQuery = graphql`
|
const mesureListViewQuery = graphql`
|
||||||
query MitigationListViewQuery($organizationId: ID!, $first: Int) {
|
query MesureListViewQuery($organizationId: ID!, $first: Int) {
|
||||||
organization: node(id: $organizationId) {
|
organization: node(id: $organizationId) {
|
||||||
id
|
id
|
||||||
... on Organization {
|
... on Organization {
|
||||||
mitigations(first: $first)
|
mesures(first: $first) @connection(key: "MesureListView_mesures") {
|
||||||
@connection(key: "MitigationListView_mitigations") {
|
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -63,13 +62,13 @@ const mitigationListViewQuery = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const importMitigationMutation = graphql`
|
const importMesureMutation = graphql`
|
||||||
mutation MitigationListViewImportMitigationMutation(
|
mutation MesureListViewImportMesureMutation(
|
||||||
$input: ImportMitigationInput!
|
$input: ImportMesureInput!
|
||||||
$connections: [ID!]!
|
$connections: [ID!]!
|
||||||
) {
|
) {
|
||||||
importMitigation(input: $input) {
|
importMesure(input: $input) {
|
||||||
mitigationEdges @appendEdge(connections: $connections) {
|
mesureEdges @appendEdge(connections: $connections) {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@@ -85,7 +84,7 @@ const importMitigationMutation = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
interface Mitigation {
|
interface Mesure {
|
||||||
id?: string;
|
id?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
@@ -102,7 +101,7 @@ interface Category {
|
|||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
progress: number;
|
progress: number;
|
||||||
mitigations: Mitigation[];
|
mesures: Mesure[];
|
||||||
doneCount: number;
|
doneCount: number;
|
||||||
totalCount: number;
|
totalCount: number;
|
||||||
}
|
}
|
||||||
@@ -110,21 +109,21 @@ interface Category {
|
|||||||
interface OrganizationData {
|
interface OrganizationData {
|
||||||
organization: {
|
organization: {
|
||||||
id: string;
|
id: string;
|
||||||
mitigations?: {
|
mesures?: {
|
||||||
edges: Array<{
|
edges: Array<{
|
||||||
node: Mitigation;
|
node: Mesure;
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function MitigationListContent({
|
function MesureListContent({
|
||||||
queryRef,
|
queryRef,
|
||||||
}: {
|
}: {
|
||||||
queryRef: PreloadedQuery<MitigationListViewQueryType>;
|
queryRef: PreloadedQuery<MesureListViewQueryType>;
|
||||||
}) {
|
}) {
|
||||||
const data = usePreloadedQuery<MitigationListViewQueryType>(
|
const data = usePreloadedQuery<MesureListViewQueryType>(
|
||||||
mitigationListViewQuery,
|
mesureListViewQuery,
|
||||||
queryRef
|
queryRef
|
||||||
) as unknown as OrganizationData;
|
) as unknown as OrganizationData;
|
||||||
|
|
||||||
@@ -133,10 +132,8 @@ function MitigationListContent({
|
|||||||
const [isImporting, setIsImporting] = useState(false);
|
const [isImporting, setIsImporting] = useState(false);
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
const [importMitigation] =
|
const [importMesure] =
|
||||||
useMutation<MitigationListViewImportMitigationMutationType>(
|
useMutation<MesureListViewImportMesureMutationType>(importMesureMutation);
|
||||||
importMitigationMutation
|
|
||||||
);
|
|
||||||
|
|
||||||
// Monitor URL hash for changes and update state accordingly
|
// Monitor URL hash for changes and update state accordingly
|
||||||
const [initialHashCategory] = useState(() =>
|
const [initialHashCategory] = useState(() =>
|
||||||
@@ -181,10 +178,10 @@ function MitigationListContent({
|
|||||||
};
|
};
|
||||||
}, [expandedCategories]);
|
}, [expandedCategories]);
|
||||||
|
|
||||||
const mitigations =
|
const mesures =
|
||||||
data.organization.mitigations?.edges.map((edge) => edge.node) ?? [];
|
data.organization.mesures?.edges.map((edge) => edge.node) ?? [];
|
||||||
|
|
||||||
// Map mitigation state to status for the new design
|
// Map mesure state to status for the new design
|
||||||
const mapStateToStatus = (state?: string): string => {
|
const mapStateToStatus = (state?: string): string => {
|
||||||
if (!state) return "incomplete";
|
if (!state) return "incomplete";
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@@ -201,48 +198,48 @@ function MitigationListContent({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const processedMitigations = mitigations.map((mitigation: Mitigation) => ({
|
const processedMesures = mesures.map((mesure: Mesure) => ({
|
||||||
...mitigation,
|
...mesure,
|
||||||
status: mapStateToStatus(mitigation.state),
|
status: mapStateToStatus(mesure.state),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Calculate global progress
|
// Calculate global progress
|
||||||
const implementedCount = processedMitigations.filter(
|
const implementedCount = processedMesures.filter(
|
||||||
(mitigation: Mitigation) => mitigation.status === "complete"
|
(mesure: Mesure) => mesure.status === "complete"
|
||||||
).length;
|
).length;
|
||||||
const notApplicableCount = processedMitigations.filter(
|
const notApplicableCount = processedMesures.filter(
|
||||||
(mitigation: Mitigation) => mitigation.status === "not-applicable"
|
(mesure: Mesure) => mesure.status === "not-applicable"
|
||||||
).length;
|
).length;
|
||||||
const totalMitigations = processedMitigations.length;
|
const totalMesures = processedMesures.length;
|
||||||
|
|
||||||
// Include not-applicable as effectively "complete" for progress percentage
|
// Include not-applicable as effectively "complete" for progress percentage
|
||||||
const effectiveCompletedCount = implementedCount + notApplicableCount;
|
const effectiveCompletedCount = implementedCount + notApplicableCount;
|
||||||
const globalProgress = totalMitigations
|
const globalProgress = totalMesures
|
||||||
? Math.round((effectiveCompletedCount / totalMitigations) * 100)
|
? Math.round((effectiveCompletedCount / totalMesures) * 100)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
// Get global status counts
|
// Get global status counts
|
||||||
const globalStatusCounts = processedMitigations.reduce(
|
const globalStatusCounts = processedMesures.reduce(
|
||||||
(acc: Record<string, number>, mitigation: Mitigation) => {
|
(acc: Record<string, number>, mesure: Mesure) => {
|
||||||
if (mitigation.status) {
|
if (mesure.status) {
|
||||||
acc[mitigation.status] = (acc[mitigation.status] || 0) + 1;
|
acc[mesure.status] = (acc[mesure.status] || 0) + 1;
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
{} as Record<string, number>
|
{} as Record<string, number>
|
||||||
);
|
);
|
||||||
|
|
||||||
// Group mitigations by category
|
// Group mesures by category
|
||||||
const mitigationsByCategory = processedMitigations.reduce(
|
const mesuresByCategory = processedMesures.reduce(
|
||||||
(acc: Record<string, Mitigation[]>, mitigation: Mitigation) => {
|
(acc: Record<string, Mesure[]>, mesure: Mesure) => {
|
||||||
if (!mitigation?.category) return acc;
|
if (!mesure?.category) return acc;
|
||||||
if (!acc[mitigation.category]) {
|
if (!acc[mesure.category]) {
|
||||||
acc[mitigation.category] = [];
|
acc[mesure.category] = [];
|
||||||
}
|
}
|
||||||
acc[mitigation.category].push(mitigation);
|
acc[mesure.category].push(mesure);
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
{} as Record<string, Mitigation[]>
|
{} as Record<string, Mesure[]>
|
||||||
);
|
);
|
||||||
|
|
||||||
// Function to toggle a category's expanded state
|
// Function to toggle a category's expanded state
|
||||||
@@ -256,17 +253,17 @@ function MitigationListContent({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const categories: Category[] = Object.entries(mitigationsByCategory)
|
const categories: Category[] = Object.entries(mesuresByCategory)
|
||||||
.map(([categoryName, categoryMitigations]: [string, Mitigation[]]) => {
|
.map(([categoryName, categoryMesures]: [string, Mesure[]]) => {
|
||||||
const catImplementedCount = categoryMitigations.filter(
|
const catImplementedCount = categoryMesures.filter(
|
||||||
(mitigation) => mitigation.status === "complete"
|
(mesure) => mesure.status === "complete"
|
||||||
).length;
|
).length;
|
||||||
const catNotApplicableCount = categoryMitigations.filter(
|
const catNotApplicableCount = categoryMesures.filter(
|
||||||
(mitigation) => mitigation.status === "not-applicable"
|
(mesure) => mesure.status === "not-applicable"
|
||||||
).length;
|
).length;
|
||||||
// Consider both "complete" and "not-applicable" as done for category progress
|
// Consider both "complete" and "not-applicable" as done for category progress
|
||||||
const catDoneCount = catImplementedCount + catNotApplicableCount;
|
const catDoneCount = catImplementedCount + catNotApplicableCount;
|
||||||
const catTotalCount = categoryMitigations.length;
|
const catTotalCount = categoryMesures.length;
|
||||||
const progress = catTotalCount
|
const progress = catTotalCount
|
||||||
? Math.round((catDoneCount / catTotalCount) * 100)
|
? Math.round((catDoneCount / catTotalCount) * 100)
|
||||||
: 0;
|
: 0;
|
||||||
@@ -274,16 +271,16 @@ function MitigationListContent({
|
|||||||
return {
|
return {
|
||||||
id: categoryName,
|
id: categoryName,
|
||||||
name: categoryName,
|
name: categoryName,
|
||||||
description: `Mitigations related to ${categoryName.toLowerCase()}`,
|
description: `Mesures related to ${categoryName.toLowerCase()}`,
|
||||||
progress: progress,
|
progress: progress,
|
||||||
mitigations: categoryMitigations.sort((a, b) =>
|
mesures: categoryMesures.sort((a, b) =>
|
||||||
(a.name || "").localeCompare(b.name || "")
|
(a.name || "").localeCompare(b.name || "")
|
||||||
),
|
),
|
||||||
doneCount: catDoneCount,
|
doneCount: catDoneCount,
|
||||||
totalCount: catTotalCount,
|
totalCount: catTotalCount,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter((category) => category.mitigations.length > 0)
|
.filter((category) => category.mesures.length > 0)
|
||||||
.sort((a, b) => a.name.localeCompare(b.name));
|
.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
|
||||||
const getStatusIcon = (status: string) => {
|
const getStatusIcon = (status: string) => {
|
||||||
@@ -309,12 +306,12 @@ function MitigationListContent({
|
|||||||
|
|
||||||
setIsImporting(true);
|
setIsImporting(true);
|
||||||
|
|
||||||
importMitigation({
|
importMesure({
|
||||||
variables: {
|
variables: {
|
||||||
connections: [
|
connections: [
|
||||||
ConnectionHandler.getConnectionID(
|
ConnectionHandler.getConnectionID(
|
||||||
data.organization.id,
|
data.organization.id,
|
||||||
"MitigationListView_mitigations"
|
"MesureListView_mesures"
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
input: {
|
input: {
|
||||||
@@ -328,8 +325,8 @@ function MitigationListContent({
|
|||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
setIsImporting(false);
|
setIsImporting(false);
|
||||||
toast({
|
toast({
|
||||||
title: "Mitigations imported",
|
title: "Mesures imported",
|
||||||
description: "Mitigations have been imported successfully.",
|
description: "Mesures have been imported successfully.",
|
||||||
variant: "default",
|
variant: "default",
|
||||||
});
|
});
|
||||||
if (fileInputRef.current) {
|
if (fileInputRef.current) {
|
||||||
@@ -339,7 +336,7 @@ function MitigationListContent({
|
|||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
setIsImporting(false);
|
setIsImporting(false);
|
||||||
toast({
|
toast({
|
||||||
title: "Error importing mitigations",
|
title: "Error importing mesures",
|
||||||
description: error.message,
|
description: error.message,
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
@@ -349,8 +346,8 @@ function MitigationListContent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageTemplate
|
<PageTemplate
|
||||||
title="Mitigations"
|
title="Mesures"
|
||||||
description="Mitigations are actions taken to reduce the risk. Add them to track their implementation status."
|
description="Mesures are actions taken to reduce the risk. Add them to track their implementation status."
|
||||||
actions={
|
actions={
|
||||||
<div className="flex gap-4">
|
<div className="flex gap-4">
|
||||||
<Button
|
<Button
|
||||||
@@ -358,17 +355,17 @@ function MitigationListContent({
|
|||||||
onClick={() => fileInputRef.current?.click()}
|
onClick={() => fileInputRef.current?.click()}
|
||||||
disabled={isImporting}
|
disabled={isImporting}
|
||||||
>
|
>
|
||||||
{isImporting ? "Importing..." : "Import Mitigations"}
|
{isImporting ? "Importing..." : "Import Mesures"}
|
||||||
</Button>
|
</Button>
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link to={`/organizations/${organizationId}/mitigations/new`}>
|
<Link to={`/organizations/${organizationId}/mesures/new`}>
|
||||||
New Mitigation
|
New Mesure
|
||||||
</Link>
|
</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* Hidden file input for mitigation import */}
|
{/* Hidden file input for mesure import */}
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
ref={fileInputRef}
|
ref={fileInputRef}
|
||||||
@@ -380,7 +377,7 @@ function MitigationListContent({
|
|||||||
{/* Global Progress Summary */}
|
{/* Global Progress Summary */}
|
||||||
<div className="mb-8">
|
<div className="mb-8">
|
||||||
<div className="flex items-center justify-between mb-1">
|
<div className="flex items-center justify-between mb-1">
|
||||||
<h3 className="text-lg font-medium">Mitigation Implementation</h3>
|
<h3 className="text-lg font-medium">Mesure Implementation</h3>
|
||||||
<span className="text-sm text-tertiary">
|
<span className="text-sm text-tertiary">
|
||||||
{globalProgress}% complete
|
{globalProgress}% complete
|
||||||
</span>
|
</span>
|
||||||
@@ -396,7 +393,7 @@ function MitigationListContent({
|
|||||||
className="bg-green-500 h-full"
|
className="bg-green-500 h-full"
|
||||||
style={{
|
style={{
|
||||||
width: `${
|
width: `${
|
||||||
(globalStatusCounts.complete / totalMitigations) * 100
|
(globalStatusCounts.complete / totalMesures) * 100
|
||||||
}%`,
|
}%`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -407,7 +404,7 @@ function MitigationListContent({
|
|||||||
className="bg-blue-500 h-full"
|
className="bg-blue-500 h-full"
|
||||||
style={{
|
style={{
|
||||||
width: `${
|
width: `${
|
||||||
(globalStatusCounts["in-progress"] / totalMitigations) * 100
|
(globalStatusCounts["in-progress"] / totalMesures) * 100
|
||||||
}%`,
|
}%`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -418,7 +415,7 @@ function MitigationListContent({
|
|||||||
className="bg-red-500 h-full"
|
className="bg-red-500 h-full"
|
||||||
style={{
|
style={{
|
||||||
width: `${
|
width: `${
|
||||||
(globalStatusCounts.incomplete / totalMitigations) * 100
|
(globalStatusCounts.incomplete / totalMesures) * 100
|
||||||
}%`,
|
}%`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -429,8 +426,7 @@ function MitigationListContent({
|
|||||||
className="bg-primary-bg h-full"
|
className="bg-primary-bg h-full"
|
||||||
style={{
|
style={{
|
||||||
width: `${
|
width: `${
|
||||||
(globalStatusCounts["not-applicable"] / totalMitigations) *
|
(globalStatusCounts["not-applicable"] / totalMesures) * 100
|
||||||
100
|
|
||||||
}%`,
|
}%`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -441,7 +437,7 @@ function MitigationListContent({
|
|||||||
className="bg-secondary h-full"
|
className="bg-secondary h-full"
|
||||||
style={{
|
style={{
|
||||||
width: `${
|
width: `${
|
||||||
(globalStatusCounts["not-started"] / totalMitigations) * 100
|
(globalStatusCounts["not-started"] / totalMesures) * 100
|
||||||
}%`,
|
}%`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -521,7 +517,7 @@ function MitigationListContent({
|
|||||||
|
|
||||||
{isExpanded && (
|
{isExpanded && (
|
||||||
<CardContent className="p-0">
|
<CardContent className="p-0">
|
||||||
{category.mitigations.length > 0 ? (
|
{category.mesures.length > 0 ? (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<table className="w-full">
|
<table className="w-full">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -532,26 +528,24 @@ function MitigationListContent({
|
|||||||
<th className="w-24 px-4 py-2 text-left">
|
<th className="w-24 px-4 py-2 text-left">
|
||||||
Status
|
Status
|
||||||
</th>
|
</th>
|
||||||
<th className="px-4 py-2 text-left">
|
<th className="px-4 py-2 text-left">Mesure</th>
|
||||||
Mitigation
|
|
||||||
</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y">
|
<tbody className="divide-y">
|
||||||
{category.mitigations.map((mitigation) => (
|
{category.mesures.map((mesure) => (
|
||||||
<tr
|
<tr
|
||||||
key={mitigation.id || Math.random().toString()}
|
key={mesure.id || Math.random().toString()}
|
||||||
className="hover:bg-h-subtle-bg cursor-pointer"
|
className="hover:bg-h-subtle-bg cursor-pointer"
|
||||||
>
|
>
|
||||||
<td className="w-24 px-4 py-3 align-middle">
|
<td className="w-24 px-4 py-3 align-middle">
|
||||||
<Badge variant="outline" className="text-xs">
|
<Badge variant="outline" className="text-xs">
|
||||||
{mitigation.importance}
|
{mesure.importance}
|
||||||
</Badge>
|
</Badge>
|
||||||
</td>
|
</td>
|
||||||
<td className="w-24 px-4 py-3 align-middle">
|
<td className="w-24 px-4 py-3 align-middle">
|
||||||
<div className="flex items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
{mitigation.status
|
{mesure.status
|
||||||
? getStatusIcon(mitigation.status)
|
? getStatusIcon(mesure.status)
|
||||||
: null}
|
: null}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -561,11 +555,11 @@ function MitigationListContent({
|
|||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<Link
|
<Link
|
||||||
to={`/organizations/${organizationId}/mitigations/${mitigation.id}`}
|
to={`/organizations/${organizationId}/mesures/${mesure.id}`}
|
||||||
className="font-medium group flex items-center relative"
|
className="font-medium group flex items-center relative"
|
||||||
>
|
>
|
||||||
<span className="mr-1">
|
<span className="mr-1">
|
||||||
{mitigation.name}
|
{mesure.name}
|
||||||
</span>
|
</span>
|
||||||
<span className="absolute bottom-0 left-0 w-full h-0.5 bg-primary-bg scale-x-0 group-hover:scale-x-100 transition-transform"></span>
|
<span className="absolute bottom-0 left-0 w-full h-0.5 bg-primary-bg scale-x-0 group-hover:scale-x-100 transition-transform"></span>
|
||||||
</Link>
|
</Link>
|
||||||
@@ -584,7 +578,7 @@ function MitigationListContent({
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
className="p-0 h-6 w-6 rounded-full hover:bg-primary-bg"
|
className="p-0 h-6 w-6 rounded-full hover:bg-primary-bg"
|
||||||
aria-label="Learn more about this mitigation"
|
aria-label="Learn more about this mesure"
|
||||||
>
|
>
|
||||||
<HelpCircle className="h-5 w-5 text-primary hover:text-primary" />
|
<HelpCircle className="h-5 w-5 text-primary hover:text-primary" />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -597,26 +591,26 @@ function MitigationListContent({
|
|||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<div className="flex justify-between items-start">
|
<div className="flex justify-between items-start">
|
||||||
<h4 className="font-bold text-md">
|
<h4 className="font-bold text-md">
|
||||||
{mitigation.name}
|
{mesure.name}
|
||||||
</h4>
|
</h4>
|
||||||
<Badge
|
<Badge
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="text-xs"
|
className="text-xs"
|
||||||
>
|
>
|
||||||
{mitigation.importance}
|
{mesure.importance}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{mitigation.description && (
|
{mesure.description && (
|
||||||
<div className="text-sm">
|
<div className="text-sm">
|
||||||
<p className="font-semibold mb-1">
|
<p className="font-semibold mb-1">
|
||||||
Why is this important:
|
Why is this important:
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{mitigation.description.startsWith(
|
{mesure.description.startsWith(
|
||||||
"##"
|
"##"
|
||||||
)
|
)
|
||||||
? mitigation.description
|
? mesure.description
|
||||||
.split("\n")
|
.split("\n")
|
||||||
.find((line) =>
|
.find((line) =>
|
||||||
line.startsWith(
|
line.startsWith(
|
||||||
@@ -626,16 +620,16 @@ function MitigationListContent({
|
|||||||
?.replace("## Why?", "")
|
?.replace("## Why?", "")
|
||||||
?.replace("## Why", "")
|
?.replace("## Why", "")
|
||||||
?.trim() ||
|
?.trim() ||
|
||||||
mitigation.description.split(
|
mesure.description.split(
|
||||||
"\n"
|
"\n"
|
||||||
)[1] ||
|
)[1] ||
|
||||||
""
|
""
|
||||||
: mitigation.description.substring(
|
: mesure.description.substring(
|
||||||
0,
|
0,
|
||||||
180
|
180
|
||||||
) +
|
) +
|
||||||
(mitigation.description
|
(mesure.description.length >
|
||||||
.length > 180
|
180
|
||||||
? "..."
|
? "..."
|
||||||
: "")}
|
: "")}
|
||||||
</p>
|
</p>
|
||||||
@@ -650,7 +644,7 @@ function MitigationListContent({
|
|||||||
asChild
|
asChild
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
to={`/organizations/${organizationId}/mitigations/${mitigation.id}`}
|
to={`/organizations/${organizationId}/mesures/${mesure.id}`}
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
Implementation guide
|
Implementation guide
|
||||||
@@ -671,7 +665,7 @@ function MitigationListContent({
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex items-center justify-center p-6 text-center text-tertiary">
|
<div className="flex items-center justify-center p-6 text-center text-tertiary">
|
||||||
No mitigations in this category
|
No mesures in this category
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
@@ -685,10 +679,9 @@ function MitigationListContent({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function MitigationListView() {
|
export default function MesureListView() {
|
||||||
const [queryRef, loadQuery] = useQueryLoader<MitigationListViewQueryType>(
|
const [queryRef, loadQuery] =
|
||||||
mitigationListViewQuery
|
useQueryLoader<MesureListViewQueryType>(mesureListViewQuery);
|
||||||
);
|
|
||||||
|
|
||||||
const { organizationId } = useParams();
|
const { organizationId } = useParams();
|
||||||
|
|
||||||
@@ -700,12 +693,12 @@ export default function MitigationListView() {
|
|||||||
}, [loadQuery, organizationId]);
|
}, [loadQuery, organizationId]);
|
||||||
|
|
||||||
if (!queryRef) {
|
if (!queryRef) {
|
||||||
return <MitigationListViewSkeleton />;
|
return <MesureListViewSkeleton />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<MitigationListViewSkeleton />}>
|
<Suspense fallback={<MesureListViewSkeleton />}>
|
||||||
<MitigationListContent queryRef={queryRef} />
|
<MesureListContent queryRef={queryRef} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -5,9 +5,9 @@ import { lazy } from "@probo/react-lazy";
|
|||||||
import { useLocation } from "react-router";
|
import { useLocation } from "react-router";
|
||||||
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
||||||
|
|
||||||
const MitigationView = lazy(() => import("./MitigationView"));
|
const MesureView = lazy(() => import("./MesureView"));
|
||||||
|
|
||||||
export function MitigationViewSkeleton() {
|
export function MesureViewSkeleton() {
|
||||||
return (
|
return (
|
||||||
<PageTemplateSkeleton
|
<PageTemplateSkeleton
|
||||||
actions={
|
actions={
|
||||||
@@ -32,13 +32,13 @@ export function MitigationViewSkeleton() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function MitigationPage() {
|
export function MesurePage() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense key={location.pathname} fallback={<MitigationViewSkeleton />}>
|
<Suspense key={location.pathname} fallback={<MesureViewSkeleton />}>
|
||||||
<ErrorBoundaryWithLocation>
|
<ErrorBoundaryWithLocation>
|
||||||
<MitigationView />
|
<MesureView />
|
||||||
</ErrorBoundaryWithLocation>
|
</ErrorBoundaryWithLocation>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
@@ -79,26 +79,26 @@ import {
|
|||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
|
|
||||||
import { PageTemplate } from "@/components/PageTemplate";
|
import { PageTemplate } from "@/components/PageTemplate";
|
||||||
import { MitigationViewSkeleton } from "./MitigationPage";
|
import { MesureViewSkeleton } from "./MesurePage";
|
||||||
import { MitigationViewUpdateTaskStateMutation as MitigationViewUpdateTaskStateMutationType } from "./__generated__/MitigationViewUpdateTaskStateMutation.graphql";
|
import { MesureViewUpdateTaskStateMutation as MesureViewUpdateTaskStateMutationType } from "./__generated__/MesureViewUpdateTaskStateMutation.graphql";
|
||||||
import { MitigationViewCreateTaskMutation as MitigationViewCreateTaskMutationType } from "./__generated__/MitigationViewCreateTaskMutation.graphql";
|
import { MesureViewCreateTaskMutation as MesureViewCreateTaskMutationType } from "./__generated__/MesureViewCreateTaskMutation.graphql";
|
||||||
import { MitigationViewDeleteTaskMutation as MitigationViewDeleteTaskMutationType } from "./__generated__/MitigationViewDeleteTaskMutation.graphql";
|
import { MesureViewDeleteTaskMutation as MesureViewDeleteTaskMutationType } from "./__generated__/MesureViewDeleteTaskMutation.graphql";
|
||||||
import { MitigationViewDeleteEvidenceMutation as MitigationViewDeleteEvidenceMutationType } from "./__generated__/MitigationViewDeleteEvidenceMutation.graphql";
|
import { MesureViewDeleteEvidenceMutation as MesureViewDeleteEvidenceMutationType } from "./__generated__/MesureViewDeleteEvidenceMutation.graphql";
|
||||||
import { MitigationViewAssignTaskMutation as MitigationViewAssignTaskMutationType } from "./__generated__/MitigationViewAssignTaskMutation.graphql";
|
import { MesureViewAssignTaskMutation as MesureViewAssignTaskMutationType } from "./__generated__/MesureViewAssignTaskMutation.graphql";
|
||||||
import { MitigationViewUnassignTaskMutation as MitigationViewUnassignTaskMutationType } from "./__generated__/MitigationViewUnassignTaskMutation.graphql";
|
import { MesureViewUnassignTaskMutation as MesureViewUnassignTaskMutationType } from "./__generated__/MesureViewUnassignTaskMutation.graphql";
|
||||||
import { MitigationViewUpdateMitigationStateMutation as MitigationViewUpdateMitigationStateMutationType } from "./__generated__/MitigationViewUpdateMitigationStateMutation.graphql";
|
import { MesureViewUpdateMesureStateMutation as MesureViewUpdateMesureStateMutationType } from "./__generated__/MesureViewUpdateMesureStateMutation.graphql";
|
||||||
import { MitigationViewQuery as MitigationViewQueryType } from "./__generated__/MitigationViewQuery.graphql";
|
import { MesureViewQuery as MesureViewQueryType } from "./__generated__/MesureViewQuery.graphql";
|
||||||
import { MitigationViewOrganizationQuery$data } from "./__generated__/MitigationViewOrganizationQuery.graphql";
|
import { MesureViewOrganizationQuery$data } from "./__generated__/MesureViewOrganizationQuery.graphql";
|
||||||
import {
|
import {
|
||||||
MitigationViewFrameworksQuery,
|
MesureViewFrameworksQuery,
|
||||||
MitigationViewFrameworksQuery$data,
|
MesureViewFrameworksQuery$data,
|
||||||
} from "./__generated__/MitigationViewFrameworksQuery.graphql";
|
} from "./__generated__/MesureViewFrameworksQuery.graphql";
|
||||||
import {
|
import {
|
||||||
MitigationViewLinkedControlsQuery,
|
MesureViewLinkedControlsQuery,
|
||||||
MitigationViewLinkedControlsQuery$data,
|
MesureViewLinkedControlsQuery$data,
|
||||||
} from "./__generated__/MitigationViewLinkedControlsQuery.graphql";
|
} from "./__generated__/MesureViewLinkedControlsQuery.graphql";
|
||||||
import { MitigationViewCreateEvidenceMutation as MitigationViewCreateEvidenceMutationType } from "./__generated__/MitigationViewCreateEvidenceMutation.graphql";
|
import { MesureViewCreateEvidenceMutation as MesureViewCreateEvidenceMutationType } from "./__generated__/MesureViewCreateEvidenceMutation.graphql";
|
||||||
import { MitigationViewFulfillEvidenceMutation as MitigationViewFulfillEvidenceMutationType } from "./__generated__/MitigationViewFulfillEvidenceMutation.graphql";
|
import { MesureViewFulfillEvidenceMutation as MesureViewFulfillEvidenceMutationType } from "./__generated__/MesureViewFulfillEvidenceMutation.graphql";
|
||||||
|
|
||||||
// Function to format ISO8601 duration to human-readable format
|
// Function to format ISO8601 duration to human-readable format
|
||||||
const formatDuration = (isoDuration: string): string => {
|
const formatDuration = (isoDuration: string): string => {
|
||||||
@@ -137,17 +137,17 @@ const formatDuration = (isoDuration: string): string => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const mitigationViewQuery = graphql`
|
const mesureViewQuery = graphql`
|
||||||
query MitigationViewQuery($mitigationId: ID!) {
|
query MesureViewQuery($mesureId: ID!) {
|
||||||
mitigation: node(id: $mitigationId) {
|
mesure: node(id: $mesureId) {
|
||||||
id
|
id
|
||||||
... on Mitigation {
|
... on Mesure {
|
||||||
name
|
name
|
||||||
description
|
description
|
||||||
state
|
state
|
||||||
importance
|
importance
|
||||||
category
|
category
|
||||||
tasks(first: 100) @connection(key: "MitigationView_tasks") {
|
tasks(first: 100) @connection(key: "MesureView_tasks") {
|
||||||
__id
|
__id
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
@@ -161,8 +161,7 @@ const mitigationViewQuery = graphql`
|
|||||||
fullName
|
fullName
|
||||||
primaryEmailAddress
|
primaryEmailAddress
|
||||||
}
|
}
|
||||||
evidences(first: 50)
|
evidences(first: 50) @connection(key: "MesureView_evidences") {
|
||||||
@connection(key: "MitigationView_evidences") {
|
|
||||||
__id
|
__id
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
@@ -187,7 +186,7 @@ const mitigationViewQuery = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const updateTaskStateMutation = graphql`
|
const updateTaskStateMutation = graphql`
|
||||||
mutation MitigationViewUpdateTaskStateMutation($input: UpdateTaskInput!) {
|
mutation MesureViewUpdateTaskStateMutation($input: UpdateTaskInput!) {
|
||||||
updateTask(input: $input) {
|
updateTask(input: $input) {
|
||||||
task {
|
task {
|
||||||
id
|
id
|
||||||
@@ -199,7 +198,7 @@ const updateTaskStateMutation = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const createTaskMutation = graphql`
|
const createTaskMutation = graphql`
|
||||||
mutation MitigationViewCreateTaskMutation(
|
mutation MesureViewCreateTaskMutation(
|
||||||
$input: CreateTaskInput!
|
$input: CreateTaskInput!
|
||||||
$connections: [ID!]!
|
$connections: [ID!]!
|
||||||
) {
|
) {
|
||||||
@@ -223,7 +222,7 @@ const createTaskMutation = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const deleteTaskMutation = graphql`
|
const deleteTaskMutation = graphql`
|
||||||
mutation MitigationViewDeleteTaskMutation(
|
mutation MesureViewDeleteTaskMutation(
|
||||||
$input: DeleteTaskInput!
|
$input: DeleteTaskInput!
|
||||||
$connections: [ID!]!
|
$connections: [ID!]!
|
||||||
) {
|
) {
|
||||||
@@ -234,7 +233,7 @@ const deleteTaskMutation = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const createEvidenceMutation = graphql`
|
const createEvidenceMutation = graphql`
|
||||||
mutation MitigationViewCreateEvidenceMutation(
|
mutation MesureViewCreateEvidenceMutation(
|
||||||
$input: CreateEvidenceInput!
|
$input: CreateEvidenceInput!
|
||||||
$connections: [ID!]!
|
$connections: [ID!]!
|
||||||
) {
|
) {
|
||||||
@@ -258,7 +257,7 @@ const createEvidenceMutation = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const deleteEvidenceMutation = graphql`
|
const deleteEvidenceMutation = graphql`
|
||||||
mutation MitigationViewDeleteEvidenceMutation(
|
mutation MesureViewDeleteEvidenceMutation(
|
||||||
$input: DeleteEvidenceInput!
|
$input: DeleteEvidenceInput!
|
||||||
$connections: [ID!]!
|
$connections: [ID!]!
|
||||||
) {
|
) {
|
||||||
@@ -270,7 +269,7 @@ const deleteEvidenceMutation = graphql`
|
|||||||
|
|
||||||
// Add a GraphQL query to fetch the fileUrl for an evidence item
|
// Add a GraphQL query to fetch the fileUrl for an evidence item
|
||||||
const getEvidenceFileUrlQuery = graphql`
|
const getEvidenceFileUrlQuery = graphql`
|
||||||
query MitigationViewGetEvidenceFileUrlQuery($evidenceId: ID!) {
|
query MesureViewGetEvidenceFileUrlQuery($evidenceId: ID!) {
|
||||||
node(id: $evidenceId) {
|
node(id: $evidenceId) {
|
||||||
... on Evidence {
|
... on Evidence {
|
||||||
id
|
id
|
||||||
@@ -281,7 +280,7 @@ const getEvidenceFileUrlQuery = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const assignTaskMutation = graphql`
|
const assignTaskMutation = graphql`
|
||||||
mutation MitigationViewAssignTaskMutation($input: AssignTaskInput!) {
|
mutation MesureViewAssignTaskMutation($input: AssignTaskInput!) {
|
||||||
assignTask(input: $input) {
|
assignTask(input: $input) {
|
||||||
task {
|
task {
|
||||||
id
|
id
|
||||||
@@ -296,7 +295,7 @@ const assignTaskMutation = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const unassignTaskMutation = graphql`
|
const unassignTaskMutation = graphql`
|
||||||
mutation MitigationViewUnassignTaskMutation($input: UnassignTaskInput!) {
|
mutation MesureViewUnassignTaskMutation($input: UnassignTaskInput!) {
|
||||||
unassignTask(input: $input) {
|
unassignTask(input: $input) {
|
||||||
task {
|
task {
|
||||||
id
|
id
|
||||||
@@ -310,12 +309,10 @@ const unassignTaskMutation = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const updateMitigationStateMutation = graphql`
|
const updateMesureStateMutation = graphql`
|
||||||
mutation MitigationViewUpdateMitigationStateMutation(
|
mutation MesureViewUpdateMesureStateMutation($input: UpdateMesureInput!) {
|
||||||
$input: UpdateMitigationInput!
|
updateMesure(input: $input) {
|
||||||
) {
|
mesure {
|
||||||
updateMitigation(input: $input) {
|
|
||||||
mitigation {
|
|
||||||
id
|
id
|
||||||
state
|
state
|
||||||
}
|
}
|
||||||
@@ -324,12 +321,12 @@ const updateMitigationStateMutation = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const organizationQuery = graphql`
|
const organizationQuery = graphql`
|
||||||
query MitigationViewOrganizationQuery($organizationId: ID!) {
|
query MesureViewOrganizationQuery($organizationId: ID!) {
|
||||||
organization: node(id: $organizationId) {
|
organization: node(id: $organizationId) {
|
||||||
id
|
id
|
||||||
... on Organization {
|
... on Organization {
|
||||||
peoples(first: 100, orderBy: { direction: ASC, field: FULL_NAME })
|
peoples(first: 100, orderBy: { direction: ASC, field: FULL_NAME })
|
||||||
@connection(key: "MitigationView_peoples") {
|
@connection(key: "MesureView_peoples") {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -345,7 +342,7 @@ const organizationQuery = graphql`
|
|||||||
|
|
||||||
// New queries and mutations for Control Mapping
|
// New queries and mutations for Control Mapping
|
||||||
const frameworksQuery = graphql`
|
const frameworksQuery = graphql`
|
||||||
query MitigationViewFrameworksQuery($organizationId: ID!) {
|
query MesureViewFrameworksQuery($organizationId: ID!) {
|
||||||
organization: node(id: $organizationId) {
|
organization: node(id: $organizationId) {
|
||||||
id
|
id
|
||||||
... on Organization {
|
... on Organization {
|
||||||
@@ -373,11 +370,11 @@ const frameworksQuery = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const linkedControlsQuery = graphql`
|
const linkedControlsQuery = graphql`
|
||||||
query MitigationViewLinkedControlsQuery($mitigationId: ID!) {
|
query MesureViewLinkedControlsQuery($mesureId: ID!) {
|
||||||
mitigation: node(id: $mitigationId) {
|
mesure: node(id: $mesureId) {
|
||||||
id
|
id
|
||||||
... on Mitigation {
|
... on Mesure {
|
||||||
controls(first: 100) @connection(key: "Mitigation__controls") {
|
controls(first: 100) @connection(key: "MesureView_controls") {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -393,20 +390,20 @@ const linkedControlsQuery = graphql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const createControlMappingMutation = graphql`
|
const createControlMappingMutation = graphql`
|
||||||
mutation MitigationViewCreateControlMappingMutation(
|
mutation MesureViewCreateControlMappingMutation(
|
||||||
$input: CreateControlMitigationMappingInput!
|
$input: CreateControlMesureMappingInput!
|
||||||
) {
|
) {
|
||||||
createControlMitigationMapping(input: $input) {
|
createControlMesureMapping(input: $input) {
|
||||||
success
|
success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const deleteControlMappingMutation = graphql`
|
const deleteControlMappingMutation = graphql`
|
||||||
mutation MitigationViewDeleteControlMappingMutation(
|
mutation MesureViewDeleteControlMappingMutation(
|
||||||
$input: DeleteControlMitigationMappingInput!
|
$input: DeleteControlMesureMappingInput!
|
||||||
) {
|
) {
|
||||||
deleteControlMitigationMapping(input: $input) {
|
deleteControlMesureMapping(input: $input) {
|
||||||
success
|
success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -414,7 +411,7 @@ const deleteControlMappingMutation = graphql`
|
|||||||
|
|
||||||
// Add a mutation to fulfill evidence
|
// Add a mutation to fulfill evidence
|
||||||
const fulfillEvidenceMutation = graphql`
|
const fulfillEvidenceMutation = graphql`
|
||||||
mutation MitigationViewFulfillEvidenceMutation(
|
mutation MesureViewFulfillEvidenceMutation(
|
||||||
$input: FulfillEvidenceInput!
|
$input: FulfillEvidenceInput!
|
||||||
$connections: [ID!]!
|
$connections: [ID!]!
|
||||||
) {
|
) {
|
||||||
@@ -437,13 +434,13 @@ const fulfillEvidenceMutation = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Add query to fetch risks linked to a mitigation
|
// Add query to fetch risks linked to a mesure
|
||||||
const mitigationRisksQuery = graphql`
|
const mesureRisksQuery = graphql`
|
||||||
query MitigationViewRisksQuery($mitigationId: ID!) {
|
query MesureViewRisksQuery($mesureId: ID!) {
|
||||||
mitigation: node(id: $mitigationId) {
|
mesure: node(id: $mesureId) {
|
||||||
id
|
id
|
||||||
... on Mitigation {
|
... on Mesure {
|
||||||
risks(first: 100) @connection(key: "MitigationView_risks") {
|
risks(first: 100) @connection(key: "MesureView_risks") {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -499,8 +496,8 @@ type RiskNode = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Define the risks data type
|
// Define the risks data type
|
||||||
type MitigationRisksData = {
|
type MesureRisksData = {
|
||||||
mitigation?: {
|
mesure?: {
|
||||||
id: string;
|
id: string;
|
||||||
risks?: {
|
risks?: {
|
||||||
edges: Array<{
|
edges: Array<{
|
||||||
@@ -510,17 +507,17 @@ type MitigationRisksData = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
function MitigationViewContent({
|
function MesureViewContent({
|
||||||
queryRef,
|
queryRef,
|
||||||
}: {
|
}: {
|
||||||
queryRef: PreloadedQuery<MitigationViewQueryType>;
|
queryRef: PreloadedQuery<MesureViewQueryType>;
|
||||||
}) {
|
}) {
|
||||||
const data = usePreloadedQuery<MitigationViewQueryType>(
|
const data = usePreloadedQuery<MesureViewQueryType>(
|
||||||
mitigationViewQuery,
|
mesureViewQuery,
|
||||||
queryRef
|
queryRef
|
||||||
);
|
);
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const { organizationId, mitigationId } = useParams();
|
const { organizationId, mesureId } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const environment = useRelayEnvironment();
|
const environment = useRelayEnvironment();
|
||||||
|
|
||||||
@@ -533,15 +530,15 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
// Load organization data for people selector
|
// Load organization data for people selector
|
||||||
const [organizationData, setOrganizationData] =
|
const [organizationData, setOrganizationData] =
|
||||||
useState<MitigationViewOrganizationQuery$data | null>(null);
|
useState<MesureViewOrganizationQuery$data | null>(null);
|
||||||
|
|
||||||
// Control mapping state
|
// Control mapping state
|
||||||
const [isControlMappingDialogOpen, setIsControlMappingDialogOpen] =
|
const [isControlMappingDialogOpen, setIsControlMappingDialogOpen] =
|
||||||
useState(false);
|
useState(false);
|
||||||
const [frameworksData, setFrameworksData] =
|
const [frameworksData, setFrameworksData] =
|
||||||
useState<MitigationViewFrameworksQuery$data | null>(null);
|
useState<MesureViewFrameworksQuery$data | null>(null);
|
||||||
const [linkedControlsData, setLinkedControlsData] =
|
const [linkedControlsData, setLinkedControlsData] =
|
||||||
useState<MitigationViewLinkedControlsQuery$data | null>(null);
|
useState<MesureViewLinkedControlsQuery$data | null>(null);
|
||||||
const [controlSearchQuery, setControlSearchQuery] = useState("");
|
const [controlSearchQuery, setControlSearchQuery] = useState("");
|
||||||
const [selectedFrameworkId, setSelectedFrameworkId] = useState<string | null>(
|
const [selectedFrameworkId, setSelectedFrameworkId] = useState<string | null>(
|
||||||
null
|
null
|
||||||
@@ -562,7 +559,7 @@ function MitigationViewContent({
|
|||||||
if (organizationId) {
|
if (organizationId) {
|
||||||
fetchQuery(environment, organizationQuery, { organizationId }).subscribe({
|
fetchQuery(environment, organizationQuery, { organizationId }).subscribe({
|
||||||
next: (data: unknown) => {
|
next: (data: unknown) => {
|
||||||
setOrganizationData(data as MitigationViewOrganizationQuery$data);
|
setOrganizationData(data as MesureViewOrganizationQuery$data);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error fetching organization:", error);
|
console.error("Error fetching organization:", error);
|
||||||
@@ -573,36 +570,34 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
// Load linked controls when component mounts
|
// Load linked controls when component mounts
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mitigationId) {
|
if (mesureId) {
|
||||||
fetchQuery(environment, linkedControlsQuery, { mitigationId }).subscribe({
|
fetchQuery(environment, linkedControlsQuery, { mesureId }).subscribe({
|
||||||
next: (data: unknown) => {
|
next: (data: unknown) => {
|
||||||
setLinkedControlsData(data as MitigationViewLinkedControlsQuery$data);
|
setLinkedControlsData(data as MesureViewLinkedControlsQuery$data);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error fetching linked controls:", error);
|
console.error("Error fetching linked controls:", error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [environment, mitigationId]);
|
}, [environment, mesureId]);
|
||||||
|
|
||||||
// Add state for risks data
|
// Add state for risks data
|
||||||
const [risksData, setRisksData] = useState<MitigationRisksData | null>(null);
|
const [risksData, setRisksData] = useState<MesureRisksData | null>(null);
|
||||||
|
|
||||||
// Load risks data when component mounts
|
// Load risks data when component mounts
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mitigationId) {
|
if (mesureId) {
|
||||||
fetchQuery(environment, mitigationRisksQuery, { mitigationId }).subscribe(
|
fetchQuery(environment, mesureRisksQuery, { mesureId }).subscribe({
|
||||||
{
|
|
||||||
next: (data: unknown) => {
|
next: (data: unknown) => {
|
||||||
setRisksData(data as MitigationRisksData);
|
setRisksData(data as MesureRisksData);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error fetching risks:", error);
|
console.error("Error fetching risks:", error);
|
||||||
},
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
}, [environment, mesureId]);
|
||||||
}
|
|
||||||
}, [environment, mitigationId]);
|
|
||||||
|
|
||||||
const formatImportance = (importance: string | undefined): string => {
|
const formatImportance = (importance: string | undefined): string => {
|
||||||
if (!importance) return "";
|
if (!importance) return "";
|
||||||
@@ -656,33 +651,30 @@ function MitigationViewContent({
|
|||||||
return "bg-secondary-bg text-primary";
|
return "bg-secondary-bg text-primary";
|
||||||
};
|
};
|
||||||
|
|
||||||
const [updateTask] = useMutation<MitigationViewUpdateTaskStateMutationType>(
|
const [updateTask] = useMutation<MesureViewUpdateTaskStateMutationType>(
|
||||||
updateTaskStateMutation
|
updateTaskStateMutation
|
||||||
);
|
);
|
||||||
const [createTask] =
|
const [createTask] =
|
||||||
useMutation<MitigationViewCreateTaskMutationType>(createTaskMutation);
|
useMutation<MesureViewCreateTaskMutationType>(createTaskMutation);
|
||||||
const [deleteTask] =
|
const [deleteTask] =
|
||||||
useMutation<MitigationViewDeleteTaskMutationType>(deleteTaskMutation);
|
useMutation<MesureViewDeleteTaskMutationType>(deleteTaskMutation);
|
||||||
const [createEvidence] =
|
const [createEvidence] = useMutation<MesureViewCreateEvidenceMutationType>(
|
||||||
useMutation<MitigationViewCreateEvidenceMutationType>(
|
|
||||||
createEvidenceMutation
|
createEvidenceMutation
|
||||||
);
|
);
|
||||||
const [deleteEvidence] =
|
const [deleteEvidence] = useMutation<MesureViewDeleteEvidenceMutationType>(
|
||||||
useMutation<MitigationViewDeleteEvidenceMutationType>(
|
|
||||||
deleteEvidenceMutation
|
deleteEvidenceMutation
|
||||||
);
|
);
|
||||||
const [assignTask] =
|
const [assignTask] =
|
||||||
useMutation<MitigationViewAssignTaskMutationType>(assignTaskMutation);
|
useMutation<MesureViewAssignTaskMutationType>(assignTaskMutation);
|
||||||
const [unassignTask] =
|
const [unassignTask] =
|
||||||
useMutation<MitigationViewUnassignTaskMutationType>(unassignTaskMutation);
|
useMutation<MesureViewUnassignTaskMutationType>(unassignTaskMutation);
|
||||||
const [fulfillEvidence] =
|
const [fulfillEvidence] = useMutation<MesureViewFulfillEvidenceMutationType>(
|
||||||
useMutation<MitigationViewFulfillEvidenceMutationType>(
|
|
||||||
fulfillEvidenceMutation
|
fulfillEvidenceMutation
|
||||||
);
|
);
|
||||||
|
|
||||||
const [updateMitigationState] =
|
const [updateMesureState] =
|
||||||
useMutation<MitigationViewUpdateMitigationStateMutationType>(
|
useMutation<MesureViewUpdateMesureStateMutationType>(
|
||||||
updateMitigationStateMutation
|
updateMesureStateMutation
|
||||||
);
|
);
|
||||||
|
|
||||||
const [isCreateTaskOpen, setIsCreateTaskOpen] = useState(false);
|
const [isCreateTaskOpen, setIsCreateTaskOpen] = useState(false);
|
||||||
@@ -765,7 +757,7 @@ function MitigationViewContent({
|
|||||||
// Track if task panel is open
|
// Track if task panel is open
|
||||||
const [isTaskPanelOpen, setIsTaskPanelOpen] = useState(false);
|
const [isTaskPanelOpen, setIsTaskPanelOpen] = useState(false);
|
||||||
|
|
||||||
const tasks = data.mitigation.tasks?.edges.map((edge) => edge.node) || [];
|
const tasks = data.mesure.tasks?.edges.map((edge) => edge.node) || [];
|
||||||
|
|
||||||
// Add useEffect to handle URL parameters for task selection
|
// Add useEffect to handle URL parameters for task selection
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -907,10 +899,10 @@ function MitigationViewContent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.mitigation.id) {
|
if (!data.mesure.id) {
|
||||||
toast({
|
toast({
|
||||||
title: "Error creating task",
|
title: "Error creating task",
|
||||||
description: "Mitigation ID is missing",
|
description: "Mesure ID is missing",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -920,9 +912,9 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
createTask({
|
createTask({
|
||||||
variables: {
|
variables: {
|
||||||
connections: [`${data.mitigation.tasks?.__id}`],
|
connections: [`${data.mesure.tasks?.__id}`],
|
||||||
input: {
|
input: {
|
||||||
mitigationId: data.mitigation.id,
|
mesureId: data.mesure.id,
|
||||||
name: newTaskName,
|
name: newTaskName,
|
||||||
description: newTaskDescription,
|
description: newTaskDescription,
|
||||||
timeEstimate: isoTimeEstimate === "" ? null : isoTimeEstimate,
|
timeEstimate: isoTimeEstimate === "" ? null : isoTimeEstimate,
|
||||||
@@ -960,7 +952,7 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
deleteTask({
|
deleteTask({
|
||||||
variables: {
|
variables: {
|
||||||
connections: [`${data.mitigation.tasks?.__id}`],
|
connections: [`${data.mesure.tasks?.__id}`],
|
||||||
input: {
|
input: {
|
||||||
taskId: taskToDelete.id,
|
taskId: taskToDelete.id,
|
||||||
},
|
},
|
||||||
@@ -983,10 +975,8 @@ function MitigationViewContent({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEditMitigation = () => {
|
const handleEditMesure = () => {
|
||||||
navigate(
|
navigate(`/organizations/${organizationId}/mesures/${mesureId}/edit`);
|
||||||
`/organizations/${organizationId}/mitigations/${mitigationId}/edit`
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCreateEvidence = (taskId: string, taskName: string) => {
|
const handleCreateEvidence = (taskId: string, taskName: string) => {
|
||||||
@@ -1458,12 +1448,12 @@ function MitigationViewContent({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function to handle mitigation state change
|
// Function to handle mesure state change
|
||||||
const handleMitigationStateChange = (newState: string) => {
|
const handleMesureStateChange = (newState: string) => {
|
||||||
updateMitigationState({
|
updateMesureState({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
id: data.mitigation.id,
|
id: data.mesure.id,
|
||||||
state: newState as
|
state: newState as
|
||||||
| "NOT_STARTED"
|
| "NOT_STARTED"
|
||||||
| "IN_PROGRESS"
|
| "IN_PROGRESS"
|
||||||
@@ -1473,15 +1463,15 @@ function MitigationViewContent({
|
|||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
toast({
|
toast({
|
||||||
title: "Mitigation state updated",
|
title: "Mesure state updated",
|
||||||
description: `Mitigation state has been updated to ${formatState(
|
description: `Mesure state has been updated to ${formatState(
|
||||||
newState
|
newState
|
||||||
)}.`,
|
)}.`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
toast({
|
toast({
|
||||||
title: "Error updating mitigation state",
|
title: "Error updating mesure state",
|
||||||
description: error.message,
|
description: error.message,
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
@@ -1612,12 +1602,12 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
// Control mapping functions
|
// Control mapping functions
|
||||||
const loadFrameworksAndControls = useCallback(() => {
|
const loadFrameworksAndControls = useCallback(() => {
|
||||||
if (!organizationId || !mitigationId) return;
|
if (!organizationId || !mesureId) return;
|
||||||
|
|
||||||
setIsLoadingControls(true);
|
setIsLoadingControls(true);
|
||||||
|
|
||||||
// Fetch all frameworks and their controls
|
// Fetch all frameworks and their controls
|
||||||
fetchQuery<MitigationViewFrameworksQuery>(environment, frameworksQuery, {
|
fetchQuery<MesureViewFrameworksQuery>(environment, frameworksQuery, {
|
||||||
organizationId,
|
organizationId,
|
||||||
}).subscribe({
|
}).subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
@@ -1635,14 +1625,12 @@ function MitigationViewContent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
// Fetch already linked controls for this mitigation
|
// Fetch already linked controls for this mesure
|
||||||
fetchQuery(environment, linkedControlsQuery, {
|
fetchQuery(environment, linkedControlsQuery, {
|
||||||
mitigationId,
|
mesureId,
|
||||||
}).subscribe({
|
}).subscribe({
|
||||||
next: (data: unknown) => {
|
next: (data: unknown) => {
|
||||||
setLinkedControlsData(
|
setLinkedControlsData(data as MesureViewLinkedControlsQuery$data);
|
||||||
data as MitigationViewLinkedControlsQuery$data
|
|
||||||
);
|
|
||||||
setIsLoadingControls(false);
|
setIsLoadingControls(false);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
@@ -1666,7 +1654,7 @@ function MitigationViewContent({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}, [environment, mitigationId, organizationId, selectedFrameworkId, toast]);
|
}, [environment, mesureId, organizationId, selectedFrameworkId, toast]);
|
||||||
|
|
||||||
const getControls = useCallback(() => {
|
const getControls = useCallback(() => {
|
||||||
if (!frameworksData?.organization?.frameworks?.edges) return [];
|
if (!frameworksData?.organization?.frameworks?.edges) return [];
|
||||||
@@ -1691,8 +1679,8 @@ function MitigationViewContent({
|
|||||||
}, [frameworksData, selectedFrameworkId]);
|
}, [frameworksData, selectedFrameworkId]);
|
||||||
|
|
||||||
const getLinkedControls = useCallback(() => {
|
const getLinkedControls = useCallback(() => {
|
||||||
if (!linkedControlsData?.mitigation?.controls?.edges) return [];
|
if (!linkedControlsData?.mesure?.controls?.edges) return [];
|
||||||
return (linkedControlsData.mitigation.controls.edges || []).map(
|
return (linkedControlsData.mesure.controls.edges || []).map(
|
||||||
(edge) => edge.node
|
(edge) => edge.node
|
||||||
);
|
);
|
||||||
}, [linkedControlsData]);
|
}, [linkedControlsData]);
|
||||||
@@ -1709,7 +1697,7 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
const handleLinkControl = useCallback(
|
const handleLinkControl = useCallback(
|
||||||
(controlId: string) => {
|
(controlId: string) => {
|
||||||
if (!mitigationId) return;
|
if (!mesureId) return;
|
||||||
|
|
||||||
setIsLinkingControl(true);
|
setIsLinkingControl(true);
|
||||||
|
|
||||||
@@ -1717,7 +1705,7 @@ function MitigationViewContent({
|
|||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
controlId,
|
controlId,
|
||||||
mitigationId,
|
mesureId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: (_, errors) => {
|
onCompleted: (_, errors) => {
|
||||||
@@ -1734,11 +1722,11 @@ function MitigationViewContent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Refresh linked controls data
|
// Refresh linked controls data
|
||||||
fetchQuery<MitigationViewLinkedControlsQuery>(
|
fetchQuery<MesureViewLinkedControlsQuery>(
|
||||||
environment,
|
environment,
|
||||||
linkedControlsQuery,
|
linkedControlsQuery,
|
||||||
{
|
{
|
||||||
mitigationId,
|
mesureId,
|
||||||
}
|
}
|
||||||
).subscribe({
|
).subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
@@ -1751,7 +1739,7 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
description: "Control successfully linked to mitigation.",
|
description: "Control successfully linked to mesure.",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
@@ -1765,12 +1753,12 @@ function MitigationViewContent({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[commitCreateControlMapping, environment, mitigationId, toast]
|
[commitCreateControlMapping, environment, mesureId, toast]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleUnlinkControl = useCallback(
|
const handleUnlinkControl = useCallback(
|
||||||
(controlId: string) => {
|
(controlId: string) => {
|
||||||
if (!mitigationId) return;
|
if (!mesureId) return;
|
||||||
|
|
||||||
setIsUnlinkingControl(true);
|
setIsUnlinkingControl(true);
|
||||||
|
|
||||||
@@ -1778,7 +1766,7 @@ function MitigationViewContent({
|
|||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
controlId,
|
controlId,
|
||||||
mitigationId,
|
mesureId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: (_, errors) => {
|
onCompleted: (_, errors) => {
|
||||||
@@ -1796,12 +1784,10 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
// Refresh linked controls data
|
// Refresh linked controls data
|
||||||
fetchQuery(environment, linkedControlsQuery, {
|
fetchQuery(environment, linkedControlsQuery, {
|
||||||
mitigationId,
|
mesureId,
|
||||||
}).subscribe({
|
}).subscribe({
|
||||||
next: (data: unknown) => {
|
next: (data: unknown) => {
|
||||||
setLinkedControlsData(
|
setLinkedControlsData(data as MesureViewLinkedControlsQuery$data);
|
||||||
data as MitigationViewLinkedControlsQuery$data
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error refreshing linked controls:", error);
|
console.error("Error refreshing linked controls:", error);
|
||||||
@@ -1810,7 +1796,7 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
description: "Control successfully unlinked from mitigation.",
|
description: "Control successfully unlinked from mesure.",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
@@ -1824,7 +1810,7 @@ function MitigationViewContent({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[commitDeleteControlMapping, environment, mitigationId, toast]
|
[commitDeleteControlMapping, environment, mesureId, toast]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleOpenControlMappingDialog = useCallback(() => {
|
const handleOpenControlMappingDialog = useCallback(() => {
|
||||||
@@ -1882,21 +1868,21 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageTemplate
|
<PageTemplate
|
||||||
title={data.mitigation.name ?? ""}
|
title={data.mesure.name ?? ""}
|
||||||
actions={
|
actions={
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Button onClick={handleEditMitigation}>Edit Mitigation</Button>
|
<Button onClick={handleEditMesure}>Edit Mesure</Button>
|
||||||
<Select
|
<Select
|
||||||
defaultValue={data.mitigation.state}
|
defaultValue={data.mesure.state}
|
||||||
onValueChange={handleMitigationStateChange}
|
onValueChange={handleMesureStateChange}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="w-[160px] h-10 text-sm">
|
<SelectTrigger className="w-[160px] h-10 text-sm">
|
||||||
<div
|
<div
|
||||||
className={`${getStateColor(
|
className={`${getStateColor(
|
||||||
data.mitigation.state
|
data.mesure.state
|
||||||
)} px-2 py-0.5 rounded-sm text-sm w-full text-center`}
|
)} px-2 py-0.5 rounded-sm text-sm w-full text-center`}
|
||||||
>
|
>
|
||||||
{formatState(data.mitigation.state)}
|
{formatState(data.mesure.state)}
|
||||||
</div>
|
</div>
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
@@ -1908,10 +1894,10 @@ function MitigationViewContent({
|
|||||||
</Select>
|
</Select>
|
||||||
<div
|
<div
|
||||||
className={`${getImportanceColor(
|
className={`${getImportanceColor(
|
||||||
data.mitigation.importance
|
data.mesure.importance
|
||||||
)} px-3 py-1 rounded-full text-sm`}
|
)} px-3 py-1 rounded-full text-sm`}
|
||||||
>
|
>
|
||||||
{formatImportance(data.mitigation.importance)}
|
{formatImportance(data.mesure.importance)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -1920,7 +1906,7 @@ function MitigationViewContent({
|
|||||||
<Card className="mt-4">
|
<Card className="mt-4">
|
||||||
<CardContent className="pt-6">
|
<CardContent className="pt-6">
|
||||||
<div className="prose prose-gray prose-sm md:prose-base text-secondary max-w-3xl">
|
<div className="prose prose-gray prose-sm md:prose-base text-secondary max-w-3xl">
|
||||||
<ReactMarkdown>{data.mitigation.description}</ReactMarkdown>
|
<ReactMarkdown>{data.mesure.description}</ReactMarkdown>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
@@ -1946,20 +1932,20 @@ function MitigationViewContent({
|
|||||||
<TabsTrigger value="controls" className="flex items-center gap-2">
|
<TabsTrigger value="controls" className="flex items-center gap-2">
|
||||||
<ShieldCheck className="w-4 h-4" />
|
<ShieldCheck className="w-4 h-4" />
|
||||||
Controls
|
Controls
|
||||||
{linkedControlsData?.mitigation?.controls?.edges &&
|
{linkedControlsData?.mesure?.controls?.edges &&
|
||||||
linkedControlsData.mitigation.controls.edges.length > 0 && (
|
linkedControlsData.mesure.controls.edges.length > 0 && (
|
||||||
<span className="ml-1.5 bg-blue-100 text-blue-800 rounded-full text-xs px-2 py-0.5">
|
<span className="ml-1.5 bg-blue-100 text-blue-800 rounded-full text-xs px-2 py-0.5">
|
||||||
{linkedControlsData.mitigation.controls.edges.length}
|
{linkedControlsData.mesure.controls.edges.length}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<TabsTrigger value="risks" className="flex items-center gap-2">
|
<TabsTrigger value="risks" className="flex items-center gap-2">
|
||||||
<AlertTriangle className="w-4 h-4" />
|
<AlertTriangle className="w-4 h-4" />
|
||||||
Risks
|
Risks
|
||||||
{risksData?.mitigation?.risks?.edges &&
|
{risksData?.mesure?.risks?.edges &&
|
||||||
risksData.mitigation.risks.edges.length > 0 && (
|
risksData.mesure.risks.edges.length > 0 && (
|
||||||
<span className="ml-1.5 bg-blue-100 text-blue-800 rounded-full text-xs px-2 py-0.5">
|
<span className="ml-1.5 bg-blue-100 text-blue-800 rounded-full text-xs px-2 py-0.5">
|
||||||
{risksData.mitigation.risks.edges.length}
|
{risksData.mesure.risks.edges.length}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
@@ -1988,10 +1974,10 @@ function MitigationViewContent({
|
|||||||
>
|
>
|
||||||
<DialogContent className="max-w-3xl max-h-[80vh] overflow-hidden flex flex-col">
|
<DialogContent className="max-w-3xl max-h-[80vh] overflow-hidden flex flex-col">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Map Mitigation to Controls</DialogTitle>
|
<DialogTitle>Map Mesure to Controls</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
Search and select controls to link to this mitigation. This
|
Search and select controls to link to this mesure. This
|
||||||
helps track which controls are addressed by this mitigation.
|
helps track which controls are addressed by this mesure.
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
@@ -2140,8 +2126,8 @@ function MitigationViewContent({
|
|||||||
{/* Linked Controls List */}
|
{/* Linked Controls List */}
|
||||||
<Card>
|
<Card>
|
||||||
<CardContent className="p-4">
|
<CardContent className="p-4">
|
||||||
{linkedControlsData?.mitigation?.controls?.edges &&
|
{linkedControlsData?.mesure?.controls?.edges &&
|
||||||
linkedControlsData.mitigation.controls.edges.length > 0 ? (
|
linkedControlsData.mesure.controls.edges.length > 0 ? (
|
||||||
<div className="overflow-x-auto">
|
<div className="overflow-x-auto">
|
||||||
<table className="w-full">
|
<table className="w-full">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -2189,8 +2175,8 @@ function MitigationViewContent({
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-center py-8 text-secondary">
|
<div className="text-center py-8 text-secondary">
|
||||||
No controls linked to this mitigation yet. Click "Map
|
No controls linked to this mesure yet. Click "Map to
|
||||||
to Controls" to link controls.
|
Controls" to link controls.
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
@@ -2222,7 +2208,7 @@ function MitigationViewContent({
|
|||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Create New Task</DialogTitle>
|
<DialogTitle>Create New Task</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
Add a new task to this mitigation. Click save when
|
Add a new task to this mesure. Click save when
|
||||||
you're done.
|
you're done.
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
@@ -2809,8 +2795,8 @@ function MitigationViewContent({
|
|||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
<CardContent className="p-4">
|
<CardContent className="p-4">
|
||||||
{risksData?.mitigation?.risks?.edges &&
|
{risksData?.mesure?.risks?.edges &&
|
||||||
risksData.mitigation.risks.edges.length > 0 ? (
|
risksData.mesure.risks.edges.length > 0 ? (
|
||||||
<div className="overflow-x-auto">
|
<div className="overflow-x-auto">
|
||||||
<table className="w-full">
|
<table className="w-full">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -2830,7 +2816,7 @@ function MitigationViewContent({
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{risksData.mitigation.risks.edges.map(({ node }) => (
|
{risksData.mesure.risks.edges.map(({ node }) => (
|
||||||
<tr
|
<tr
|
||||||
key={node.id}
|
key={node.id}
|
||||||
className="border-b hover:bg-invert-bg"
|
className="border-b hover:bg-invert-bg"
|
||||||
@@ -2870,7 +2856,7 @@ function MitigationViewContent({
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-center py-8 text-secondary">
|
<div className="text-center py-8 text-secondary">
|
||||||
No risks linked to this mitigation yet.
|
No risks linked to this mesure yet.
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
@@ -3674,24 +3660,24 @@ function MitigationViewContent({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function MitigationView() {
|
export default function MesureView() {
|
||||||
const { mitigationId } = useParams();
|
const { mesureId } = useParams();
|
||||||
const [queryRef, loadQuery] =
|
const [queryRef, loadQuery] =
|
||||||
useQueryLoader<MitigationViewQueryType>(mitigationViewQuery);
|
useQueryLoader<MesureViewQueryType>(mesureViewQuery);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mitigationId) {
|
if (mesureId) {
|
||||||
loadQuery({ mitigationId });
|
loadQuery({ mesureId });
|
||||||
}
|
}
|
||||||
}, [mitigationId, loadQuery]);
|
}, [mesureId, loadQuery]);
|
||||||
|
|
||||||
if (!queryRef) {
|
if (!queryRef) {
|
||||||
return <MitigationViewSkeleton />;
|
return <MesureViewSkeleton />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<MitigationViewSkeleton />}>
|
<Suspense fallback={<MesureViewSkeleton />}>
|
||||||
<MitigationViewContent queryRef={queryRef} />
|
<MesureViewContent queryRef={queryRef} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -4,26 +4,26 @@ import { lazy } from "@probo/react-lazy";
|
|||||||
import { useLocation } from "react-router";
|
import { useLocation } from "react-router";
|
||||||
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
import { ErrorBoundaryWithLocation } from "../ErrorBoundary";
|
||||||
|
|
||||||
const EditMitigationView = lazy(() => import("./EditMitigationView"));
|
const NewMesureView = lazy(() => import("./NewMesureView"));
|
||||||
|
|
||||||
export function EditMitigationViewSkeleton() {
|
export function NewMesureViewSkeleton() {
|
||||||
return (
|
return (
|
||||||
<PageTemplateSkeleton
|
<PageTemplateSkeleton
|
||||||
title="Edit Mitigation"
|
title="New Mesure"
|
||||||
description="Edit a mitigation. You will be able to link it to control and risks"
|
description="Add a new mesure. You will be able to link it to control and risks"
|
||||||
>
|
>
|
||||||
<div className="max-w-2xl aspect-square bg-subtle-bg rounded-xl animate-pulse" />
|
<div className="max-w-2xl aspect-square bg-subtle-bg rounded-xl animate-pulse" />
|
||||||
</PageTemplateSkeleton>
|
</PageTemplateSkeleton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function EditMitigationPage() {
|
export function NewMesurePage() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense key={location.pathname} fallback={<EditMitigationViewSkeleton />}>
|
<Suspense key={location.pathname} fallback={<NewMesureViewSkeleton />}>
|
||||||
<ErrorBoundaryWithLocation>
|
<ErrorBoundaryWithLocation>
|
||||||
<EditMitigationView />
|
<NewMesureView />
|
||||||
</ErrorBoundaryWithLocation>
|
</ErrorBoundaryWithLocation>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
@@ -3,20 +3,20 @@ import { ConnectionHandler, graphql, useMutation } from "react-relay";
|
|||||||
import { useParams, useNavigate } from "react-router";
|
import { useParams, useNavigate } from "react-router";
|
||||||
import { PageTemplate } from "@/components/PageTemplate";
|
import { PageTemplate } from "@/components/PageTemplate";
|
||||||
import { useToast } from "@/hooks/use-toast";
|
import { useToast } from "@/hooks/use-toast";
|
||||||
import { NewMitigationViewCreateMitigationMutation } from "./__generated__/NewMitigationViewCreateMitigationMutation.graphql";
|
import { NewMesureViewCreateMesureMutation } from "./__generated__/NewMesureViewCreateMesureMutation.graphql";
|
||||||
import { EditableField } from "@/components/EditableField";
|
import { EditableField } from "@/components/EditableField";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Card } from "@/components/ui/card";
|
import { Card } from "@/components/ui/card";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
const createMitigationMutation = graphql`
|
const createMesureMutation = graphql`
|
||||||
mutation NewMitigationViewCreateMitigationMutation(
|
mutation NewMesureViewCreateMesureMutation(
|
||||||
$input: CreateMitigationInput!
|
$input: CreateMesureInput!
|
||||||
$connections: [ID!]!
|
$connections: [ID!]!
|
||||||
) {
|
) {
|
||||||
createMitigation(input: $input) {
|
createMesure(input: $input) {
|
||||||
mitigationEdge @prependEdge(connections: $connections) {
|
mesureEdge @prependEdge(connections: $connections) {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@@ -27,7 +27,7 @@ const createMitigationMutation = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default function NewMitigationView() {
|
export default function NewMesureView() {
|
||||||
const { organizationId } = useParams<{
|
const { organizationId } = useParams<{
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
}>();
|
}>();
|
||||||
@@ -41,9 +41,7 @@ export default function NewMitigationView() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [commit, isInFlight] =
|
const [commit, isInFlight] =
|
||||||
useMutation<NewMitigationViewCreateMitigationMutation>(
|
useMutation<NewMesureViewCreateMesureMutation>(createMesureMutation);
|
||||||
createMitigationMutation
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleFieldChange = (field: keyof typeof formData, value: unknown) => {
|
const handleFieldChange = (field: keyof typeof formData, value: unknown) => {
|
||||||
setFormData((prev) => ({
|
setFormData((prev) => ({
|
||||||
@@ -66,7 +64,7 @@ export default function NewMitigationView() {
|
|||||||
|
|
||||||
const connectionId = ConnectionHandler.getConnectionID(
|
const connectionId = ConnectionHandler.getConnectionID(
|
||||||
organizationId!,
|
organizationId!,
|
||||||
"MitigationListView_mitigations"
|
"MesureListView_mesures"
|
||||||
);
|
);
|
||||||
|
|
||||||
commit({
|
commit({
|
||||||
@@ -84,7 +82,7 @@ export default function NewMitigationView() {
|
|||||||
if (errors) {
|
if (errors) {
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: errors[0]?.message || "Failed to create mitigation",
|
description: errors[0]?.message || "Failed to create mesure",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -92,17 +90,17 @@ export default function NewMitigationView() {
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
description: "Mitigation created successfully",
|
description: "Mesure created successfully",
|
||||||
});
|
});
|
||||||
|
|
||||||
navigate(
|
navigate(
|
||||||
`/organizations/${organizationId}/mitigations/${data.createMitigation.mitigationEdge.node.id}`
|
`/organizations/${organizationId}/mesures/${data.createMesure.mesureEdge.node.id}`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
onError(error) {
|
onError(error) {
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: error.message || "Failed to create mitigation",
|
description: error.message || "Failed to create mesure",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -111,8 +109,8 @@ export default function NewMitigationView() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageTemplate
|
<PageTemplate
|
||||||
title="New Mitigation"
|
title="New Mesure"
|
||||||
description="Add a new mitigation. You will be able to link it to control and risks"
|
description="Add a new mesure. You will be able to link it to control and risks"
|
||||||
>
|
>
|
||||||
<Card className="max-w-2xl">
|
<Card className="max-w-2xl">
|
||||||
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
||||||
@@ -129,7 +127,7 @@ export default function NewMitigationView() {
|
|||||||
onChange={(value) => handleFieldChange("description", value)}
|
onChange={(value) => handleFieldChange("description", value)}
|
||||||
required
|
required
|
||||||
multiline
|
multiline
|
||||||
helpText="Provide a detailed description of the mitigation"
|
helpText="Provide a detailed description of the mesure"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<EditableField
|
<EditableField
|
||||||
@@ -190,13 +188,13 @@ export default function NewMitigationView() {
|
|||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
navigate(`/organizations/${organizationId}/mitigations`)
|
navigate(`/organizations/${organizationId}/mesures`)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit" disabled={isInFlight}>
|
<Button type="submit" disabled={isInFlight}>
|
||||||
{isInFlight ? "Creating..." : "Create Mitigation"}
|
{isInFlight ? "Creating..." : "Create Mesure"}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<851436cc3003fed7f1e384d153eff0b7>>
|
* @generated SignedSource<<7a5c27ece406a4250a38977e9ed9173f>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,22 +9,22 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type EditMitigationViewQuery$variables = {
|
export type EditMesureViewQuery$variables = {
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type EditMitigationViewQuery$data = {
|
export type EditMesureViewQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly category?: string;
|
readonly category?: string;
|
||||||
readonly description?: string;
|
readonly description?: string;
|
||||||
readonly id?: string;
|
readonly id?: string;
|
||||||
readonly importance?: MitigationImportance;
|
readonly importance?: MesureImportance;
|
||||||
readonly name?: string;
|
readonly name?: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type EditMitigationViewQuery = {
|
export type EditMesureViewQuery = {
|
||||||
response: EditMitigationViewQuery$data;
|
response: EditMesureViewQuery$data;
|
||||||
variables: EditMitigationViewQuery$variables;
|
variables: EditMesureViewQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -32,14 +32,14 @@ var v0 = [
|
|||||||
{
|
{
|
||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "mitigationId"
|
"name": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = [
|
v1 = [
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"variableName": "mitigationId"
|
"variableName": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v2 = {
|
v2 = {
|
||||||
@@ -82,7 +82,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "EditMitigationViewQuery",
|
"name": "EditMesureViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -101,7 +101,7 @@ return {
|
|||||||
(v5/*: any*/),
|
(v5/*: any*/),
|
||||||
(v6/*: any*/)
|
(v6/*: any*/)
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -115,7 +115,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "EditMitigationViewQuery",
|
"name": "EditMesureViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -141,7 +141,7 @@ return {
|
|||||||
(v5/*: any*/),
|
(v5/*: any*/),
|
||||||
(v6/*: any*/)
|
(v6/*: any*/)
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -150,16 +150,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "df8ca216b15dda843c6da7f82bc4fb37",
|
"cacheID": "d38df91a88f32d80da84fc47b7ca17ca",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "EditMitigationViewQuery",
|
"name": "EditMesureViewQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query EditMitigationViewQuery(\n $mitigationId: ID!\n) {\n node(id: $mitigationId) {\n __typename\n ... on Mitigation {\n id\n name\n description\n category\n importance\n }\n id\n }\n}\n"
|
"text": "query EditMesureViewQuery(\n $mesureId: ID!\n) {\n node(id: $mesureId) {\n __typename\n ... on Mesure {\n id\n name\n description\n category\n importance\n }\n id\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "bb3db4a2e4bcdcd77f8847d302f74340";
|
(node as any).hash = "abca56f710248363bacef919222a8420";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<ef4c93d248af00040b679e1bdb225a64>>
|
* @generated SignedSource<<869dc4adbc0716aa90912098821ce101>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,31 +9,31 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type UpdateMitigationInput = {
|
export type UpdateMesureInput = {
|
||||||
category?: string | null | undefined;
|
category?: string | null | undefined;
|
||||||
description?: string | null | undefined;
|
description?: string | null | undefined;
|
||||||
id: string;
|
id: string;
|
||||||
importance?: MitigationImportance | null | undefined;
|
importance?: MesureImportance | null | undefined;
|
||||||
name?: string | null | undefined;
|
name?: string | null | undefined;
|
||||||
state?: MitigationState | null | undefined;
|
state?: MesureState | null | undefined;
|
||||||
};
|
};
|
||||||
export type EditMitigationViewUpdateMitigationMutation$variables = {
|
export type EditMesureViewUpdateMesureMutation$variables = {
|
||||||
input: UpdateMitigationInput;
|
input: UpdateMesureInput;
|
||||||
};
|
};
|
||||||
export type EditMitigationViewUpdateMitigationMutation$data = {
|
export type EditMesureViewUpdateMesureMutation$data = {
|
||||||
readonly updateMitigation: {
|
readonly updateMesure: {
|
||||||
readonly mitigation: {
|
readonly mesure: {
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type EditMitigationViewUpdateMitigationMutation = {
|
export type EditMesureViewUpdateMesureMutation = {
|
||||||
response: EditMitigationViewUpdateMitigationMutation$data;
|
response: EditMesureViewUpdateMesureMutation$data;
|
||||||
variables: EditMitigationViewUpdateMitigationMutation$variables;
|
variables: EditMesureViewUpdateMesureMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -54,17 +54,17 @@ v1 = [
|
|||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "UpdateMitigationPayload",
|
"concreteType": "UpdateMesurePayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "updateMitigation",
|
"name": "updateMesure",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigation",
|
"name": "mesure",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -100,7 +100,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "EditMitigationViewUpdateMitigationMutation",
|
"name": "EditMesureViewUpdateMesureMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -109,20 +109,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "EditMitigationViewUpdateMitigationMutation",
|
"name": "EditMesureViewUpdateMesureMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "b28b509d2111119e074541df44720f4f",
|
"cacheID": "ab674147338f145102c150b220578304",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "EditMitigationViewUpdateMitigationMutation",
|
"name": "EditMesureViewUpdateMesureMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation EditMitigationViewUpdateMitigationMutation(\n $input: UpdateMitigationInput!\n) {\n updateMitigation(input: $input) {\n mitigation {\n id\n name\n description\n }\n }\n}\n"
|
"text": "mutation EditMesureViewUpdateMesureMutation(\n $input: UpdateMesureInput!\n) {\n updateMesure(input: $input) {\n mesure {\n id\n name\n description\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "30ac146016e936fd8912b480286c93de";
|
(node as any).hash = "5f00ce5e7a705abecd93b06e727d5587";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<d4590a13a15cf248104340854bc46aa7>>
|
* @generated SignedSource<<251663bea47f61a5857366afa4cc0d28>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,35 +9,35 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type ImportMitigationInput = {
|
export type ImportMesureInput = {
|
||||||
file: any;
|
file: any;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
};
|
};
|
||||||
export type MitigationListViewImportMitigationMutation$variables = {
|
export type MesureListViewImportMesureMutation$variables = {
|
||||||
connections: ReadonlyArray<string>;
|
connections: ReadonlyArray<string>;
|
||||||
input: ImportMitigationInput;
|
input: ImportMesureInput;
|
||||||
};
|
};
|
||||||
export type MitigationListViewImportMitigationMutation$data = {
|
export type MesureListViewImportMesureMutation$data = {
|
||||||
readonly importMitigation: {
|
readonly importMesure: {
|
||||||
readonly mitigationEdges: ReadonlyArray<{
|
readonly mesureEdges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly category: string;
|
readonly category: string;
|
||||||
readonly createdAt: string;
|
readonly createdAt: string;
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly importance: MitigationImportance;
|
readonly importance: MesureImportance;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly state: MitigationState;
|
readonly state: MesureState;
|
||||||
readonly updatedAt: string;
|
readonly updatedAt: string;
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationListViewImportMitigationMutation = {
|
export type MesureListViewImportMesureMutation = {
|
||||||
response: MitigationListViewImportMitigationMutation$data;
|
response: MesureListViewImportMesureMutation$data;
|
||||||
variables: MitigationListViewImportMitigationMutation$variables;
|
variables: MesureListViewImportMesureMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -61,15 +61,15 @@ v2 = [
|
|||||||
v3 = {
|
v3 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationEdge",
|
"concreteType": "MesureEdge",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigationEdges",
|
"name": "mesureEdges",
|
||||||
"plural": true,
|
"plural": true,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
@@ -144,14 +144,14 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationListViewImportMitigationMutation",
|
"name": "MesureListViewImportMesureMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v2/*: any*/),
|
"args": (v2/*: any*/),
|
||||||
"concreteType": "ImportMitigationPayload",
|
"concreteType": "ImportMesurePayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "importMitigation",
|
"name": "importMesure",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/)
|
(v3/*: any*/)
|
||||||
@@ -169,14 +169,14 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationListViewImportMitigationMutation",
|
"name": "MesureListViewImportMesureMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v2/*: any*/),
|
"args": (v2/*: any*/),
|
||||||
"concreteType": "ImportMitigationPayload",
|
"concreteType": "ImportMesurePayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "importMitigation",
|
"name": "importMesure",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
@@ -187,7 +187,7 @@ return {
|
|||||||
"handle": "appendEdge",
|
"handle": "appendEdge",
|
||||||
"key": "",
|
"key": "",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "mitigationEdges",
|
"name": "mesureEdges",
|
||||||
"handleArgs": [
|
"handleArgs": [
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
@@ -202,16 +202,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "84c038c572378999bfaacb87e8172b1e",
|
"cacheID": "179ac701005009dc5f30388570061264",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationListViewImportMitigationMutation",
|
"name": "MesureListViewImportMesureMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationListViewImportMitigationMutation(\n $input: ImportMitigationInput!\n) {\n importMitigation(input: $input) {\n mitigationEdges {\n node {\n id\n name\n description\n category\n state\n importance\n createdAt\n updatedAt\n }\n }\n }\n}\n"
|
"text": "mutation MesureListViewImportMesureMutation(\n $input: ImportMesureInput!\n) {\n importMesure(input: $input) {\n mesureEdges {\n node {\n id\n name\n description\n category\n state\n importance\n createdAt\n updatedAt\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "59e3d4a8e71cee0dcee606b93d706dad";
|
(node as any).hash = "c1c9deeaa806b9553b7eb25d8832818c";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<cfd9a630fcbe359cd0b4db0e940dd564>>
|
* @generated SignedSource<<90d959a85cf60161201cb5736ac6abcf>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,34 +9,34 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type MitigationListViewQuery$variables = {
|
export type MesureListViewQuery$variables = {
|
||||||
first?: number | null | undefined;
|
first?: number | null | undefined;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
};
|
};
|
||||||
export type MitigationListViewQuery$data = {
|
export type MesureListViewQuery$data = {
|
||||||
readonly organization: {
|
readonly organization: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly mitigations?: {
|
readonly mesures?: {
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly category: string;
|
readonly category: string;
|
||||||
readonly createdAt: string;
|
readonly createdAt: string;
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly importance: MitigationImportance;
|
readonly importance: MesureImportance;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly state: MitigationState;
|
readonly state: MesureState;
|
||||||
readonly updatedAt: string;
|
readonly updatedAt: string;
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationListViewQuery = {
|
export type MesureListViewQuery = {
|
||||||
response: MitigationListViewQuery$data;
|
response: MesureListViewQuery$data;
|
||||||
variables: MitigationListViewQuery$variables;
|
variables: MesureListViewQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -75,7 +75,7 @@ v5 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationEdge",
|
"concreteType": "MesureEdge",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "edges",
|
"name": "edges",
|
||||||
"plural": true,
|
"plural": true,
|
||||||
@@ -83,7 +83,7 @@ v5 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
@@ -193,7 +193,7 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationListViewQuery",
|
"name": "MesureListViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -208,11 +208,11 @@ return {
|
|||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigations",
|
"alias": "mesures",
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__MitigationListView_mitigations_connection",
|
"name": "__MesureListView_mesures_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v5/*: any*/),
|
"selections": (v5/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -235,7 +235,7 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationListViewQuery",
|
"name": "MesureListViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -253,9 +253,9 @@ return {
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v6/*: any*/),
|
"args": (v6/*: any*/),
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigations",
|
"name": "mesures",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v5/*: any*/),
|
"selections": (v5/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -265,9 +265,9 @@ return {
|
|||||||
"args": (v6/*: any*/),
|
"args": (v6/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "MitigationListView_mitigations",
|
"key": "MesureListView_mesures",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "mitigations"
|
"name": "mesures"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Organization",
|
"type": "Organization",
|
||||||
@@ -279,7 +279,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "9951f5e4be50df7a883af63426fe5fde",
|
"cacheID": "9f6e9e1487bd34be972a52077bc91ee8",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -289,18 +289,18 @@ return {
|
|||||||
"direction": "forward",
|
"direction": "forward",
|
||||||
"path": [
|
"path": [
|
||||||
"organization",
|
"organization",
|
||||||
"mitigations"
|
"mesures"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "MitigationListViewQuery",
|
"name": "MesureListViewQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query MitigationListViewQuery(\n $organizationId: ID!\n $first: Int\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n mitigations(first: $first) {\n edges {\n node {\n id\n name\n description\n category\n state\n importance\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query MesureListViewQuery(\n $organizationId: ID!\n $first: Int\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n mesures(first: $first) {\n edges {\n node {\n id\n name\n description\n category\n state\n importance\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "6b2de4417fd7175dd9ccd34549e097b7";
|
(node as any).hash = "47928382749f3bac585927423bcdd09e";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<c176425ad01ae9a330d0b8217a54841f>>
|
* @generated SignedSource<<d85f0048d0939eddb1152b5e0b361749>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -13,10 +13,10 @@ export type AssignTaskInput = {
|
|||||||
assignedToId: string;
|
assignedToId: string;
|
||||||
taskId: string;
|
taskId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewAssignTaskMutation$variables = {
|
export type MesureViewAssignTaskMutation$variables = {
|
||||||
input: AssignTaskInput;
|
input: AssignTaskInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewAssignTaskMutation$data = {
|
export type MesureViewAssignTaskMutation$data = {
|
||||||
readonly assignTask: {
|
readonly assignTask: {
|
||||||
readonly task: {
|
readonly task: {
|
||||||
readonly assignedTo: {
|
readonly assignedTo: {
|
||||||
@@ -28,9 +28,9 @@ export type MitigationViewAssignTaskMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewAssignTaskMutation = {
|
export type MesureViewAssignTaskMutation = {
|
||||||
response: MitigationViewAssignTaskMutation$data;
|
response: MesureViewAssignTaskMutation$data;
|
||||||
variables: MitigationViewAssignTaskMutation$variables;
|
variables: MesureViewAssignTaskMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -110,7 +110,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewAssignTaskMutation",
|
"name": "MesureViewAssignTaskMutation",
|
||||||
"selections": (v2/*: any*/),
|
"selections": (v2/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -119,20 +119,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewAssignTaskMutation",
|
"name": "MesureViewAssignTaskMutation",
|
||||||
"selections": (v2/*: any*/)
|
"selections": (v2/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "c01a2f758aea8268b73365c426b7c08a",
|
"cacheID": "6d3f95b9e223f40d7e333b951193abcc",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewAssignTaskMutation",
|
"name": "MesureViewAssignTaskMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewAssignTaskMutation(\n $input: AssignTaskInput!\n) {\n assignTask(input: $input) {\n task {\n id\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n"
|
"text": "mutation MesureViewAssignTaskMutation(\n $input: AssignTaskInput!\n) {\n assignTask(input: $input) {\n task {\n id\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "2b01502cb830a0d914553e01ceb2445f";
|
(node as any).hash = "28bc00cb45866a86eb79ebe0c1396a65";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<2eea3e72c7001db14095958b3bcd750a>>
|
* @generated SignedSource<<f5d09284634ce1975ceff8ce576884c9>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,21 +9,21 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type CreateControlMitigationMappingInput = {
|
export type CreateControlMesureMappingInput = {
|
||||||
controlId: string;
|
controlId: string;
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type ControlCreateMitigationMappingMutation$variables = {
|
export type MesureViewCreateControlMappingMutation$variables = {
|
||||||
input: CreateControlMitigationMappingInput;
|
input: CreateControlMesureMappingInput;
|
||||||
};
|
};
|
||||||
export type ControlCreateMitigationMappingMutation$data = {
|
export type MesureViewCreateControlMappingMutation$data = {
|
||||||
readonly createControlMitigationMapping: {
|
readonly createControlMesureMapping: {
|
||||||
readonly success: boolean;
|
readonly success: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type ControlCreateMitigationMappingMutation = {
|
export type MesureViewCreateControlMappingMutation = {
|
||||||
response: ControlCreateMitigationMappingMutation$data;
|
response: MesureViewCreateControlMappingMutation$data;
|
||||||
variables: ControlCreateMitigationMappingMutation$variables;
|
variables: MesureViewCreateControlMappingMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -44,9 +44,9 @@ v1 = [
|
|||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "CreateControlMitigationMappingPayload",
|
"concreteType": "CreateControlMesureMappingPayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "createControlMitigationMapping",
|
"name": "createControlMesureMapping",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -65,7 +65,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ControlCreateMitigationMappingMutation",
|
"name": "MesureViewCreateControlMappingMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -74,20 +74,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "ControlCreateMitigationMappingMutation",
|
"name": "MesureViewCreateControlMappingMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "955241a049e81cd7faed45d69ce3b145",
|
"cacheID": "78c1205d1a787ee2cc4e1173e3ef463f",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ControlCreateMitigationMappingMutation",
|
"name": "MesureViewCreateControlMappingMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation ControlCreateMitigationMappingMutation(\n $input: CreateControlMitigationMappingInput!\n) {\n createControlMitigationMapping(input: $input) {\n success\n }\n}\n"
|
"text": "mutation MesureViewCreateControlMappingMutation(\n $input: CreateControlMesureMappingInput!\n) {\n createControlMesureMapping(input: $input) {\n success\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "ffbcf187d7f2d3c65a2d1fb5c6a180bb";
|
(node as any).hash = "cdbbc7ebd2c99ef1d19bac274af5a147";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<487ccddf967e20c9111c5074548bebae>>
|
* @generated SignedSource<<0601ac43da57ebf5dffbd0e3ce9abde7>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -19,11 +19,11 @@ export type CreateEvidenceInput = {
|
|||||||
type: EvidenceType;
|
type: EvidenceType;
|
||||||
url?: string | null | undefined;
|
url?: string | null | undefined;
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateEvidenceMutation$variables = {
|
export type MesureViewCreateEvidenceMutation$variables = {
|
||||||
connections: ReadonlyArray<string>;
|
connections: ReadonlyArray<string>;
|
||||||
input: CreateEvidenceInput;
|
input: CreateEvidenceInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateEvidenceMutation$data = {
|
export type MesureViewCreateEvidenceMutation$data = {
|
||||||
readonly createEvidence: {
|
readonly createEvidence: {
|
||||||
readonly evidenceEdge: {
|
readonly evidenceEdge: {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
@@ -41,9 +41,9 @@ export type MitigationViewCreateEvidenceMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateEvidenceMutation = {
|
export type MesureViewCreateEvidenceMutation = {
|
||||||
response: MitigationViewCreateEvidenceMutation$data;
|
response: MesureViewCreateEvidenceMutation$data;
|
||||||
variables: MitigationViewCreateEvidenceMutation$variables;
|
variables: MesureViewCreateEvidenceMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -164,7 +164,7 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewCreateEvidenceMutation",
|
"name": "MesureViewCreateEvidenceMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -189,7 +189,7 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewCreateEvidenceMutation",
|
"name": "MesureViewCreateEvidenceMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -222,16 +222,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "899aada42838cb5db77546be2bd6adb2",
|
"cacheID": "550cd90cddee628ec42ebd53ac749af0",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewCreateEvidenceMutation",
|
"name": "MesureViewCreateEvidenceMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewCreateEvidenceMutation(\n $input: CreateEvidenceInput!\n) {\n createEvidence(input: $input) {\n evidenceEdge {\n node {\n id\n filename\n fileUrl\n mimeType\n type\n url\n size\n state\n createdAt\n description\n }\n }\n }\n}\n"
|
"text": "mutation MesureViewCreateEvidenceMutation(\n $input: CreateEvidenceInput!\n) {\n createEvidence(input: $input) {\n evidenceEdge {\n node {\n id\n filename\n fileUrl\n mimeType\n type\n url\n size\n state\n createdAt\n description\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "ca8611e07bcf9233313c3a1580bfc7eb";
|
(node as any).hash = "2a00046ec29c9dc07b563b5442a85d2d";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<e544ac1f4a0b6d728cba2b66a2f97520>>
|
* @generated SignedSource<<fa3e50475f102e38ffd517849b9aedf2>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -13,15 +13,15 @@ export type TaskState = "DONE" | "TODO";
|
|||||||
export type CreateTaskInput = {
|
export type CreateTaskInput = {
|
||||||
assignedToId?: string | null | undefined;
|
assignedToId?: string | null | undefined;
|
||||||
description: string;
|
description: string;
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
name: string;
|
name: string;
|
||||||
timeEstimate?: any | null | undefined;
|
timeEstimate?: any | null | undefined;
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateTaskMutation$variables = {
|
export type MesureViewCreateTaskMutation$variables = {
|
||||||
connections: ReadonlyArray<string>;
|
connections: ReadonlyArray<string>;
|
||||||
input: CreateTaskInput;
|
input: CreateTaskInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateTaskMutation$data = {
|
export type MesureViewCreateTaskMutation$data = {
|
||||||
readonly createTask: {
|
readonly createTask: {
|
||||||
readonly taskEdge: {
|
readonly taskEdge: {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
@@ -39,9 +39,9 @@ export type MitigationViewCreateTaskMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewCreateTaskMutation = {
|
export type MesureViewCreateTaskMutation = {
|
||||||
response: MitigationViewCreateTaskMutation$data;
|
response: MesureViewCreateTaskMutation$data;
|
||||||
variables: MitigationViewCreateTaskMutation$variables;
|
variables: MesureViewCreateTaskMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -154,7 +154,7 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewCreateTaskMutation",
|
"name": "MesureViewCreateTaskMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -179,7 +179,7 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewCreateTaskMutation",
|
"name": "MesureViewCreateTaskMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -212,16 +212,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "273c3d2ae0de44280e85e47db23db892",
|
"cacheID": "453cd7da016798ce86c012c9d1cf29f1",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewCreateTaskMutation",
|
"name": "MesureViewCreateTaskMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewCreateTaskMutation(\n $input: CreateTaskInput!\n) {\n createTask(input: $input) {\n taskEdge {\n node {\n id\n name\n description\n timeEstimate\n state\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n }\n}\n"
|
"text": "mutation MesureViewCreateTaskMutation(\n $input: CreateTaskInput!\n) {\n createTask(input: $input) {\n taskEdge {\n node {\n id\n name\n description\n timeEstimate\n state\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "ad8a56e4976e9dc15f4ee8e1b32d9fa9";
|
(node as any).hash = "19abdc1f9accd5deb6bc36a88a91b04d";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<7c4ad77e70fa42cf8257113897a607ec>>
|
* @generated SignedSource<<aa1cb94133ffcc770185dddcf490492e>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,21 +9,21 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type DeleteControlMitigationMappingInput = {
|
export type DeleteControlMesureMappingInput = {
|
||||||
controlId: string;
|
controlId: string;
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type ControlDeleteMitigationMappingMutation$variables = {
|
export type MesureViewDeleteControlMappingMutation$variables = {
|
||||||
input: DeleteControlMitigationMappingInput;
|
input: DeleteControlMesureMappingInput;
|
||||||
};
|
};
|
||||||
export type ControlDeleteMitigationMappingMutation$data = {
|
export type MesureViewDeleteControlMappingMutation$data = {
|
||||||
readonly deleteControlMitigationMapping: {
|
readonly deleteControlMesureMapping: {
|
||||||
readonly success: boolean;
|
readonly success: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type ControlDeleteMitigationMappingMutation = {
|
export type MesureViewDeleteControlMappingMutation = {
|
||||||
response: ControlDeleteMitigationMappingMutation$data;
|
response: MesureViewDeleteControlMappingMutation$data;
|
||||||
variables: ControlDeleteMitigationMappingMutation$variables;
|
variables: MesureViewDeleteControlMappingMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -44,9 +44,9 @@ v1 = [
|
|||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "DeleteControlMitigationMappingPayload",
|
"concreteType": "DeleteControlMesureMappingPayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "deleteControlMitigationMapping",
|
"name": "deleteControlMesureMapping",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -65,7 +65,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ControlDeleteMitigationMappingMutation",
|
"name": "MesureViewDeleteControlMappingMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -74,20 +74,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "ControlDeleteMitigationMappingMutation",
|
"name": "MesureViewDeleteControlMappingMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "3d09a29c8ae06a97d098e565a7f2d172",
|
"cacheID": "5293df3ec3b7a9c5dab1ae7c41177186",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ControlDeleteMitigationMappingMutation",
|
"name": "MesureViewDeleteControlMappingMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation ControlDeleteMitigationMappingMutation(\n $input: DeleteControlMitigationMappingInput!\n) {\n deleteControlMitigationMapping(input: $input) {\n success\n }\n}\n"
|
"text": "mutation MesureViewDeleteControlMappingMutation(\n $input: DeleteControlMesureMappingInput!\n) {\n deleteControlMesureMapping(input: $input) {\n success\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "6905236aeeb313e5deed3e569a0c7c54";
|
(node as any).hash = "14d324c311f9f5aa0a27c0d705fe7bb6";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<c7cba05f3dbc917afc82d3a3dae6045c>>
|
* @generated SignedSource<<5819ea12b0c6baff2a21d28b6d22bf29>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -12,18 +12,18 @@ import { ConcreteRequest } from 'relay-runtime';
|
|||||||
export type DeleteEvidenceInput = {
|
export type DeleteEvidenceInput = {
|
||||||
evidenceId: string;
|
evidenceId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteEvidenceMutation$variables = {
|
export type MesureViewDeleteEvidenceMutation$variables = {
|
||||||
connections: ReadonlyArray<string>;
|
connections: ReadonlyArray<string>;
|
||||||
input: DeleteEvidenceInput;
|
input: DeleteEvidenceInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteEvidenceMutation$data = {
|
export type MesureViewDeleteEvidenceMutation$data = {
|
||||||
readonly deleteEvidence: {
|
readonly deleteEvidence: {
|
||||||
readonly deletedEvidenceId: string;
|
readonly deletedEvidenceId: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteEvidenceMutation = {
|
export type MesureViewDeleteEvidenceMutation = {
|
||||||
response: MitigationViewDeleteEvidenceMutation$data;
|
response: MesureViewDeleteEvidenceMutation$data;
|
||||||
variables: MitigationViewDeleteEvidenceMutation$variables;
|
variables: MesureViewDeleteEvidenceMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -59,7 +59,7 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewDeleteEvidenceMutation",
|
"name": "MesureViewDeleteEvidenceMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -84,7 +84,7 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewDeleteEvidenceMutation",
|
"name": "MesureViewDeleteEvidenceMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -117,16 +117,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "4770e84f6f87fb95b9f102cf8e572f44",
|
"cacheID": "26fbd71aca06943318c6154a0079d6d7",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewDeleteEvidenceMutation",
|
"name": "MesureViewDeleteEvidenceMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewDeleteEvidenceMutation(\n $input: DeleteEvidenceInput!\n) {\n deleteEvidence(input: $input) {\n deletedEvidenceId\n }\n}\n"
|
"text": "mutation MesureViewDeleteEvidenceMutation(\n $input: DeleteEvidenceInput!\n) {\n deleteEvidence(input: $input) {\n deletedEvidenceId\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "993f84f2e310e888a78200abb9b79ae0";
|
(node as any).hash = "1121dd991a7505864bcd00f06065f2eb";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<c91c57e5263b695d85ca6d95f14acc1d>>
|
* @generated SignedSource<<c70fd910b41f49426916f3f3aa1433bd>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -12,18 +12,18 @@ import { ConcreteRequest } from 'relay-runtime';
|
|||||||
export type DeleteTaskInput = {
|
export type DeleteTaskInput = {
|
||||||
taskId: string;
|
taskId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteTaskMutation$variables = {
|
export type MesureViewDeleteTaskMutation$variables = {
|
||||||
connections: ReadonlyArray<string>;
|
connections: ReadonlyArray<string>;
|
||||||
input: DeleteTaskInput;
|
input: DeleteTaskInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteTaskMutation$data = {
|
export type MesureViewDeleteTaskMutation$data = {
|
||||||
readonly deleteTask: {
|
readonly deleteTask: {
|
||||||
readonly deletedTaskId: string;
|
readonly deletedTaskId: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewDeleteTaskMutation = {
|
export type MesureViewDeleteTaskMutation = {
|
||||||
response: MitigationViewDeleteTaskMutation$data;
|
response: MesureViewDeleteTaskMutation$data;
|
||||||
variables: MitigationViewDeleteTaskMutation$variables;
|
variables: MesureViewDeleteTaskMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -59,7 +59,7 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewDeleteTaskMutation",
|
"name": "MesureViewDeleteTaskMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -84,7 +84,7 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewDeleteTaskMutation",
|
"name": "MesureViewDeleteTaskMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -117,16 +117,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "f586e9c07d233eb31a72c2564c448fe4",
|
"cacheID": "a5096acddc7796fbc89521cc80b5538e",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewDeleteTaskMutation",
|
"name": "MesureViewDeleteTaskMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewDeleteTaskMutation(\n $input: DeleteTaskInput!\n) {\n deleteTask(input: $input) {\n deletedTaskId\n }\n}\n"
|
"text": "mutation MesureViewDeleteTaskMutation(\n $input: DeleteTaskInput!\n) {\n deleteTask(input: $input) {\n deletedTaskId\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "2d6cfcb4704b95bc89f9f4715488d133";
|
(node as any).hash = "42867b2a8776a0facd18b0b24499ccc9";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<641911581864265e2933d2d5f2705bfe>>
|
* @generated SignedSource<<296196d78af980e2c7456af3192b29ef>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationViewFrameworksQuery$variables = {
|
export type MesureViewFrameworksQuery$variables = {
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewFrameworksQuery$data = {
|
export type MesureViewFrameworksQuery$data = {
|
||||||
readonly organization: {
|
readonly organization: {
|
||||||
readonly frameworks?: {
|
readonly frameworks?: {
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
@@ -35,9 +35,9 @@ export type MitigationViewFrameworksQuery$data = {
|
|||||||
readonly id: string;
|
readonly id: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewFrameworksQuery = {
|
export type MesureViewFrameworksQuery = {
|
||||||
response: MitigationViewFrameworksQuery$data;
|
response: MesureViewFrameworksQuery$data;
|
||||||
variables: MitigationViewFrameworksQuery$variables;
|
variables: MesureViewFrameworksQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -163,7 +163,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewFrameworksQuery",
|
"name": "MesureViewFrameworksQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -240,7 +240,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewFrameworksQuery",
|
"name": "MesureViewFrameworksQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -331,7 +331,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "34e6669a992e649351d4284a2d66c66a",
|
"cacheID": "68ea9b6b474fc4c715eda4e5814b3343",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -352,13 +352,13 @@ return {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "MitigationViewFrameworksQuery",
|
"name": "MesureViewFrameworksQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query MitigationViewFrameworksQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n frameworks(first: 100) {\n edges {\n node {\n id\n name\n controls(first: 100) {\n edges {\n node {\n id\n referenceId\n name\n description\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query MesureViewFrameworksQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n frameworks(first: 100) {\n edges {\n node {\n id\n name\n controls(first: 100) {\n edges {\n node {\n id\n referenceId\n name\n description\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "f4f9ed0abc3a0d36365801dcc60c4333";
|
(node as any).hash = "c66b330acf51a54f75ac9b4238c30ec1";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<780fd466293ec923661adc90f801380a>>
|
* @generated SignedSource<<a690863c83d2e67fa057c3fe63b63979>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -17,11 +17,11 @@ export type FulfillEvidenceInput = {
|
|||||||
name?: string | null | undefined;
|
name?: string | null | undefined;
|
||||||
url?: string | null | undefined;
|
url?: string | null | undefined;
|
||||||
};
|
};
|
||||||
export type MitigationViewFulfillEvidenceMutation$variables = {
|
export type MesureViewFulfillEvidenceMutation$variables = {
|
||||||
connections: ReadonlyArray<string>;
|
connections: ReadonlyArray<string>;
|
||||||
input: FulfillEvidenceInput;
|
input: FulfillEvidenceInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewFulfillEvidenceMutation$data = {
|
export type MesureViewFulfillEvidenceMutation$data = {
|
||||||
readonly fulfillEvidence: {
|
readonly fulfillEvidence: {
|
||||||
readonly evidenceEdge: {
|
readonly evidenceEdge: {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
@@ -39,9 +39,9 @@ export type MitigationViewFulfillEvidenceMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewFulfillEvidenceMutation = {
|
export type MesureViewFulfillEvidenceMutation = {
|
||||||
response: MitigationViewFulfillEvidenceMutation$data;
|
response: MesureViewFulfillEvidenceMutation$data;
|
||||||
variables: MitigationViewFulfillEvidenceMutation$variables;
|
variables: MesureViewFulfillEvidenceMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -162,7 +162,7 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewFulfillEvidenceMutation",
|
"name": "MesureViewFulfillEvidenceMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -187,7 +187,7 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewFulfillEvidenceMutation",
|
"name": "MesureViewFulfillEvidenceMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -220,16 +220,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "efdf549604c425e8bb58ccf51df580c9",
|
"cacheID": "605c054b1e501d03ded168635513d859",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewFulfillEvidenceMutation",
|
"name": "MesureViewFulfillEvidenceMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewFulfillEvidenceMutation(\n $input: FulfillEvidenceInput!\n) {\n fulfillEvidence(input: $input) {\n evidenceEdge {\n node {\n id\n filename\n fileUrl\n mimeType\n type\n url\n size\n state\n createdAt\n description\n }\n }\n }\n}\n"
|
"text": "mutation MesureViewFulfillEvidenceMutation(\n $input: FulfillEvidenceInput!\n) {\n fulfillEvidence(input: $input) {\n evidenceEdge {\n node {\n id\n filename\n fileUrl\n mimeType\n type\n url\n size\n state\n createdAt\n description\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "2a7f04e50e4e6fc39457a861a22baf08";
|
(node as any).hash = "049b31ff4cf60918ec33c2c10fcb9b46";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<c39e6569df1609b4a9cf0a6c1673df3a>>
|
* @generated SignedSource<<d3565063e8e1b68e794fe4347c923138>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,18 +9,18 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationViewGetEvidenceFileUrlQuery$variables = {
|
export type MesureViewGetEvidenceFileUrlQuery$variables = {
|
||||||
evidenceId: string;
|
evidenceId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewGetEvidenceFileUrlQuery$data = {
|
export type MesureViewGetEvidenceFileUrlQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly fileUrl?: string | null | undefined;
|
readonly fileUrl?: string | null | undefined;
|
||||||
readonly id?: string;
|
readonly id?: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewGetEvidenceFileUrlQuery = {
|
export type MesureViewGetEvidenceFileUrlQuery = {
|
||||||
response: MitigationViewGetEvidenceFileUrlQuery$data;
|
response: MesureViewGetEvidenceFileUrlQuery$data;
|
||||||
variables: MitigationViewGetEvidenceFileUrlQuery$variables;
|
variables: MesureViewGetEvidenceFileUrlQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -57,7 +57,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewGetEvidenceFileUrlQuery",
|
"name": "MesureViewGetEvidenceFileUrlQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -87,7 +87,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewGetEvidenceFileUrlQuery",
|
"name": "MesureViewGetEvidenceFileUrlQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -119,16 +119,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "1dc81a5d665b9141b5cd62ef893ff0e1",
|
"cacheID": "05edf89cc90a90e1a96bd02f8448b629",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewGetEvidenceFileUrlQuery",
|
"name": "MesureViewGetEvidenceFileUrlQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query MitigationViewGetEvidenceFileUrlQuery(\n $evidenceId: ID!\n) {\n node(id: $evidenceId) {\n __typename\n ... on Evidence {\n id\n fileUrl\n }\n id\n }\n}\n"
|
"text": "query MesureViewGetEvidenceFileUrlQuery(\n $evidenceId: ID!\n) {\n node(id: $evidenceId) {\n __typename\n ... on Evidence {\n id\n fileUrl\n }\n id\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "9d7bbfc81ce73246b671989102da3192";
|
(node as any).hash = "2bef4c934e725a40e5140a812bd31bc8";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<c9c1170d3b2dcef033fe6f69b6a9b11e>>
|
* @generated SignedSource<<7f9c4ed295020bbeadd37ac046817d51>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,11 +9,11 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationViewLinkedControlsQuery$variables = {
|
export type MesureViewLinkedControlsQuery$variables = {
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewLinkedControlsQuery$data = {
|
export type MesureViewLinkedControlsQuery$data = {
|
||||||
readonly mitigation: {
|
readonly mesure: {
|
||||||
readonly controls?: {
|
readonly controls?: {
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
@@ -27,9 +27,9 @@ export type MitigationViewLinkedControlsQuery$data = {
|
|||||||
readonly id: string;
|
readonly id: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewLinkedControlsQuery = {
|
export type MesureViewLinkedControlsQuery = {
|
||||||
response: MitigationViewLinkedControlsQuery$data;
|
response: MesureViewLinkedControlsQuery$data;
|
||||||
variables: MitigationViewLinkedControlsQuery$variables;
|
variables: MesureViewLinkedControlsQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -37,14 +37,14 @@ var v0 = [
|
|||||||
{
|
{
|
||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "mitigationId"
|
"name": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = [
|
v1 = [
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"variableName": "mitigationId"
|
"variableName": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v2 = {
|
v2 = {
|
||||||
@@ -152,10 +152,10 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewLinkedControlsQuery",
|
"name": "MesureViewLinkedControlsQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigation",
|
"alias": "mesure",
|
||||||
"args": (v1/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
@@ -171,13 +171,13 @@ return {
|
|||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "ControlConnection",
|
"concreteType": "ControlConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__Mitigation__controls_connection",
|
"name": "__MesureView_controls_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v4/*: any*/),
|
"selections": (v4/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -191,10 +191,10 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewLinkedControlsQuery",
|
"name": "MesureViewLinkedControlsQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigation",
|
"alias": "mesure",
|
||||||
"args": (v1/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
@@ -221,12 +221,12 @@ return {
|
|||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "Mitigation__controls",
|
"key": "MesureView_controls",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "controls"
|
"name": "controls"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -235,7 +235,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "7429166728b5a233e15cb0f4cb33d15c",
|
"cacheID": "84229c9d2f99008d1b85401ad2c0e185",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -244,19 +244,19 @@ return {
|
|||||||
"cursor": null,
|
"cursor": null,
|
||||||
"direction": "forward",
|
"direction": "forward",
|
||||||
"path": [
|
"path": [
|
||||||
"mitigation",
|
"mesure",
|
||||||
"controls"
|
"controls"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "MitigationViewLinkedControlsQuery",
|
"name": "MesureViewLinkedControlsQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query MitigationViewLinkedControlsQuery(\n $mitigationId: ID!\n) {\n mitigation: node(id: $mitigationId) {\n __typename\n id\n ... on Mitigation {\n controls(first: 100) {\n edges {\n node {\n id\n referenceId\n name\n description\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query MesureViewLinkedControlsQuery(\n $mesureId: ID!\n) {\n mesure: node(id: $mesureId) {\n __typename\n id\n ... on Mesure {\n controls(first: 100) {\n edges {\n node {\n id\n referenceId\n name\n description\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "0748d068025e5f577ab56a8014ee38cc";
|
(node as any).hash = "c9a7971b4e7f8e4a708d69211333bb8a";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<780c10208a633b2ce7cd34ccc580cf25>>
|
* @generated SignedSource<<c50d4f287a6322e4dada5685bc5d830f>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationViewOrganizationQuery$variables = {
|
export type MesureViewOrganizationQuery$variables = {
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewOrganizationQuery$data = {
|
export type MesureViewOrganizationQuery$data = {
|
||||||
readonly organization: {
|
readonly organization: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly peoples?: {
|
readonly peoples?: {
|
||||||
@@ -26,9 +26,9 @@ export type MitigationViewOrganizationQuery$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewOrganizationQuery = {
|
export type MesureViewOrganizationQuery = {
|
||||||
response: MitigationViewOrganizationQuery$data;
|
response: MesureViewOrganizationQuery$data;
|
||||||
variables: MitigationViewOrganizationQuery$variables;
|
variables: MesureViewOrganizationQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -153,7 +153,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewOrganizationQuery",
|
"name": "MesureViewOrganizationQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -174,10 +174,10 @@ return {
|
|||||||
],
|
],
|
||||||
"concreteType": "PeopleConnection",
|
"concreteType": "PeopleConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__MitigationView_peoples_connection",
|
"name": "__MesureView_peoples_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v5/*: any*/),
|
"selections": (v5/*: any*/),
|
||||||
"storageKey": "__MitigationView_peoples_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})"
|
"storageKey": "__MesureView_peoples_connection(orderBy:{\"direction\":\"ASC\",\"field\":\"FULL_NAME\"})"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Organization",
|
"type": "Organization",
|
||||||
@@ -194,7 +194,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewOrganizationQuery",
|
"name": "MesureViewOrganizationQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -226,7 +226,7 @@ return {
|
|||||||
"orderBy"
|
"orderBy"
|
||||||
],
|
],
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "MitigationView_peoples",
|
"key": "MesureView_peoples",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "peoples"
|
"name": "peoples"
|
||||||
}
|
}
|
||||||
@@ -240,7 +240,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "3d1fc2d02bc6eea68edcabc6fc6f0b56",
|
"cacheID": "cc07a873a9d2756876763a8491fd305a",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -255,13 +255,13 @@ return {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "MitigationViewOrganizationQuery",
|
"name": "MesureViewOrganizationQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query MitigationViewOrganizationQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n peoples(first: 100, orderBy: {direction: ASC, field: FULL_NAME}) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query MesureViewOrganizationQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n peoples(first: 100, orderBy: {direction: ASC, field: FULL_NAME}) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "73abf70f60b6f5a07b25f3c83676e02f";
|
(node as any).hash = "4d0f80a682d98e8b90102b47ec2a7cb3";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<8b25e364318ac90f1c1eaf313a6286cb>>
|
* @generated SignedSource<<911e86f76b51015804e409479ee4068c>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -11,20 +11,20 @@
|
|||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type EvidenceState = "FULFILLED" | "REQUESTED";
|
export type EvidenceState = "FULFILLED" | "REQUESTED";
|
||||||
export type EvidenceType = "FILE" | "LINK";
|
export type EvidenceType = "FILE" | "LINK";
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type TaskState = "DONE" | "TODO";
|
export type TaskState = "DONE" | "TODO";
|
||||||
export type MitigationViewQuery$variables = {
|
export type MesureViewQuery$variables = {
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewQuery$data = {
|
export type MesureViewQuery$data = {
|
||||||
readonly mitigation: {
|
readonly mesure: {
|
||||||
readonly category?: string;
|
readonly category?: string;
|
||||||
readonly description?: string;
|
readonly description?: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly importance?: MitigationImportance;
|
readonly importance?: MesureImportance;
|
||||||
readonly name?: string;
|
readonly name?: string;
|
||||||
readonly state?: MitigationState;
|
readonly state?: MesureState;
|
||||||
readonly tasks?: {
|
readonly tasks?: {
|
||||||
readonly __id: string;
|
readonly __id: string;
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
@@ -60,9 +60,9 @@ export type MitigationViewQuery$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewQuery = {
|
export type MesureViewQuery = {
|
||||||
response: MitigationViewQuery$data;
|
response: MesureViewQuery$data;
|
||||||
variables: MitigationViewQuery$variables;
|
variables: MesureViewQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -70,14 +70,14 @@ var v0 = [
|
|||||||
{
|
{
|
||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "mitigationId"
|
"name": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = [
|
v1 = [
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"variableName": "mitigationId"
|
"variableName": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v2 = {
|
v2 = {
|
||||||
@@ -298,10 +298,10 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewQuery",
|
"name": "MesureViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigation",
|
"alias": "mesure",
|
||||||
"args": (v1/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
@@ -322,7 +322,7 @@ return {
|
|||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "TaskConnection",
|
"concreteType": "TaskConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__MitigationView_tasks_connection",
|
"name": "__MesureView_tasks_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -352,7 +352,7 @@ return {
|
|||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "EvidenceConnection",
|
"concreteType": "EvidenceConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__MitigationView_evidences_connection",
|
"name": "__MesureView_evidences_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v14/*: any*/),
|
"selections": (v14/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -371,7 +371,7 @@ return {
|
|||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -385,10 +385,10 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewQuery",
|
"name": "MesureViewQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigation",
|
"alias": "mesure",
|
||||||
"args": (v1/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
@@ -450,7 +450,7 @@ return {
|
|||||||
"args": (v16/*: any*/),
|
"args": (v16/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "MitigationView_evidences",
|
"key": "MesureView_evidences",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "evidences"
|
"name": "evidences"
|
||||||
},
|
},
|
||||||
@@ -472,12 +472,12 @@ return {
|
|||||||
"args": (v15/*: any*/),
|
"args": (v15/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "MitigationView_tasks",
|
"key": "MesureView_tasks",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "tasks"
|
"name": "tasks"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -486,7 +486,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "711b5dac4db6ca883144ece5d4bc48c3",
|
"cacheID": "e4c3abf8e8559e732088a9123863a375",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -501,19 +501,19 @@ return {
|
|||||||
"cursor": null,
|
"cursor": null,
|
||||||
"direction": "forward",
|
"direction": "forward",
|
||||||
"path": [
|
"path": [
|
||||||
"mitigation",
|
"mesure",
|
||||||
"tasks"
|
"tasks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "MitigationViewQuery",
|
"name": "MesureViewQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query MitigationViewQuery(\n $mitigationId: ID!\n) {\n mitigation: node(id: $mitigationId) {\n __typename\n id\n ... on Mitigation {\n name\n description\n state\n importance\n category\n tasks(first: 100) {\n edges {\n node {\n id\n name\n description\n state\n timeEstimate\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n evidences(first: 50) {\n edges {\n node {\n id\n mimeType\n filename\n size\n state\n type\n url\n createdAt\n description\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query MesureViewQuery(\n $mesureId: ID!\n) {\n mesure: node(id: $mesureId) {\n __typename\n id\n ... on Mesure {\n name\n description\n state\n importance\n category\n tasks(first: 100) {\n edges {\n node {\n id\n name\n description\n state\n timeEstimate\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n evidences(first: 50) {\n edges {\n node {\n id\n mimeType\n filename\n size\n state\n type\n url\n createdAt\n description\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "cb5d73e09aa6168901bf5db0f931e24c";
|
(node as any).hash = "38c0abd51a589411fc60391269af0227";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<b7154e691d26fef3b8f64ec3a39304fd>>
|
* @generated SignedSource<<a6bd25e3b378dcc7ac26ba611a054fbe>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,11 +9,11 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationViewRisksQuery$variables = {
|
export type MesureViewRisksQuery$variables = {
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewRisksQuery$data = {
|
export type MesureViewRisksQuery$data = {
|
||||||
readonly mitigation: {
|
readonly mesure: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly risks?: {
|
readonly risks?: {
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
@@ -30,9 +30,9 @@ export type MitigationViewRisksQuery$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewRisksQuery = {
|
export type MesureViewRisksQuery = {
|
||||||
response: MitigationViewRisksQuery$data;
|
response: MesureViewRisksQuery$data;
|
||||||
variables: MitigationViewRisksQuery$variables;
|
variables: MesureViewRisksQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -40,14 +40,14 @@ var v0 = [
|
|||||||
{
|
{
|
||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "mitigationId"
|
"name": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = [
|
v1 = [
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"variableName": "mitigationId"
|
"variableName": "mesureId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v2 = {
|
v2 = {
|
||||||
@@ -176,10 +176,10 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewRisksQuery",
|
"name": "MesureViewRisksQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigation",
|
"alias": "mesure",
|
||||||
"args": (v1/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
@@ -195,13 +195,13 @@ return {
|
|||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "RiskConnection",
|
"concreteType": "RiskConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__MitigationView_risks_connection",
|
"name": "__MesureView_risks_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v4/*: any*/),
|
"selections": (v4/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -215,10 +215,10 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewRisksQuery",
|
"name": "MesureViewRisksQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigation",
|
"alias": "mesure",
|
||||||
"args": (v1/*: any*/),
|
"args": (v1/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
@@ -245,12 +245,12 @@ return {
|
|||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "MitigationView_risks",
|
"key": "MesureView_risks",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "risks"
|
"name": "risks"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Mitigation",
|
"type": "Mesure",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -259,7 +259,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "6e8982bef70e90ee745d6985c82c597e",
|
"cacheID": "b8095743d31791d2084177fde0203ed4",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -268,19 +268,19 @@ return {
|
|||||||
"cursor": null,
|
"cursor": null,
|
||||||
"direction": "forward",
|
"direction": "forward",
|
||||||
"path": [
|
"path": [
|
||||||
"mitigation",
|
"mesure",
|
||||||
"risks"
|
"risks"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "MitigationViewRisksQuery",
|
"name": "MesureViewRisksQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query MitigationViewRisksQuery(\n $mitigationId: ID!\n) {\n mitigation: node(id: $mitigationId) {\n __typename\n id\n ... on Mitigation {\n risks(first: 100) {\n edges {\n node {\n id\n name\n description\n inherentLikelihood\n inherentImpact\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query MesureViewRisksQuery(\n $mesureId: ID!\n) {\n mesure: node(id: $mesureId) {\n __typename\n id\n ... on Mesure {\n risks(first: 100) {\n edges {\n node {\n id\n name\n description\n inherentLikelihood\n inherentImpact\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "0fe825c558627da60c1025efa825f91e";
|
(node as any).hash = "0609b3e58837ae65fb4df484b967060a";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<a0f8386de345c2c768657efd4358518c>>
|
* @generated SignedSource<<1a725a74db916d1672685d90c48def81>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -12,10 +12,10 @@ import { ConcreteRequest } from 'relay-runtime';
|
|||||||
export type UnassignTaskInput = {
|
export type UnassignTaskInput = {
|
||||||
taskId: string;
|
taskId: string;
|
||||||
};
|
};
|
||||||
export type MitigationViewUnassignTaskMutation$variables = {
|
export type MesureViewUnassignTaskMutation$variables = {
|
||||||
input: UnassignTaskInput;
|
input: UnassignTaskInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewUnassignTaskMutation$data = {
|
export type MesureViewUnassignTaskMutation$data = {
|
||||||
readonly unassignTask: {
|
readonly unassignTask: {
|
||||||
readonly task: {
|
readonly task: {
|
||||||
readonly assignedTo: {
|
readonly assignedTo: {
|
||||||
@@ -27,9 +27,9 @@ export type MitigationViewUnassignTaskMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewUnassignTaskMutation = {
|
export type MesureViewUnassignTaskMutation = {
|
||||||
response: MitigationViewUnassignTaskMutation$data;
|
response: MesureViewUnassignTaskMutation$data;
|
||||||
variables: MitigationViewUnassignTaskMutation$variables;
|
variables: MesureViewUnassignTaskMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -109,7 +109,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewUnassignTaskMutation",
|
"name": "MesureViewUnassignTaskMutation",
|
||||||
"selections": (v2/*: any*/),
|
"selections": (v2/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -118,20 +118,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewUnassignTaskMutation",
|
"name": "MesureViewUnassignTaskMutation",
|
||||||
"selections": (v2/*: any*/)
|
"selections": (v2/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "6cf554a835936763f3b4f55f04c9771f",
|
"cacheID": "3f91f027e7a8a935f306386469bbac21",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewUnassignTaskMutation",
|
"name": "MesureViewUnassignTaskMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewUnassignTaskMutation(\n $input: UnassignTaskInput!\n) {\n unassignTask(input: $input) {\n task {\n id\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n"
|
"text": "mutation MesureViewUnassignTaskMutation(\n $input: UnassignTaskInput!\n) {\n unassignTask(input: $input) {\n task {\n id\n assignedTo {\n id\n fullName\n primaryEmailAddress\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "07d79596fef3416fdc001077d2d51c75";
|
(node as any).hash = "c5c62c4c4d16dfd6147a1d44aa35b8fe";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<1d924bb487fd93636fa7207c5aa08cdc>>
|
* @generated SignedSource<<9dac57f235ab6d16f6b3f78002c83dcc>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,30 +9,30 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type UpdateMitigationInput = {
|
export type UpdateMesureInput = {
|
||||||
category?: string | null | undefined;
|
category?: string | null | undefined;
|
||||||
description?: string | null | undefined;
|
description?: string | null | undefined;
|
||||||
id: string;
|
id: string;
|
||||||
importance?: MitigationImportance | null | undefined;
|
importance?: MesureImportance | null | undefined;
|
||||||
name?: string | null | undefined;
|
name?: string | null | undefined;
|
||||||
state?: MitigationState | null | undefined;
|
state?: MesureState | null | undefined;
|
||||||
};
|
};
|
||||||
export type MitigationViewUpdateMitigationStateMutation$variables = {
|
export type MesureViewUpdateMesureStateMutation$variables = {
|
||||||
input: UpdateMitigationInput;
|
input: UpdateMesureInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewUpdateMitigationStateMutation$data = {
|
export type MesureViewUpdateMesureStateMutation$data = {
|
||||||
readonly updateMitigation: {
|
readonly updateMesure: {
|
||||||
readonly mitigation: {
|
readonly mesure: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly state: MitigationState;
|
readonly state: MesureState;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewUpdateMitigationStateMutation = {
|
export type MesureViewUpdateMesureStateMutation = {
|
||||||
response: MitigationViewUpdateMitigationStateMutation$data;
|
response: MesureViewUpdateMesureStateMutation$data;
|
||||||
variables: MitigationViewUpdateMitigationStateMutation$variables;
|
variables: MesureViewUpdateMesureStateMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -53,17 +53,17 @@ v1 = [
|
|||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "UpdateMitigationPayload",
|
"concreteType": "UpdateMesurePayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "updateMitigation",
|
"name": "updateMesure",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigation",
|
"name": "mesure",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewUpdateMitigationStateMutation",
|
"name": "MesureViewUpdateMesureStateMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -101,20 +101,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewUpdateMitigationStateMutation",
|
"name": "MesureViewUpdateMesureStateMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "7e4a92a089fa5927b0239004c3fb5f47",
|
"cacheID": "59db8143f555230677a401f5bed6a6c3",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewUpdateMitigationStateMutation",
|
"name": "MesureViewUpdateMesureStateMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewUpdateMitigationStateMutation(\n $input: UpdateMitigationInput!\n) {\n updateMitigation(input: $input) {\n mitigation {\n id\n state\n }\n }\n}\n"
|
"text": "mutation MesureViewUpdateMesureStateMutation(\n $input: UpdateMesureInput!\n) {\n updateMesure(input: $input) {\n mesure {\n id\n state\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "e985902d55a537a08b8a2d4482abe0b3";
|
(node as any).hash = "ae0f63f654568f052621f28e73382172";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<a68054962a4ec7ae205dc2976fe8d2bf>>
|
* @generated SignedSource<<efb9132cf25dca5dff1df4fa6f139cd1>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -17,10 +17,10 @@ export type UpdateTaskInput = {
|
|||||||
taskId: string;
|
taskId: string;
|
||||||
timeEstimate?: any | null | undefined;
|
timeEstimate?: any | null | undefined;
|
||||||
};
|
};
|
||||||
export type MitigationViewUpdateTaskStateMutation$variables = {
|
export type MesureViewUpdateTaskStateMutation$variables = {
|
||||||
input: UpdateTaskInput;
|
input: UpdateTaskInput;
|
||||||
};
|
};
|
||||||
export type MitigationViewUpdateTaskStateMutation$data = {
|
export type MesureViewUpdateTaskStateMutation$data = {
|
||||||
readonly updateTask: {
|
readonly updateTask: {
|
||||||
readonly task: {
|
readonly task: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -29,9 +29,9 @@ export type MitigationViewUpdateTaskStateMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type MitigationViewUpdateTaskStateMutation = {
|
export type MesureViewUpdateTaskStateMutation = {
|
||||||
response: MitigationViewUpdateTaskStateMutation$data;
|
response: MesureViewUpdateTaskStateMutation$data;
|
||||||
variables: MitigationViewUpdateTaskStateMutation$variables;
|
variables: MesureViewUpdateTaskStateMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -98,7 +98,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "MitigationViewUpdateTaskStateMutation",
|
"name": "MesureViewUpdateTaskStateMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -107,20 +107,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "MitigationViewUpdateTaskStateMutation",
|
"name": "MesureViewUpdateTaskStateMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "f8d2ca86f8e7856b3d24bcd810490a6a",
|
"cacheID": "3af3e26a5c5be4c129b6d1706d3d1b59",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "MitigationViewUpdateTaskStateMutation",
|
"name": "MesureViewUpdateTaskStateMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation MitigationViewUpdateTaskStateMutation(\n $input: UpdateTaskInput!\n) {\n updateTask(input: $input) {\n task {\n id\n state\n timeEstimate\n }\n }\n}\n"
|
"text": "mutation MesureViewUpdateTaskStateMutation(\n $input: UpdateTaskInput!\n) {\n updateTask(input: $input) {\n task {\n id\n state\n timeEstimate\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "7ab07c94be8f56a93d39178828d85823";
|
(node as any).hash = "fd909d70346802420c83942efa30ef20";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
/**
|
||||||
|
* @generated SignedSource<<6e5efc598a8e6657fd0a1375e6104ff6>>
|
||||||
|
* @lightSyntaxTransform
|
||||||
|
* @nogrep
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
|
import { ConcreteRequest } from "relay-runtime";
|
||||||
|
export type EvidenceState = "FULLFILLED" | "REQUESTED";
|
||||||
|
export type EvidenceType = "FILE" | "LINK";
|
||||||
|
export type UploadEvidenceInput = {
|
||||||
|
description: string;
|
||||||
|
file?: any | null | undefined;
|
||||||
|
name: string;
|
||||||
|
taskId: string;
|
||||||
|
type: EvidenceType;
|
||||||
|
url?: string | null | undefined;
|
||||||
|
};
|
||||||
|
export type MesureViewUploadEvidenceMutation$variables = {
|
||||||
|
connections: ReadonlyArray<string>;
|
||||||
|
input: UploadEvidenceInput;
|
||||||
|
};
|
||||||
|
export type MesureViewUploadEvidenceMutation$data = {
|
||||||
|
readonly uploadEvidence: {
|
||||||
|
readonly evidenceEdge: {
|
||||||
|
readonly node: {
|
||||||
|
readonly createdAt: string;
|
||||||
|
readonly fileUrl: string | null | undefined;
|
||||||
|
readonly filename: string;
|
||||||
|
readonly id: string;
|
||||||
|
readonly mimeType: string;
|
||||||
|
readonly size: number;
|
||||||
|
readonly state: EvidenceState;
|
||||||
|
readonly type: EvidenceType;
|
||||||
|
readonly url: string | null | undefined;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export type MesureViewUploadEvidenceMutation = {
|
||||||
|
response: MesureViewUploadEvidenceMutation$data;
|
||||||
|
variables: MesureViewUploadEvidenceMutation$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: "EvidenceEdge",
|
||||||
|
kind: "LinkedField",
|
||||||
|
name: "evidenceEdge",
|
||||||
|
plural: false,
|
||||||
|
selections: [
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
concreteType: "Evidence",
|
||||||
|
kind: "LinkedField",
|
||||||
|
name: "node",
|
||||||
|
plural: false,
|
||||||
|
selections: [
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "id",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "filename",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "fileUrl",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "mimeType",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "type",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "url",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "size",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "state",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
kind: "ScalarField",
|
||||||
|
name: "createdAt",
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
storageKey: null,
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
fragment: {
|
||||||
|
argumentDefinitions: [v0 /*: any*/, v1 /*: any*/],
|
||||||
|
kind: "Fragment",
|
||||||
|
metadata: null,
|
||||||
|
name: "MesureViewUploadEvidenceMutation",
|
||||||
|
selections: [
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: v2 /*: any*/,
|
||||||
|
concreteType: "UploadEvidencePayload",
|
||||||
|
kind: "LinkedField",
|
||||||
|
name: "uploadEvidence",
|
||||||
|
plural: false,
|
||||||
|
selections: [v3 /*: any*/],
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
type: "Mutation",
|
||||||
|
abstractKey: null,
|
||||||
|
},
|
||||||
|
kind: "Request",
|
||||||
|
operation: {
|
||||||
|
argumentDefinitions: [v1 /*: any*/, v0 /*: any*/],
|
||||||
|
kind: "Operation",
|
||||||
|
name: "MesureViewUploadEvidenceMutation",
|
||||||
|
selections: [
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: v2 /*: any*/,
|
||||||
|
concreteType: "UploadEvidencePayload",
|
||||||
|
kind: "LinkedField",
|
||||||
|
name: "uploadEvidence",
|
||||||
|
plural: false,
|
||||||
|
selections: [
|
||||||
|
v3 /*: any*/,
|
||||||
|
{
|
||||||
|
alias: null,
|
||||||
|
args: null,
|
||||||
|
filters: null,
|
||||||
|
handle: "appendEdge",
|
||||||
|
key: "",
|
||||||
|
kind: "LinkedHandle",
|
||||||
|
name: "evidenceEdge",
|
||||||
|
handleArgs: [
|
||||||
|
{
|
||||||
|
kind: "Variable",
|
||||||
|
name: "connections",
|
||||||
|
variableName: "connections",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
storageKey: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
cacheID: "30a6915055d3f6b63d96836b26f05a45",
|
||||||
|
id: null,
|
||||||
|
metadata: {},
|
||||||
|
name: "MesureViewUploadEvidenceMutation",
|
||||||
|
operationKind: "mutation",
|
||||||
|
text: "mutation MesureViewUploadEvidenceMutation(\n $input: UploadEvidenceInput!\n) {\n uploadEvidence(input: $input) {\n evidenceEdge {\n node {\n id\n filename\n fileUrl\n mimeType\n type\n url\n size\n state\n createdAt\n }\n }\n }\n}\n",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
(node as any).hash = "4cf5430a0971ba1ddf476765df614e30";
|
||||||
|
|
||||||
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<50b15dea665515ca83a54c39e03453c2>>
|
* @generated SignedSource<<3b585f9a06a084982155a0f356838402>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,21 +9,21 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
export type MesureImportance = "ADVANCED" | "MANDATORY" | "PREFERRED";
|
||||||
export type CreateMitigationInput = {
|
export type CreateMesureInput = {
|
||||||
category: string;
|
category: string;
|
||||||
description: string;
|
description: string;
|
||||||
importance: MitigationImportance;
|
importance: MesureImportance;
|
||||||
name: string;
|
name: string;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
};
|
};
|
||||||
export type NewMitigationViewCreateMitigationMutation$variables = {
|
export type NewMesureViewCreateMesureMutation$variables = {
|
||||||
connections: ReadonlyArray<string>;
|
connections: ReadonlyArray<string>;
|
||||||
input: CreateMitigationInput;
|
input: CreateMesureInput;
|
||||||
};
|
};
|
||||||
export type NewMitigationViewCreateMitigationMutation$data = {
|
export type NewMesureViewCreateMesureMutation$data = {
|
||||||
readonly createMitigation: {
|
readonly createMesure: {
|
||||||
readonly mitigationEdge: {
|
readonly mesureEdge: {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -32,9 +32,9 @@ export type NewMitigationViewCreateMitigationMutation$data = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type NewMitigationViewCreateMitigationMutation = {
|
export type NewMesureViewCreateMesureMutation = {
|
||||||
response: NewMitigationViewCreateMitigationMutation$data;
|
response: NewMesureViewCreateMesureMutation$data;
|
||||||
variables: NewMitigationViewCreateMitigationMutation$variables;
|
variables: NewMesureViewCreateMesureMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -58,15 +58,15 @@ v2 = [
|
|||||||
v3 = {
|
v3 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationEdge",
|
"concreteType": "MesureEdge",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigationEdge",
|
"name": "mesureEdge",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
@@ -106,14 +106,14 @@ return {
|
|||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "NewMitigationViewCreateMitigationMutation",
|
"name": "NewMesureViewCreateMesureMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v2/*: any*/),
|
"args": (v2/*: any*/),
|
||||||
"concreteType": "CreateMitigationPayload",
|
"concreteType": "CreateMesurePayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "createMitigation",
|
"name": "createMesure",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/)
|
(v3/*: any*/)
|
||||||
@@ -131,14 +131,14 @@ return {
|
|||||||
(v0/*: any*/)
|
(v0/*: any*/)
|
||||||
],
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "NewMitigationViewCreateMitigationMutation",
|
"name": "NewMesureViewCreateMesureMutation",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v2/*: any*/),
|
"args": (v2/*: any*/),
|
||||||
"concreteType": "CreateMitigationPayload",
|
"concreteType": "CreateMesurePayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "createMitigation",
|
"name": "createMesure",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
@@ -149,7 +149,7 @@ return {
|
|||||||
"handle": "prependEdge",
|
"handle": "prependEdge",
|
||||||
"key": "",
|
"key": "",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "mitigationEdge",
|
"name": "mesureEdge",
|
||||||
"handleArgs": [
|
"handleArgs": [
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
@@ -164,16 +164,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "9615313ab1f2555f58a79b85741684f4",
|
"cacheID": "de8b930c9628c62ae4272bd427076ebd",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "NewMitigationViewCreateMitigationMutation",
|
"name": "NewMesureViewCreateMesureMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation NewMitigationViewCreateMitigationMutation(\n $input: CreateMitigationInput!\n) {\n createMitigation(input: $input) {\n mitigationEdge {\n node {\n id\n name\n description\n }\n }\n }\n}\n"
|
"text": "mutation NewMesureViewCreateMesureMutation(\n $input: CreateMesureInput!\n) {\n createMesure(input: $input) {\n mesureEdge {\n node {\n id\n name\n description\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "6b6ead3a24d113ec969c98680956ebb9";
|
(node as any).hash = "94532353875a658b6e0b87a8181eab5e";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,229 +0,0 @@
|
|||||||
/**
|
|
||||||
* @generated SignedSource<<6e5efc598a8e6657fd0a1375e6104ff6>>
|
|
||||||
* @lightSyntaxTransform
|
|
||||||
* @nogrep
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @ts-nocheck
|
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
|
||||||
export type EvidenceState = "FULLFILLED" | "REQUESTED";
|
|
||||||
export type EvidenceType = "FILE" | "LINK";
|
|
||||||
export type UploadEvidenceInput = {
|
|
||||||
description: string;
|
|
||||||
file?: any | null | undefined;
|
|
||||||
name: string;
|
|
||||||
taskId: string;
|
|
||||||
type: EvidenceType;
|
|
||||||
url?: string | null | undefined;
|
|
||||||
};
|
|
||||||
export type MitigationViewUploadEvidenceMutation$variables = {
|
|
||||||
connections: ReadonlyArray<string>;
|
|
||||||
input: UploadEvidenceInput;
|
|
||||||
};
|
|
||||||
export type MitigationViewUploadEvidenceMutation$data = {
|
|
||||||
readonly uploadEvidence: {
|
|
||||||
readonly evidenceEdge: {
|
|
||||||
readonly node: {
|
|
||||||
readonly createdAt: string;
|
|
||||||
readonly fileUrl: string | null | undefined;
|
|
||||||
readonly filename: string;
|
|
||||||
readonly id: string;
|
|
||||||
readonly mimeType: string;
|
|
||||||
readonly size: number;
|
|
||||||
readonly state: EvidenceState;
|
|
||||||
readonly type: EvidenceType;
|
|
||||||
readonly url: string | null | undefined;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export type MitigationViewUploadEvidenceMutation = {
|
|
||||||
response: MitigationViewUploadEvidenceMutation$data;
|
|
||||||
variables: MitigationViewUploadEvidenceMutation$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": "EvidenceEdge",
|
|
||||||
"kind": "LinkedField",
|
|
||||||
"name": "evidenceEdge",
|
|
||||||
"plural": false,
|
|
||||||
"selections": [
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"concreteType": "Evidence",
|
|
||||||
"kind": "LinkedField",
|
|
||||||
"name": "node",
|
|
||||||
"plural": false,
|
|
||||||
"selections": [
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "id",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "filename",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "fileUrl",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "mimeType",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "type",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "url",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "size",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "state",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "createdAt",
|
|
||||||
"storageKey": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
};
|
|
||||||
return {
|
|
||||||
"fragment": {
|
|
||||||
"argumentDefinitions": [
|
|
||||||
(v0/*: any*/),
|
|
||||||
(v1/*: any*/)
|
|
||||||
],
|
|
||||||
"kind": "Fragment",
|
|
||||||
"metadata": null,
|
|
||||||
"name": "MitigationViewUploadEvidenceMutation",
|
|
||||||
"selections": [
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": (v2/*: any*/),
|
|
||||||
"concreteType": "UploadEvidencePayload",
|
|
||||||
"kind": "LinkedField",
|
|
||||||
"name": "uploadEvidence",
|
|
||||||
"plural": false,
|
|
||||||
"selections": [
|
|
||||||
(v3/*: any*/)
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "Mutation",
|
|
||||||
"abstractKey": null
|
|
||||||
},
|
|
||||||
"kind": "Request",
|
|
||||||
"operation": {
|
|
||||||
"argumentDefinitions": [
|
|
||||||
(v1/*: any*/),
|
|
||||||
(v0/*: any*/)
|
|
||||||
],
|
|
||||||
"kind": "Operation",
|
|
||||||
"name": "MitigationViewUploadEvidenceMutation",
|
|
||||||
"selections": [
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": (v2/*: any*/),
|
|
||||||
"concreteType": "UploadEvidencePayload",
|
|
||||||
"kind": "LinkedField",
|
|
||||||
"name": "uploadEvidence",
|
|
||||||
"plural": false,
|
|
||||||
"selections": [
|
|
||||||
(v3/*: any*/),
|
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"filters": null,
|
|
||||||
"handle": "appendEdge",
|
|
||||||
"key": "",
|
|
||||||
"kind": "LinkedHandle",
|
|
||||||
"name": "evidenceEdge",
|
|
||||||
"handleArgs": [
|
|
||||||
{
|
|
||||||
"kind": "Variable",
|
|
||||||
"name": "connections",
|
|
||||||
"variableName": "connections"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"storageKey": null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"params": {
|
|
||||||
"cacheID": "30a6915055d3f6b63d96836b26f05a45",
|
|
||||||
"id": null,
|
|
||||||
"metadata": {},
|
|
||||||
"name": "MitigationViewUploadEvidenceMutation",
|
|
||||||
"operationKind": "mutation",
|
|
||||||
"text": "mutation MitigationViewUploadEvidenceMutation(\n $input: UploadEvidenceInput!\n) {\n uploadEvidence(input: $input) {\n evidenceEdge {\n node {\n id\n filename\n fileUrl\n mimeType\n type\n url\n size\n state\n createdAt\n }\n }\n }\n}\n"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
|
|
||||||
(node as any).hash = "4cf5430a0971ba1ddf476765df614e30";
|
|
||||||
|
|
||||||
export default node;
|
|
||||||
@@ -16,7 +16,7 @@ export function PolicyListViewSkeleton() {
|
|||||||
<div className="bg-subtle-bg animate-pulse h-9 w-1/6 rounded-lg" />
|
<div className="bg-subtle-bg animate-pulse h-9 w-1/6 rounded-lg" />
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* Search and filter mitigations skeleton */}
|
{/* Search and filter mesures skeleton */}
|
||||||
<div className="flex flex-col md:flex-row gap-4 mb-6">
|
<div className="flex flex-col md:flex-row gap-4 mb-6">
|
||||||
<div className="flex-1 h-10 bg-subtle-bg animate-pulse rounded" />
|
<div className="flex-1 h-10 bg-subtle-bg animate-pulse rounded" />
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ function PolicyListViewContent({
|
|||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* Search and filter mitigations */}
|
{/* Search and filter mesures */}
|
||||||
<div className="flex flex-col md:flex-row gap-4 mb-6">
|
<div className="flex flex-col md:flex-row gap-4 mb-6">
|
||||||
<div className="relative flex-1">
|
<div className="relative flex-1">
|
||||||
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-tertiary" />
|
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-tertiary" />
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ import {
|
|||||||
TableRow,
|
TableRow,
|
||||||
} from "@/components/ui/table";
|
} from "@/components/ui/table";
|
||||||
import {
|
import {
|
||||||
ShowRiskViewOrganizationMitigationsQuery,
|
ShowRiskViewOrganizationMesuresQuery,
|
||||||
ShowRiskViewOrganizationMitigationsQuery$data,
|
ShowRiskViewOrganizationMesuresQuery$data,
|
||||||
} from "./__generated__/ShowRiskViewOrganizationMitigationsQuery.graphql";
|
} from "./__generated__/ShowRiskViewOrganizationMesuresQuery.graphql";
|
||||||
import { ShowRiskViewCreateRiskMitigationMappingMutation } from "./__generated__/ShowRiskViewCreateRiskMitigationMappingMutation.graphql";
|
import { ShowRiskViewCreateRiskMesureMappingMutation } from "./__generated__/ShowRiskViewCreateRiskMesureMappingMutation.graphql";
|
||||||
import { ShowRiskViewDeleteRiskMitigationMappingMutation } from "./__generated__/ShowRiskViewDeleteRiskMitigationMappingMutation.graphql";
|
import { ShowRiskViewDeleteRiskMesureMappingMutation } from "./__generated__/ShowRiskViewDeleteRiskMesureMappingMutation.graphql";
|
||||||
import {
|
import {
|
||||||
ShowRiskViewOrganizationPoliciesQuery,
|
ShowRiskViewOrganizationPoliciesQuery,
|
||||||
ShowRiskViewOrganizationPoliciesQuery$data,
|
ShowRiskViewOrganizationPoliciesQuery$data,
|
||||||
@@ -84,7 +84,7 @@ const showRiskViewQuery = graphql`
|
|||||||
residualImpact
|
residualImpact
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
mitigations(first: 100) @connection(key: "Risk__mitigations") {
|
mesures(first: 100) @connection(key: "Risk__mesures") {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -122,13 +122,13 @@ const showRiskViewQuery = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Add query to fetch all mitigations for the organization
|
// Add query to fetch all mesures for the organization
|
||||||
const organizationMitigationsQuery = graphql`
|
const organizationMesuresQuery = graphql`
|
||||||
query ShowRiskViewOrganizationMitigationsQuery($organizationId: ID!) {
|
query ShowRiskViewOrganizationMesuresQuery($organizationId: ID!) {
|
||||||
organization: node(id: $organizationId) {
|
organization: node(id: $organizationId) {
|
||||||
id
|
id
|
||||||
... on Organization {
|
... on Organization {
|
||||||
mitigations(first: 100) @connection(key: "Organization__mitigations") {
|
mesures(first: 100) @connection(key: "Organization__mesures") {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
@@ -164,23 +164,23 @@ const organizationPoliciesQuery = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Add mutation to create risk-mitigation mapping
|
// Add mutation to create risk-mesure mapping
|
||||||
const createRiskMitigationMappingMutation = graphql`
|
const createRiskMesureMappingMutation = graphql`
|
||||||
mutation ShowRiskViewCreateRiskMitigationMappingMutation(
|
mutation ShowRiskViewCreateRiskMesureMappingMutation(
|
||||||
$input: CreateRiskMitigationMappingInput!
|
$input: CreateRiskMesureMappingInput!
|
||||||
) {
|
) {
|
||||||
createRiskMitigationMapping(input: $input) {
|
createRiskMesureMapping(input: $input) {
|
||||||
success
|
success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Add mutation to delete risk-mitigation mapping
|
// Add mutation to delete risk-mesure mapping
|
||||||
const deleteRiskMitigationMappingMutation = graphql`
|
const deleteRiskMesureMappingMutation = graphql`
|
||||||
mutation ShowRiskViewDeleteRiskMitigationMappingMutation(
|
mutation ShowRiskViewDeleteRiskMesureMappingMutation(
|
||||||
$input: DeleteRiskMitigationMappingInput!
|
$input: DeleteRiskMesureMappingInput!
|
||||||
) {
|
) {
|
||||||
deleteRiskMitigationMapping(input: $input) {
|
deleteRiskMesureMapping(input: $input) {
|
||||||
success
|
success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -238,8 +238,8 @@ function ShowRiskViewContent({
|
|||||||
risk.inherentImpact!
|
risk.inherentImpact!
|
||||||
);
|
);
|
||||||
|
|
||||||
// Fix typing for mitigations
|
// Fix typing for mesures
|
||||||
const mitigations = risk.mitigations?.edges?.map((edge) => edge.node) || [];
|
const mesures = risk.mesures?.edges?.map((edge) => edge.node) || [];
|
||||||
const residualSeverity = getRiskSeverity(
|
const residualSeverity = getRiskSeverity(
|
||||||
risk.residualLikelihood!,
|
risk.residualLikelihood!,
|
||||||
risk.residualImpact!
|
risk.residualImpact!
|
||||||
@@ -251,17 +251,17 @@ function ShowRiskViewContent({
|
|||||||
// Fix typing for controls
|
// Fix typing for controls
|
||||||
const controls = risk.controls?.edges?.map((edge) => edge.node) || [];
|
const controls = risk.controls?.edges?.map((edge) => edge.node) || [];
|
||||||
|
|
||||||
// Add state for mitigation mapping dialog
|
// Add state for mesure mapping dialog
|
||||||
const [isMitigationDialogOpen, setIsMitigationDialogOpen] = useState(false);
|
const [isMesureDialogOpen, setIsMesureDialogOpen] = useState(false);
|
||||||
const [organizationMitigationsData, setOrganizationMitigationsData] =
|
const [organizationMesuresData, setOrganizationMesuresData] =
|
||||||
useState<ShowRiskViewOrganizationMitigationsQuery$data | null>(null);
|
useState<ShowRiskViewOrganizationMesuresQuery$data | null>(null);
|
||||||
const [mitigationSearchQuery, setMitigationSearchQuery] = useState("");
|
const [mesureSearchQuery, setMesureSearchQuery] = useState("");
|
||||||
const [categoryFilter, setCategoryFilter] = useState<string | null>(null);
|
const [categoryFilter, setCategoryFilter] = useState<string | null>(null);
|
||||||
const [isLoadingMitigations, setIsLoadingMitigations] = useState(false);
|
const [isLoadingMesures, setIsLoadingMesures] = useState(false);
|
||||||
const [linkingMitigations, setLinkingMitigations] = useState<
|
const [linkingMesures, setLinkingMesures] = useState<Record<string, boolean>>(
|
||||||
Record<string, boolean>
|
{}
|
||||||
>({});
|
);
|
||||||
const [unlinkingMitigations, setUnlinkingMitigations] = useState<
|
const [unlinkingMesures, setUnlinkingMesures] = useState<
|
||||||
Record<string, boolean>
|
Record<string, boolean>
|
||||||
>({});
|
>({});
|
||||||
|
|
||||||
@@ -279,13 +279,13 @@ function ShowRiskViewContent({
|
|||||||
>({});
|
>({});
|
||||||
|
|
||||||
// Setup mutation hooks
|
// Setup mutation hooks
|
||||||
const [createRiskMitigationMapping] =
|
const [createRiskMesureMapping] =
|
||||||
useMutation<ShowRiskViewCreateRiskMitigationMappingMutation>(
|
useMutation<ShowRiskViewCreateRiskMesureMappingMutation>(
|
||||||
createRiskMitigationMappingMutation
|
createRiskMesureMappingMutation
|
||||||
);
|
);
|
||||||
const [deleteRiskMitigationMapping] =
|
const [deleteRiskMesureMapping] =
|
||||||
useMutation<ShowRiskViewDeleteRiskMitigationMappingMutation>(
|
useMutation<ShowRiskViewDeleteRiskMesureMappingMutation>(
|
||||||
deleteRiskMitigationMappingMutation
|
deleteRiskMesureMappingMutation
|
||||||
);
|
);
|
||||||
|
|
||||||
// Setup policy mutation hooks
|
// Setup policy mutation hooks
|
||||||
@@ -300,13 +300,13 @@ function ShowRiskViewContent({
|
|||||||
|
|
||||||
// Clear filters when dialog closes
|
// Clear filters when dialog closes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isMitigationDialogOpen) {
|
if (!isMesureDialogOpen) {
|
||||||
setMitigationSearchQuery("");
|
setMesureSearchQuery("");
|
||||||
setCategoryFilter(null);
|
setCategoryFilter(null);
|
||||||
setLinkingMitigations({});
|
setLinkingMesures({});
|
||||||
setUnlinkingMitigations({});
|
setUnlinkingMesures({});
|
||||||
}
|
}
|
||||||
}, [isMitigationDialogOpen]);
|
}, [isMesureDialogOpen]);
|
||||||
|
|
||||||
// Clear filters when policy dialog closes
|
// Clear filters when policy dialog closes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -317,30 +317,30 @@ function ShowRiskViewContent({
|
|||||||
}
|
}
|
||||||
}, [isPolicyDialogOpen]);
|
}, [isPolicyDialogOpen]);
|
||||||
|
|
||||||
// Load mitigations data when needed
|
// Load mesures data when needed
|
||||||
const loadMitigationsData = useCallback(() => {
|
const loadMesuresData = useCallback(() => {
|
||||||
if (!organizationId || !risk.id) return;
|
if (!organizationId || !risk.id) return;
|
||||||
|
|
||||||
setIsLoadingMitigations(true);
|
setIsLoadingMesures(true);
|
||||||
|
|
||||||
// Fetch all mitigations for the organization
|
// Fetch all mesures for the organization
|
||||||
fetchQuery<ShowRiskViewOrganizationMitigationsQuery>(
|
fetchQuery<ShowRiskViewOrganizationMesuresQuery>(
|
||||||
environment,
|
environment,
|
||||||
organizationMitigationsQuery,
|
organizationMesuresQuery,
|
||||||
{
|
{
|
||||||
organizationId,
|
organizationId,
|
||||||
}
|
}
|
||||||
).subscribe({
|
).subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
setOrganizationMitigationsData(data);
|
setOrganizationMesuresData(data);
|
||||||
setIsLoadingMitigations(false);
|
setIsLoadingMesures(false);
|
||||||
},
|
},
|
||||||
error: (error: Error) => {
|
error: (error: Error) => {
|
||||||
console.error("Error fetching organization mitigations:", error);
|
console.error("Error fetching organization mesures:", error);
|
||||||
setIsLoadingMitigations(false);
|
setIsLoadingMesures(false);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to load mitigations.",
|
description: "Failed to load mesures.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -378,52 +378,49 @@ function ShowRiskViewContent({
|
|||||||
}, [risk.id, environment, organizationId, toast]);
|
}, [risk.id, environment, organizationId, toast]);
|
||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
const getMitigations = useCallback(() => {
|
const getMesures = useCallback(() => {
|
||||||
if (!organizationMitigationsData?.organization?.mitigations?.edges)
|
if (!organizationMesuresData?.organization?.mesures?.edges) return [];
|
||||||
return [];
|
return organizationMesuresData.organization.mesures.edges.map(
|
||||||
return organizationMitigationsData.organization.mitigations.edges.map(
|
|
||||||
(edge) => edge.node
|
(edge) => edge.node
|
||||||
);
|
);
|
||||||
}, [organizationMitigationsData]);
|
}, [organizationMesuresData]);
|
||||||
|
|
||||||
const getMitigationCategories = useCallback(() => {
|
const getMesureCategories = useCallback(() => {
|
||||||
const mitigations = getMitigations();
|
const mesures = getMesures();
|
||||||
const categories = new Set<string>();
|
const categories = new Set<string>();
|
||||||
|
|
||||||
mitigations.forEach((mitigation) => {
|
mesures.forEach((mesure) => {
|
||||||
if (mitigation.category) {
|
if (mesure.category) {
|
||||||
categories.add(mitigation.category);
|
categories.add(mesure.category);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return Array.from(categories).sort();
|
return Array.from(categories).sort();
|
||||||
}, [getMitigations]);
|
}, [getMesures]);
|
||||||
|
|
||||||
const filteredMitigations = useCallback(() => {
|
const filteredMesures = useCallback(() => {
|
||||||
const mitigations = getMitigations();
|
const mesures = getMesures();
|
||||||
if (!mitigationSearchQuery && !categoryFilter) return mitigations;
|
if (!mesureSearchQuery && !categoryFilter) return mesures;
|
||||||
|
|
||||||
return mitigations.filter((mitigation) => {
|
return mesures.filter((mesure) => {
|
||||||
// Filter by search query
|
// Filter by search query
|
||||||
const matchesSearch =
|
const matchesSearch =
|
||||||
!mitigationSearchQuery ||
|
!mesureSearchQuery ||
|
||||||
mitigation.name
|
mesure.name.toLowerCase().includes(mesureSearchQuery.toLowerCase()) ||
|
||||||
|
(mesure.description &&
|
||||||
|
mesure.description
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(mitigationSearchQuery.toLowerCase()) ||
|
.includes(mesureSearchQuery.toLowerCase()));
|
||||||
(mitigation.description &&
|
|
||||||
mitigation.description
|
|
||||||
.toLowerCase()
|
|
||||||
.includes(mitigationSearchQuery.toLowerCase()));
|
|
||||||
|
|
||||||
// Filter by category
|
// Filter by category
|
||||||
const matchesCategory =
|
const matchesCategory =
|
||||||
!categoryFilter ||
|
!categoryFilter ||
|
||||||
categoryFilter === "all" ||
|
categoryFilter === "all" ||
|
||||||
mitigation.category === categoryFilter;
|
mesure.category === categoryFilter;
|
||||||
|
|
||||||
return matchesSearch && matchesCategory;
|
return matchesSearch && matchesCategory;
|
||||||
});
|
});
|
||||||
}, [getMitigations, mitigationSearchQuery, categoryFilter]);
|
}, [getMesures, mesureSearchQuery, categoryFilter]);
|
||||||
|
|
||||||
// Helper functions for policies
|
// Helper functions for policies
|
||||||
const getPolicies = useCallback(() => {
|
const getPolicies = useCallback(() => {
|
||||||
@@ -445,38 +442,38 @@ function ShowRiskViewContent({
|
|||||||
});
|
});
|
||||||
}, [getPolicies, policySearchQuery]);
|
}, [getPolicies, policySearchQuery]);
|
||||||
|
|
||||||
// Handle linking a mitigation to this risk
|
// Handle linking a mesure to this risk
|
||||||
const handleLinkMitigation = useCallback(
|
const handleLinkMesure = useCallback(
|
||||||
(
|
(
|
||||||
mitigation: NonNullable<
|
mesure: NonNullable<
|
||||||
NonNullable<
|
NonNullable<
|
||||||
ShowRiskViewOrganizationMitigationsQuery$data["organization"]
|
ShowRiskViewOrganizationMesuresQuery$data["organization"]
|
||||||
>["mitigations"]
|
>["mesures"]
|
||||||
>["edges"][0]["node"]
|
>["edges"][0]["node"]
|
||||||
) => {
|
) => {
|
||||||
if (!risk.id) return;
|
if (!risk.id) return;
|
||||||
|
|
||||||
// Track this specific mitigation as linking
|
// Track this specific mesure as linking
|
||||||
setLinkingMitigations((prev) => ({ ...prev, [mitigation.id]: true }));
|
setLinkingMesures((prev) => ({ ...prev, [mesure.id]: true }));
|
||||||
|
|
||||||
createRiskMitigationMapping({
|
createRiskMesureMapping({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
riskId: risk.id,
|
riskId: risk.id,
|
||||||
mitigationId: mitigation.id,
|
mesureId: mesure.id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: (_, errors) => {
|
onCompleted: (_, errors) => {
|
||||||
setLinkingMitigations((prev) => ({
|
setLinkingMesures((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[mitigation.id]: false,
|
[mesure.id]: false,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (errors && errors.length > 0) {
|
if (errors && errors.length > 0) {
|
||||||
console.error("Error linking mitigation:", errors);
|
console.error("Error linking mesure:", errors);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to link mitigation. Please try again.",
|
description: "Failed to link mesure. Please try again.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -497,58 +494,58 @@ function ShowRiskViewContent({
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
description: `Linked mitigation "${mitigation.name}" to this risk.`,
|
description: `Linked mesure "${mesure.name}" to this risk.`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
setLinkingMitigations((prev) => ({
|
setLinkingMesures((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[mitigation.id]: false,
|
[mesure.id]: false,
|
||||||
}));
|
}));
|
||||||
console.error("Error linking mitigation:", error);
|
console.error("Error linking mesure:", error);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to link mitigation. Please try again.",
|
description: "Failed to link mesure. Please try again.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[risk.id, createRiskMitigationMapping, toast, environment, loadQuery]
|
[risk.id, createRiskMesureMapping, toast, environment, loadQuery]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Handle unlinking a mitigation from this risk
|
// Handle unlinking a mesure from this risk
|
||||||
const handleUnlinkMitigation = useCallback(
|
const handleUnlinkMesure = useCallback(
|
||||||
(
|
(
|
||||||
mitigation: NonNullable<
|
mesure: NonNullable<
|
||||||
NonNullable<
|
NonNullable<
|
||||||
ShowRiskViewOrganizationMitigationsQuery$data["organization"]
|
ShowRiskViewOrganizationMesuresQuery$data["organization"]
|
||||||
>["mitigations"]
|
>["mesures"]
|
||||||
>["edges"][0]["node"]
|
>["edges"][0]["node"]
|
||||||
) => {
|
) => {
|
||||||
if (!risk.id) return;
|
if (!risk.id) return;
|
||||||
|
|
||||||
// Track this specific mitigation as unlinking
|
// Track this specific mesure as unlinking
|
||||||
setUnlinkingMitigations((prev) => ({ ...prev, [mitigation.id]: true }));
|
setUnlinkingMesures((prev) => ({ ...prev, [mesure.id]: true }));
|
||||||
|
|
||||||
deleteRiskMitigationMapping({
|
deleteRiskMesureMapping({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
riskId: risk.id,
|
riskId: risk.id,
|
||||||
mitigationId: mitigation.id,
|
mesureId: mesure.id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: (_, errors) => {
|
onCompleted: (_, errors) => {
|
||||||
setUnlinkingMitigations((prev) => ({
|
setUnlinkingMesures((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[mitigation.id]: false,
|
[mesure.id]: false,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (errors && errors.length > 0) {
|
if (errors && errors.length > 0) {
|
||||||
console.error("Error unlinking mitigation:", errors);
|
console.error("Error unlinking mesure:", errors);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to unlink mitigation. Please try again.",
|
description: "Failed to unlink mesure. Please try again.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -569,24 +566,24 @@ function ShowRiskViewContent({
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Success",
|
title: "Success",
|
||||||
description: `Unlinked mitigation "${mitigation.name}" from this risk.`,
|
description: `Unlinked mesure "${mesure.name}" from this risk.`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
setUnlinkingMitigations((prev) => ({
|
setUnlinkingMesures((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[mitigation.id]: false,
|
[mesure.id]: false,
|
||||||
}));
|
}));
|
||||||
console.error("Error unlinking mitigation:", error);
|
console.error("Error unlinking mesure:", error);
|
||||||
toast({
|
toast({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to unlink mitigation. Please try again.",
|
description: "Failed to unlink mesure. Please try again.",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[risk.id, deleteRiskMitigationMapping, toast, environment, loadQuery]
|
[risk.id, deleteRiskMesureMapping, toast, environment, loadQuery]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Handle linking a policy to this risk
|
// Handle linking a policy to this risk
|
||||||
@@ -871,8 +868,8 @@ function ShowRiskViewContent({
|
|||||||
</Badge>
|
</Badge>
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xs text-secondary mt-1">
|
<p className="text-xs text-secondary mt-1">
|
||||||
{mitigations.length} mitigation
|
{mesures.length} mesure
|
||||||
{mitigations.length !== 1 ? "s" : ""} applied
|
{mesures.length !== 1 ? "s" : ""} applied
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -880,56 +877,53 @@ function ShowRiskViewContent({
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Tabs defaultValue="mitigations" className="w-full">
|
<Tabs defaultValue="mesures" className="w-full">
|
||||||
<TabsList>
|
<TabsList>
|
||||||
<TabsTrigger value="mitigations">Mitigations</TabsTrigger>
|
<TabsTrigger value="mesures">Mesures</TabsTrigger>
|
||||||
<TabsTrigger value="policies">Policies</TabsTrigger>
|
<TabsTrigger value="policies">Policies</TabsTrigger>
|
||||||
<TabsTrigger value="controls">Controls</TabsTrigger>
|
<TabsTrigger value="controls">Controls</TabsTrigger>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|
||||||
<TabsContent value="mitigations" className="space-y-4">
|
<TabsContent value="mesures" className="space-y-4">
|
||||||
<div className="flex justify-between items-center mb-4">
|
<div className="flex justify-between items-center mb-4">
|
||||||
<h2 className="text-xl font-semibold">Risk Mitigations</h2>
|
<h2 className="text-xl font-semibold">Risk Mesures</h2>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsMitigationDialogOpen(true);
|
setIsMesureDialogOpen(true);
|
||||||
loadMitigationsData();
|
loadMesuresData();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Plus className="mr-2 h-4 w-4" />
|
<Plus className="mr-2 h-4 w-4" />
|
||||||
Link Mitigation
|
Link Mesure
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{risk.mitigations?.edges?.length &&
|
{risk.mesures?.edges?.length && risk.mesures?.edges?.length > 0 ? (
|
||||||
risk.mitigations?.edges?.length > 0 ? (
|
|
||||||
<div className="rounded-md border">
|
<div className="rounded-md border">
|
||||||
<Table>
|
<Table>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead className="w-full">Mitigation</TableHead>
|
<TableHead className="w-full">Mesure</TableHead>
|
||||||
<TableHead className="w-20">Actions</TableHead>
|
<TableHead className="w-20">Actions</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{risk.mitigations?.edges.map(({ node: mitigation }) => (
|
{risk.mesures?.edges.map(({ node: mesure }) => (
|
||||||
<TableRow key={mitigation.id}>
|
<TableRow key={mesure.id}>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Link
|
<Link
|
||||||
to={`/organizations/${organizationId}/mitigations/${mitigation.id}`}
|
to={`/organizations/${organizationId}/mesures/${mesure.id}`}
|
||||||
className="font-medium text-blue-600 hover:underline"
|
className="font-medium text-blue-600 hover:underline"
|
||||||
>
|
>
|
||||||
{mitigation.name}
|
{mesure.name}
|
||||||
</Link>
|
</Link>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={() => handleUnlinkMitigation(mitigation)}
|
onClick={() => handleUnlinkMesure(mesure)}
|
||||||
disabled={
|
disabled={unlinkingMesures[mesure.id] || false}
|
||||||
unlinkingMitigations[mitigation.id] || false
|
title="Unlink mesure"
|
||||||
}
|
|
||||||
title="Unlink mitigation"
|
|
||||||
>
|
>
|
||||||
<Trash2 className="h-4 w-4 text-danger" />
|
<Trash2 className="h-4 w-4 text-danger" />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -941,7 +935,7 @@ function ShowRiskViewContent({
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-center py-10 text-secondary">
|
<div className="text-center py-10 text-secondary">
|
||||||
<p>No mitigations associated with this risk.</p>
|
<p>No mesures associated with this risk.</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
@@ -1039,18 +1033,15 @@ function ShowRiskViewContent({
|
|||||||
</TabsContent>
|
</TabsContent>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
{/* Dialog for linking mitigations */}
|
{/* Dialog for linking mesures */}
|
||||||
<Dialog
|
<Dialog open={isMesureDialogOpen} onOpenChange={setIsMesureDialogOpen}>
|
||||||
open={isMitigationDialogOpen}
|
|
||||||
onOpenChange={setIsMitigationDialogOpen}
|
|
||||||
>
|
|
||||||
<DialogContent className="max-w-3xl">
|
<DialogContent className="max-w-3xl">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<div>
|
<div>
|
||||||
<DialogTitle>Manage Risk Mitigations</DialogTitle>
|
<DialogTitle>Manage Risk Mesures</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
Link or unlink mitigations to manage this risk.
|
Link or unlink mesures to manage this risk.
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1062,10 +1053,10 @@ function ShowRiskViewContent({
|
|||||||
<div className="relative">
|
<div className="relative">
|
||||||
<Search className="absolute left-2 top-2.5 h-4 w-4 text-tertiary" />
|
<Search className="absolute left-2 top-2.5 h-4 w-4 text-tertiary" />
|
||||||
<Input
|
<Input
|
||||||
placeholder="Search mitigations..."
|
placeholder="Search mesures..."
|
||||||
className="pl-8"
|
className="pl-8"
|
||||||
value={mitigationSearchQuery}
|
value={mesureSearchQuery}
|
||||||
onChange={(e) => setMitigationSearchQuery(e.target.value)}
|
onChange={(e) => setMesureSearchQuery(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1080,7 +1071,7 @@ function ShowRiskViewContent({
|
|||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="all">All Categories</SelectItem>
|
<SelectItem value="all">All Categories</SelectItem>
|
||||||
{getMitigationCategories().map((category) => (
|
{getMesureCategories().map((category) => (
|
||||||
<SelectItem key={category} value={category}>
|
<SelectItem key={category} value={category}>
|
||||||
{category}
|
{category}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
@@ -1090,37 +1081,35 @@ function ShowRiskViewContent({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="border rounded-md max-h-96 overflow-y-auto">
|
<div className="border rounded-md max-h-96 overflow-y-auto">
|
||||||
{isLoadingMitigations ? (
|
{isLoadingMesures ? (
|
||||||
<div className="p-4 text-center">Loading mitigations...</div>
|
<div className="p-4 text-center">Loading mesures...</div>
|
||||||
) : filteredMitigations().length === 0 ? (
|
) : filteredMesures().length === 0 ? (
|
||||||
<div className="p-4 text-center">No mitigations found.</div>
|
<div className="p-4 text-center">No mesures found.</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="divide-y">
|
<div className="divide-y">
|
||||||
{filteredMitigations().map((mitigation) => {
|
{filteredMesures().map((mesure) => {
|
||||||
// For each render, recalculate linked status directly against the current risk data
|
// For each render, recalculate linked status directly against the current risk data
|
||||||
const isLinked = risk.mitigations?.edges?.some(
|
const isLinked = risk.mesures?.edges?.some(
|
||||||
(edge) => edge.node.id === mitigation.id
|
(edge) => edge.node.id === mesure.id
|
||||||
);
|
);
|
||||||
const isLinking =
|
const isLinking = linkingMesures[mesure.id] || false;
|
||||||
linkingMitigations[mitigation.id] || false;
|
const isUnlinking = unlinkingMesures[mesure.id] || false;
|
||||||
const isUnlinking =
|
|
||||||
unlinkingMitigations[mitigation.id] || false;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={mitigation.id}
|
key={mesure.id}
|
||||||
className="relative p-4 hover:bg-blue-50 transition-colors duration-150"
|
className="relative p-4 hover:bg-blue-50 transition-colors duration-150"
|
||||||
>
|
>
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<h3 className="font-medium">{mitigation.name}</h3>
|
<h3 className="font-medium">{mesure.name}</h3>
|
||||||
{mitigation.category && (
|
{mesure.category && (
|
||||||
<Badge
|
<Badge
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="text-xs font-normal"
|
className="text-xs font-normal"
|
||||||
>
|
>
|
||||||
<Tag className="h-3 w-3 mr-1" />
|
<Tag className="h-3 w-3 mr-1" />
|
||||||
{mitigation.category}
|
{mesure.category}
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -1129,9 +1118,7 @@ function ShowRiskViewContent({
|
|||||||
size="sm"
|
size="sm"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
disabled={isUnlinking}
|
disabled={isUnlinking}
|
||||||
onClick={() =>
|
onClick={() => handleUnlinkMesure(mesure)}
|
||||||
handleUnlinkMitigation(mitigation)
|
|
||||||
}
|
|
||||||
className="text-red-600 border-red-200 hover:bg-red-50"
|
className="text-red-600 border-red-200 hover:bg-red-50"
|
||||||
>
|
>
|
||||||
{isUnlinking ? "Unlinking..." : "Unlink"}
|
{isUnlinking ? "Unlinking..." : "Unlink"}
|
||||||
@@ -1140,7 +1127,7 @@ function ShowRiskViewContent({
|
|||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
disabled={isLinking}
|
disabled={isLinking}
|
||||||
onClick={() => handleLinkMitigation(mitigation)}
|
onClick={() => handleLinkMesure(mesure)}
|
||||||
>
|
>
|
||||||
{isLinking ? "Linking..." : "Link"}
|
{isLinking ? "Linking..." : "Link"}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -1157,7 +1144,7 @@ function ShowRiskViewContent({
|
|||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() => setIsMitigationDialogOpen(false)}
|
onClick={() => setIsMesureDialogOpen(false)}
|
||||||
>
|
>
|
||||||
Close
|
Close
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<73623cc6511c56dd418345cd64d500d5>>
|
* @generated SignedSource<<b2d5c0102cdcaff05ca490a75b797625>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,21 +9,21 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type CreateRiskMitigationMappingInput = {
|
export type CreateRiskMesureMappingInput = {
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
riskId: string;
|
riskId: string;
|
||||||
};
|
};
|
||||||
export type ShowRiskViewCreateRiskMitigationMappingMutation$variables = {
|
export type ShowRiskViewCreateRiskMesureMappingMutation$variables = {
|
||||||
input: CreateRiskMitigationMappingInput;
|
input: CreateRiskMesureMappingInput;
|
||||||
};
|
};
|
||||||
export type ShowRiskViewCreateRiskMitigationMappingMutation$data = {
|
export type ShowRiskViewCreateRiskMesureMappingMutation$data = {
|
||||||
readonly createRiskMitigationMapping: {
|
readonly createRiskMesureMapping: {
|
||||||
readonly success: boolean;
|
readonly success: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type ShowRiskViewCreateRiskMitigationMappingMutation = {
|
export type ShowRiskViewCreateRiskMesureMappingMutation = {
|
||||||
response: ShowRiskViewCreateRiskMitigationMappingMutation$data;
|
response: ShowRiskViewCreateRiskMesureMappingMutation$data;
|
||||||
variables: ShowRiskViewCreateRiskMitigationMappingMutation$variables;
|
variables: ShowRiskViewCreateRiskMesureMappingMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -44,9 +44,9 @@ v1 = [
|
|||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "CreateRiskMitigationMappingPayload",
|
"concreteType": "CreateRiskMesureMappingPayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "createRiskMitigationMapping",
|
"name": "createRiskMesureMapping",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -65,7 +65,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ShowRiskViewCreateRiskMitigationMappingMutation",
|
"name": "ShowRiskViewCreateRiskMesureMappingMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -74,20 +74,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "ShowRiskViewCreateRiskMitigationMappingMutation",
|
"name": "ShowRiskViewCreateRiskMesureMappingMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "5a8744dfb9cf5f977c2702d848aab7ae",
|
"cacheID": "f7d34307825549877c07678c77ca17c6",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ShowRiskViewCreateRiskMitigationMappingMutation",
|
"name": "ShowRiskViewCreateRiskMesureMappingMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation ShowRiskViewCreateRiskMitigationMappingMutation(\n $input: CreateRiskMitigationMappingInput!\n) {\n createRiskMitigationMapping(input: $input) {\n success\n }\n}\n"
|
"text": "mutation ShowRiskViewCreateRiskMesureMappingMutation(\n $input: CreateRiskMesureMappingInput!\n) {\n createRiskMesureMapping(input: $input) {\n success\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "bdb664dab4a9e655c0923cfdd4ab0fe9";
|
(node as any).hash = "e1d7cdd482d6658c2befddd478a3397d";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<406a706e512ed01c1924632306a4f81c>>
|
* @generated SignedSource<<0fc791ecc00bfd6b1aa3a8da262df36c>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,21 +9,21 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type DeleteRiskMitigationMappingInput = {
|
export type DeleteRiskMesureMappingInput = {
|
||||||
mitigationId: string;
|
mesureId: string;
|
||||||
riskId: string;
|
riskId: string;
|
||||||
};
|
};
|
||||||
export type ShowRiskViewDeleteRiskMitigationMappingMutation$variables = {
|
export type ShowRiskViewDeleteRiskMesureMappingMutation$variables = {
|
||||||
input: DeleteRiskMitigationMappingInput;
|
input: DeleteRiskMesureMappingInput;
|
||||||
};
|
};
|
||||||
export type ShowRiskViewDeleteRiskMitigationMappingMutation$data = {
|
export type ShowRiskViewDeleteRiskMesureMappingMutation$data = {
|
||||||
readonly deleteRiskMitigationMapping: {
|
readonly deleteRiskMesureMapping: {
|
||||||
readonly success: boolean;
|
readonly success: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type ShowRiskViewDeleteRiskMitigationMappingMutation = {
|
export type ShowRiskViewDeleteRiskMesureMappingMutation = {
|
||||||
response: ShowRiskViewDeleteRiskMitigationMappingMutation$data;
|
response: ShowRiskViewDeleteRiskMesureMappingMutation$data;
|
||||||
variables: ShowRiskViewDeleteRiskMitigationMappingMutation$variables;
|
variables: ShowRiskViewDeleteRiskMesureMappingMutation$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -44,9 +44,9 @@ v1 = [
|
|||||||
"variableName": "input"
|
"variableName": "input"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"concreteType": "DeleteRiskMitigationMappingPayload",
|
"concreteType": "DeleteRiskMesureMappingPayload",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "deleteRiskMitigationMapping",
|
"name": "deleteRiskMesureMapping",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
@@ -65,7 +65,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ShowRiskViewDeleteRiskMitigationMappingMutation",
|
"name": "ShowRiskViewDeleteRiskMesureMappingMutation",
|
||||||
"selections": (v1/*: any*/),
|
"selections": (v1/*: any*/),
|
||||||
"type": "Mutation",
|
"type": "Mutation",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -74,20 +74,20 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "ShowRiskViewDeleteRiskMitigationMappingMutation",
|
"name": "ShowRiskViewDeleteRiskMesureMappingMutation",
|
||||||
"selections": (v1/*: any*/)
|
"selections": (v1/*: any*/)
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "9a4b56b457c7fb53dc2583da93a3aaa4",
|
"cacheID": "d46920306e833fb33b4f10dca6aa1c5a",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ShowRiskViewDeleteRiskMitigationMappingMutation",
|
"name": "ShowRiskViewDeleteRiskMesureMappingMutation",
|
||||||
"operationKind": "mutation",
|
"operationKind": "mutation",
|
||||||
"text": "mutation ShowRiskViewDeleteRiskMitigationMappingMutation(\n $input: DeleteRiskMitigationMappingInput!\n) {\n deleteRiskMitigationMapping(input: $input) {\n success\n }\n}\n"
|
"text": "mutation ShowRiskViewDeleteRiskMesureMappingMutation(\n $input: DeleteRiskMesureMappingInput!\n) {\n deleteRiskMesureMapping(input: $input) {\n success\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "d9fece39ecffbd551662d6491088ce4c";
|
(node as any).hash = "e55c8d6490fbcfe0d287053200b6347d";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<da6cda7380aec978f37e3adc35942e03>>
|
* @generated SignedSource<<1fdd1781c11f4c88aeb14ba52fc3e884>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,29 +9,29 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type ShowRiskViewOrganizationMitigationsQuery$variables = {
|
export type ShowRiskViewOrganizationMesuresQuery$variables = {
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
};
|
};
|
||||||
export type ShowRiskViewOrganizationMitigationsQuery$data = {
|
export type ShowRiskViewOrganizationMesuresQuery$data = {
|
||||||
readonly organization: {
|
readonly organization: {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly mitigations?: {
|
readonly mesures?: {
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly category: string;
|
readonly category: string;
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly state: MitigationState;
|
readonly state: MesureState;
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type ShowRiskViewOrganizationMitigationsQuery = {
|
export type ShowRiskViewOrganizationMesuresQuery = {
|
||||||
response: ShowRiskViewOrganizationMitigationsQuery$data;
|
response: ShowRiskViewOrganizationMesuresQuery$data;
|
||||||
variables: ShowRiskViewOrganizationMitigationsQuery$variables;
|
variables: ShowRiskViewOrganizationMesuresQuery$variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
@@ -67,7 +67,7 @@ v4 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationEdge",
|
"concreteType": "MesureEdge",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "edges",
|
"name": "edges",
|
||||||
"plural": true,
|
"plural": true,
|
||||||
@@ -75,7 +75,7 @@ v4 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
@@ -161,7 +161,7 @@ return {
|
|||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ShowRiskViewOrganizationMitigationsQuery",
|
"name": "ShowRiskViewOrganizationMesuresQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -176,11 +176,11 @@ return {
|
|||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "mitigations",
|
"alias": "mesures",
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__Organization__mitigations_connection",
|
"name": "__Organization__mesures_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v4/*: any*/),
|
"selections": (v4/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -200,7 +200,7 @@ return {
|
|||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": (v0/*: any*/),
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "ShowRiskViewOrganizationMitigationsQuery",
|
"name": "ShowRiskViewOrganizationMesuresQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": "organization",
|
"alias": "organization",
|
||||||
@@ -218,21 +218,21 @@ return {
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigations",
|
"name": "mesures",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v4/*: any*/),
|
"selections": (v4/*: any*/),
|
||||||
"storageKey": "mitigations(first:100)"
|
"storageKey": "mesures(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "Organization__mitigations",
|
"key": "Organization__mesures",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "mitigations"
|
"name": "mesures"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "Organization",
|
"type": "Organization",
|
||||||
@@ -244,7 +244,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "a73345064022bd2f11ef2f971cd898b5",
|
"cacheID": "af9a0c71ad20ea7e65e3c625e30b00d8",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -254,18 +254,18 @@ return {
|
|||||||
"direction": "forward",
|
"direction": "forward",
|
||||||
"path": [
|
"path": [
|
||||||
"organization",
|
"organization",
|
||||||
"mitigations"
|
"mesures"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"name": "ShowRiskViewOrganizationMitigationsQuery",
|
"name": "ShowRiskViewOrganizationMesuresQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query ShowRiskViewOrganizationMitigationsQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n mitigations(first: 100) {\n edges {\n node {\n id\n name\n description\n category\n state\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query ShowRiskViewOrganizationMesuresQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ... on Organization {\n mesures(first: 100) {\n edges {\n node {\n id\n name\n description\n category\n state\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "76ce05cd9f5a367595eb31b5df24a679";
|
(node as any).hash = "addb9873294354cedf28bc3262cb736a";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<486518520656d7e1392a34ee1877fe22>>
|
* @generated SignedSource<<166b32236b296d1d0a4956cabacb1715>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
|
||||||
import { ConcreteRequest } from 'relay-runtime';
|
import { ConcreteRequest } from 'relay-runtime';
|
||||||
export type MitigationState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
export type MesureState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
|
||||||
export type PolicyStatus = "ACTIVE" | "DRAFT";
|
export type PolicyStatus = "ACTIVE" | "DRAFT";
|
||||||
export type RiskTreatment = "ACCEPTED" | "AVOIDED" | "MITIGATED" | "TRANSFERRED";
|
export type RiskTreatment = "ACCEPTED" | "AVOIDED" | "MITIGATED" | "TRANSFERRED";
|
||||||
export type ShowRiskViewQuery$variables = {
|
export type ShowRiskViewQuery$variables = {
|
||||||
@@ -33,7 +33,7 @@ export type ShowRiskViewQuery$data = {
|
|||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly inherentImpact?: number;
|
readonly inherentImpact?: number;
|
||||||
readonly inherentLikelihood?: number;
|
readonly inherentLikelihood?: number;
|
||||||
readonly mitigations?: {
|
readonly mesures?: {
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly category: string;
|
readonly category: string;
|
||||||
@@ -41,7 +41,7 @@ export type ShowRiskViewQuery$data = {
|
|||||||
readonly description: string;
|
readonly description: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly state: MitigationState;
|
readonly state: MesureState;
|
||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
@@ -218,7 +218,7 @@ v16 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationEdge",
|
"concreteType": "MesureEdge",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "edges",
|
"name": "edges",
|
||||||
"plural": true,
|
"plural": true,
|
||||||
@@ -226,7 +226,7 @@ v16 = [
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Mitigation",
|
"concreteType": "Mesure",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
@@ -371,11 +371,11 @@ return {
|
|||||||
(v11/*: any*/),
|
(v11/*: any*/),
|
||||||
(v12/*: any*/),
|
(v12/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": "mitigations",
|
"alias": "mesures",
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__Risk__mitigations_connection",
|
"name": "__Risk__mesures_connection",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v16/*: any*/),
|
"selections": (v16/*: any*/),
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -443,21 +443,21 @@ return {
|
|||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v19/*: any*/),
|
"args": (v19/*: any*/),
|
||||||
"concreteType": "MitigationConnection",
|
"concreteType": "MesureConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "mitigations",
|
"name": "mesures",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": (v16/*: any*/),
|
"selections": (v16/*: any*/),
|
||||||
"storageKey": "mitigations(first:100)"
|
"storageKey": "mesures(first:100)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v19/*: any*/),
|
"args": (v19/*: any*/),
|
||||||
"filters": null,
|
"filters": null,
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "Risk__mitigations",
|
"key": "Risk__mesures",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
"name": "mitigations"
|
"name": "mesures"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
@@ -507,7 +507,7 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "8867786ee5bfa23bfd16d52d0023beeb",
|
"cacheID": "b315b57d1b366f87758e300825909da0",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"connection": [
|
"connection": [
|
||||||
@@ -517,7 +517,7 @@ return {
|
|||||||
"direction": "forward",
|
"direction": "forward",
|
||||||
"path": [
|
"path": [
|
||||||
"node",
|
"node",
|
||||||
"mitigations"
|
"mesures"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -542,11 +542,11 @@ return {
|
|||||||
},
|
},
|
||||||
"name": "ShowRiskViewQuery",
|
"name": "ShowRiskViewQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query ShowRiskViewQuery(\n $riskId: ID!\n) {\n node(id: $riskId) {\n __typename\n id\n ... on Risk {\n name\n description\n treatment\n owner {\n id\n fullName\n }\n inherentLikelihood\n inherentImpact\n residualLikelihood\n residualImpact\n createdAt\n updatedAt\n mitigations(first: 100) {\n edges {\n node {\n id\n name\n description\n category\n createdAt\n state\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n policies(first: 100) {\n edges {\n node {\n id\n name\n status\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n controls(first: 100) {\n edges {\n node {\n id\n referenceId\n name\n description\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
"text": "query ShowRiskViewQuery(\n $riskId: ID!\n) {\n node(id: $riskId) {\n __typename\n id\n ... on Risk {\n name\n description\n treatment\n owner {\n id\n fullName\n }\n inherentLikelihood\n inherentImpact\n residualLikelihood\n residualImpact\n createdAt\n updatedAt\n mesures(first: 100) {\n edges {\n node {\n id\n name\n description\n category\n createdAt\n state\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n policies(first: 100) {\n edges {\n node {\n id\n name\n status\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n controls(first: 100) {\n edges {\n node {\n id\n referenceId\n name\n description\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "264f7dd097e487eda41cdc4d04a14274";
|
(node as any).hash = "bbb709790492c573d25ee19412956501";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -116,11 +116,11 @@ WHERE %s
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controls) LoadByMitigationID(
|
func (c *Controls) LoadByMesureID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
cursor *page.Cursor[ControlOrderField],
|
cursor *page.Cursor[ControlOrderField],
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
@@ -137,9 +137,9 @@ WITH ctrl AS (
|
|||||||
FROM
|
FROM
|
||||||
controls c
|
controls c
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
controls_mitigations cm ON c.id = cm.control_id
|
controls_mesures cm ON c.id = cm.control_id
|
||||||
WHERE
|
WHERE
|
||||||
cm.mitigation_id = @mitigation_id
|
cm.mesure_id = @mesure_id
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
@@ -157,7 +157,7 @@ WHERE %s
|
|||||||
`
|
`
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
||||||
|
|
||||||
args := pgx.NamedArgs{"mitigation_id": mitigationID}
|
args := pgx.NamedArgs{"mesure_id": mesureID}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
|
||||||
rows, err := conn.Query(ctx, q, args)
|
rows, err := conn.Query(ctx, q, args)
|
||||||
@@ -200,9 +200,9 @@ WITH ctrl AS (
|
|||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
risks_policies rp ON cp.policy_id = rp.policy_id
|
risks_policies rp ON cp.policy_id = rp.policy_id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
controls_mitigations cm ON c.id = cm.control_id
|
controls_mesures cm ON c.id = cm.control_id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
risks_mitigations rm ON (rm.mitigation_id = cm.mitigation_id)
|
risks_mesures rm ON (rm.mesure_id = cm.mesure_id)
|
||||||
WHERE
|
WHERE
|
||||||
rp.risk_id = @risk_id OR rm.risk_id = @risk_id
|
rp.risk_id = @risk_id OR rm.risk_id = @risk_id
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,41 +26,41 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
ControlMitigation struct {
|
ControlMesure struct {
|
||||||
ControlID gid.GID `db:"control_id"`
|
ControlID gid.GID `db:"control_id"`
|
||||||
MitigationID gid.GID `db:"mitigation_id"`
|
MesureID gid.GID `db:"mesure_id"`
|
||||||
TenantID gid.TenantID `db:"tenant_id"`
|
TenantID gid.TenantID `db:"tenant_id"`
|
||||||
CreatedAt time.Time `db:"created_at"`
|
CreatedAt time.Time `db:"created_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
ControlMitigations []*ControlMitigation
|
ControlMesures []*ControlMesure
|
||||||
)
|
)
|
||||||
|
|
||||||
func (cm ControlMitigation) Upsert(
|
func (cm ControlMesure) Upsert(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
controls_mitigations (
|
controls_mesures (
|
||||||
control_id,
|
control_id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
created_at
|
created_at
|
||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
@control_id,
|
@control_id,
|
||||||
@mitigation_id,
|
@mesure_id,
|
||||||
@tenant_id,
|
@tenant_id,
|
||||||
@created_at
|
@created_at
|
||||||
)
|
)
|
||||||
ON CONFLICT (control_id, mitigation_id) DO NOTHING;
|
ON CONFLICT (control_id, mesure_id) DO NOTHING;
|
||||||
`
|
`
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"control_id": cm.ControlID,
|
"control_id": cm.ControlID,
|
||||||
"mitigation_id": cm.MitigationID,
|
"mesure_id": cm.MesureID,
|
||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"created_at": cm.CreatedAt,
|
"created_at": cm.CreatedAt,
|
||||||
}
|
}
|
||||||
@@ -68,22 +68,22 @@ ON CONFLICT (control_id, mitigation_id) DO NOTHING;
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm ControlMitigation) Insert(
|
func (cm ControlMesure) 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
|
||||||
controls_mitigations (
|
controls_mesures (
|
||||||
control_id,
|
control_id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
created_at
|
created_at
|
||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
@control_id,
|
@control_id,
|
||||||
@mitigation_id,
|
@mesure_id,
|
||||||
@tenant_id,
|
@tenant_id,
|
||||||
@created_at
|
@created_at
|
||||||
);
|
);
|
||||||
@@ -91,7 +91,7 @@ VALUES (
|
|||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"control_id": cm.ControlID,
|
"control_id": cm.ControlID,
|
||||||
"mitigation_id": cm.MitigationID,
|
"mesure_id": cm.MesureID,
|
||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"created_at": cm.CreatedAt,
|
"created_at": cm.CreatedAt,
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ VALUES (
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm ControlMitigation) Delete(
|
func (cm ControlMesure) Delete(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
@@ -107,16 +107,16 @@ func (cm ControlMitigation) Delete(
|
|||||||
q := `
|
q := `
|
||||||
DELETE
|
DELETE
|
||||||
FROM
|
FROM
|
||||||
controls_mitigations
|
controls_mesures
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND control_id = @control_id
|
AND control_id = @control_id
|
||||||
AND mitigation_id = @mitigation_id;
|
AND mesure_id = @mesure_id;
|
||||||
`
|
`
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"control_id": cm.ControlID,
|
"control_id": cm.ControlID,
|
||||||
"mitigation_id": cm.MitigationID,
|
"mesure_id": cm.MesureID,
|
||||||
}
|
}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
@@ -125,39 +125,39 @@ WHERE
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cms *ControlMitigations) LoadByMitigationID(
|
func (cms *ControlMesures) LoadByMesureID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
SELECT
|
SELECT
|
||||||
control_id,
|
control_id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
created_at
|
created_at
|
||||||
FROM
|
FROM
|
||||||
control_mitigations
|
controls_mesures
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND mitigation_id = @mitigation_id
|
AND mesure_id = @mesure_id
|
||||||
`
|
`
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{"mitigation_id": mitigationID}
|
args := pgx.StrictNamedArgs{"mesure_id": mesureID}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.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 control_mitigations: %w", err)
|
return fmt.Errorf("cannot query control_mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
controlMitigations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ControlMitigation])
|
controlMesures, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ControlMesure])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot collect control_mitigations: %w", err)
|
return fmt.Errorf("cannot collect control_mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
*cms = controlMitigations
|
*cms = controlMesures
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@ package coredata
|
|||||||
const (
|
const (
|
||||||
OrganizationEntityType uint16 = iota
|
OrganizationEntityType uint16 = iota
|
||||||
FrameworkEntityType
|
FrameworkEntityType
|
||||||
MitigationEntityType
|
MesureEntityType
|
||||||
TaskEntityType
|
TaskEntityType
|
||||||
EvidenceEntityType
|
EvidenceEntityType
|
||||||
_ControlStateTransitionEntityType // UNUSED
|
_ControlStateTransitionEntityType // UNUSED
|
||||||
|
|||||||
@@ -28,41 +28,41 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
Mitigation struct {
|
Mesure struct {
|
||||||
ID gid.GID `db:"id"`
|
ID gid.GID `db:"id"`
|
||||||
TenantID gid.TenantID `db:"tenant_id"`
|
TenantID gid.TenantID `db:"tenant_id"`
|
||||||
OrganizationID gid.GID `db:"organization_id"`
|
OrganizationID gid.GID `db:"organization_id"`
|
||||||
Category string `db:"category"`
|
Category string `db:"category"`
|
||||||
Name string `db:"name"`
|
Name string `db:"name"`
|
||||||
Description string `db:"description"`
|
Description string `db:"description"`
|
||||||
Importance MitigationImportance `db:"importance"`
|
Importance MesureImportance `db:"importance"`
|
||||||
State MitigationState `db:"state"`
|
State MesureState `db:"state"`
|
||||||
ReferenceID string `db:"reference_id"`
|
ReferenceID string `db:"reference_id"`
|
||||||
CreatedAt time.Time `db:"created_at"`
|
CreatedAt time.Time `db:"created_at"`
|
||||||
UpdatedAt time.Time `db:"updated_at"`
|
UpdatedAt time.Time `db:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
Mitigations []*Mitigation
|
Mesures []*Mesure
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c Mitigation) CursorKey(orderBy MitigationOrderField) page.CursorKey {
|
func (m Mesure) CursorKey(orderBy MesureOrderField) page.CursorKey {
|
||||||
switch orderBy {
|
switch orderBy {
|
||||||
case MitigationOrderFieldCreatedAt:
|
case MesureOrderFieldCreatedAt:
|
||||||
return page.NewCursorKey(c.ID, c.CreatedAt)
|
return page.NewCursorKey(m.ID, m.CreatedAt)
|
||||||
}
|
}
|
||||||
|
|
||||||
panic(fmt.Sprintf("unsupported order by: %s", orderBy))
|
panic(fmt.Sprintf("unsupported order by: %s", orderBy))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Mitigations) LoadByRiskID(
|
func (m *Mesures) LoadByRiskID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
riskID gid.GID,
|
riskID gid.GID,
|
||||||
cursor *page.Cursor[MitigationOrderField],
|
cursor *page.Cursor[MesureOrderField],
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
WITH mtgtns AS (
|
WITH msrs AS (
|
||||||
SELECT
|
SELECT
|
||||||
m.id,
|
m.id,
|
||||||
m.tenant_id,
|
m.tenant_id,
|
||||||
@@ -76,9 +76,9 @@ WITH mtgtns AS (
|
|||||||
m.created_at,
|
m.created_at,
|
||||||
m.updated_at
|
m.updated_at
|
||||||
FROM
|
FROM
|
||||||
mitigations m
|
mesures m
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
risks_mitigations rm ON m.id = rm.mitigation_id
|
risks_mesures rm ON m.id = rm.mesure_id
|
||||||
WHERE
|
WHERE
|
||||||
rm.risk_id = @risk_id
|
rm.risk_id = @risk_id
|
||||||
)
|
)
|
||||||
@@ -95,7 +95,7 @@ SELECT
|
|||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
mtgtns
|
msrs
|
||||||
WHERE %s
|
WHERE %s
|
||||||
AND %s
|
AND %s
|
||||||
`
|
`
|
||||||
@@ -107,25 +107,25 @@ WHERE %s
|
|||||||
|
|
||||||
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 mitigations: %w", err)
|
return fmt.Errorf("cannot query mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mitigations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Mitigation])
|
mesures, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Mesure])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot collect mitigations: %w", err)
|
return fmt.Errorf("cannot collect mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
*c = mitigations
|
*m = mesures
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Mitigations) LoadByControlID(
|
func (m *Mesures) 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[MitigationOrderField],
|
cursor *page.Cursor[MesureOrderField],
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
WITH mtgtns AS (
|
WITH mtgtns AS (
|
||||||
@@ -142,9 +142,9 @@ WITH mtgtns AS (
|
|||||||
m.created_at,
|
m.created_at,
|
||||||
m.updated_at
|
m.updated_at
|
||||||
FROM
|
FROM
|
||||||
mitigations m
|
mesures m
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
controls_mitigations cm ON m.id = cm.mitigation_id
|
controls_mesures cm ON m.id = cm.mesure_id
|
||||||
WHERE
|
WHERE
|
||||||
cm.control_id = @control_id
|
cm.control_id = @control_id
|
||||||
)
|
)
|
||||||
@@ -173,25 +173,25 @@ WHERE %s
|
|||||||
|
|
||||||
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 mitigations: %w", err)
|
return fmt.Errorf("cannot query mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mitigations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Mitigation])
|
mesures, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Mesure])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot collect mitigations: %w", err)
|
return fmt.Errorf("cannot collect mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
*c = mitigations
|
*m = mesures
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Mitigations) LoadByOrganizationID(
|
func (m *Mesures) LoadByOrganizationID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
organizationID gid.GID,
|
organizationID gid.GID,
|
||||||
cursor *page.Cursor[MitigationOrderField],
|
cursor *page.Cursor[MesureOrderField],
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
SELECT
|
SELECT
|
||||||
@@ -207,7 +207,7 @@ SELECT
|
|||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
mitigations
|
mesures
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND organization_id = @organization_id
|
AND organization_id = @organization_id
|
||||||
@@ -221,24 +221,24 @@ 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 mitigations: %w", err)
|
return fmt.Errorf("cannot query mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mitigations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Mitigation])
|
mesures, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Mesure])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot collect mitigations: %w", err)
|
return fmt.Errorf("cannot collect mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
*c = mitigations
|
*m = mesures
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Mitigation) LoadByID(
|
func (m *Mesure) LoadByID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
SELECT
|
SELECT
|
||||||
@@ -254,41 +254,41 @@ SELECT
|
|||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
mitigations
|
mesures
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND id = @mitigation_id
|
AND id = @mesure_id
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
`
|
`
|
||||||
|
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{"mitigation_id": mitigationID}
|
args := pgx.StrictNamedArgs{"mesure_id": mesureID}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.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 mitigations: %w", err)
|
return fmt.Errorf("cannot query mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mitigation, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Mitigation])
|
mesure, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Mesure])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot collect mitigations: %w", err)
|
return fmt.Errorf("cannot collect mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
*c = mitigation
|
*m = mesure
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Mitigation) Upsert(
|
func (m *Mesure) Upsert(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
mitigations (
|
mesures (
|
||||||
tenant_id,
|
tenant_id,
|
||||||
id,
|
id,
|
||||||
organization_id,
|
organization_id,
|
||||||
@@ -303,7 +303,7 @@ INSERT INTO
|
|||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
@tenant_id,
|
@tenant_id,
|
||||||
@mitigation_id,
|
@mesure_id,
|
||||||
@organization_id,
|
@organization_id,
|
||||||
@category,
|
@category,
|
||||||
@name,
|
@name,
|
||||||
@@ -335,41 +335,41 @@ RETURNING
|
|||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"mitigation_id": c.ID,
|
"mesure_id": m.ID,
|
||||||
"organization_id": c.OrganizationID,
|
"organization_id": m.OrganizationID,
|
||||||
"category": c.Category,
|
"category": m.Category,
|
||||||
"name": c.Name,
|
"name": m.Name,
|
||||||
"importance": c.Importance,
|
"importance": m.Importance,
|
||||||
"state": c.State,
|
"state": m.State,
|
||||||
"description": c.Description,
|
"description": m.Description,
|
||||||
"reference_id": c.ReferenceID,
|
"reference_id": m.ReferenceID,
|
||||||
"created_at": c.CreatedAt,
|
"created_at": m.CreatedAt,
|
||||||
"updated_at": c.UpdatedAt,
|
"updated_at": m.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|
||||||
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 mitigations: %w", err)
|
return fmt.Errorf("cannot query mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mitigation, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Mitigation])
|
mesure, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Mesure])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot collect mitigations: %w", err)
|
return fmt.Errorf("cannot collect mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
*c = mitigation
|
*m = mesure
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Mitigation) Insert(
|
func (m Mesure) 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
|
||||||
mitigations (
|
mesures (
|
||||||
tenant_id,
|
tenant_id,
|
||||||
id,
|
id,
|
||||||
organization_id,
|
organization_id,
|
||||||
@@ -384,7 +384,7 @@ INSERT INTO
|
|||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
@tenant_id,
|
@tenant_id,
|
||||||
@mitigation_id,
|
@mesure_id,
|
||||||
@organization_id,
|
@organization_id,
|
||||||
@category,
|
@category,
|
||||||
@name,
|
@name,
|
||||||
@@ -399,28 +399,28 @@ VALUES (
|
|||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"mitigation_id": c.ID,
|
"mesure_id": m.ID,
|
||||||
"organization_id": c.OrganizationID,
|
"organization_id": m.OrganizationID,
|
||||||
"category": c.Category,
|
"category": m.Category,
|
||||||
"name": c.Name,
|
"name": m.Name,
|
||||||
"description": c.Description,
|
"description": m.Description,
|
||||||
"reference_id": c.ReferenceID,
|
"reference_id": m.ReferenceID,
|
||||||
"created_at": c.CreatedAt,
|
"created_at": m.CreatedAt,
|
||||||
"updated_at": c.UpdatedAt,
|
"updated_at": m.UpdatedAt,
|
||||||
"state": c.State,
|
"state": m.State,
|
||||||
"importance": c.Importance,
|
"importance": m.Importance,
|
||||||
}
|
}
|
||||||
_, err := conn.Exec(ctx, q, args)
|
_, err := conn.Exec(ctx, q, args)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Mitigation) Update(
|
func (m *Mesure) Update(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
UPDATE mitigations
|
UPDATE mesures
|
||||||
SET
|
SET
|
||||||
name = @name,
|
name = @name,
|
||||||
description = @description,
|
description = @description,
|
||||||
@@ -429,18 +429,18 @@ SET
|
|||||||
importance = @importance,
|
importance = @importance,
|
||||||
updated_at = @updated_at
|
updated_at = @updated_at
|
||||||
WHERE %s
|
WHERE %s
|
||||||
AND id = @mitigation_id
|
AND id = @mesure_id
|
||||||
`
|
`
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
|
|
||||||
args := pgx.NamedArgs{
|
args := pgx.NamedArgs{
|
||||||
"mitigation_id": c.ID,
|
"mesure_id": m.ID,
|
||||||
"name": c.Name,
|
"name": m.Name,
|
||||||
"description": c.Description,
|
"description": m.Description,
|
||||||
"category": c.Category,
|
"category": m.Category,
|
||||||
"state": c.State,
|
"state": m.State,
|
||||||
"importance": c.Importance,
|
"importance": m.Importance,
|
||||||
"updated_at": c.UpdatedAt,
|
"updated_at": m.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
@@ -20,48 +20,48 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MitigationImportance uint8
|
type MesureImportance uint8
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MitigationImportanceMandatory MitigationImportance = iota
|
MesureImportanceMandatory MesureImportance = iota
|
||||||
MitigationImportancePreferred
|
MesureImportancePreferred
|
||||||
MitigationImportanceAdvanced
|
MesureImportanceAdvanced
|
||||||
)
|
)
|
||||||
|
|
||||||
func (i MitigationImportance) String() string {
|
func (i MesureImportance) String() string {
|
||||||
return []string{"MANDATORY", "PREFERRED", "ADVANCED"}[i]
|
return []string{"MANDATORY", "PREFERRED", "ADVANCED"}[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *MitigationImportance) Scan(value interface{}) error {
|
func (i *MesureImportance) Scan(value interface{}) error {
|
||||||
switch v := value.(type) {
|
switch v := value.(type) {
|
||||||
case uint8:
|
case uint8:
|
||||||
*i = MitigationImportance(v)
|
*i = MesureImportance(v)
|
||||||
case string:
|
case string:
|
||||||
switch v {
|
switch v {
|
||||||
case "MANDATORY":
|
case "MANDATORY":
|
||||||
*i = MitigationImportanceMandatory
|
*i = MesureImportanceMandatory
|
||||||
case "PREFERRED":
|
case "PREFERRED":
|
||||||
*i = MitigationImportancePreferred
|
*i = MesureImportancePreferred
|
||||||
case "ADVANCED":
|
case "ADVANCED":
|
||||||
*i = MitigationImportanceAdvanced
|
*i = MesureImportanceAdvanced
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("invalid MitigationImportance value: %q", v)
|
return fmt.Errorf("invalid MesureImportance value: %q", v)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unsupported type for MitigationImportance: %T", value)
|
return fmt.Errorf("unsupported type for MesureImportance: %T", value)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i MitigationImportance) Value() (driver.Value, error) {
|
func (i MesureImportance) Value() (driver.Value, error) {
|
||||||
return i.String(), nil
|
return i.String(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i MitigationImportance) MarshalJSON() ([]byte, error) {
|
func (i MesureImportance) MarshalJSON() ([]byte, error) {
|
||||||
return json.Marshal(i.String())
|
return json.Marshal(i.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *MitigationImportance) UnmarshalJSON(data []byte) error {
|
func (i *MesureImportance) UnmarshalJSON(data []byte) error {
|
||||||
var s string
|
var s string
|
||||||
if err := json.Unmarshal(data, &s); err != nil {
|
if err := json.Unmarshal(data, &s); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -69,18 +69,18 @@ func (i *MitigationImportance) UnmarshalJSON(data []byte) error {
|
|||||||
|
|
||||||
switch s {
|
switch s {
|
||||||
case "MANDATORY":
|
case "MANDATORY":
|
||||||
*i = MitigationImportanceMandatory
|
*i = MesureImportanceMandatory
|
||||||
case "PREFERRED":
|
case "PREFERRED":
|
||||||
*i = MitigationImportancePreferred
|
*i = MesureImportancePreferred
|
||||||
case "ADVANCED":
|
case "ADVANCED":
|
||||||
*i = MitigationImportanceAdvanced
|
*i = MesureImportanceAdvanced
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("invalid MitigationImportance value: %q", s)
|
return fmt.Errorf("invalid MesureImportance value: %q", s)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *MitigationImportance) UnmarshalText(text []byte) error {
|
func (i *MesureImportance) UnmarshalText(text []byte) error {
|
||||||
var s string
|
var s string
|
||||||
if err := json.Unmarshal(text, &s); err != nil {
|
if err := json.Unmarshal(text, &s); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -88,13 +88,13 @@ func (i *MitigationImportance) UnmarshalText(text []byte) error {
|
|||||||
|
|
||||||
switch s {
|
switch s {
|
||||||
case "MANDATORY":
|
case "MANDATORY":
|
||||||
*i = MitigationImportanceMandatory
|
*i = MesureImportanceMandatory
|
||||||
case "PREFERRED":
|
case "PREFERRED":
|
||||||
*i = MitigationImportancePreferred
|
*i = MesureImportancePreferred
|
||||||
case "ADVANCED":
|
case "ADVANCED":
|
||||||
*i = MitigationImportanceAdvanced
|
*i = MesureImportanceAdvanced
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("invalid MitigationImportance value: %q", s)
|
return fmt.Errorf("invalid MesureImportance value: %q", s)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -15,26 +15,26 @@
|
|||||||
package coredata
|
package coredata
|
||||||
|
|
||||||
type (
|
type (
|
||||||
MitigationOrderField string
|
MesureOrderField string
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MitigationOrderFieldCreatedAt MitigationOrderField = "CREATED_AT"
|
MesureOrderFieldCreatedAt MesureOrderField = "CREATED_AT"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (p MitigationOrderField) Column() string {
|
func (p MesureOrderField) Column() string {
|
||||||
return string(p)
|
return string(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p MitigationOrderField) String() string {
|
func (p MesureOrderField) String() string {
|
||||||
return string(p)
|
return string(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p MitigationOrderField) MarshalText() ([]byte, error) {
|
func (p MesureOrderField) MarshalText() ([]byte, error) {
|
||||||
return []byte(p.String()), nil
|
return []byte(p.String()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *MitigationOrderField) UnmarshalText(text []byte) error {
|
func (p *MesureOrderField) UnmarshalText(text []byte) error {
|
||||||
*p = MitigationOrderField(text)
|
*p = MesureOrderField(text)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
84
pkg/coredata/mesure_state.go
Normal file
84
pkg/coredata/mesure_state.go
Normal file
@@ -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 coredata
|
||||||
|
|
||||||
|
import (
|
||||||
|
"database/sql/driver"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
MesureState uint8
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
MesureStateNotStarted MesureState = iota
|
||||||
|
MesureStateInProgress
|
||||||
|
MesureStateNotApplicable
|
||||||
|
MesureStateImplemented
|
||||||
|
)
|
||||||
|
|
||||||
|
func (ms MesureState) MarshalText() ([]byte, error) {
|
||||||
|
return []byte(ms.String()), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ms *MesureState) UnmarshalText(data []byte) error {
|
||||||
|
val := string(data)
|
||||||
|
|
||||||
|
switch val {
|
||||||
|
case MesureStateNotStarted.String():
|
||||||
|
*ms = MesureStateNotStarted
|
||||||
|
case MesureStateInProgress.String():
|
||||||
|
*ms = MesureStateInProgress
|
||||||
|
case MesureStateNotApplicable.String():
|
||||||
|
*ms = MesureStateNotApplicable
|
||||||
|
case MesureStateImplemented.String():
|
||||||
|
*ms = MesureStateImplemented
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("invalid MesureState value: %q", val)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ms MesureState) String() string {
|
||||||
|
var val string
|
||||||
|
|
||||||
|
switch ms {
|
||||||
|
case MesureStateNotStarted:
|
||||||
|
val = "NOT_STARTED"
|
||||||
|
case MesureStateInProgress:
|
||||||
|
val = "IN_PROGRESS"
|
||||||
|
case MesureStateNotApplicable:
|
||||||
|
val = "NOT_APPLICABLE"
|
||||||
|
case MesureStateImplemented:
|
||||||
|
val = "IMPLEMENTED"
|
||||||
|
}
|
||||||
|
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ms *MesureState) Scan(value any) error {
|
||||||
|
val, ok := value.(string)
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("invalid scan source for MesureState, expected string got %T", value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return ms.UnmarshalText([]byte(val))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ms MesureState) Value() (driver.Value, error) {
|
||||||
|
return ms.String(), nil
|
||||||
|
}
|
||||||
2
pkg/coredata/migrations/20250412T175500Z.sql
Normal file
2
pkg/coredata/migrations/20250412T175500Z.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE mitigations RENAME TO mesures;
|
||||||
|
|
||||||
2
pkg/coredata/migrations/20250412T180400Z.sql
Normal file
2
pkg/coredata/migrations/20250412T180400Z.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE risks_mitigations RENAME TO risks_mesures;
|
||||||
|
ALTER TABLE risks_mesures RENAME COLUMN mitigation_id TO mesure_id;
|
||||||
2
pkg/coredata/migrations/20250412T182100Z.sql
Normal file
2
pkg/coredata/migrations/20250412T182100Z.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE controls_mitigations RENAME TO controls_mesures;
|
||||||
|
ALTER TABLE controls_mesures RENAME COLUMN mitigation_id TO mesure_id;
|
||||||
1
pkg/coredata/migrations/20250412T210000Z.sql
Normal file
1
pkg/coredata/migrations/20250412T210000Z.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE tasks RENAME COLUMN mitigation_id TO mesure_id;
|
||||||
@@ -1,84 +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 coredata
|
|
||||||
|
|
||||||
import (
|
|
||||||
"database/sql/driver"
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
MitigationState uint8
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
MitigationStateNotStarted MitigationState = iota
|
|
||||||
MitigationStateInProgress
|
|
||||||
MitigationStateNotApplicable
|
|
||||||
MitigationStateImplemented
|
|
||||||
)
|
|
||||||
|
|
||||||
func (cs MitigationState) MarshalText() ([]byte, error) {
|
|
||||||
return []byte(cs.String()), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cs *MitigationState) UnmarshalText(data []byte) error {
|
|
||||||
val := string(data)
|
|
||||||
|
|
||||||
switch val {
|
|
||||||
case MitigationStateNotStarted.String():
|
|
||||||
*cs = MitigationStateNotStarted
|
|
||||||
case MitigationStateInProgress.String():
|
|
||||||
*cs = MitigationStateInProgress
|
|
||||||
case MitigationStateNotApplicable.String():
|
|
||||||
*cs = MitigationStateNotApplicable
|
|
||||||
case MitigationStateImplemented.String():
|
|
||||||
*cs = MitigationStateImplemented
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("invalid MitigationState value: %q", val)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cs MitigationState) String() string {
|
|
||||||
var val string
|
|
||||||
|
|
||||||
switch cs {
|
|
||||||
case MitigationStateNotStarted:
|
|
||||||
val = "NOT_STARTED"
|
|
||||||
case MitigationStateInProgress:
|
|
||||||
val = "IN_PROGRESS"
|
|
||||||
case MitigationStateNotApplicable:
|
|
||||||
val = "NOT_APPLICABLE"
|
|
||||||
case MitigationStateImplemented:
|
|
||||||
val = "IMPLEMENTED"
|
|
||||||
}
|
|
||||||
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cs *MitigationState) Scan(value any) error {
|
|
||||||
val, ok := value.(string)
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("invalid scan source for MitigationState, expected string got %T", value)
|
|
||||||
}
|
|
||||||
|
|
||||||
return cs.UnmarshalText([]byte(val))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cs MitigationState) Value() (driver.Value, error) {
|
|
||||||
return cs.String(), nil
|
|
||||||
}
|
|
||||||
@@ -62,11 +62,11 @@ func (r *Risk) ResidualSeverity() float64 {
|
|||||||
return r.ResidualLikelihood * r.ResidualImpact
|
return r.ResidualLikelihood * r.ResidualImpact
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Risks) LoadByMitigationID(
|
func (r *Risks) LoadByMesureID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
cursor *page.Cursor[RiskOrderField],
|
cursor *page.Cursor[RiskOrderField],
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
@@ -87,9 +87,9 @@ WITH rsks AS (
|
|||||||
FROM
|
FROM
|
||||||
risks r
|
risks r
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
risks_mitigations rm ON r.id = rm.risk_id
|
risks_mesures rm ON r.id = rm.risk_id
|
||||||
WHERE
|
WHERE
|
||||||
rm.mitigation_id = @mitigation_id
|
rm.mesure_id = @mesure_id
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
@@ -111,7 +111,7 @@ WHERE %s
|
|||||||
`
|
`
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
||||||
|
|
||||||
args := pgx.NamedArgs{"mitigation_id": mitigationID}
|
args := pgx.NamedArgs{"mesure_id": mesureID}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
|
||||||
rows, err := conn.Query(ctx, q, args)
|
rows, err := conn.Query(ctx, q, args)
|
||||||
|
|||||||
@@ -26,32 +26,32 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
RiskMitigation struct {
|
RiskMesure struct {
|
||||||
RiskID gid.GID `db:"risk_id"`
|
RiskID gid.GID `db:"risk_id"`
|
||||||
MitigationID gid.GID `db:"mitigation_id"`
|
MesureID gid.GID `db:"mesure_id"`
|
||||||
TenantID gid.TenantID `db:"tenant_id"`
|
TenantID gid.TenantID `db:"tenant_id"`
|
||||||
CreatedAt time.Time `db:"created_at"`
|
CreatedAt time.Time `db:"created_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
RiskMitigations []*RiskMitigation
|
RiskMesures []*RiskMesure
|
||||||
)
|
)
|
||||||
|
|
||||||
func (rm RiskMitigation) Insert(
|
func (rm RiskMesure) 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
|
||||||
risks_mitigations (
|
risks_mesures (
|
||||||
risk_id,
|
risk_id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
created_at
|
created_at
|
||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
@risk_id,
|
@risk_id,
|
||||||
@mitigation_id,
|
@mesure_id,
|
||||||
@tenant_id,
|
@tenant_id,
|
||||||
@created_at
|
@created_at
|
||||||
);
|
);
|
||||||
@@ -59,7 +59,7 @@ VALUES (
|
|||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"risk_id": rm.RiskID,
|
"risk_id": rm.RiskID,
|
||||||
"mitigation_id": rm.MitigationID,
|
"mesure_id": rm.MesureID,
|
||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"created_at": rm.CreatedAt,
|
"created_at": rm.CreatedAt,
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ VALUES (
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rm RiskMitigation) Delete(
|
func (rm RiskMesure) Delete(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
@@ -75,18 +75,18 @@ func (rm RiskMitigation) Delete(
|
|||||||
q := `
|
q := `
|
||||||
DELETE
|
DELETE
|
||||||
FROM
|
FROM
|
||||||
risks_mitigations
|
risks_mesures
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND risk_id = @risk_id
|
AND risk_id = @risk_id
|
||||||
AND mitigation_id = @mitigation_id;
|
AND mesure_id = @mesure_id;
|
||||||
`
|
`
|
||||||
|
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"risk_id": rm.RiskID,
|
"risk_id": rm.RiskID,
|
||||||
"mitigation_id": rm.MitigationID,
|
"mesure_id": rm.MesureID,
|
||||||
}
|
}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ import (
|
|||||||
type (
|
type (
|
||||||
Task struct {
|
Task struct {
|
||||||
ID gid.GID `db:"id"`
|
ID gid.GID `db:"id"`
|
||||||
MitigationID gid.GID `db:"mitigation_id"`
|
MesureID gid.GID `db:"mesure_id"`
|
||||||
Name string `db:"name"`
|
Name string `db:"name"`
|
||||||
Description string `db:"description"`
|
Description string `db:"description"`
|
||||||
State TaskState `db:"state"`
|
State TaskState `db:"state"`
|
||||||
@@ -62,7 +62,7 @@ func (c *Task) LoadByID(
|
|||||||
q := `
|
q := `
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
state,
|
state,
|
||||||
@@ -109,7 +109,7 @@ INSERT INTO
|
|||||||
tasks (
|
tasks (
|
||||||
tenant_id,
|
tenant_id,
|
||||||
id,
|
id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
reference_id,
|
reference_id,
|
||||||
@@ -122,7 +122,7 @@ INSERT INTO
|
|||||||
VALUES (
|
VALUES (
|
||||||
@tenant_id,
|
@tenant_id,
|
||||||
@task_id,
|
@task_id,
|
||||||
@mitigation_id,
|
@mesure_id,
|
||||||
@name,
|
@name,
|
||||||
@description,
|
@description,
|
||||||
@reference_id,
|
@reference_id,
|
||||||
@@ -137,7 +137,7 @@ VALUES (
|
|||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"task_id": c.ID,
|
"task_id": c.ID,
|
||||||
"mitigation_id": c.MitigationID,
|
"mesure_id": c.MesureID,
|
||||||
"name": c.Name,
|
"name": c.Name,
|
||||||
"description": c.Description,
|
"description": c.Description,
|
||||||
"reference_id": c.ReferenceID,
|
"reference_id": c.ReferenceID,
|
||||||
@@ -161,7 +161,7 @@ INSERT INTO
|
|||||||
tasks (
|
tasks (
|
||||||
tenant_id,
|
tenant_id,
|
||||||
id,
|
id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
reference_id,
|
reference_id,
|
||||||
@@ -174,7 +174,7 @@ INSERT INTO
|
|||||||
VALUES (
|
VALUES (
|
||||||
@tenant_id,
|
@tenant_id,
|
||||||
@task_id,
|
@task_id,
|
||||||
@mitigation_id,
|
@mesure_id,
|
||||||
@name,
|
@name,
|
||||||
@description,
|
@description,
|
||||||
@reference_id,
|
@reference_id,
|
||||||
@@ -184,13 +184,13 @@ VALUES (
|
|||||||
@created_at,
|
@created_at,
|
||||||
@updated_at
|
@updated_at
|
||||||
)
|
)
|
||||||
ON CONFLICT (mitigation_id, reference_id) DO UPDATE SET
|
ON CONFLICT (mesure_id, reference_id) DO UPDATE SET
|
||||||
name = @name,
|
name = @name,
|
||||||
description = @description,
|
description = @description,
|
||||||
updated_at = @updated_at
|
updated_at = @updated_at
|
||||||
RETURNING
|
RETURNING
|
||||||
id,
|
id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
reference_id,
|
reference_id,
|
||||||
@@ -204,7 +204,7 @@ RETURNING
|
|||||||
args := pgx.StrictNamedArgs{
|
args := pgx.StrictNamedArgs{
|
||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"task_id": c.ID,
|
"task_id": c.ID,
|
||||||
"mitigation_id": c.MitigationID,
|
"mesure_id": c.MesureID,
|
||||||
"name": c.Name,
|
"name": c.Name,
|
||||||
"description": c.Description,
|
"description": c.Description,
|
||||||
"reference_id": c.ReferenceID,
|
"reference_id": c.ReferenceID,
|
||||||
@@ -229,17 +229,17 @@ RETURNING
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Tasks) LoadByMitigationID(
|
func (c *Tasks) LoadByMesureID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
cursor *page.Cursor[TaskOrderField],
|
cursor *page.Cursor[TaskOrderField],
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
state,
|
state,
|
||||||
@@ -252,12 +252,12 @@ FROM
|
|||||||
tasks
|
tasks
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND mitigation_id = @mitigation_id
|
AND mesure_id = @mesure_id
|
||||||
AND %s
|
AND %s
|
||||||
`
|
`
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{"mitigation_id": mitigationID}
|
args := pgx.StrictNamedArgs{"mesure_id": mesureID}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
maps.Copy(args, cursor.SQLArguments())
|
maps.Copy(args, cursor.SQLArguments())
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ WHERE %s
|
|||||||
AND id = @task_id
|
AND id = @task_id
|
||||||
RETURNING
|
RETURNING
|
||||||
id,
|
id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
reference_id,
|
reference_id,
|
||||||
@@ -371,7 +371,7 @@ WHERE %s
|
|||||||
AND id = @task_id
|
AND id = @task_id
|
||||||
RETURNING
|
RETURNING
|
||||||
id,
|
id,
|
||||||
mitigation_id,
|
mesure_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
reference_id,
|
reference_id,
|
||||||
|
|||||||
@@ -76,9 +76,9 @@ func (s ControlService) ListForPolicyID(
|
|||||||
return page.NewPage(controls, cursor), nil
|
return page.NewPage(controls, cursor), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ControlService) ListForMitigationID(
|
func (s ControlService) ListForMesureID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
cursor *page.Cursor[coredata.ControlOrderField],
|
cursor *page.Cursor[coredata.ControlOrderField],
|
||||||
) (*page.Page[*coredata.Control, coredata.ControlOrderField], error) {
|
) (*page.Page[*coredata.Control, coredata.ControlOrderField], error) {
|
||||||
var controls coredata.Controls
|
var controls coredata.Controls
|
||||||
@@ -86,7 +86,7 @@ func (s ControlService) ListForMitigationID(
|
|||||||
err := s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return controls.LoadByMitigationID(ctx, conn, s.svc.scope, mitigationID, cursor)
|
return controls.LoadByMesureID(ctx, conn, s.svc.scope, mesureID, cursor)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -97,14 +97,14 @@ func (s ControlService) ListForMitigationID(
|
|||||||
return page.NewPage(controls, cursor), nil
|
return page.NewPage(controls, cursor), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ControlService) CreateMitigationMapping(
|
func (s ControlService) CreateMesureMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
) error {
|
) error {
|
||||||
controlMitigation := &coredata.ControlMitigation{
|
controlMesure := &coredata.ControlMesure{
|
||||||
ControlID: controlID,
|
ControlID: controlID,
|
||||||
MitigationID: mitigationID,
|
MesureID: mesureID,
|
||||||
TenantID: s.svc.scope.GetTenantID(),
|
TenantID: s.svc.scope.GetTenantID(),
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
}
|
}
|
||||||
@@ -112,19 +112,19 @@ func (s ControlService) CreateMitigationMapping(
|
|||||||
return s.svc.pg.WithConn(
|
return s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return controlMitigation.Insert(ctx, conn, s.svc.scope)
|
return controlMesure.Insert(ctx, conn, s.svc.scope)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ControlService) DeleteMitigationMapping(
|
func (s ControlService) DeleteMesureMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
controlID gid.GID,
|
controlID gid.GID,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
) error {
|
) error {
|
||||||
controlMitigation := &coredata.ControlMitigation{
|
controlMesure := &coredata.ControlMesure{
|
||||||
ControlID: controlID,
|
ControlID: controlID,
|
||||||
MitigationID: mitigationID,
|
MesureID: mesureID,
|
||||||
TenantID: s.svc.scope.GetTenantID(),
|
TenantID: s.svc.scope.GetTenantID(),
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ func (s ControlService) DeleteMitigationMapping(
|
|||||||
return s.svc.pg.WithConn(
|
return s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return controlMitigation.Delete(ctx, conn, s.svc.scope)
|
return controlMesure.Delete(ctx, conn, s.svc.scope)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
383
pkg/probo/mesure_service.go
Normal file
383
pkg/probo/mesure_service.go
Normal file
@@ -0,0 +1,383 @@
|
|||||||
|
// 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 probo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/getprobo/probo/pkg/coredata"
|
||||||
|
"github.com/getprobo/probo/pkg/gid"
|
||||||
|
"github.com/getprobo/probo/pkg/page"
|
||||||
|
"go.gearno.de/crypto/uuid"
|
||||||
|
"go.gearno.de/kit/pg"
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
MesureService struct {
|
||||||
|
svc *TenantService
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateMesureRequest struct {
|
||||||
|
OrganizationID gid.GID
|
||||||
|
Name string
|
||||||
|
Description string
|
||||||
|
Category string
|
||||||
|
Importance coredata.MesureImportance
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateMesureRequest struct {
|
||||||
|
ID gid.GID
|
||||||
|
Name *string
|
||||||
|
Description *string
|
||||||
|
Category *string
|
||||||
|
State *coredata.MesureState
|
||||||
|
Importance *coredata.MesureImportance
|
||||||
|
}
|
||||||
|
|
||||||
|
ImportMesureRequest struct {
|
||||||
|
Mesures []struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Category string `json:"category"`
|
||||||
|
Importance coredata.MesureImportance `json:"importance"`
|
||||||
|
ReferenceID string `json:"reference-id"`
|
||||||
|
Standards []struct {
|
||||||
|
Framework string `json:"framework"`
|
||||||
|
Control string `json:"control"`
|
||||||
|
} `json:"standards"`
|
||||||
|
Tasks []struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
ReferenceID string `json:"reference-id"`
|
||||||
|
RequestedEvidences []struct {
|
||||||
|
ReferenceID string `json:"reference-id"`
|
||||||
|
Type coredata.EvidenceType `json:"type"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
} `json:"requested-evidences"`
|
||||||
|
} `json:"tasks"`
|
||||||
|
} `json:"mesures"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func (s MesureService) ListForRiskID(
|
||||||
|
ctx context.Context,
|
||||||
|
riskID gid.GID,
|
||||||
|
cursor *page.Cursor[coredata.MesureOrderField],
|
||||||
|
) (*page.Page[*coredata.Mesure, coredata.MesureOrderField], error) {
|
||||||
|
var mesures coredata.Mesures
|
||||||
|
|
||||||
|
err := s.svc.pg.WithConn(
|
||||||
|
ctx,
|
||||||
|
func(conn pg.Conn) error {
|
||||||
|
return mesures.LoadByRiskID(ctx, conn, s.svc.scope, riskID, cursor)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return page.NewPage(mesures, cursor), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s MesureService) ListForControlID(
|
||||||
|
ctx context.Context,
|
||||||
|
controlID gid.GID,
|
||||||
|
cursor *page.Cursor[coredata.MesureOrderField],
|
||||||
|
) (*page.Page[*coredata.Mesure, coredata.MesureOrderField], error) {
|
||||||
|
var mesures coredata.Mesures
|
||||||
|
|
||||||
|
err := s.svc.pg.WithConn(
|
||||||
|
ctx,
|
||||||
|
func(conn pg.Conn) error {
|
||||||
|
return mesures.LoadByControlID(ctx, conn, s.svc.scope, controlID, cursor)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return page.NewPage(mesures, cursor), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s MesureService) Get(
|
||||||
|
ctx context.Context,
|
||||||
|
mesureID gid.GID,
|
||||||
|
) (*coredata.Mesure, error) {
|
||||||
|
mesure := &coredata.Mesure{}
|
||||||
|
|
||||||
|
err := s.svc.pg.WithConn(
|
||||||
|
ctx,
|
||||||
|
func(conn pg.Conn) error {
|
||||||
|
return mesure.LoadByID(ctx, conn, s.svc.scope, mesureID)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return mesure, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s MesureService) Import(
|
||||||
|
ctx context.Context,
|
||||||
|
organizationID gid.GID,
|
||||||
|
req ImportMesureRequest,
|
||||||
|
) (*page.Page[*coredata.Mesure, coredata.MesureOrderField], error) {
|
||||||
|
importedMesures := coredata.Mesures{}
|
||||||
|
|
||||||
|
err := s.svc.pg.WithTx(
|
||||||
|
ctx,
|
||||||
|
func(tx pg.Conn) error {
|
||||||
|
for i := range req.Mesures {
|
||||||
|
now := time.Now()
|
||||||
|
|
||||||
|
mesureID, err := gid.NewGID(organizationID.TenantID(), coredata.MesureEntityType)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cannot create global id: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mesure := &coredata.Mesure{
|
||||||
|
ID: mesureID,
|
||||||
|
OrganizationID: organizationID,
|
||||||
|
Name: req.Mesures[i].Name,
|
||||||
|
Description: req.Mesures[i].Description,
|
||||||
|
Category: req.Mesures[i].Category,
|
||||||
|
State: coredata.MesureStateNotStarted,
|
||||||
|
ReferenceID: req.Mesures[i].ReferenceID,
|
||||||
|
Importance: req.Mesures[i].Importance,
|
||||||
|
CreatedAt: now,
|
||||||
|
UpdatedAt: now,
|
||||||
|
}
|
||||||
|
|
||||||
|
importedMesures = append(importedMesures, mesure)
|
||||||
|
|
||||||
|
if err := mesure.Upsert(ctx, tx, s.svc.scope); err != nil {
|
||||||
|
return fmt.Errorf("cannot upsert mesure: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for j := range req.Mesures[i].Tasks {
|
||||||
|
taskID, err := gid.NewGID(organizationID.TenantID(), coredata.TaskEntityType)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cannot create global id: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
task := &coredata.Task{
|
||||||
|
ID: taskID,
|
||||||
|
MesureID: mesure.ID,
|
||||||
|
Name: req.Mesures[i].Tasks[j].Name,
|
||||||
|
Description: req.Mesures[i].Tasks[j].Description,
|
||||||
|
ReferenceID: req.Mesures[i].Tasks[j].ReferenceID,
|
||||||
|
State: coredata.TaskStateTodo,
|
||||||
|
CreatedAt: now,
|
||||||
|
UpdatedAt: now,
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := task.Upsert(ctx, tx, s.svc.scope); err != nil {
|
||||||
|
return fmt.Errorf("cannot upsert task: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for k := range req.Mesures[i].Tasks[j].RequestedEvidences {
|
||||||
|
evidenceID, err := gid.NewGID(organizationID.TenantID(), coredata.EvidenceEntityType)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cannot create global id: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
evidence := &coredata.Evidence{
|
||||||
|
State: coredata.EvidenceStateRequested,
|
||||||
|
ID: evidenceID,
|
||||||
|
TaskID: task.ID,
|
||||||
|
ReferenceID: req.Mesures[i].Tasks[j].RequestedEvidences[k].ReferenceID,
|
||||||
|
Type: req.Mesures[i].Tasks[j].RequestedEvidences[k].Type,
|
||||||
|
Description: req.Mesures[i].Tasks[j].RequestedEvidences[k].Name,
|
||||||
|
CreatedAt: now,
|
||||||
|
UpdatedAt: now,
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := evidence.Upsert(ctx, tx, s.svc.scope); err != nil {
|
||||||
|
return fmt.Errorf("cannot upsert evidence: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, standard := range req.Mesures[i].Standards {
|
||||||
|
framework := &coredata.Framework{}
|
||||||
|
if err := framework.LoadByReferenceID(ctx, tx, s.svc.scope, standard.Framework); err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
control := &coredata.Control{}
|
||||||
|
if err := control.LoadByFrameworkIDAndReferenceID(ctx, tx, s.svc.scope, framework.ID, standard.Control); err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
controlMesure := &coredata.ControlMesure{
|
||||||
|
ControlID: control.ID,
|
||||||
|
MesureID: mesure.ID,
|
||||||
|
CreatedAt: now,
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := controlMesure.Upsert(ctx, tx, s.svc.scope); err != nil {
|
||||||
|
return fmt.Errorf("cannot insert control mesure: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("cannot import mesures: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cursor := page.NewCursor(
|
||||||
|
len(importedMesures),
|
||||||
|
nil,
|
||||||
|
page.Head,
|
||||||
|
page.OrderBy[coredata.MesureOrderField]{
|
||||||
|
Field: coredata.MesureOrderFieldCreatedAt,
|
||||||
|
Direction: page.OrderDirectionAsc,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
return page.NewPage(importedMesures, cursor), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s MesureService) Update(
|
||||||
|
ctx context.Context,
|
||||||
|
req UpdateMesureRequest,
|
||||||
|
) (*coredata.Mesure, error) {
|
||||||
|
mesure := &coredata.Mesure{ID: req.ID}
|
||||||
|
|
||||||
|
err := s.svc.pg.WithTx(
|
||||||
|
ctx,
|
||||||
|
func(conn pg.Conn) error {
|
||||||
|
if err := mesure.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
|
||||||
|
return fmt.Errorf("cannot load mesure: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.Name != nil {
|
||||||
|
mesure.Name = *req.Name
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.Description != nil {
|
||||||
|
mesure.Description = *req.Description
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.Category != nil {
|
||||||
|
mesure.Category = *req.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.State != nil {
|
||||||
|
mesure.State = *req.State
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.Importance != nil {
|
||||||
|
mesure.Importance = *req.Importance
|
||||||
|
}
|
||||||
|
|
||||||
|
mesure.UpdatedAt = time.Now()
|
||||||
|
|
||||||
|
if err := mesure.Update(ctx, conn, s.svc.scope); err != nil {
|
||||||
|
return fmt.Errorf("cannot update mesure: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return mesure, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s MesureService) ListForOrganizationID(
|
||||||
|
ctx context.Context,
|
||||||
|
organizationID gid.GID,
|
||||||
|
cursor *page.Cursor[coredata.MesureOrderField],
|
||||||
|
) (*page.Page[*coredata.Mesure, coredata.MesureOrderField], error) {
|
||||||
|
var mesures coredata.Mesures
|
||||||
|
|
||||||
|
err := s.svc.pg.WithConn(
|
||||||
|
ctx,
|
||||||
|
func(conn pg.Conn) error {
|
||||||
|
return mesures.LoadByOrganizationID(
|
||||||
|
ctx,
|
||||||
|
conn,
|
||||||
|
s.svc.scope,
|
||||||
|
organizationID,
|
||||||
|
cursor,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return page.NewPage(mesures, cursor), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s MesureService) Create(
|
||||||
|
ctx context.Context,
|
||||||
|
req CreateMesureRequest,
|
||||||
|
) (*coredata.Mesure, error) {
|
||||||
|
now := time.Now()
|
||||||
|
mesureID, err := gid.NewGID(s.svc.scope.GetTenantID(), coredata.MesureEntityType)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("cannot create mesure global id: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
referenceID, err := uuid.NewV4()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("cannot generate reference id: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mesure := &coredata.Mesure{
|
||||||
|
ID: mesureID,
|
||||||
|
OrganizationID: req.OrganizationID,
|
||||||
|
Name: req.Name,
|
||||||
|
Description: req.Description,
|
||||||
|
Category: req.Category,
|
||||||
|
ReferenceID: "custom-mesure-" + referenceID.String(),
|
||||||
|
State: coredata.MesureStateNotStarted,
|
||||||
|
Importance: req.Importance,
|
||||||
|
CreatedAt: now,
|
||||||
|
UpdatedAt: now,
|
||||||
|
}
|
||||||
|
|
||||||
|
err = s.svc.pg.WithTx(
|
||||||
|
ctx,
|
||||||
|
func(conn pg.Conn) error {
|
||||||
|
if err := mesure.Insert(ctx, conn, s.svc.scope); err != nil {
|
||||||
|
return fmt.Errorf("cannot insert mesure: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return mesure, nil
|
||||||
|
}
|
||||||
@@ -1,383 +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 probo
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/getprobo/probo/pkg/coredata"
|
|
||||||
"github.com/getprobo/probo/pkg/gid"
|
|
||||||
"github.com/getprobo/probo/pkg/page"
|
|
||||||
"go.gearno.de/crypto/uuid"
|
|
||||||
"go.gearno.de/kit/pg"
|
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
MitigationService struct {
|
|
||||||
svc *TenantService
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateMitigationRequest struct {
|
|
||||||
OrganizationID gid.GID
|
|
||||||
Name string
|
|
||||||
Description string
|
|
||||||
Category string
|
|
||||||
Importance coredata.MitigationImportance
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateMitigationRequest struct {
|
|
||||||
ID gid.GID
|
|
||||||
Name *string
|
|
||||||
Description *string
|
|
||||||
Category *string
|
|
||||||
State *coredata.MitigationState
|
|
||||||
Importance *coredata.MitigationImportance
|
|
||||||
}
|
|
||||||
|
|
||||||
ImportMitigationRequest struct {
|
|
||||||
Mitigations []struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
Description string `json:"description"`
|
|
||||||
Category string `json:"category"`
|
|
||||||
Importance coredata.MitigationImportance `json:"importance"`
|
|
||||||
ReferenceID string `json:"reference-id"`
|
|
||||||
Standards []struct {
|
|
||||||
Framework string `json:"framework"`
|
|
||||||
Control string `json:"control"`
|
|
||||||
} `json:"standards"`
|
|
||||||
Tasks []struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
Description string `json:"description"`
|
|
||||||
ReferenceID string `json:"reference-id"`
|
|
||||||
RequestedEvidences []struct {
|
|
||||||
ReferenceID string `json:"reference-id"`
|
|
||||||
Type coredata.EvidenceType `json:"type"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
} `json:"requested-evidences"`
|
|
||||||
} `json:"tasks"`
|
|
||||||
} `json:"mitigations"`
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func (s MitigationService) ListForRiskID(
|
|
||||||
ctx context.Context,
|
|
||||||
riskID gid.GID,
|
|
||||||
cursor *page.Cursor[coredata.MitigationOrderField],
|
|
||||||
) (*page.Page[*coredata.Mitigation, coredata.MitigationOrderField], error) {
|
|
||||||
var mitigations coredata.Mitigations
|
|
||||||
|
|
||||||
err := s.svc.pg.WithConn(
|
|
||||||
ctx,
|
|
||||||
func(conn pg.Conn) error {
|
|
||||||
return mitigations.LoadByRiskID(ctx, conn, s.svc.scope, riskID, cursor)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return page.NewPage(mitigations, cursor), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s MitigationService) ListForControlID(
|
|
||||||
ctx context.Context,
|
|
||||||
controlID gid.GID,
|
|
||||||
cursor *page.Cursor[coredata.MitigationOrderField],
|
|
||||||
) (*page.Page[*coredata.Mitigation, coredata.MitigationOrderField], error) {
|
|
||||||
var mitigations coredata.Mitigations
|
|
||||||
|
|
||||||
err := s.svc.pg.WithConn(
|
|
||||||
ctx,
|
|
||||||
func(conn pg.Conn) error {
|
|
||||||
return mitigations.LoadByControlID(ctx, conn, s.svc.scope, controlID, cursor)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return page.NewPage(mitigations, cursor), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s MitigationService) Get(
|
|
||||||
ctx context.Context,
|
|
||||||
mitigationID gid.GID,
|
|
||||||
) (*coredata.Mitigation, error) {
|
|
||||||
mitigation := &coredata.Mitigation{}
|
|
||||||
|
|
||||||
err := s.svc.pg.WithConn(
|
|
||||||
ctx,
|
|
||||||
func(conn pg.Conn) error {
|
|
||||||
return mitigation.LoadByID(ctx, conn, s.svc.scope, mitigationID)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return mitigation, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s MitigationService) Import(
|
|
||||||
ctx context.Context,
|
|
||||||
organizationID gid.GID,
|
|
||||||
req ImportMitigationRequest,
|
|
||||||
) (*page.Page[*coredata.Mitigation, coredata.MitigationOrderField], error) {
|
|
||||||
importedMitigations := coredata.Mitigations{}
|
|
||||||
|
|
||||||
err := s.svc.pg.WithTx(
|
|
||||||
ctx,
|
|
||||||
func(tx pg.Conn) error {
|
|
||||||
for i := range req.Mitigations {
|
|
||||||
now := time.Now()
|
|
||||||
|
|
||||||
mitigationID, err := gid.NewGID(organizationID.TenantID(), coredata.MitigationEntityType)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("cannot create global id: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
mitigation := &coredata.Mitigation{
|
|
||||||
ID: mitigationID,
|
|
||||||
OrganizationID: organizationID,
|
|
||||||
Name: req.Mitigations[i].Name,
|
|
||||||
Description: req.Mitigations[i].Description,
|
|
||||||
Category: req.Mitigations[i].Category,
|
|
||||||
State: coredata.MitigationStateNotStarted,
|
|
||||||
ReferenceID: req.Mitigations[i].ReferenceID,
|
|
||||||
Importance: req.Mitigations[i].Importance,
|
|
||||||
CreatedAt: now,
|
|
||||||
UpdatedAt: now,
|
|
||||||
}
|
|
||||||
|
|
||||||
importedMitigations = append(importedMitigations, mitigation)
|
|
||||||
|
|
||||||
if err := mitigation.Upsert(ctx, tx, s.svc.scope); err != nil {
|
|
||||||
return fmt.Errorf("cannot upsert mitigation: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
for j := range req.Mitigations[i].Tasks {
|
|
||||||
taskID, err := gid.NewGID(organizationID.TenantID(), coredata.TaskEntityType)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("cannot create global id: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
task := &coredata.Task{
|
|
||||||
ID: taskID,
|
|
||||||
MitigationID: mitigation.ID,
|
|
||||||
Name: req.Mitigations[i].Tasks[j].Name,
|
|
||||||
Description: req.Mitigations[i].Tasks[j].Description,
|
|
||||||
ReferenceID: req.Mitigations[i].Tasks[j].ReferenceID,
|
|
||||||
State: coredata.TaskStateTodo,
|
|
||||||
CreatedAt: now,
|
|
||||||
UpdatedAt: now,
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := task.Upsert(ctx, tx, s.svc.scope); err != nil {
|
|
||||||
return fmt.Errorf("cannot upsert task: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
for k := range req.Mitigations[i].Tasks[j].RequestedEvidences {
|
|
||||||
evidenceID, err := gid.NewGID(organizationID.TenantID(), coredata.EvidenceEntityType)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("cannot create global id: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
evidence := &coredata.Evidence{
|
|
||||||
State: coredata.EvidenceStateRequested,
|
|
||||||
ID: evidenceID,
|
|
||||||
TaskID: task.ID,
|
|
||||||
ReferenceID: req.Mitigations[i].Tasks[j].RequestedEvidences[k].ReferenceID,
|
|
||||||
Type: req.Mitigations[i].Tasks[j].RequestedEvidences[k].Type,
|
|
||||||
Description: req.Mitigations[i].Tasks[j].RequestedEvidences[k].Name,
|
|
||||||
CreatedAt: now,
|
|
||||||
UpdatedAt: now,
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := evidence.Upsert(ctx, tx, s.svc.scope); err != nil {
|
|
||||||
return fmt.Errorf("cannot upsert evidence: %w", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, standard := range req.Mitigations[i].Standards {
|
|
||||||
framework := &coredata.Framework{}
|
|
||||||
if err := framework.LoadByReferenceID(ctx, tx, s.svc.scope, standard.Framework); err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
control := &coredata.Control{}
|
|
||||||
if err := control.LoadByFrameworkIDAndReferenceID(ctx, tx, s.svc.scope, framework.ID, standard.Control); err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
controlMitigation := &coredata.ControlMitigation{
|
|
||||||
ControlID: control.ID,
|
|
||||||
MitigationID: mitigation.ID,
|
|
||||||
CreatedAt: now,
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := controlMitigation.Upsert(ctx, tx, s.svc.scope); err != nil {
|
|
||||||
return fmt.Errorf("cannot insert control mitigation: %w", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("cannot import mitigations: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
cursor := page.NewCursor(
|
|
||||||
len(importedMitigations),
|
|
||||||
nil,
|
|
||||||
page.Head,
|
|
||||||
page.OrderBy[coredata.MitigationOrderField]{
|
|
||||||
Field: coredata.MitigationOrderFieldCreatedAt,
|
|
||||||
Direction: page.OrderDirectionAsc,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
return page.NewPage(importedMitigations, cursor), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s MitigationService) Update(
|
|
||||||
ctx context.Context,
|
|
||||||
req UpdateMitigationRequest,
|
|
||||||
) (*coredata.Mitigation, error) {
|
|
||||||
mitigation := &coredata.Mitigation{ID: req.ID}
|
|
||||||
|
|
||||||
err := s.svc.pg.WithTx(
|
|
||||||
ctx,
|
|
||||||
func(conn pg.Conn) error {
|
|
||||||
if err := mitigation.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
|
|
||||||
return fmt.Errorf("cannot load mitigation: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.Name != nil {
|
|
||||||
mitigation.Name = *req.Name
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.Description != nil {
|
|
||||||
mitigation.Description = *req.Description
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.Category != nil {
|
|
||||||
mitigation.Category = *req.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.State != nil {
|
|
||||||
mitigation.State = *req.State
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.Importance != nil {
|
|
||||||
mitigation.Importance = *req.Importance
|
|
||||||
}
|
|
||||||
|
|
||||||
mitigation.UpdatedAt = time.Now()
|
|
||||||
|
|
||||||
if err := mitigation.Update(ctx, conn, s.svc.scope); err != nil {
|
|
||||||
return fmt.Errorf("cannot update mitigation: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return mitigation, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s MitigationService) ListForOrganizationID(
|
|
||||||
ctx context.Context,
|
|
||||||
organizationID gid.GID,
|
|
||||||
cursor *page.Cursor[coredata.MitigationOrderField],
|
|
||||||
) (*page.Page[*coredata.Mitigation, coredata.MitigationOrderField], error) {
|
|
||||||
var mitigations coredata.Mitigations
|
|
||||||
|
|
||||||
err := s.svc.pg.WithConn(
|
|
||||||
ctx,
|
|
||||||
func(conn pg.Conn) error {
|
|
||||||
return mitigations.LoadByOrganizationID(
|
|
||||||
ctx,
|
|
||||||
conn,
|
|
||||||
s.svc.scope,
|
|
||||||
organizationID,
|
|
||||||
cursor,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return page.NewPage(mitigations, cursor), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s MitigationService) Create(
|
|
||||||
ctx context.Context,
|
|
||||||
req CreateMitigationRequest,
|
|
||||||
) (*coredata.Mitigation, error) {
|
|
||||||
now := time.Now()
|
|
||||||
mitigationID, err := gid.NewGID(s.svc.scope.GetTenantID(), coredata.MitigationEntityType)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("cannot create mitigation global id: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
referenceID, err := uuid.NewV4()
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("cannot generate reference id: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
mitigation := &coredata.Mitigation{
|
|
||||||
ID: mitigationID,
|
|
||||||
OrganizationID: req.OrganizationID,
|
|
||||||
Name: req.Name,
|
|
||||||
Description: req.Description,
|
|
||||||
Category: req.Category,
|
|
||||||
ReferenceID: "custom-mitigation-" + referenceID.String(),
|
|
||||||
State: coredata.MitigationStateNotStarted,
|
|
||||||
Importance: req.Importance,
|
|
||||||
CreatedAt: now,
|
|
||||||
UpdatedAt: now,
|
|
||||||
}
|
|
||||||
|
|
||||||
err = s.svc.pg.WithTx(
|
|
||||||
ctx,
|
|
||||||
func(conn pg.Conn) error {
|
|
||||||
if err := mitigation.Insert(ctx, conn, s.svc.scope); err != nil {
|
|
||||||
return fmt.Errorf("cannot insert mitigation: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return mitigation, nil
|
|
||||||
}
|
|
||||||
@@ -66,7 +66,7 @@ func (s OrganizationService) Create(
|
|||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
if err := organization.Insert(ctx, conn); err != nil {
|
if err := organization.Insert(ctx, conn); err != nil {
|
||||||
return fmt.Errorf("cannot insert mitigation: %w", err)
|
return fmt.Errorf("cannot insert organization: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s RiskService) ListForMitigationID(
|
func (s RiskService) ListForMesureID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
cursor *page.Cursor[coredata.RiskOrderField],
|
cursor *page.Cursor[coredata.RiskOrderField],
|
||||||
) (*page.Page[*coredata.Risk, coredata.RiskOrderField], error) {
|
) (*page.Page[*coredata.Risk, coredata.RiskOrderField], error) {
|
||||||
var risks coredata.Risks
|
var risks coredata.Risks
|
||||||
@@ -65,7 +65,7 @@ func (s RiskService) ListForMitigationID(
|
|||||||
err := s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return risks.LoadByMitigationID(ctx, conn, s.svc.scope, mitigationID, cursor)
|
return risks.LoadByMesureID(ctx, conn, s.svc.scope, mesureID, cursor)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -116,14 +116,14 @@ func (s RiskService) DeletePolicyMapping(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s RiskService) CreateMitigationMapping(
|
func (s RiskService) CreateMesureMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
riskID gid.GID,
|
riskID gid.GID,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
) error {
|
) error {
|
||||||
riskMitigation := &coredata.RiskMitigation{
|
riskMesure := &coredata.RiskMesure{
|
||||||
RiskID: riskID,
|
RiskID: riskID,
|
||||||
MitigationID: mitigationID,
|
MesureID: mesureID,
|
||||||
TenantID: s.svc.scope.GetTenantID(),
|
TenantID: s.svc.scope.GetTenantID(),
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
}
|
}
|
||||||
@@ -131,19 +131,19 @@ func (s RiskService) CreateMitigationMapping(
|
|||||||
return s.svc.pg.WithConn(
|
return s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return riskMitigation.Insert(ctx, conn, s.svc.scope)
|
return riskMesure.Insert(ctx, conn, s.svc.scope)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s RiskService) DeleteMitigationMapping(
|
func (s RiskService) DeleteMesureMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
riskID gid.GID,
|
riskID gid.GID,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
) error {
|
) error {
|
||||||
riskMitigation := &coredata.RiskMitigation{
|
riskMesure := &coredata.RiskMesure{
|
||||||
RiskID: riskID,
|
RiskID: riskID,
|
||||||
MitigationID: mitigationID,
|
MesureID: mesureID,
|
||||||
TenantID: s.svc.scope.GetTenantID(),
|
TenantID: s.svc.scope.GetTenantID(),
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ func (s RiskService) DeleteMitigationMapping(
|
|||||||
return s.svc.pg.WithConn(
|
return s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return riskMitigation.Delete(ctx, conn, s.svc.scope)
|
return riskMesure.Delete(ctx, conn, s.svc.scope)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ type (
|
|||||||
scope coredata.Scoper
|
scope coredata.Scoper
|
||||||
|
|
||||||
Frameworks *FrameworkService
|
Frameworks *FrameworkService
|
||||||
Mitigations *MitigationService
|
Mesures *MesureService
|
||||||
Tasks *TaskService
|
Tasks *TaskService
|
||||||
Evidences *EvidenceService
|
Evidences *EvidenceService
|
||||||
Organizations *OrganizationService
|
Organizations *OrganizationService
|
||||||
@@ -80,7 +80,7 @@ func (s *Service) WithTenant(tenantID gid.TenantID) *TenantService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tenantService.Frameworks = &FrameworkService{svc: tenantService}
|
tenantService.Frameworks = &FrameworkService{svc: tenantService}
|
||||||
tenantService.Mitigations = &MitigationService{svc: tenantService}
|
tenantService.Mesures = &MesureService{svc: tenantService}
|
||||||
tenantService.Tasks = &TaskService{svc: tenantService}
|
tenantService.Tasks = &TaskService{svc: tenantService}
|
||||||
tenantService.Evidences = &EvidenceService{svc: tenantService}
|
tenantService.Evidences = &EvidenceService{svc: tenantService}
|
||||||
tenantService.Peoples = &PeopleService{svc: tenantService}
|
tenantService.Peoples = &PeopleService{svc: tenantService}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
CreateTaskRequest struct {
|
CreateTaskRequest struct {
|
||||||
MitigationID gid.GID
|
MesureID gid.GID
|
||||||
Name string
|
Name string
|
||||||
Description string
|
Description string
|
||||||
TimeEstimate *time.Duration
|
TimeEstimate *time.Duration
|
||||||
@@ -65,7 +65,7 @@ func (s TaskService) Create(
|
|||||||
|
|
||||||
task := &coredata.Task{
|
task := &coredata.Task{
|
||||||
ID: taskID,
|
ID: taskID,
|
||||||
MitigationID: req.MitigationID,
|
MesureID: req.MesureID,
|
||||||
Name: req.Name,
|
Name: req.Name,
|
||||||
Description: req.Description,
|
Description: req.Description,
|
||||||
TimeEstimate: req.TimeEstimate,
|
TimeEstimate: req.TimeEstimate,
|
||||||
@@ -215,9 +215,9 @@ func (s TaskService) Delete(
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s TaskService) ListForMitigationID(
|
func (s TaskService) ListForMesureID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
mitigationID gid.GID,
|
mesureID gid.GID,
|
||||||
cursor *page.Cursor[coredata.TaskOrderField],
|
cursor *page.Cursor[coredata.TaskOrderField],
|
||||||
) (*page.Page[*coredata.Task, coredata.TaskOrderField], error) {
|
) (*page.Page[*coredata.Task, coredata.TaskOrderField], error) {
|
||||||
var tasks coredata.Tasks
|
var tasks coredata.Tasks
|
||||||
@@ -225,11 +225,11 @@ func (s TaskService) ListForMitigationID(
|
|||||||
err := s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return tasks.LoadByMitigationID(
|
return tasks.LoadByMesureID(
|
||||||
ctx,
|
ctx,
|
||||||
conn,
|
conn,
|
||||||
s.svc.scope,
|
s.svc.scope,
|
||||||
mitigationID,
|
mesureID,
|
||||||
cursor,
|
cursor,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,23 +39,23 @@ enum OrderDirection
|
|||||||
DESC @goEnum(value: "github.com/getprobo/probo/pkg/page.OrderDirectionDesc")
|
DESC @goEnum(value: "github.com/getprobo/probo/pkg/page.OrderDirectionDesc")
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MitigationState
|
enum MesureState
|
||||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.MitigationState") {
|
@goModel(model: "github.com/getprobo/probo/pkg/coredata.MesureState") {
|
||||||
NOT_STARTED
|
NOT_STARTED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationStateNotStarted"
|
value: "github.com/getprobo/probo/pkg/coredata.MesureStateNotStarted"
|
||||||
)
|
)
|
||||||
IN_PROGRESS
|
IN_PROGRESS
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationStateInProgress"
|
value: "github.com/getprobo/probo/pkg/coredata.MesureStateInProgress"
|
||||||
)
|
)
|
||||||
NOT_APPLICABLE
|
NOT_APPLICABLE
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationStateNotApplicable"
|
value: "github.com/getprobo/probo/pkg/coredata.MesureStateNotApplicable"
|
||||||
)
|
)
|
||||||
IMPLEMENTED
|
IMPLEMENTED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationStateImplemented"
|
value: "github.com/getprobo/probo/pkg/coredata.MesureStateImplemented"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,21 +91,19 @@ enum PeopleKind
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MitigationImportance
|
enum MesureImportance
|
||||||
@goModel(
|
@goModel(model: "github.com/getprobo/probo/pkg/coredata.MesureImportance") {
|
||||||
model: "github.com/getprobo/probo/pkg/coredata.MitigationImportance"
|
|
||||||
) {
|
|
||||||
MANDATORY
|
MANDATORY
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationImportanceMandatory"
|
value: "github.com/getprobo/probo/pkg/coredata.MesureImportanceMandatory"
|
||||||
)
|
)
|
||||||
PREFERRED
|
PREFERRED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationImportancePreferred"
|
value: "github.com/getprobo/probo/pkg/coredata.MesureImportancePreferred"
|
||||||
)
|
)
|
||||||
ADVANCED
|
ADVANCED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationImportanceAdvanced"
|
value: "github.com/getprobo/probo/pkg/coredata.MesureImportanceAdvanced"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,13 +211,11 @@ enum ControlOrderField
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MitigationOrderField
|
enum MesureOrderField
|
||||||
@goModel(
|
@goModel(model: "github.com/getprobo/probo/pkg/coredata.MesureOrderField") {
|
||||||
model: "github.com/getprobo/probo/pkg/coredata.MitigationOrderField"
|
|
||||||
) {
|
|
||||||
CREATED_AT
|
CREATED_AT
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationOrderFieldCreatedAt"
|
value: "github.com/getprobo/probo/pkg/coredata.MesureOrderFieldCreatedAt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,12 +303,12 @@ input ControlOrder
|
|||||||
field: ControlOrderField!
|
field: ControlOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
input MitigationOrder
|
input MesureOrder
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.MitigationOrderBy"
|
model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.MesureOrderBy"
|
||||||
) {
|
) {
|
||||||
direction: OrderDirection!
|
direction: OrderDirection!
|
||||||
field: MitigationOrderField!
|
field: MesureOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
input TaskOrder
|
input TaskOrder
|
||||||
@@ -406,13 +402,13 @@ type Organization implements Node {
|
|||||||
orderBy: PolicyOrder
|
orderBy: PolicyOrder
|
||||||
): PolicyConnection! @goField(forceResolver: true)
|
): PolicyConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
mitigations(
|
mesures(
|
||||||
first: Int
|
first: Int
|
||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: MitigationOrder
|
orderBy: MesureOrder
|
||||||
): MitigationConnection! @goField(forceResolver: true)
|
): MesureConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
risks(
|
risks(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -516,13 +512,13 @@ type Control implements Node {
|
|||||||
name: String!
|
name: String!
|
||||||
description: String!
|
description: String!
|
||||||
|
|
||||||
mitigations(
|
mesures(
|
||||||
first: Int
|
first: Int
|
||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: MitigationOrder
|
orderBy: MesureOrder
|
||||||
): MitigationConnection! @goField(forceResolver: true)
|
): MesureConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
policies(
|
policies(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -536,13 +532,13 @@ type Control implements Node {
|
|||||||
updatedAt: Datetime!
|
updatedAt: Datetime!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Mitigation implements Node {
|
type Mesure implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
category: String!
|
category: String!
|
||||||
name: String!
|
name: String!
|
||||||
description: String!
|
description: String!
|
||||||
state: MitigationState!
|
state: MesureState!
|
||||||
importance: MitigationImportance!
|
importance: MesureImportance!
|
||||||
|
|
||||||
tasks(
|
tasks(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -641,13 +637,13 @@ type Risk implements Node {
|
|||||||
|
|
||||||
owner: People @goField(forceResolver: true)
|
owner: People @goField(forceResolver: true)
|
||||||
|
|
||||||
mitigations(
|
mesures(
|
||||||
first: Int
|
first: Int
|
||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: MitigationOrder
|
orderBy: MesureOrder
|
||||||
): MitigationConnection! @goField(forceResolver: true)
|
): MesureConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
policies(
|
policies(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -748,14 +744,14 @@ type ControlEdge {
|
|||||||
node: Control!
|
node: Control!
|
||||||
}
|
}
|
||||||
|
|
||||||
type MitigationConnection {
|
type MesureConnection {
|
||||||
edges: [MitigationEdge!]!
|
edges: [MesureEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
}
|
}
|
||||||
|
|
||||||
type MitigationEdge {
|
type MesureEdge {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: Mitigation!
|
node: Mesure!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TaskConnection {
|
type TaskConnection {
|
||||||
@@ -847,21 +843,21 @@ type Mutation {
|
|||||||
importFramework(input: ImportFrameworkInput!): ImportFrameworkPayload!
|
importFramework(input: ImportFrameworkInput!): ImportFrameworkPayload!
|
||||||
deleteFramework(input: DeleteFrameworkInput!): DeleteFrameworkPayload!
|
deleteFramework(input: DeleteFrameworkInput!): DeleteFrameworkPayload!
|
||||||
|
|
||||||
# Mitigation mutations
|
# Mesure mutations
|
||||||
createMitigation(input: CreateMitigationInput!): CreateMitigationPayload!
|
createMesure(input: CreateMesureInput!): CreateMesurePayload!
|
||||||
updateMitigation(input: UpdateMitigationInput!): UpdateMitigationPayload!
|
updateMesure(input: UpdateMesureInput!): UpdateMesurePayload!
|
||||||
importMitigation(input: ImportMitigationInput!): ImportMitigationPayload!
|
importMesure(input: ImportMesureInput!): ImportMesurePayload!
|
||||||
|
|
||||||
# Control mutations
|
# Control mutations
|
||||||
createControlMitigationMapping(
|
createControlMesureMapping(
|
||||||
input: CreateControlMitigationMappingInput!
|
input: CreateControlMesureMappingInput!
|
||||||
): CreateControlMitigationMappingPayload!
|
): CreateControlMesureMappingPayload!
|
||||||
createControlPolicyMapping(
|
createControlPolicyMapping(
|
||||||
input: CreateControlPolicyMappingInput!
|
input: CreateControlPolicyMappingInput!
|
||||||
): CreateControlPolicyMappingPayload!
|
): CreateControlPolicyMappingPayload!
|
||||||
deleteControlMitigationMapping(
|
deleteControlMesureMapping(
|
||||||
input: DeleteControlMitigationMappingInput!
|
input: DeleteControlMesureMappingInput!
|
||||||
): DeleteControlMitigationMappingPayload!
|
): DeleteControlMesureMappingPayload!
|
||||||
deleteControlPolicyMapping(
|
deleteControlPolicyMapping(
|
||||||
input: DeleteControlPolicyMappingInput!
|
input: DeleteControlPolicyMappingInput!
|
||||||
): DeleteControlPolicyMappingPayload!
|
): DeleteControlPolicyMappingPayload!
|
||||||
@@ -877,12 +873,12 @@ type Mutation {
|
|||||||
createRisk(input: CreateRiskInput!): CreateRiskPayload!
|
createRisk(input: CreateRiskInput!): CreateRiskPayload!
|
||||||
updateRisk(input: UpdateRiskInput!): UpdateRiskPayload!
|
updateRisk(input: UpdateRiskInput!): UpdateRiskPayload!
|
||||||
deleteRisk(input: DeleteRiskInput!): DeleteRiskPayload!
|
deleteRisk(input: DeleteRiskInput!): DeleteRiskPayload!
|
||||||
createRiskMitigationMapping(
|
createRiskMesureMapping(
|
||||||
input: CreateRiskMitigationMappingInput!
|
input: CreateRiskMesureMappingInput!
|
||||||
): CreateRiskMitigationMappingPayload!
|
): CreateRiskMesureMappingPayload!
|
||||||
deleteRiskMitigationMapping(
|
deleteRiskMesureMapping(
|
||||||
input: DeleteRiskMitigationMappingInput!
|
input: DeleteRiskMesureMappingInput!
|
||||||
): DeleteRiskMitigationMappingPayload!
|
): DeleteRiskMesureMappingPayload!
|
||||||
|
|
||||||
createRiskPolicyMapping(
|
createRiskPolicyMapping(
|
||||||
input: CreateRiskPolicyMappingInput!
|
input: CreateRiskPolicyMappingInput!
|
||||||
@@ -1019,30 +1015,30 @@ input DeleteFrameworkInput {
|
|||||||
frameworkId: ID!
|
frameworkId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateMitigationInput {
|
input CreateMesureInput {
|
||||||
organizationId: ID!
|
organizationId: ID!
|
||||||
name: String!
|
name: String!
|
||||||
description: String!
|
description: String!
|
||||||
category: String!
|
category: String!
|
||||||
importance: MitigationImportance!
|
importance: MesureImportance!
|
||||||
}
|
}
|
||||||
|
|
||||||
input UpdateMitigationInput {
|
input UpdateMesureInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String
|
name: String
|
||||||
description: String
|
description: String
|
||||||
category: String
|
category: String
|
||||||
state: MitigationState
|
state: MesureState
|
||||||
importance: MitigationImportance
|
importance: MesureImportance
|
||||||
}
|
}
|
||||||
|
|
||||||
input ImportMitigationInput {
|
input ImportMesureInput {
|
||||||
organizationId: ID!
|
organizationId: ID!
|
||||||
file: Upload!
|
file: Upload!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateTaskInput {
|
input CreateTaskInput {
|
||||||
mitigationId: ID!
|
mesureId: ID!
|
||||||
name: String!
|
name: String!
|
||||||
description: String!
|
description: String!
|
||||||
timeEstimate: Duration
|
timeEstimate: Duration
|
||||||
@@ -1070,9 +1066,9 @@ input UnassignTaskInput {
|
|||||||
taskId: ID!
|
taskId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateControlMitigationMappingInput {
|
input CreateControlMesureMappingInput {
|
||||||
controlId: ID!
|
controlId: ID!
|
||||||
mitigationId: ID!
|
mesureId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateControlPolicyMappingInput {
|
input CreateControlPolicyMappingInput {
|
||||||
@@ -1080,9 +1076,9 @@ input CreateControlPolicyMappingInput {
|
|||||||
policyId: ID!
|
policyId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteControlMitigationMappingInput {
|
input DeleteControlMesureMappingInput {
|
||||||
controlId: ID!
|
controlId: ID!
|
||||||
mitigationId: ID!
|
mesureId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteControlPolicyMappingInput {
|
input DeleteControlPolicyMappingInput {
|
||||||
@@ -1118,14 +1114,14 @@ input DeleteRiskInput {
|
|||||||
riskId: ID!
|
riskId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateRiskMitigationMappingInput {
|
input CreateRiskMesureMappingInput {
|
||||||
riskId: ID!
|
riskId: ID!
|
||||||
mitigationId: ID!
|
mesureId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteRiskMitigationMappingInput {
|
input DeleteRiskMesureMappingInput {
|
||||||
riskId: ID!
|
riskId: ID!
|
||||||
mitigationId: ID!
|
mesureId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateRiskPolicyMappingInput {
|
input CreateRiskPolicyMappingInput {
|
||||||
@@ -1267,16 +1263,16 @@ type DeleteFrameworkPayload {
|
|||||||
deletedFrameworkId: ID!
|
deletedFrameworkId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateMitigationPayload {
|
type CreateMesurePayload {
|
||||||
mitigationEdge: MitigationEdge!
|
mesureEdge: MesureEdge!
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateMitigationPayload {
|
type UpdateMesurePayload {
|
||||||
mitigation: Mitigation!
|
mesure: Mesure!
|
||||||
}
|
}
|
||||||
|
|
||||||
type ImportMitigationPayload {
|
type ImportMesurePayload {
|
||||||
mitigationEdges: [MitigationEdge!]!
|
mesureEdges: [MesureEdge!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateTaskPayload {
|
type CreateTaskPayload {
|
||||||
@@ -1299,7 +1295,7 @@ type UnassignTaskPayload {
|
|||||||
task: Task!
|
task: Task!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlMitigationMappingPayload {
|
type CreateControlMesureMappingPayload {
|
||||||
success: Boolean!
|
success: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1307,7 +1303,7 @@ type CreateControlPolicyMappingPayload {
|
|||||||
success: Boolean!
|
success: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlMitigationMappingPayload {
|
type DeleteControlMesureMappingPayload {
|
||||||
success: Boolean!
|
success: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1327,11 +1323,11 @@ type DeleteRiskPayload {
|
|||||||
deletedRiskId: ID!
|
deletedRiskId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateRiskMitigationMappingPayload {
|
type CreateRiskMesureMappingPayload {
|
||||||
success: Boolean!
|
success: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteRiskMitigationMappingPayload {
|
type DeleteRiskMesureMappingPayload {
|
||||||
success: Boolean!
|
success: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -20,31 +20,31 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
MitigationOrderBy OrderBy[coredata.MitigationOrderField]
|
MesureOrderBy OrderBy[coredata.MesureOrderField]
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewMitigationConnection(p *page.Page[*coredata.Mitigation, coredata.MitigationOrderField]) *MitigationConnection {
|
func NewMesureConnection(p *page.Page[*coredata.Mesure, coredata.MesureOrderField]) *MesureConnection {
|
||||||
var edges = make([]*MitigationEdge, len(p.Data))
|
var edges = make([]*MesureEdge, len(p.Data))
|
||||||
|
|
||||||
for i := range edges {
|
for i := range edges {
|
||||||
edges[i] = NewMitigationEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
edges[i] = NewMesureEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &MitigationConnection{
|
return &MesureConnection{
|
||||||
Edges: edges,
|
Edges: edges,
|
||||||
PageInfo: NewPageInfo(p),
|
PageInfo: NewPageInfo(p),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMitigationEdge(c *coredata.Mitigation, orderBy coredata.MitigationOrderField) *MitigationEdge {
|
func NewMesureEdge(c *coredata.Mesure, orderBy coredata.MesureOrderField) *MesureEdge {
|
||||||
return &MitigationEdge{
|
return &MesureEdge{
|
||||||
Cursor: c.CursorKey(orderBy),
|
Cursor: c.CursorKey(orderBy),
|
||||||
Node: NewMitigation(c),
|
Node: NewMesure(c),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMitigation(c *coredata.Mitigation) *Mitigation {
|
func NewMesure(c *coredata.Mesure) *Mesure {
|
||||||
return &Mitigation{
|
return &Mesure{
|
||||||
ID: c.ID,
|
ID: c.ID,
|
||||||
Category: c.Category,
|
Category: c.Category,
|
||||||
Name: c.Name,
|
Name: c.Name,
|
||||||
@@ -41,7 +41,7 @@ type Control struct {
|
|||||||
ReferenceID string `json:"referenceId"`
|
ReferenceID string `json:"referenceId"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Mitigations *MitigationConnection `json:"mitigations"`
|
Mesures *MesureConnection `json:"mesures"`
|
||||||
Policies *PolicyConnection `json:"policies"`
|
Policies *PolicyConnection `json:"policies"`
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
@@ -60,12 +60,12 @@ type ControlEdge struct {
|
|||||||
Node *Control `json:"node"`
|
Node *Control `json:"node"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlMitigationMappingInput struct {
|
type CreateControlMesureMappingInput struct {
|
||||||
ControlID gid.GID `json:"controlId"`
|
ControlID gid.GID `json:"controlId"`
|
||||||
MitigationID gid.GID `json:"mitigationId"`
|
MesureID gid.GID `json:"mesureId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateControlMitigationMappingPayload struct {
|
type CreateControlMesureMappingPayload struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,16 +101,16 @@ type CreateFrameworkPayload struct {
|
|||||||
FrameworkEdge *FrameworkEdge `json:"frameworkEdge"`
|
FrameworkEdge *FrameworkEdge `json:"frameworkEdge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateMitigationInput struct {
|
type CreateMesureInput struct {
|
||||||
OrganizationID gid.GID `json:"organizationId"`
|
OrganizationID gid.GID `json:"organizationId"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Category string `json:"category"`
|
Category string `json:"category"`
|
||||||
Importance coredata.MitigationImportance `json:"importance"`
|
Importance coredata.MesureImportance `json:"importance"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateMitigationPayload struct {
|
type CreateMesurePayload struct {
|
||||||
MitigationEdge *MitigationEdge `json:"mitigationEdge"`
|
MesureEdge *MesureEdge `json:"mesureEdge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateOrganizationInput struct {
|
type CreateOrganizationInput struct {
|
||||||
@@ -158,12 +158,12 @@ type CreateRiskInput struct {
|
|||||||
ResidualImpact *float64 `json:"residualImpact,omitempty"`
|
ResidualImpact *float64 `json:"residualImpact,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateRiskMitigationMappingInput struct {
|
type CreateRiskMesureMappingInput struct {
|
||||||
RiskID gid.GID `json:"riskId"`
|
RiskID gid.GID `json:"riskId"`
|
||||||
MitigationID gid.GID `json:"mitigationId"`
|
MesureID gid.GID `json:"mesureId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateRiskMitigationMappingPayload struct {
|
type CreateRiskMesureMappingPayload struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ type CreateRiskPolicyMappingPayload struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CreateTaskInput struct {
|
type CreateTaskInput struct {
|
||||||
MitigationID gid.GID `json:"mitigationId"`
|
MesureID gid.GID `json:"mesureId"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
TimeEstimate *time.Duration `json:"timeEstimate,omitempty"`
|
TimeEstimate *time.Duration `json:"timeEstimate,omitempty"`
|
||||||
@@ -220,12 +220,12 @@ type CreateVendorPayload struct {
|
|||||||
VendorEdge *VendorEdge `json:"vendorEdge"`
|
VendorEdge *VendorEdge `json:"vendorEdge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlMitigationMappingInput struct {
|
type DeleteControlMesureMappingInput struct {
|
||||||
ControlID gid.GID `json:"controlId"`
|
ControlID gid.GID `json:"controlId"`
|
||||||
MitigationID gid.GID `json:"mitigationId"`
|
MesureID gid.GID `json:"mesureId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteControlMitigationMappingPayload struct {
|
type DeleteControlMesureMappingPayload struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,12 +282,12 @@ type DeleteRiskInput struct {
|
|||||||
RiskID gid.GID `json:"riskId"`
|
RiskID gid.GID `json:"riskId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteRiskMitigationMappingInput struct {
|
type DeleteRiskMesureMappingInput struct {
|
||||||
RiskID gid.GID `json:"riskId"`
|
RiskID gid.GID `json:"riskId"`
|
||||||
MitigationID gid.GID `json:"mitigationId"`
|
MesureID gid.GID `json:"mesureId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteRiskMitigationMappingPayload struct {
|
type DeleteRiskMesureMappingPayload struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,13 +397,13 @@ type ImportFrameworkPayload struct {
|
|||||||
FrameworkEdge *FrameworkEdge `json:"frameworkEdge"`
|
FrameworkEdge *FrameworkEdge `json:"frameworkEdge"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ImportMitigationInput struct {
|
type ImportMesureInput struct {
|
||||||
OrganizationID gid.GID `json:"organizationId"`
|
OrganizationID gid.GID `json:"organizationId"`
|
||||||
File graphql.Upload `json:"file"`
|
File graphql.Upload `json:"file"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ImportMitigationPayload struct {
|
type ImportMesurePayload struct {
|
||||||
MitigationEdges []*MitigationEdge `json:"mitigationEdges"`
|
MesureEdges []*MesureEdge `json:"mesureEdges"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type InviteUserInput struct {
|
type InviteUserInput struct {
|
||||||
@@ -416,13 +416,13 @@ type InviteUserPayload struct {
|
|||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Mitigation struct {
|
type Mesure struct {
|
||||||
ID gid.GID `json:"id"`
|
ID gid.GID `json:"id"`
|
||||||
Category string `json:"category"`
|
Category string `json:"category"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
State coredata.MitigationState `json:"state"`
|
State coredata.MesureState `json:"state"`
|
||||||
Importance coredata.MitigationImportance `json:"importance"`
|
Importance coredata.MesureImportance `json:"importance"`
|
||||||
Tasks *TaskConnection `json:"tasks"`
|
Tasks *TaskConnection `json:"tasks"`
|
||||||
Risks *RiskConnection `json:"risks"`
|
Risks *RiskConnection `json:"risks"`
|
||||||
Controls *ControlConnection `json:"controls"`
|
Controls *ControlConnection `json:"controls"`
|
||||||
@@ -430,17 +430,17 @@ type Mitigation struct {
|
|||||||
UpdatedAt time.Time `json:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Mitigation) IsNode() {}
|
func (Mesure) IsNode() {}
|
||||||
func (this Mitigation) GetID() gid.GID { return this.ID }
|
func (this Mesure) GetID() gid.GID { return this.ID }
|
||||||
|
|
||||||
type MitigationConnection struct {
|
type MesureConnection struct {
|
||||||
Edges []*MitigationEdge `json:"edges"`
|
Edges []*MesureEdge `json:"edges"`
|
||||||
PageInfo *PageInfo `json:"pageInfo"`
|
PageInfo *PageInfo `json:"pageInfo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MitigationEdge struct {
|
type MesureEdge struct {
|
||||||
Cursor page.CursorKey `json:"cursor"`
|
Cursor page.CursorKey `json:"cursor"`
|
||||||
Node *Mitigation `json:"node"`
|
Node *Mesure `json:"node"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Mutation struct {
|
type Mutation struct {
|
||||||
@@ -455,7 +455,7 @@ type Organization struct {
|
|||||||
Vendors *VendorConnection `json:"vendors"`
|
Vendors *VendorConnection `json:"vendors"`
|
||||||
Peoples *PeopleConnection `json:"peoples"`
|
Peoples *PeopleConnection `json:"peoples"`
|
||||||
Policies *PolicyConnection `json:"policies"`
|
Policies *PolicyConnection `json:"policies"`
|
||||||
Mitigations *MitigationConnection `json:"mitigations"`
|
Mesures *MesureConnection `json:"mesures"`
|
||||||
Risks *RiskConnection `json:"risks"`
|
Risks *RiskConnection `json:"risks"`
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
@@ -569,7 +569,7 @@ type Risk struct {
|
|||||||
ResidualImpact float64 `json:"residualImpact"`
|
ResidualImpact float64 `json:"residualImpact"`
|
||||||
ResidualSeverity float64 `json:"residualSeverity"`
|
ResidualSeverity float64 `json:"residualSeverity"`
|
||||||
Owner *People `json:"owner,omitempty"`
|
Owner *People `json:"owner,omitempty"`
|
||||||
Mitigations *MitigationConnection `json:"mitigations"`
|
Mesures *MesureConnection `json:"mesures"`
|
||||||
Policies *PolicyConnection `json:"policies"`
|
Policies *PolicyConnection `json:"policies"`
|
||||||
Controls *ControlConnection `json:"controls"`
|
Controls *ControlConnection `json:"controls"`
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
@@ -637,17 +637,17 @@ type UpdateFrameworkPayload struct {
|
|||||||
Framework *Framework `json:"framework"`
|
Framework *Framework `json:"framework"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateMitigationInput struct {
|
type UpdateMesureInput struct {
|
||||||
ID gid.GID `json:"id"`
|
ID gid.GID `json:"id"`
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
Description *string `json:"description,omitempty"`
|
Description *string `json:"description,omitempty"`
|
||||||
Category *string `json:"category,omitempty"`
|
Category *string `json:"category,omitempty"`
|
||||||
State *coredata.MitigationState `json:"state,omitempty"`
|
State *coredata.MesureState `json:"state,omitempty"`
|
||||||
Importance *coredata.MitigationImportance `json:"importance,omitempty"`
|
Importance *coredata.MesureImportance `json:"importance,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateMitigationPayload struct {
|
type UpdateMesurePayload struct {
|
||||||
Mitigation *Mitigation `json:"mitigation"`
|
Mesure *Mesure `json:"mesure"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateOrganizationInput struct {
|
type UpdateOrganizationInput struct {
|
||||||
|
|||||||
@@ -20,16 +20,16 @@ import (
|
|||||||
"github.com/vektah/gqlparser/v2/gqlerror"
|
"github.com/vektah/gqlparser/v2/gqlerror"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Mitigations is the resolver for the mitigations field.
|
// Mesures is the resolver for the mesures field.
|
||||||
func (r *controlResolver) Mitigations(ctx context.Context, obj *types.Control, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) (*types.MitigationConnection, error) {
|
func (r *controlResolver) Mesures(ctx context.Context, obj *types.Control, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MesureOrderBy) (*types.MesureConnection, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.MitigationOrderField]{
|
pageOrderBy := page.OrderBy[coredata.MesureOrderField]{
|
||||||
Field: coredata.MitigationOrderFieldCreatedAt,
|
Field: coredata.MesureOrderFieldCreatedAt,
|
||||||
Direction: page.OrderDirectionDesc,
|
Direction: page.OrderDirectionDesc,
|
||||||
}
|
}
|
||||||
if orderBy != nil {
|
if orderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.MitigationOrderField]{
|
pageOrderBy = page.OrderBy[coredata.MesureOrderField]{
|
||||||
Field: orderBy.Field,
|
Field: orderBy.Field,
|
||||||
Direction: orderBy.Direction,
|
Direction: orderBy.Direction,
|
||||||
}
|
}
|
||||||
@@ -37,12 +37,12 @@ func (r *controlResolver) Mitigations(ctx context.Context, obj *types.Control, f
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
page, err := svc.Mitigations.ListForControlID(ctx, obj.ID, cursor)
|
page, err := svc.Mesures.ListForControlID(ctx, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot list mitigations: %w", err)
|
return nil, fmt.Errorf("cannot list mesures: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewMitigationConnection(page), nil
|
return types.NewMesureConnection(page), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Policies is the resolver for the policies field.
|
// Policies is the resolver for the policies field.
|
||||||
@@ -113,7 +113,7 @@ func (r *frameworkResolver) Controls(ctx context.Context, obj *types.Framework,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Tasks is the resolver for the tasks field.
|
// Tasks is the resolver for the tasks field.
|
||||||
func (r *mitigationResolver) Tasks(ctx context.Context, obj *types.Mitigation, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) (*types.TaskConnection, error) {
|
func (r *mesureResolver) Tasks(ctx context.Context, obj *types.Mesure, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) (*types.TaskConnection, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.TaskOrderField]{
|
pageOrderBy := page.OrderBy[coredata.TaskOrderField]{
|
||||||
@@ -129,16 +129,16 @@ func (r *mitigationResolver) Tasks(ctx context.Context, obj *types.Mitigation, f
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
page, err := svc.Tasks.ListForMitigationID(ctx, obj.ID, cursor)
|
page, err := svc.Tasks.ListForMesureID(ctx, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot list mitigation tasks: %w", err)
|
return nil, fmt.Errorf("cannot list mesure tasks: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTaskConnection(page), nil
|
return types.NewTaskConnection(page), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Risks is the resolver for the risks field.
|
// Risks is the resolver for the risks field.
|
||||||
func (r *mitigationResolver) Risks(ctx context.Context, obj *types.Mitigation, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.RiskOrderBy) (*types.RiskConnection, error) {
|
func (r *mesureResolver) Risks(ctx context.Context, obj *types.Mesure, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.RiskOrderBy) (*types.RiskConnection, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.RiskOrderField]{
|
pageOrderBy := page.OrderBy[coredata.RiskOrderField]{
|
||||||
@@ -154,16 +154,16 @@ func (r *mitigationResolver) Risks(ctx context.Context, obj *types.Mitigation, f
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
page, err := svc.Risks.ListForMitigationID(ctx, obj.ID, cursor)
|
page, err := svc.Risks.ListForMesureID(ctx, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot list mitigation risks: %w", err)
|
return nil, fmt.Errorf("cannot list mesure risks: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewRiskConnection(page), nil
|
return types.NewRiskConnection(page), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controls is the resolver for the controls field.
|
// Controls is the resolver for the controls field.
|
||||||
func (r *mitigationResolver) Controls(ctx context.Context, obj *types.Mitigation, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy) (*types.ControlConnection, error) {
|
func (r *mesureResolver) Controls(ctx context.Context, obj *types.Mesure, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy) (*types.ControlConnection, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.ControlOrderField]{
|
pageOrderBy := page.OrderBy[coredata.ControlOrderField]{
|
||||||
@@ -179,9 +179,9 @@ func (r *mitigationResolver) Controls(ctx context.Context, obj *types.Mitigation
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
page, err := svc.Controls.ListForMitigationID(ctx, obj.ID, cursor)
|
page, err := svc.Controls.ListForMesureID(ctx, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot list mitigation controls: %w", err)
|
return nil, fmt.Errorf("cannot list mesure controls: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewControlConnection(page), nil
|
return types.NewControlConnection(page), nil
|
||||||
@@ -518,11 +518,11 @@ func (r *mutationResolver) DeleteFramework(ctx context.Context, input types.Dele
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// // CreateMitigation is the resolver for the createMitigation field.
|
// // CreateMesure is the resolver for the createMesure field.
|
||||||
func (r *mutationResolver) CreateMitigation(ctx context.Context, input types.CreateMitigationInput) (*types.CreateMitigationPayload, error) {
|
func (r *mutationResolver) CreateMesure(ctx context.Context, input types.CreateMesureInput) (*types.CreateMesurePayload, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.OrganizationID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, input.OrganizationID.TenantID())
|
||||||
|
|
||||||
mitigation, err := svc.Mitigations.Create(ctx, probo.CreateMitigationRequest{
|
mesure, err := svc.Mesures.Create(ctx, probo.CreateMesureRequest{
|
||||||
OrganizationID: input.OrganizationID,
|
OrganizationID: input.OrganizationID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
Description: input.Description,
|
Description: input.Description,
|
||||||
@@ -530,19 +530,19 @@ func (r *mutationResolver) CreateMitigation(ctx context.Context, input types.Cre
|
|||||||
Importance: input.Importance,
|
Importance: input.Importance,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot create mitigation: %w", err))
|
panic(fmt.Errorf("cannot create mesure: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.CreateMitigationPayload{
|
return &types.CreateMesurePayload{
|
||||||
MitigationEdge: types.NewMitigationEdge(mitigation, coredata.MitigationOrderFieldCreatedAt),
|
MesureEdge: types.NewMesureEdge(mesure, coredata.MesureOrderFieldCreatedAt),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateMitigation is the resolver for the updateMitigation field.
|
// UpdateMesure is the resolver for the updateMesure field.
|
||||||
func (r *mutationResolver) UpdateMitigation(ctx context.Context, input types.UpdateMitigationInput) (*types.UpdateMitigationPayload, error) {
|
func (r *mutationResolver) UpdateMesure(ctx context.Context, input types.UpdateMesureInput) (*types.UpdateMesurePayload, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.ID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, input.ID.TenantID())
|
||||||
|
|
||||||
mitigation, err := svc.Mitigations.Update(ctx, probo.UpdateMitigationRequest{
|
mesure, err := svc.Mesures.Update(ctx, probo.UpdateMesureRequest{
|
||||||
ID: input.ID,
|
ID: input.ID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
Description: input.Description,
|
Description: input.Description,
|
||||||
@@ -551,48 +551,48 @@ func (r *mutationResolver) UpdateMitigation(ctx context.Context, input types.Upd
|
|||||||
State: input.State,
|
State: input.State,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot update mitigation: %w", err))
|
panic(fmt.Errorf("cannot update mesure: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.UpdateMitigationPayload{
|
return &types.UpdateMesurePayload{
|
||||||
Mitigation: types.NewMitigation(mitigation),
|
Mesure: types.NewMesure(mesure),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImportMitigation is the resolver for the importMitigation field.
|
// ImportMesure is the resolver for the importMesure field.
|
||||||
func (r *mutationResolver) ImportMitigation(ctx context.Context, input types.ImportMitigationInput) (*types.ImportMitigationPayload, error) {
|
func (r *mutationResolver) ImportMesure(ctx context.Context, input types.ImportMesureInput) (*types.ImportMesurePayload, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.OrganizationID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, input.OrganizationID.TenantID())
|
||||||
|
|
||||||
var req probo.ImportMitigationRequest
|
var req probo.ImportMesureRequest
|
||||||
if err := json.NewDecoder(input.File.File).Decode(&req.Mitigations); err != nil {
|
if err := json.NewDecoder(input.File.File).Decode(&req.Mesures); err != nil {
|
||||||
return nil, fmt.Errorf("cannot unmarshal mitigation: %w", err)
|
return nil, fmt.Errorf("cannot unmarshal mesure: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mitigations, err := svc.Mitigations.Import(ctx, input.OrganizationID, req)
|
mesures, err := svc.Mesures.Import(ctx, input.OrganizationID, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot import mitigation: %w", err)
|
return nil, fmt.Errorf("cannot import mesure: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mitigationEdges := make([]*types.MitigationEdge, len(mitigations.Data))
|
mesureEdges := make([]*types.MesureEdge, len(mesures.Data))
|
||||||
for i, mitigation := range mitigations.Data {
|
for i, mesure := range mesures.Data {
|
||||||
mitigationEdges[i] = types.NewMitigationEdge(mitigation, coredata.MitigationOrderFieldCreatedAt)
|
mesureEdges[i] = types.NewMesureEdge(mesure, coredata.MesureOrderFieldCreatedAt)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.ImportMitigationPayload{
|
return &types.ImportMesurePayload{
|
||||||
MitigationEdges: mitigationEdges,
|
MesureEdges: mesureEdges,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateControlMitigationMapping is the resolver for the createControlMitigationMapping field.
|
// CreateControlMesureMapping is the resolver for the createControlMesureMapping field.
|
||||||
func (r *mutationResolver) CreateControlMitigationMapping(ctx context.Context, input types.CreateControlMitigationMappingInput) (*types.CreateControlMitigationMappingPayload, error) {
|
func (r *mutationResolver) CreateControlMesureMapping(ctx context.Context, input types.CreateControlMesureMappingInput) (*types.CreateControlMesureMappingPayload, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MitigationID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, input.MesureID.TenantID())
|
||||||
|
|
||||||
err := svc.Controls.CreateMitigationMapping(ctx, input.ControlID, input.MitigationID)
|
err := svc.Controls.CreateMesureMapping(ctx, input.ControlID, input.MesureID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot create control mitigation mapping: %w", err))
|
panic(fmt.Errorf("cannot create control mesure mapping: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.CreateControlMitigationMappingPayload{
|
return &types.CreateControlMesureMappingPayload{
|
||||||
Success: true,
|
Success: true,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
@@ -611,16 +611,16 @@ func (r *mutationResolver) CreateControlPolicyMapping(ctx context.Context, input
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteControlMitigationMapping is the resolver for the deleteControlMitigationMapping field.
|
// DeleteControlMesureMapping is the resolver for the deleteControlMesureMapping field.
|
||||||
func (r *mutationResolver) DeleteControlMitigationMapping(ctx context.Context, input types.DeleteControlMitigationMappingInput) (*types.DeleteControlMitigationMappingPayload, error) {
|
func (r *mutationResolver) DeleteControlMesureMapping(ctx context.Context, input types.DeleteControlMesureMappingInput) (*types.DeleteControlMesureMappingPayload, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MitigationID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, input.MesureID.TenantID())
|
||||||
|
|
||||||
err := svc.Controls.DeleteMitigationMapping(ctx, input.ControlID, input.MitigationID)
|
err := svc.Controls.DeleteMesureMapping(ctx, input.ControlID, input.MesureID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot delete control mitigation mapping: %w", err))
|
panic(fmt.Errorf("cannot delete control mesure mapping: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.DeleteControlMitigationMappingPayload{
|
return &types.DeleteControlMesureMappingPayload{
|
||||||
Success: true,
|
Success: true,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
@@ -641,10 +641,10 @@ func (r *mutationResolver) DeleteControlPolicyMapping(ctx context.Context, input
|
|||||||
|
|
||||||
// CreateTask is the resolver for the createTask field.
|
// CreateTask is the resolver for the createTask field.
|
||||||
func (r *mutationResolver) CreateTask(ctx context.Context, input types.CreateTaskInput) (*types.CreateTaskPayload, error) {
|
func (r *mutationResolver) CreateTask(ctx context.Context, input types.CreateTaskInput) (*types.CreateTaskPayload, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MitigationID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, input.MesureID.TenantID())
|
||||||
|
|
||||||
task, err := svc.Tasks.Create(ctx, probo.CreateTaskRequest{
|
task, err := svc.Tasks.Create(ctx, probo.CreateTaskRequest{
|
||||||
MitigationID: input.MitigationID,
|
MesureID: input.MesureID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
Description: input.Description,
|
Description: input.Description,
|
||||||
TimeEstimate: input.TimeEstimate,
|
TimeEstimate: input.TimeEstimate,
|
||||||
@@ -788,30 +788,30 @@ func (r *mutationResolver) DeleteRisk(ctx context.Context, input types.DeleteRis
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateRiskMitigationMapping is the resolver for the createRiskMitigationMapping field.
|
// CreateRiskMesureMapping is the resolver for the createRiskMesureMapping field.
|
||||||
func (r *mutationResolver) CreateRiskMitigationMapping(ctx context.Context, input types.CreateRiskMitigationMappingInput) (*types.CreateRiskMitigationMappingPayload, error) {
|
func (r *mutationResolver) CreateRiskMesureMapping(ctx context.Context, input types.CreateRiskMesureMappingInput) (*types.CreateRiskMesureMappingPayload, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.RiskID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, input.RiskID.TenantID())
|
||||||
|
|
||||||
err := svc.Risks.CreateMitigationMapping(ctx, input.RiskID, input.MitigationID)
|
err := svc.Risks.CreateMesureMapping(ctx, input.RiskID, input.MesureID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot create risk mitigation mapping: %w", err))
|
panic(fmt.Errorf("cannot create risk mesure mapping: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.CreateRiskMitigationMappingPayload{
|
return &types.CreateRiskMesureMappingPayload{
|
||||||
Success: true,
|
Success: true,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteRiskMitigationMapping is the resolver for the deleteRiskMitigationMapping field.
|
// DeleteRiskMesureMapping is the resolver for the deleteRiskMesureMapping field.
|
||||||
func (r *mutationResolver) DeleteRiskMitigationMapping(ctx context.Context, input types.DeleteRiskMitigationMappingInput) (*types.DeleteRiskMitigationMappingPayload, error) {
|
func (r *mutationResolver) DeleteRiskMesureMapping(ctx context.Context, input types.DeleteRiskMesureMappingInput) (*types.DeleteRiskMesureMappingPayload, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.RiskID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, input.RiskID.TenantID())
|
||||||
|
|
||||||
err := svc.Risks.DeleteMitigationMapping(ctx, input.RiskID, input.MitigationID)
|
err := svc.Risks.DeleteMesureMapping(ctx, input.RiskID, input.MesureID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot delete risk mitigation mapping: %w", err))
|
panic(fmt.Errorf("cannot delete risk mesure mapping: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.DeleteRiskMitigationMappingPayload{
|
return &types.DeleteRiskMesureMappingPayload{
|
||||||
Success: true,
|
Success: true,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
@@ -1162,16 +1162,16 @@ func (r *organizationResolver) Policies(ctx context.Context, obj *types.Organiza
|
|||||||
return types.NewPolicyConnection(page), nil
|
return types.NewPolicyConnection(page), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mitigations is the resolver for the mitigations field.
|
// Mesures is the resolver for the mesures field.
|
||||||
func (r *organizationResolver) Mitigations(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) (*types.MitigationConnection, error) {
|
func (r *organizationResolver) Mesures(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MesureOrderBy) (*types.MesureConnection, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.MitigationOrderField]{
|
pageOrderBy := page.OrderBy[coredata.MesureOrderField]{
|
||||||
Field: coredata.MitigationOrderFieldCreatedAt,
|
Field: coredata.MesureOrderFieldCreatedAt,
|
||||||
Direction: page.OrderDirectionDesc,
|
Direction: page.OrderDirectionDesc,
|
||||||
}
|
}
|
||||||
if orderBy != nil {
|
if orderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.MitigationOrderField]{
|
pageOrderBy = page.OrderBy[coredata.MesureOrderField]{
|
||||||
Field: orderBy.Field,
|
Field: orderBy.Field,
|
||||||
Direction: orderBy.Direction,
|
Direction: orderBy.Direction,
|
||||||
}
|
}
|
||||||
@@ -1179,12 +1179,12 @@ func (r *organizationResolver) Mitigations(ctx context.Context, obj *types.Organ
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
page, err := svc.Mitigations.ListForOrganizationID(ctx, obj.ID, cursor)
|
page, err := svc.Mesures.ListForOrganizationID(ctx, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot list organization mitigations: %w", err))
|
panic(fmt.Errorf("cannot list organization mesures: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewMitigationConnection(page), nil
|
return types.NewMesureConnection(page), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Risks is the resolver for the risks field.
|
// Risks is the resolver for the risks field.
|
||||||
@@ -1288,13 +1288,13 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
}
|
}
|
||||||
|
|
||||||
return types.NewFramework(framework), nil
|
return types.NewFramework(framework), nil
|
||||||
case coredata.MitigationEntityType:
|
case coredata.MesureEntityType:
|
||||||
mitigation, err := svc.Mitigations.Get(ctx, id)
|
mesure, err := svc.Mesures.Get(ctx, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot get mitigation: %w", err))
|
panic(fmt.Errorf("cannot get mesure: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewMitigation(mitigation), nil
|
return types.NewMesure(mesure), nil
|
||||||
case coredata.TaskEntityType:
|
case coredata.TaskEntityType:
|
||||||
task, err := svc.Tasks.Get(ctx, id)
|
task, err := svc.Tasks.Get(ctx, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -1372,16 +1372,16 @@ func (r *riskResolver) Owner(ctx context.Context, obj *types.Risk) (*types.Peopl
|
|||||||
return types.NewPeople(owner), nil
|
return types.NewPeople(owner), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mitigations is the resolver for the mitigations field.
|
// Mesures is the resolver for the mesures field.
|
||||||
func (r *riskResolver) Mitigations(ctx context.Context, obj *types.Risk, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) (*types.MitigationConnection, error) {
|
func (r *riskResolver) Mesures(ctx context.Context, obj *types.Risk, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MesureOrderBy) (*types.MesureConnection, error) {
|
||||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.MitigationOrderField]{
|
pageOrderBy := page.OrderBy[coredata.MesureOrderField]{
|
||||||
Field: coredata.MitigationOrderFieldCreatedAt,
|
Field: coredata.MesureOrderFieldCreatedAt,
|
||||||
Direction: page.OrderDirectionDesc,
|
Direction: page.OrderDirectionDesc,
|
||||||
}
|
}
|
||||||
if orderBy != nil {
|
if orderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.MitigationOrderField]{
|
pageOrderBy = page.OrderBy[coredata.MesureOrderField]{
|
||||||
Field: orderBy.Field,
|
Field: orderBy.Field,
|
||||||
Direction: orderBy.Direction,
|
Direction: orderBy.Direction,
|
||||||
}
|
}
|
||||||
@@ -1389,12 +1389,12 @@ func (r *riskResolver) Mitigations(ctx context.Context, obj *types.Risk, first *
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
page, err := svc.Mitigations.ListForRiskID(ctx, obj.ID, cursor)
|
page, err := svc.Mesures.ListForRiskID(ctx, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot list risk mitigations: %w", err))
|
panic(fmt.Errorf("cannot list risk mesures: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewMitigationConnection(page), nil
|
return types.NewMesureConnection(page), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Policies is the resolver for the policies field.
|
// Policies is the resolver for the policies field.
|
||||||
@@ -1617,8 +1617,8 @@ func (r *Resolver) Evidence() schema.EvidenceResolver { return &evidenceResolver
|
|||||||
// Framework returns schema.FrameworkResolver implementation.
|
// Framework returns schema.FrameworkResolver implementation.
|
||||||
func (r *Resolver) Framework() schema.FrameworkResolver { return &frameworkResolver{r} }
|
func (r *Resolver) Framework() schema.FrameworkResolver { return &frameworkResolver{r} }
|
||||||
|
|
||||||
// Mitigation returns schema.MitigationResolver implementation.
|
// Mesure returns schema.MesureResolver implementation.
|
||||||
func (r *Resolver) Mitigation() schema.MitigationResolver { return &mitigationResolver{r} }
|
func (r *Resolver) Mesure() schema.MesureResolver { return &mesureResolver{r} }
|
||||||
|
|
||||||
// Mutation returns schema.MutationResolver implementation.
|
// Mutation returns schema.MutationResolver implementation.
|
||||||
func (r *Resolver) Mutation() schema.MutationResolver { return &mutationResolver{r} }
|
func (r *Resolver) Mutation() schema.MutationResolver { return &mutationResolver{r} }
|
||||||
@@ -1652,7 +1652,7 @@ func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} }
|
|||||||
type controlResolver struct{ *Resolver }
|
type controlResolver struct{ *Resolver }
|
||||||
type evidenceResolver struct{ *Resolver }
|
type evidenceResolver struct{ *Resolver }
|
||||||
type frameworkResolver struct{ *Resolver }
|
type frameworkResolver struct{ *Resolver }
|
||||||
type mitigationResolver struct{ *Resolver }
|
type mesureResolver struct{ *Resolver }
|
||||||
type mutationResolver struct{ *Resolver }
|
type mutationResolver struct{ *Resolver }
|
||||||
type organizationResolver struct{ *Resolver }
|
type organizationResolver struct{ *Resolver }
|
||||||
type policyResolver struct{ *Resolver }
|
type policyResolver struct{ *Resolver }
|
||||||
|
|||||||
Reference in New Issue
Block a user