Update obligations
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -31,12 +31,11 @@ import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import { Controller } from "react-hook-form";
|
||||
import z from "zod";
|
||||
import { getStatusVariant, getStatusLabel, formatDatetime, getStatusOptions, validateSnapshotConsistency } from "@probo/helpers";
|
||||
import { getObligationStatusVariant, getObligationStatusLabel, formatDatetime, getObligationStatusOptions, validateSnapshotConsistency } from "@probo/helpers";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import type { ObligationGraphNodeQuery } from "/hooks/graph/__generated__/ObligationGraphNodeQuery.graphql";
|
||||
|
||||
const updateObligationSchema = z.object({
|
||||
referenceId: z.string().min(1, "Reference ID is required"),
|
||||
area: z.string().optional(),
|
||||
source: z.string().optional(),
|
||||
requirement: z.string().optional(),
|
||||
@@ -44,7 +43,7 @@ const updateObligationSchema = z.object({
|
||||
regulator: z.string().optional(),
|
||||
lastReviewDate: z.string().optional(),
|
||||
dueDate: z.string().optional(),
|
||||
status: z.enum(["OPEN", "IN_PROGRESS", "CLOSED"]),
|
||||
status: z.enum(["NON_COMPLIANT", "PARTIALLY_COMPLIANT", "COMPLIANT"]),
|
||||
ownerId: z.string().min(1, "Owner is required"),
|
||||
});
|
||||
|
||||
@@ -68,7 +67,7 @@ export default function ObligationDetailsPage(props: Props) {
|
||||
validateSnapshotConsistency(obligation, snapshotId);
|
||||
|
||||
const updateObligation = useUpdateObligation();
|
||||
const statusOptions = getStatusOptions(__);
|
||||
const statusOptions = getObligationStatusOptions(__);
|
||||
|
||||
const connectionId = ConnectionHandler.getConnectionID(
|
||||
organizationId,
|
||||
@@ -76,7 +75,7 @@ export default function ObligationDetailsPage(props: Props) {
|
||||
);
|
||||
|
||||
const deleteObligation = useDeleteObligation(
|
||||
{ id: obligation?.id!, referenceId: obligation?.referenceId! },
|
||||
{ id: obligation?.id! },
|
||||
connectionId
|
||||
);
|
||||
|
||||
@@ -84,7 +83,6 @@ export default function ObligationDetailsPage(props: Props) {
|
||||
updateObligationSchema,
|
||||
{
|
||||
defaultValues: {
|
||||
referenceId: obligation?.referenceId || "",
|
||||
area: obligation?.area || "",
|
||||
source: obligation?.source || "",
|
||||
requirement: obligation?.requirement || "",
|
||||
@@ -96,7 +94,7 @@ export default function ObligationDetailsPage(props: Props) {
|
||||
dueDate: obligation?.dueDate
|
||||
? new Date(obligation.dueDate).toISOString().split("T")[0]
|
||||
: "",
|
||||
status: obligation?.status || "OPEN",
|
||||
status: obligation?.status ?? "NON_COMPLIANT",
|
||||
ownerId: obligation?.owner?.id || "",
|
||||
},
|
||||
}
|
||||
@@ -106,7 +104,6 @@ export default function ObligationDetailsPage(props: Props) {
|
||||
try {
|
||||
await updateObligation({
|
||||
id: obligation.id!,
|
||||
referenceId: formData.referenceId,
|
||||
area: formData.area || undefined,
|
||||
source: formData.source || undefined,
|
||||
requirement: formData.requirement || undefined,
|
||||
@@ -116,7 +113,6 @@ export default function ObligationDetailsPage(props: Props) {
|
||||
dueDate: formatDatetime(formData.dueDate),
|
||||
status: formData.status,
|
||||
ownerId: formData.ownerId,
|
||||
|
||||
});
|
||||
|
||||
toast({
|
||||
@@ -147,13 +143,13 @@ export default function ObligationDetailsPage(props: Props) {
|
||||
<Breadcrumb
|
||||
items={[
|
||||
{ label: __("Obligations"), to: breadcrumbObligationsUrl },
|
||||
{ label: obligation.referenceId! },
|
||||
{ label: __("Obligation Details") },
|
||||
]}
|
||||
/>
|
||||
<div className="flex items-center gap-3 mt-2">
|
||||
<h1 className="text-2xl font-bold">{obligation.referenceId}</h1>
|
||||
<Badge variant={getStatusVariant(obligation.status || "OPEN")}>
|
||||
{getStatusLabel(obligation.status || "OPEN")}
|
||||
<h1 className="text-2xl font-bold">{__("Obligation")}</h1>
|
||||
<Badge variant={getObligationStatusVariant(obligation.status ?? "NON_COMPLIANT")}>
|
||||
{getObligationStatusLabel(obligation.status ?? "NON_COMPLIANT")}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
@@ -169,19 +165,6 @@ export default function ObligationDetailsPage(props: Props) {
|
||||
|
||||
<Card padded>
|
||||
<form onSubmit={onSubmit} className="space-y-6">
|
||||
<Field
|
||||
label={__("Reference ID")}
|
||||
error={formState.errors.referenceId?.message}
|
||||
required
|
||||
>
|
||||
<Input
|
||||
{...register("referenceId")}
|
||||
placeholder={__("Enter reference ID")}
|
||||
disabled={isSnapshotMode}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<Field
|
||||
|
||||
@@ -28,7 +28,7 @@ import { useParams } from "react-router";
|
||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||
import { CreateObligationDialog } from "./dialogs/CreateObligationDialog";
|
||||
import { deleteObligationMutation } from "../../../hooks/graph/ObligationGraph";
|
||||
import { sprintf, promisifyMutation, getStatusVariant, getStatusLabel, formatDate } from "@probo/helpers";
|
||||
import { promisifyMutation, getObligationStatusVariant, getObligationStatusLabel, formatDate } from "@probo/helpers";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import type { ObligationsPageQuery } from "./__generated__/ObligationsPageQuery.graphql";
|
||||
import type {
|
||||
@@ -64,7 +64,6 @@ const obligationsPageFragment = graphql`
|
||||
id
|
||||
snapshotId
|
||||
sourceId
|
||||
referenceId
|
||||
area
|
||||
source
|
||||
requirement
|
||||
@@ -152,7 +151,6 @@ export default function ObligationsPage({ queryRef }: ObligationsPageProps) {
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{__("Reference ID")}</Th>
|
||||
<Th>{__("Area")}</Th>
|
||||
<Th>{__("Source")}</Th>
|
||||
<Th>{__("Status")}</Th>
|
||||
@@ -218,11 +216,8 @@ function ObligationRow({
|
||||
},
|
||||
}),
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the obligation %s. This action cannot be undone."
|
||||
),
|
||||
obligation.referenceId
|
||||
message: __(
|
||||
"This will permanently delete this obligation. This action cannot be undone."
|
||||
),
|
||||
}
|
||||
);
|
||||
@@ -234,14 +229,11 @@ function ObligationRow({
|
||||
|
||||
return (
|
||||
<Tr to={detailsUrl}>
|
||||
<Td>
|
||||
<span className="font-mono text-sm">{obligation.referenceId}</span>
|
||||
</Td>
|
||||
<Td>{obligation.area || "-"}</Td>
|
||||
<Td>{obligation.source || "-"}</Td>
|
||||
<Td>
|
||||
<Badge variant={getStatusVariant(obligation.status || "OPEN")}>
|
||||
{getStatusLabel(obligation.status || "OPEN")}
|
||||
<Badge variant={getObligationStatusVariant(obligation.status || "NON_COMPLIANT")}>
|
||||
{getObligationStatusLabel(obligation.status || "NON_COMPLIANT")}
|
||||
</Badge>
|
||||
</Td>
|
||||
<Td>{obligation.owner?.fullName || "-"}</Td>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<5f839350ed835351175b07d38512ba37>>
|
||||
* @generated SignedSource<<27cacc02131c03f5aeaaff764e3bb226>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type ObligationStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type ObligationStatus = "COMPLIANT" | "NON_COMPLIANT" | "PARTIALLY_COMPLIANT";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ObligationsPageFragment$data = {
|
||||
readonly id: string;
|
||||
@@ -27,7 +27,6 @@ export type ObligationsPageFragment$data = {
|
||||
readonly fullName: string;
|
||||
readonly id: string;
|
||||
};
|
||||
readonly referenceId: string;
|
||||
readonly regulator: string | null | undefined;
|
||||
readonly requirement: string | null | undefined;
|
||||
readonly snapshotId: string | null | undefined;
|
||||
@@ -171,13 +170,6 @@ return {
|
||||
"name": "sourceId",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "referenceId",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -333,6 +325,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "0d7452faf6e02f97885a65819dfb112b";
|
||||
(node as any).hash = "a5dda6d90c9205f7c7d6ea6d84d760f1";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<f54af2ebc7ab4d39662c5619a23532ac>>
|
||||
* @generated SignedSource<<445c6cc243eadbe9e5eacdec0161ee62>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -176,13 +176,6 @@ return {
|
||||
"name": "sourceId",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "referenceId",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -347,12 +340,12 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "7e61419b20d9cf30e5dd31b4500bc324",
|
||||
"cacheID": "9a4d2f4ac3be91001f8c9bb602cd599f",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ObligationsPageQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ObligationsPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ObligationsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ObligationsPageFragment_3iomuz on Organization {\n id\n obligations(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query ObligationsPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ObligationsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ObligationsPageFragment_3iomuz on Organization {\n id\n obligations(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<c1ff0a7d2abc83b2111d20abecaf6baf>>
|
||||
* @generated SignedSource<<3b2a48df3fdef9f91bc4520ed2448423>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -200,13 +200,6 @@ return {
|
||||
"name": "sourceId",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "referenceId",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -371,16 +364,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "f34cf1412b7ff3e92971dfac07ca06ac",
|
||||
"cacheID": "0500f4aee677d8d1ec53cd189e350395",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ObligationsPageRefetchQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ObligationsPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ObligationsPageFragment_35e0S5\n id\n }\n}\n\nfragment ObligationsPageFragment_35e0S5 on Organization {\n id\n obligations(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query ObligationsPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ObligationsPageFragment_35e0S5\n id\n }\n}\n\nfragment ObligationsPageFragment_35e0S5 on Organization {\n id\n obligations(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "0d7452faf6e02f97885a65819dfb112b";
|
||||
(node as any).hash = "a5dda6d90c9205f7c7d6ea6d84d760f1";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -20,10 +20,9 @@ import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import { useCreateObligation } from "../../../../hooks/graph/ObligationGraph";
|
||||
import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||
import { Controller } from "react-hook-form";
|
||||
import { formatDatetime, getStatusOptions } from "@probo/helpers";
|
||||
import { formatDatetime, getObligationStatusOptions } from "@probo/helpers";
|
||||
|
||||
const schema = z.object({
|
||||
referenceId: z.string().min(1, "Reference ID is required"),
|
||||
area: z.string().optional(),
|
||||
source: z.string().optional(),
|
||||
requirement: z.string().optional(),
|
||||
@@ -32,7 +31,7 @@ const schema = z.object({
|
||||
ownerId: z.string().min(1, "Owner is required"),
|
||||
lastReviewDate: z.string().optional(),
|
||||
dueDate: z.string().optional(),
|
||||
status: z.enum(["OPEN", "IN_PROGRESS", "CLOSED"]),
|
||||
status: z.enum(["NON_COMPLIANT", "PARTIALLY_COMPLIANT", "COMPLIANT"]),
|
||||
});
|
||||
|
||||
type FormData = z.infer<typeof schema>;
|
||||
@@ -53,11 +52,10 @@ export function CreateObligationDialog({
|
||||
const dialogRef = useDialogRef();
|
||||
|
||||
const createObligation = useCreateObligation(connection || "");
|
||||
const statusOptions = getStatusOptions(__);
|
||||
const statusOptions = getObligationStatusOptions(__);
|
||||
|
||||
const { register, handleSubmit, formState, reset, control } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
referenceId: "",
|
||||
area: "",
|
||||
source: "",
|
||||
requirement: "",
|
||||
@@ -66,7 +64,7 @@ export function CreateObligationDialog({
|
||||
ownerId: "",
|
||||
lastReviewDate: "",
|
||||
dueDate: "",
|
||||
status: "OPEN" as const,
|
||||
status: "NON_COMPLIANT" as const,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -74,7 +72,6 @@ export function CreateObligationDialog({
|
||||
try {
|
||||
await createObligation({
|
||||
organizationId,
|
||||
referenceId: formData.referenceId,
|
||||
area: formData.area || undefined,
|
||||
source: formData.source || undefined,
|
||||
requirement: formData.requirement || undefined,
|
||||
@@ -112,14 +109,6 @@ export function CreateObligationDialog({
|
||||
>
|
||||
<form onSubmit={onSubmit}>
|
||||
<DialogContent padded className="space-y-4">
|
||||
<Field
|
||||
label={__("Reference ID")}
|
||||
{...register("referenceId")}
|
||||
placeholder="CR-001"
|
||||
error={formState.errors.referenceId?.message}
|
||||
required
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<Field
|
||||
label={__("Area")}
|
||||
|
||||
@@ -92,6 +92,7 @@ export default function RiskDetailPage(props: Props) {
|
||||
const documentsCount = risk.documentsInfo?.totalCount ?? 0;
|
||||
const measuresCount = risk.measuresInfo?.totalCount ?? 0;
|
||||
const controlsCount = risk.controlsInfo?.totalCount ?? 0;
|
||||
const obligationsCount = risk.obligationsInfo?.totalCount ?? 0;
|
||||
|
||||
const risksUrl = isSnapshotMode && snapshotId
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/risks`
|
||||
@@ -159,6 +160,10 @@ export default function RiskDetailPage(props: Props) {
|
||||
{__("Controls")}
|
||||
<TabBadge>{controlsCount}</TabBadge>
|
||||
</TabLink>
|
||||
<TabLink to={`${baseTabUrl}/obligations`}>
|
||||
{__("Obligations")}
|
||||
<TabBadge>{obligationsCount}</TabBadge>
|
||||
</TabLink>
|
||||
</>
|
||||
)}
|
||||
</Tabs>
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
import { graphql, useFragment } from "react-relay";
|
||||
import type { RiskObligationsTabFragment$key } from "./__generated__/RiskObligationsTabFragment.graphql";
|
||||
import { useOutletContext } from "react-router";
|
||||
import { LinkedObligationsCard } from "/components/obligations/LinkedObligationsCard";
|
||||
import { useMutationWithIncrement } from "/hooks/useMutationWithIncrement";
|
||||
|
||||
export const obligationsFragment = graphql`
|
||||
fragment RiskObligationsTabFragment on Risk {
|
||||
id
|
||||
obligations(first: 100) @connection(key: "Risk__obligations") {
|
||||
__id
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
...LinkedObligationsCardFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const attachObligationMutation = graphql`
|
||||
mutation RiskObligationsTabCreateMutation(
|
||||
$input: CreateRiskObligationMappingInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createRiskObligationMapping(input: $input) {
|
||||
obligationEdge @prependEdge(connections: $connections) {
|
||||
node {
|
||||
id
|
||||
...LinkedObligationsCardFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const detachObligationMutation = graphql`
|
||||
mutation RiskObligationsTabDetachMutation(
|
||||
$input: DeleteRiskObligationMappingInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteRiskObligationMapping(input: $input) {
|
||||
deletedObligationId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default function RiskObligationsTab() {
|
||||
const { risk } = useOutletContext<{
|
||||
risk: RiskObligationsTabFragment$key & { id: string };
|
||||
}>();
|
||||
const data = useFragment(obligationsFragment, risk);
|
||||
const connectionId = data.obligations.__id;
|
||||
const obligations = data.obligations?.edges?.map((edge) => edge.node) ?? [];
|
||||
const incrementOptions = {
|
||||
id: data.id,
|
||||
node: "obligations(first:0)",
|
||||
};
|
||||
const [detachObligation, isDetaching] = useMutationWithIncrement(
|
||||
detachObligationMutation,
|
||||
{
|
||||
...incrementOptions,
|
||||
value: -1,
|
||||
},
|
||||
);
|
||||
const [attachObligation, isAttaching] = useMutationWithIncrement(
|
||||
attachObligationMutation,
|
||||
{
|
||||
...incrementOptions,
|
||||
value: 1,
|
||||
},
|
||||
);
|
||||
const isLoading = isDetaching || isAttaching;
|
||||
|
||||
return (
|
||||
<LinkedObligationsCard
|
||||
disabled={isLoading}
|
||||
obligations={obligations}
|
||||
onAttach={attachObligation}
|
||||
onDetach={detachObligation}
|
||||
params={{ riskId: data.id }}
|
||||
connectionId={connectionId}
|
||||
variant="table"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
/**
|
||||
* @generated SignedSource<<545b2d50da8f79510029c5dba61ae821>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type CreateRiskObligationMappingInput = {
|
||||
obligationId: string;
|
||||
riskId: string;
|
||||
};
|
||||
export type RiskObligationsTabCreateMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: CreateRiskObligationMappingInput;
|
||||
};
|
||||
export type RiskObligationsTabCreateMutation$data = {
|
||||
readonly createRiskObligationMapping: {
|
||||
readonly obligationEdge: {
|
||||
readonly node: {
|
||||
readonly id: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"LinkedObligationsCardFragment">;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export type RiskObligationsTabCreateMutation = {
|
||||
response: RiskObligationsTabCreateMutation$data;
|
||||
variables: RiskObligationsTabCreateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = {
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "connections"
|
||||
},
|
||||
v1 = {
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "input"
|
||||
},
|
||||
v2 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "input",
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/)
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "RiskObligationsTabCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateRiskObligationMappingPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createRiskObligationMapping",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ObligationEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "obligationEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "LinkedObligationsCardFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [
|
||||
(v1/*: any*/),
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "RiskObligationsTabCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateRiskObligationMappingPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createRiskObligationMapping",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ObligationEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "obligationEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "requirement",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "area",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "source",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "status",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "People",
|
||||
"kind": "LinkedField",
|
||||
"name": "owner",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "fullName",
|
||||
"storageKey": null
|
||||
},
|
||||
(v3/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"filters": null,
|
||||
"handle": "prependEdge",
|
||||
"key": "",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "obligationEdge",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "connections",
|
||||
"variableName": "connections"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "8681d141acf6036709241ba71bfeae4c",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "RiskObligationsTabCreateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation RiskObligationsTabCreateMutation(\n $input: CreateRiskObligationMappingInput!\n) {\n createRiskObligationMapping(input: $input) {\n obligationEdge {\n node {\n id\n ...LinkedObligationsCardFragment\n }\n }\n }\n}\n\nfragment LinkedObligationsCardFragment on Obligation {\n id\n requirement\n area\n source\n status\n owner {\n fullName\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "eee2e37b1adaae513ca23b8c82f055c9";
|
||||
|
||||
export default node;
|
||||
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* @generated SignedSource<<58dd326af2caac72cf50ed8f289a3cac>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteRiskObligationMappingInput = {
|
||||
obligationId: string;
|
||||
riskId: string;
|
||||
};
|
||||
export type RiskObligationsTabDetachMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: DeleteRiskObligationMappingInput;
|
||||
};
|
||||
export type RiskObligationsTabDetachMutation$data = {
|
||||
readonly deleteRiskObligationMapping: {
|
||||
readonly deletedObligationId: string;
|
||||
};
|
||||
};
|
||||
export type RiskObligationsTabDetachMutation = {
|
||||
response: RiskObligationsTabDetachMutation$data;
|
||||
variables: RiskObligationsTabDetachMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = {
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "connections"
|
||||
},
|
||||
v1 = {
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "input"
|
||||
},
|
||||
v2 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "input",
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "deletedObligationId",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/)
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "RiskObligationsTabDetachMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteRiskObligationMappingPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteRiskObligationMapping",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [
|
||||
(v1/*: any*/),
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "RiskObligationsTabDetachMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteRiskObligationMappingPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteRiskObligationMapping",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"filters": null,
|
||||
"handle": "deleteEdge",
|
||||
"key": "",
|
||||
"kind": "ScalarHandle",
|
||||
"name": "deletedObligationId",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "connections",
|
||||
"variableName": "connections"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "97b75f003c5e9518831c9699a2fcaff0",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "RiskObligationsTabDetachMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation RiskObligationsTabDetachMutation(\n $input: DeleteRiskObligationMappingInput!\n) {\n deleteRiskObligationMapping(input: $input) {\n deletedObligationId\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "5923c7e9bcb08224ba1a60b0ad09642a";
|
||||
|
||||
export default node;
|
||||
155
apps/console/src/pages/organizations/risks/tabs/__generated__/RiskObligationsTabFragment.graphql.ts
generated
Normal file
155
apps/console/src/pages/organizations/risks/tabs/__generated__/RiskObligationsTabFragment.graphql.ts
generated
Normal file
@@ -0,0 +1,155 @@
|
||||
/**
|
||||
* @generated SignedSource<<1e3d6c1d36e2004b383479fb2e159c66>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type RiskObligationsTabFragment$data = {
|
||||
readonly id: string;
|
||||
readonly obligations: {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly id: string;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"LinkedObligationsCardFragment">;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
readonly " $fragmentType": "RiskObligationsTabFragment";
|
||||
};
|
||||
export type RiskObligationsTabFragment$key = {
|
||||
readonly " $data"?: RiskObligationsTabFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"RiskObligationsTabFragment">;
|
||||
};
|
||||
|
||||
const node: ReaderFragment = (function(){
|
||||
var v0 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Fragment",
|
||||
"metadata": {
|
||||
"connection": [
|
||||
{
|
||||
"count": null,
|
||||
"cursor": null,
|
||||
"direction": "forward",
|
||||
"path": [
|
||||
"obligations"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "RiskObligationsTabFragment",
|
||||
"selections": [
|
||||
(v0/*: any*/),
|
||||
{
|
||||
"alias": "obligations",
|
||||
"args": null,
|
||||
"concreteType": "ObligationConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "__Risk__obligations_connection",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ObligationEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v0/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "LinkedObligationsCardFragment"
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "PageInfo",
|
||||
"kind": "LinkedField",
|
||||
"name": "pageInfo",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "endCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasNextPage",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"kind": "ClientExtension",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__id",
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Risk",
|
||||
"abstractKey": null
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "e987e7c6dcfb73b71f769469b32c2b64";
|
||||
|
||||
export default node;
|
||||
Reference in New Issue
Block a user