Add compliance registry snapshots
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -8,10 +8,10 @@ import { useMutationWithToasts } from "../useMutationWithToasts";
|
|||||||
export const ComplianceRegistriesConnectionKey = "ComplianceRegistriesPage_complianceRegistries";
|
export const ComplianceRegistriesConnectionKey = "ComplianceRegistriesPage_complianceRegistries";
|
||||||
|
|
||||||
export const complianceRegistriesQuery = graphql`
|
export const complianceRegistriesQuery = graphql`
|
||||||
query ComplianceRegistryGraphListQuery($organizationId: ID!) {
|
query ComplianceRegistryGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||||
node(id: $organizationId) {
|
node(id: $organizationId) {
|
||||||
... on Organization {
|
... on Organization {
|
||||||
...ComplianceRegistriesPageFragment
|
...ComplianceRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,8 @@ export const complianceRegistryNodeQuery = graphql`
|
|||||||
node(id: $complianceRegistryId) {
|
node(id: $complianceRegistryId) {
|
||||||
... on ComplianceRegistry {
|
... on ComplianceRegistry {
|
||||||
id
|
id
|
||||||
|
snapshotId
|
||||||
|
sourceId
|
||||||
referenceId
|
referenceId
|
||||||
area
|
area
|
||||||
source
|
source
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<fa68dc3f1afe9ab6d98e189eff649e04>>
|
* @generated SignedSource<<41975a1dcc769268a6255ea703ff26fe>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -12,6 +12,7 @@ import { ConcreteRequest } from 'relay-runtime';
|
|||||||
import { FragmentRefs } from "relay-runtime";
|
import { FragmentRefs } from "relay-runtime";
|
||||||
export type ComplianceRegistryGraphListQuery$variables = {
|
export type ComplianceRegistryGraphListQuery$variables = {
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
|
snapshotId?: string | null | undefined;
|
||||||
};
|
};
|
||||||
export type ComplianceRegistryGraphListQuery$data = {
|
export type ComplianceRegistryGraphListQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
@@ -29,6 +30,11 @@ var v0 = [
|
|||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "organizationId"
|
"name": "organizationId"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultValue": null,
|
||||||
|
"kind": "LocalArgument",
|
||||||
|
"name": "snapshotId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = [
|
v1 = [
|
||||||
@@ -38,21 +44,33 @@ v1 = [
|
|||||||
"variableName": "organizationId"
|
"variableName": "organizationId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v2 = {
|
v2 = [
|
||||||
|
{
|
||||||
|
"kind": "Variable",
|
||||||
|
"name": "snapshotId",
|
||||||
|
"variableName": "snapshotId"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
v3 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "__typename",
|
"name": "__typename",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v3 = {
|
v4 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v4 = [
|
v5 = [
|
||||||
|
{
|
||||||
|
"fields": (v2/*: any*/),
|
||||||
|
"kind": "ObjectValue",
|
||||||
|
"name": "filter"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "Literal",
|
"kind": "Literal",
|
||||||
"name": "first",
|
"name": "first",
|
||||||
@@ -78,7 +96,7 @@ return {
|
|||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"args": null,
|
"args": (v2/*: any*/),
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "ComplianceRegistriesPageFragment"
|
"name": "ComplianceRegistriesPageFragment"
|
||||||
}
|
}
|
||||||
@@ -107,14 +125,14 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/),
|
|
||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
|
(v4/*: any*/),
|
||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v4/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"concreteType": "ComplianceRegistryConnection",
|
"concreteType": "ComplianceRegistryConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "complianceRegistries",
|
"name": "complianceRegistries",
|
||||||
@@ -143,7 +161,21 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/),
|
(v4/*: any*/),
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "snapshotId",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "sourceId",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -215,7 +247,7 @@ return {
|
|||||||
"name": "owner",
|
"name": "owner",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/),
|
(v4/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -240,7 +272,7 @@ return {
|
|||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v2/*: any*/)
|
(v3/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
@@ -292,12 +324,14 @@ return {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": "complianceRegistries(first:10)"
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v4/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"filters": null,
|
"filters": [
|
||||||
|
"filter"
|
||||||
|
],
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "ComplianceRegistriesPage_complianceRegistries",
|
"key": "ComplianceRegistriesPage_complianceRegistries",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
@@ -313,16 +347,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "2852dc9732086326e7770650cbd00ad1",
|
"cacheID": "d578089841a93f60ae9ba5bc6e9175b0",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ComplianceRegistryGraphListQuery",
|
"name": "ComplianceRegistryGraphListQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query ComplianceRegistryGraphListQuery(\n $organizationId: ID!\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ComplianceRegistriesPageFragment\n }\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment on Organization {\n id\n complianceRegistries(first: 10) {\n totalCount\n edges {\n node {\n id\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 ComplianceRegistryGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ComplianceRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment_3iomuz on Organization {\n id\n complianceRegistries(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"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "363434c78eb3e27ac52b6da13c7432a1";
|
(node as any).hash = "2c50dd58eb2d72e49bce300726f35a34";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<f3d37c53737c5f0f3bd062eb2b682898>>
|
* @generated SignedSource<<ec60b0715df426d6819f03f6e1597fef>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -32,7 +32,9 @@ export type ComplianceRegistryGraphNodeQuery$data = {
|
|||||||
readonly referenceId?: string;
|
readonly referenceId?: string;
|
||||||
readonly regulator?: string | null | undefined;
|
readonly regulator?: string | null | undefined;
|
||||||
readonly requirement?: string | null | undefined;
|
readonly requirement?: string | null | undefined;
|
||||||
|
readonly snapshotId?: string | null | undefined;
|
||||||
readonly source?: string | null | undefined;
|
readonly source?: string | null | undefined;
|
||||||
|
readonly sourceId?: string | null | undefined;
|
||||||
readonly status?: ComplianceRegistryStatus;
|
readonly status?: ComplianceRegistryStatus;
|
||||||
readonly updatedAt?: any;
|
readonly updatedAt?: any;
|
||||||
};
|
};
|
||||||
@@ -68,66 +70,80 @@ v3 = {
|
|||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "referenceId",
|
"name": "snapshotId",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v4 = {
|
v4 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "area",
|
"name": "sourceId",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v5 = {
|
v5 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "source",
|
"name": "referenceId",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v6 = {
|
v6 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "requirement",
|
"name": "area",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v7 = {
|
v7 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "actionsToBeImplemented",
|
"name": "source",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v8 = {
|
v8 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "regulator",
|
"name": "requirement",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v9 = {
|
v9 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "lastReviewDate",
|
"name": "actionsToBeImplemented",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v10 = {
|
v10 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "dueDate",
|
"name": "regulator",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v11 = {
|
v11 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "status",
|
"name": "lastReviewDate",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v12 = {
|
v12 = {
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "dueDate",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
v13 = {
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "status",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
v14 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "People",
|
"concreteType": "People",
|
||||||
@@ -146,7 +162,7 @@ v12 = {
|
|||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v13 = {
|
v15 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"concreteType": "Organization",
|
"concreteType": "Organization",
|
||||||
@@ -165,14 +181,14 @@ v13 = {
|
|||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v14 = {
|
v16 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "createdAt",
|
"name": "createdAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v15 = {
|
v17 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
@@ -210,7 +226,9 @@ return {
|
|||||||
(v12/*: any*/),
|
(v12/*: any*/),
|
||||||
(v13/*: any*/),
|
(v13/*: any*/),
|
||||||
(v14/*: any*/),
|
(v14/*: any*/),
|
||||||
(v15/*: any*/)
|
(v15/*: any*/),
|
||||||
|
(v16/*: any*/),
|
||||||
|
(v17/*: any*/)
|
||||||
],
|
],
|
||||||
"type": "ComplianceRegistry",
|
"type": "ComplianceRegistry",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -259,7 +277,9 @@ return {
|
|||||||
(v12/*: any*/),
|
(v12/*: any*/),
|
||||||
(v13/*: any*/),
|
(v13/*: any*/),
|
||||||
(v14/*: any*/),
|
(v14/*: any*/),
|
||||||
(v15/*: any*/)
|
(v15/*: any*/),
|
||||||
|
(v16/*: any*/),
|
||||||
|
(v17/*: any*/)
|
||||||
],
|
],
|
||||||
"type": "ComplianceRegistry",
|
"type": "ComplianceRegistry",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -270,16 +290,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "4b91258de0711b2821a26bef89b60b02",
|
"cacheID": "2c4649d3258530fd79420bc2ed8fd14a",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ComplianceRegistryGraphNodeQuery",
|
"name": "ComplianceRegistryGraphNodeQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query ComplianceRegistryGraphNodeQuery(\n $complianceRegistryId: ID!\n) {\n node(id: $complianceRegistryId) {\n __typename\n ... on ComplianceRegistry {\n id\n referenceId\n area\n source\n requirement\n actionsToBeImplemented\n regulator\n lastReviewDate\n dueDate\n status\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
"text": "query ComplianceRegistryGraphNodeQuery(\n $complianceRegistryId: ID!\n) {\n node(id: $complianceRegistryId) {\n __typename\n ... on ComplianceRegistry {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n actionsToBeImplemented\n regulator\n lastReviewDate\n dueDate\n status\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "1b3352776a5b514b7545111aeb780148";
|
(node as any).hash = "b290ce12f57b586e64bac227777bc294";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -24,10 +24,12 @@ import {
|
|||||||
useMutation,
|
useMutation,
|
||||||
type PreloadedQuery,
|
type PreloadedQuery,
|
||||||
} from "react-relay";
|
} from "react-relay";
|
||||||
|
import { useParams } from "react-router";
|
||||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||||
import { CreateComplianceRegistryDialog } from "./dialogs/CreateComplianceRegistryDialog";
|
import { CreateComplianceRegistryDialog } from "./dialogs/CreateComplianceRegistryDialog";
|
||||||
import { deleteComplianceRegistryMutation } from "../../../hooks/graph/ComplianceRegistryGraph";
|
import { deleteComplianceRegistryMutation } from "../../../hooks/graph/ComplianceRegistryGraph";
|
||||||
import { sprintf, promisifyMutation, getStatusVariant, getStatusLabel } from "@probo/helpers";
|
import { sprintf, promisifyMutation, getStatusVariant, getStatusLabel } from "@probo/helpers";
|
||||||
|
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||||
import type { ComplianceRegistriesPageQuery } from "./__generated__/ComplianceRegistriesPageQuery.graphql";
|
import type { ComplianceRegistriesPageQuery } from "./__generated__/ComplianceRegistriesPageQuery.graphql";
|
||||||
import type {
|
import type {
|
||||||
ComplianceRegistriesPageFragment$key,
|
ComplianceRegistriesPageFragment$key,
|
||||||
@@ -46,15 +48,22 @@ const complianceRegistriesPageFragment = graphql`
|
|||||||
@argumentDefinitions(
|
@argumentDefinitions(
|
||||||
first: { type: "Int", defaultValue: 10 }
|
first: { type: "Int", defaultValue: 10 }
|
||||||
after: { type: "CursorKey" }
|
after: { type: "CursorKey" }
|
||||||
|
snapshotId: { type: "ID", defaultValue: null }
|
||||||
) {
|
) {
|
||||||
id
|
id
|
||||||
complianceRegistries(first: $first, after: $after)
|
complianceRegistries(
|
||||||
@connection(key: "ComplianceRegistriesPage_complianceRegistries") {
|
first: $first
|
||||||
|
after: $after
|
||||||
|
filter: { snapshotId: $snapshotId }
|
||||||
|
)
|
||||||
|
@connection(key: "ComplianceRegistriesPage_complianceRegistries", filters: ["filter"]) {
|
||||||
__id
|
__id
|
||||||
totalCount
|
totalCount
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
|
snapshotId
|
||||||
|
sourceId
|
||||||
referenceId
|
referenceId
|
||||||
area
|
area
|
||||||
source
|
source
|
||||||
@@ -83,15 +92,17 @@ const complianceRegistriesPageFragment = graphql`
|
|||||||
export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistriesPageProps) {
|
export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistriesPageProps) {
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const organizationId = useOrganizationId();
|
const organizationId = useOrganizationId();
|
||||||
|
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||||
|
const isSnapshotMode = Boolean(snapshotId);
|
||||||
|
|
||||||
usePageTitle(__("Compliance Registries"));
|
usePageTitle(__("Compliance Registries"));
|
||||||
|
|
||||||
const organization = usePreloadedQuery(
|
const organization = usePreloadedQuery(
|
||||||
graphql`
|
graphql`
|
||||||
query ComplianceRegistriesPageQuery($organizationId: ID!) {
|
query ComplianceRegistriesPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||||
node(id: $organizationId) {
|
node(id: $organizationId) {
|
||||||
... on Organization {
|
... on Organization {
|
||||||
...ComplianceRegistriesPageFragment
|
...ComplianceRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,15 +120,20 @@ export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistr
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
|
{isSnapshotMode && snapshotId && (
|
||||||
|
<SnapshotBanner snapshotId={snapshotId} />
|
||||||
|
)}
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title={__("Compliance Registries")}
|
title={__("Compliance Registries")}
|
||||||
description={__(
|
description={__(
|
||||||
"Manage your organization's compliance registry entries."
|
"Manage your organization's compliance registry entries."
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<CreateComplianceRegistryDialog organizationId={organizationId} connection={connectionId}>
|
{!snapshotId && (
|
||||||
<Button icon={IconPlusLarge}>{__("Add compliance registry")}</Button>
|
<CreateComplianceRegistryDialog organizationId={organizationId} connection={connectionId}>
|
||||||
</CreateComplianceRegistryDialog>
|
<Button icon={IconPlusLarge}>{__("Add compliance registry")}</Button>
|
||||||
|
</CreateComplianceRegistryDialog>
|
||||||
|
)}
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
|
|
||||||
{registries.length === 0 ? (
|
{registries.length === 0 ? (
|
||||||
@@ -151,6 +167,7 @@ export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistr
|
|||||||
key={registry.id}
|
key={registry.id}
|
||||||
registry={registry}
|
registry={registry}
|
||||||
connectionId={connectionId}
|
connectionId={connectionId}
|
||||||
|
snapshotId={snapshotId}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Tbody>
|
</Tbody>
|
||||||
@@ -176,14 +193,17 @@ export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistr
|
|||||||
function RegistryRow({
|
function RegistryRow({
|
||||||
registry,
|
registry,
|
||||||
connectionId,
|
connectionId,
|
||||||
|
snapshotId,
|
||||||
}: {
|
}: {
|
||||||
registry: ComplianceRegistry;
|
registry: ComplianceRegistry;
|
||||||
connectionId: string;
|
connectionId: string;
|
||||||
|
snapshotId?: string;
|
||||||
}) {
|
}) {
|
||||||
const organizationId = useOrganizationId();
|
const organizationId = useOrganizationId();
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [deleteRegistry] = useMutation(deleteComplianceRegistryMutation);
|
const [deleteRegistry] = useMutation(deleteComplianceRegistryMutation);
|
||||||
const confirm = useConfirm();
|
const confirm = useConfirm();
|
||||||
|
const isSnapshotMode = Boolean(snapshotId);
|
||||||
|
|
||||||
const formatDate = (dateString: string) => {
|
const formatDate = (dateString: string) => {
|
||||||
return new Date(dateString).toLocaleDateString();
|
return new Date(dateString).toLocaleDateString();
|
||||||
@@ -211,8 +231,12 @@ function RegistryRow({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const detailsUrl = isSnapshotMode
|
||||||
|
? `/organizations/${organizationId}/snapshots/${snapshotId}/compliance-registries/${registry.id}`
|
||||||
|
: `/organizations/${organizationId}/compliance-registries/${registry.id}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tr to={`/organizations/${organizationId}/compliance-registries/${registry.id}`}>
|
<Tr to={detailsUrl}>
|
||||||
<Td>
|
<Td>
|
||||||
<span className="font-mono text-sm">{registry.referenceId}</span>
|
<span className="font-mono text-sm">{registry.referenceId}</span>
|
||||||
</Td>
|
</Td>
|
||||||
@@ -234,15 +258,17 @@ function RegistryRow({
|
|||||||
)}
|
)}
|
||||||
</Td>
|
</Td>
|
||||||
<Td noLink width={50} className="text-end">
|
<Td noLink width={50} className="text-end">
|
||||||
<ActionDropdown>
|
{!isSnapshotMode && (
|
||||||
<DropdownItem
|
<ActionDropdown>
|
||||||
icon={IconTrashCan}
|
<DropdownItem
|
||||||
variant="danger"
|
icon={IconTrashCan}
|
||||||
onSelect={handleDelete}
|
variant="danger"
|
||||||
>
|
onSelect={handleDelete}
|
||||||
{__("Delete")}
|
>
|
||||||
</DropdownItem>
|
{__("Delete")}
|
||||||
</ActionDropdown>
|
</DropdownItem>
|
||||||
|
</ActionDropdown>
|
||||||
|
)}
|
||||||
</Td>
|
</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,12 +25,14 @@ import {
|
|||||||
Select,
|
Select,
|
||||||
} from "@probo/ui";
|
} from "@probo/ui";
|
||||||
import { useTranslate } from "@probo/i18n";
|
import { useTranslate } from "@probo/i18n";
|
||||||
|
import { useParams } from "react-router";
|
||||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||||
import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||||
import { Controller } from "react-hook-form";
|
import { Controller } from "react-hook-form";
|
||||||
import z from "zod";
|
import z from "zod";
|
||||||
import { getStatusVariant, getStatusLabel, formatDatetime, getComplianceRegistryStatusOptions } from "@probo/helpers";
|
import { getStatusVariant, getStatusLabel, formatDatetime, getComplianceRegistryStatusOptions, validateSnapshotConsistency } from "@probo/helpers";
|
||||||
|
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||||
import type { ComplianceRegistryGraphNodeQuery } from "/hooks/graph/__generated__/ComplianceRegistryGraphNodeQuery.graphql";
|
import type { ComplianceRegistryGraphNodeQuery } from "/hooks/graph/__generated__/ComplianceRegistryGraphNodeQuery.graphql";
|
||||||
|
|
||||||
const updateRegistrySchema = z.object({
|
const updateRegistrySchema = z.object({
|
||||||
@@ -56,11 +58,15 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const organizationId = useOrganizationId();
|
const organizationId = useOrganizationId();
|
||||||
|
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||||
|
const isSnapshotMode = Boolean(snapshotId);
|
||||||
|
|
||||||
if (!registry) {
|
if (!registry) {
|
||||||
return <div>{__("Compliance registry entry not found")}</div>;
|
return <div>{__("Compliance registry entry not found")}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validateSnapshotConsistency(registry, snapshotId);
|
||||||
|
|
||||||
const updateRegistry = useUpdateComplianceRegistry();
|
const updateRegistry = useUpdateComplianceRegistry();
|
||||||
const statusOptions = getComplianceRegistryStatusOptions(__);
|
const statusOptions = getComplianceRegistryStatusOptions(__);
|
||||||
|
|
||||||
@@ -124,29 +130,38 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const breadcrumbComplianceRegistriesUrl = isSnapshotMode
|
||||||
|
? `/organizations/${organizationId}/snapshots/${snapshotId}/compliance-registries`
|
||||||
|
: `/organizations/${organizationId}/compliance-registries`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
|
{isSnapshotMode && snapshotId && (
|
||||||
|
<SnapshotBanner snapshotId={snapshotId} />
|
||||||
|
)}
|
||||||
<div className="flex justify-between items-start">
|
<div className="flex justify-between items-start">
|
||||||
<div>
|
<div>
|
||||||
<Breadcrumb
|
<Breadcrumb
|
||||||
items={[
|
items={[
|
||||||
{ label: __("Compliance Registries"), to: "../compliance-registries" },
|
{ label: __("Compliance Registries"), to: breadcrumbComplianceRegistriesUrl },
|
||||||
{ label: registry.referenceId! },
|
{ label: registry.referenceId! },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<div className="flex items-center gap-3 mt-2">
|
<div className="flex items-center gap-3 mt-2">
|
||||||
<h1 className="text-2xl font-bold">{registry.referenceId}</h1>
|
<h1 className="text-2xl font-bold">{registry.referenceId}</h1>
|
||||||
<Badge variant={getStatusVariant(registry.status || "OPEN")}>
|
<Badge variant={getStatusVariant(registry.status || "OPEN")}>
|
||||||
{getStatusLabel(registry.status || "OPEN")}
|
{getStatusLabel(registry.status || "OPEN")}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ActionDropdown>
|
{!isSnapshotMode && (
|
||||||
<DropdownItem icon={IconTrashCan} onClick={deleteRegistry}>
|
<ActionDropdown>
|
||||||
{__("Delete")}
|
<DropdownItem icon={IconTrashCan} onClick={deleteRegistry}>
|
||||||
</DropdownItem>
|
{__("Delete")}
|
||||||
</ActionDropdown>
|
</DropdownItem>
|
||||||
|
</ActionDropdown>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card padded>
|
<Card padded>
|
||||||
@@ -159,6 +174,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
<Input
|
<Input
|
||||||
{...register("referenceId")}
|
{...register("referenceId")}
|
||||||
placeholder={__("Enter reference ID")}
|
placeholder={__("Enter reference ID")}
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
@@ -172,6 +188,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
<Input
|
<Input
|
||||||
{...register("area")}
|
{...register("area")}
|
||||||
placeholder={__("Enter area")}
|
placeholder={__("Enter area")}
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
@@ -182,6 +199,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
<Input
|
<Input
|
||||||
{...register("source")}
|
{...register("source")}
|
||||||
placeholder={__("Enter source")}
|
placeholder={__("Enter source")}
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
@@ -198,6 +216,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
value={field.value}
|
value={field.value}
|
||||||
className="w-full"
|
className="w-full"
|
||||||
|
disabled={isSnapshotMode}
|
||||||
>
|
>
|
||||||
{statusOptions.map((option) => (
|
{statusOptions.map((option) => (
|
||||||
<Option key={option.value} value={option.value}>
|
<Option key={option.value} value={option.value}>
|
||||||
@@ -223,6 +242,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
label={__("Owner")}
|
label={__("Owner")}
|
||||||
error={formState.errors.ownerId?.message}
|
error={formState.errors.ownerId?.message}
|
||||||
required
|
required
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -236,6 +256,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
<Input
|
<Input
|
||||||
{...register("regulator")}
|
{...register("regulator")}
|
||||||
placeholder={__("Enter regulator")}
|
placeholder={__("Enter regulator")}
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
@@ -248,6 +269,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
<Input
|
<Input
|
||||||
{...register("lastReviewDate")}
|
{...register("lastReviewDate")}
|
||||||
type="date"
|
type="date"
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
@@ -258,6 +280,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
<Input
|
<Input
|
||||||
{...register("dueDate")}
|
{...register("dueDate")}
|
||||||
type="date"
|
type="date"
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</div>
|
</div>
|
||||||
@@ -270,6 +293,7 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
{...register("requirement")}
|
{...register("requirement")}
|
||||||
placeholder={__("Enter requirement")}
|
placeholder={__("Enter requirement")}
|
||||||
rows={4}
|
rows={4}
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
@@ -281,17 +305,20 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
|||||||
{...register("actionsToBeImplemented")}
|
{...register("actionsToBeImplemented")}
|
||||||
placeholder={__("Enter actions to be implemented")}
|
placeholder={__("Enter actions to be implemented")}
|
||||||
rows={4}
|
rows={4}
|
||||||
|
disabled={isSnapshotMode}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
<div className="flex justify-end">
|
{!isSnapshotMode && (
|
||||||
<Button
|
<div className="flex justify-end">
|
||||||
type="submit"
|
<Button
|
||||||
disabled={formState.isSubmitting}
|
type="submit"
|
||||||
>
|
disabled={formState.isSubmitting}
|
||||||
{formState.isSubmitting ? __("Saving...") : __("Save Changes")}
|
>
|
||||||
</Button>
|
{formState.isSubmitting ? __("Saving...") : __("Save Changes")}
|
||||||
</div>
|
</Button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</form>
|
</form>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<312905201e0a72d96dd29afeed17dee1>>
|
* @generated SignedSource<<db8b4530d56ae89fa8e332555a85eb33>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -29,7 +29,9 @@ export type ComplianceRegistriesPageFragment$data = {
|
|||||||
readonly referenceId: string;
|
readonly referenceId: string;
|
||||||
readonly regulator: string | null | undefined;
|
readonly regulator: string | null | undefined;
|
||||||
readonly requirement: string | null | undefined;
|
readonly requirement: string | null | undefined;
|
||||||
|
readonly snapshotId: string | null | undefined;
|
||||||
readonly source: string | null | undefined;
|
readonly source: string | null | undefined;
|
||||||
|
readonly sourceId: string | null | undefined;
|
||||||
readonly status: ComplianceRegistryStatus;
|
readonly status: ComplianceRegistryStatus;
|
||||||
readonly updatedAt: any;
|
readonly updatedAt: any;
|
||||||
};
|
};
|
||||||
@@ -72,6 +74,11 @@ return {
|
|||||||
"defaultValue": 10,
|
"defaultValue": 10,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "first"
|
"name": "first"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultValue": null,
|
||||||
|
"kind": "LocalArgument",
|
||||||
|
"name": "snapshotId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
@@ -108,7 +115,19 @@ return {
|
|||||||
(v1/*: any*/),
|
(v1/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": "complianceRegistries",
|
"alias": "complianceRegistries",
|
||||||
"args": null,
|
"args": [
|
||||||
|
{
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"kind": "Variable",
|
||||||
|
"name": "snapshotId",
|
||||||
|
"variableName": "snapshotId"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"kind": "ObjectValue",
|
||||||
|
"name": "filter"
|
||||||
|
}
|
||||||
|
],
|
||||||
"concreteType": "ComplianceRegistryConnection",
|
"concreteType": "ComplianceRegistryConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "__ComplianceRegistriesPage_complianceRegistries_connection",
|
"name": "__ComplianceRegistriesPage_complianceRegistries_connection",
|
||||||
@@ -138,6 +157,20 @@ return {
|
|||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v1/*: any*/),
|
(v1/*: any*/),
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "snapshotId",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "sourceId",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -300,6 +333,6 @@ return {
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "b6b97d09ba132cbc1ffb006c23a33589";
|
(node as any).hash = "b22ac157b9ba89ab14fe8363e56957ef";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<c6faaadb8a0f7d2b70fed9a5801f3580>>
|
* @generated SignedSource<<794221c1dbbf8fd2d1808863d55d2c05>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -12,6 +12,7 @@ import { ConcreteRequest } from 'relay-runtime';
|
|||||||
import { FragmentRefs } from "relay-runtime";
|
import { FragmentRefs } from "relay-runtime";
|
||||||
export type ComplianceRegistriesPageQuery$variables = {
|
export type ComplianceRegistriesPageQuery$variables = {
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
|
snapshotId?: string | null | undefined;
|
||||||
};
|
};
|
||||||
export type ComplianceRegistriesPageQuery$data = {
|
export type ComplianceRegistriesPageQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
@@ -29,6 +30,11 @@ var v0 = [
|
|||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
"kind": "LocalArgument",
|
"kind": "LocalArgument",
|
||||||
"name": "organizationId"
|
"name": "organizationId"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultValue": null,
|
||||||
|
"kind": "LocalArgument",
|
||||||
|
"name": "snapshotId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v1 = [
|
v1 = [
|
||||||
@@ -38,21 +44,33 @@ v1 = [
|
|||||||
"variableName": "organizationId"
|
"variableName": "organizationId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v2 = {
|
v2 = [
|
||||||
|
{
|
||||||
|
"kind": "Variable",
|
||||||
|
"name": "snapshotId",
|
||||||
|
"variableName": "snapshotId"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
v3 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "__typename",
|
"name": "__typename",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v3 = {
|
v4 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v4 = [
|
v5 = [
|
||||||
|
{
|
||||||
|
"fields": (v2/*: any*/),
|
||||||
|
"kind": "ObjectValue",
|
||||||
|
"name": "filter"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "Literal",
|
"kind": "Literal",
|
||||||
"name": "first",
|
"name": "first",
|
||||||
@@ -78,7 +96,7 @@ return {
|
|||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"args": null,
|
"args": (v2/*: any*/),
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "ComplianceRegistriesPageFragment"
|
"name": "ComplianceRegistriesPageFragment"
|
||||||
}
|
}
|
||||||
@@ -107,14 +125,14 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v2/*: any*/),
|
|
||||||
(v3/*: any*/),
|
(v3/*: any*/),
|
||||||
|
(v4/*: any*/),
|
||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v4/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"concreteType": "ComplianceRegistryConnection",
|
"concreteType": "ComplianceRegistryConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "complianceRegistries",
|
"name": "complianceRegistries",
|
||||||
@@ -143,7 +161,21 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/),
|
(v4/*: any*/),
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "snapshotId",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "sourceId",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -215,7 +247,7 @@ return {
|
|||||||
"name": "owner",
|
"name": "owner",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/),
|
(v4/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -240,7 +272,7 @@ return {
|
|||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v2/*: any*/)
|
(v3/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
@@ -292,12 +324,14 @@ return {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"storageKey": "complianceRegistries(first:10)"
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v4/*: any*/),
|
"args": (v5/*: any*/),
|
||||||
"filters": null,
|
"filters": [
|
||||||
|
"filter"
|
||||||
|
],
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "ComplianceRegistriesPage_complianceRegistries",
|
"key": "ComplianceRegistriesPage_complianceRegistries",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
@@ -313,16 +347,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "e4fba5ed79a8d19c72d2814f1adf38c3",
|
"cacheID": "b63e74cea7f47c7e4f735ad2b52e1765",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ComplianceRegistriesPageQuery",
|
"name": "ComplianceRegistriesPageQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query ComplianceRegistriesPageQuery(\n $organizationId: ID!\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ComplianceRegistriesPageFragment\n }\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment on Organization {\n id\n complianceRegistries(first: 10) {\n totalCount\n edges {\n node {\n id\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 ComplianceRegistriesPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ComplianceRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment_3iomuz on Organization {\n id\n complianceRegistries(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"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "3e8551eebdf52ee84fb3910ee77cfe15";
|
(node as any).hash = "f0064c0d6d6e628923be30edb4b249db";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<25a63f42437f72ee5aea5f2c6e324d4a>>
|
* @generated SignedSource<<af4b3139bff8ab757fa1876aa4be4bb1>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -14,6 +14,7 @@ export type ComplianceRegistriesPageRefetchQuery$variables = {
|
|||||||
after?: any | null | undefined;
|
after?: any | null | undefined;
|
||||||
first?: number | null | undefined;
|
first?: number | null | undefined;
|
||||||
id: string;
|
id: string;
|
||||||
|
snapshotId?: string | null | undefined;
|
||||||
};
|
};
|
||||||
export type ComplianceRegistriesPageRefetchQuery$data = {
|
export type ComplianceRegistriesPageRefetchQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
@@ -26,73 +27,99 @@ export type ComplianceRegistriesPageRefetchQuery = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const node: ConcreteRequest = (function(){
|
const node: ConcreteRequest = (function(){
|
||||||
var v0 = [
|
var v0 = {
|
||||||
{
|
"defaultValue": null,
|
||||||
"defaultValue": null,
|
"kind": "LocalArgument",
|
||||||
"kind": "LocalArgument",
|
"name": "after"
|
||||||
"name": "after"
|
},
|
||||||
},
|
v1 = {
|
||||||
{
|
"defaultValue": 10,
|
||||||
"defaultValue": 10,
|
"kind": "LocalArgument",
|
||||||
"kind": "LocalArgument",
|
"name": "first"
|
||||||
"name": "first"
|
},
|
||||||
},
|
v2 = {
|
||||||
{
|
"defaultValue": null,
|
||||||
"defaultValue": null,
|
"kind": "LocalArgument",
|
||||||
"kind": "LocalArgument",
|
"name": "id"
|
||||||
"name": "id"
|
},
|
||||||
}
|
v3 = {
|
||||||
],
|
"defaultValue": null,
|
||||||
v1 = [
|
"kind": "LocalArgument",
|
||||||
|
"name": "snapshotId"
|
||||||
|
},
|
||||||
|
v4 = [
|
||||||
{
|
{
|
||||||
"kind": "Variable",
|
"kind": "Variable",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"variableName": "id"
|
"variableName": "id"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v2 = [
|
v5 = {
|
||||||
{
|
"kind": "Variable",
|
||||||
"kind": "Variable",
|
"name": "after",
|
||||||
"name": "after",
|
"variableName": "after"
|
||||||
"variableName": "after"
|
},
|
||||||
},
|
v6 = {
|
||||||
{
|
"kind": "Variable",
|
||||||
"kind": "Variable",
|
"name": "first",
|
||||||
"name": "first",
|
"variableName": "first"
|
||||||
"variableName": "first"
|
},
|
||||||
}
|
v7 = {
|
||||||
],
|
"kind": "Variable",
|
||||||
v3 = {
|
"name": "snapshotId",
|
||||||
|
"variableName": "snapshotId"
|
||||||
|
},
|
||||||
|
v8 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "__typename",
|
"name": "__typename",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v4 = {
|
v9 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
};
|
},
|
||||||
|
v10 = [
|
||||||
|
(v5/*: any*/),
|
||||||
|
{
|
||||||
|
"fields": [
|
||||||
|
(v7/*: any*/)
|
||||||
|
],
|
||||||
|
"kind": "ObjectValue",
|
||||||
|
"name": "filter"
|
||||||
|
},
|
||||||
|
(v6/*: any*/)
|
||||||
|
];
|
||||||
return {
|
return {
|
||||||
"fragment": {
|
"fragment": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": [
|
||||||
|
(v0/*: any*/),
|
||||||
|
(v1/*: any*/),
|
||||||
|
(v2/*: any*/),
|
||||||
|
(v3/*: any*/)
|
||||||
|
],
|
||||||
"kind": "Fragment",
|
"kind": "Fragment",
|
||||||
"metadata": null,
|
"metadata": null,
|
||||||
"name": "ComplianceRegistriesPageRefetchQuery",
|
"name": "ComplianceRegistriesPageRefetchQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v1/*: any*/),
|
"args": (v4/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"args": (v2/*: any*/),
|
"args": [
|
||||||
|
(v5/*: any*/),
|
||||||
|
(v6/*: any*/),
|
||||||
|
(v7/*: any*/)
|
||||||
|
],
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "ComplianceRegistriesPageFragment"
|
"name": "ComplianceRegistriesPageFragment"
|
||||||
}
|
}
|
||||||
@@ -105,26 +132,31 @@ return {
|
|||||||
},
|
},
|
||||||
"kind": "Request",
|
"kind": "Request",
|
||||||
"operation": {
|
"operation": {
|
||||||
"argumentDefinitions": (v0/*: any*/),
|
"argumentDefinitions": [
|
||||||
|
(v0/*: any*/),
|
||||||
|
(v1/*: any*/),
|
||||||
|
(v3/*: any*/),
|
||||||
|
(v2/*: any*/)
|
||||||
|
],
|
||||||
"kind": "Operation",
|
"kind": "Operation",
|
||||||
"name": "ComplianceRegistriesPageRefetchQuery",
|
"name": "ComplianceRegistriesPageRefetchQuery",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v1/*: any*/),
|
"args": (v4/*: any*/),
|
||||||
"concreteType": null,
|
"concreteType": null,
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/),
|
(v8/*: any*/),
|
||||||
(v4/*: any*/),
|
(v9/*: any*/),
|
||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v2/*: any*/),
|
"args": (v10/*: any*/),
|
||||||
"concreteType": "ComplianceRegistryConnection",
|
"concreteType": "ComplianceRegistryConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "complianceRegistries",
|
"name": "complianceRegistries",
|
||||||
@@ -153,7 +185,21 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v4/*: any*/),
|
(v9/*: any*/),
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "snapshotId",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": null,
|
||||||
|
"args": null,
|
||||||
|
"kind": "ScalarField",
|
||||||
|
"name": "sourceId",
|
||||||
|
"storageKey": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -225,7 +271,7 @@ return {
|
|||||||
"name": "owner",
|
"name": "owner",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v4/*: any*/),
|
(v9/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -250,7 +296,7 @@ return {
|
|||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
(v3/*: any*/)
|
(v8/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
@@ -306,8 +352,10 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v2/*: any*/),
|
"args": (v10/*: any*/),
|
||||||
"filters": null,
|
"filters": [
|
||||||
|
"filter"
|
||||||
|
],
|
||||||
"handle": "connection",
|
"handle": "connection",
|
||||||
"key": "ComplianceRegistriesPage_complianceRegistries",
|
"key": "ComplianceRegistriesPage_complianceRegistries",
|
||||||
"kind": "LinkedHandle",
|
"kind": "LinkedHandle",
|
||||||
@@ -323,16 +371,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "2b10e1f8598c007ee1e3e93e39b51b0d",
|
"cacheID": "d14ed4a195ca3b570ad5ecd255cf17e8",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ComplianceRegistriesPageRefetchQuery",
|
"name": "ComplianceRegistriesPageRefetchQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query ComplianceRegistriesPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ComplianceRegistriesPageFragment_2HEEH6\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment_2HEEH6 on Organization {\n id\n complianceRegistries(first: $first, after: $after) {\n totalCount\n edges {\n node {\n id\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 ComplianceRegistriesPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ComplianceRegistriesPageFragment_35e0S5\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment_35e0S5 on Organization {\n id\n complianceRegistries(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"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "b6b97d09ba132cbc1ffb006c23a33589";
|
(node as any).hash = "b22ac157b9ba89ab14fe8363e56957ef";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
|
|||||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||||
import { ControlledField } from "/components/form/ControlledField";
|
import { ControlledField } from "/components/form/ControlledField";
|
||||||
import { SnapshotTypeOptions } from "/components/form/SnapshotTypeOptions";
|
import { SnapshotTypeOptions } from "/components/form/SnapshotTypeOptions";
|
||||||
|
import { snapshotTypes } from "@probo/helpers";
|
||||||
|
|
||||||
const snapshotCreateMutation = graphql`
|
const snapshotCreateMutation = graphql`
|
||||||
mutation SnapshotFormDialogCreateMutation(
|
mutation SnapshotFormDialogCreateMutation(
|
||||||
@@ -42,7 +43,7 @@ const snapshotCreateMutation = graphql`
|
|||||||
const snapshotSchema = z.object({
|
const snapshotSchema = z.object({
|
||||||
name: z.string().min(2, { message: "Name is required" }),
|
name: z.string().min(2, { message: "Name is required" }),
|
||||||
description: z.string().optional(),
|
description: z.string().optional(),
|
||||||
type: z.enum(["DATA", "NONCONFORMITY_REGISTRIES"]),
|
type: z.enum(snapshotTypes),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|||||||
@@ -9,8 +9,23 @@ export const complianceRegistryRoutes = [
|
|||||||
{
|
{
|
||||||
path: "compliance-registries",
|
path: "compliance-registries",
|
||||||
fallback: PageSkeleton,
|
fallback: PageSkeleton,
|
||||||
queryLoader: ({ organizationId }: { organizationId: string }) =>
|
queryLoader: (params: Record<string, string>) =>
|
||||||
loadQuery(relayEnvironment, complianceRegistriesQuery, { organizationId }),
|
loadQuery(relayEnvironment, complianceRegistriesQuery, {
|
||||||
|
organizationId: params.organizationId,
|
||||||
|
snapshotId: null
|
||||||
|
}),
|
||||||
|
Component: lazy(
|
||||||
|
() => import("/pages/organizations/complianceRegistries/ComplianceRegistriesPage")
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "snapshots/:snapshotId/compliance-registries",
|
||||||
|
fallback: PageSkeleton,
|
||||||
|
queryLoader: (params: Record<string, string>) =>
|
||||||
|
loadQuery(relayEnvironment, complianceRegistriesQuery, {
|
||||||
|
organizationId: params.organizationId,
|
||||||
|
snapshotId: params.snapshotId
|
||||||
|
}),
|
||||||
Component: lazy(
|
Component: lazy(
|
||||||
() => import("/pages/organizations/complianceRegistries/ComplianceRegistriesPage")
|
() => import("/pages/organizations/complianceRegistries/ComplianceRegistriesPage")
|
||||||
),
|
),
|
||||||
@@ -26,4 +41,15 @@ export const complianceRegistryRoutes = [
|
|||||||
() => import("/pages/organizations/complianceRegistries/ComplianceRegistryDetailsPage")
|
() => import("/pages/organizations/complianceRegistries/ComplianceRegistryDetailsPage")
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "snapshots/:snapshotId/compliance-registries/:registryId",
|
||||||
|
fallback: PageSkeleton,
|
||||||
|
queryLoader: (params: Record<string, string>) =>
|
||||||
|
loadQuery(relayEnvironment, complianceRegistryNodeQuery, {
|
||||||
|
complianceRegistryId: params.registryId
|
||||||
|
}),
|
||||||
|
Component: lazy(
|
||||||
|
() => import("/pages/organizations/complianceRegistries/ComplianceRegistryDetailsPage")
|
||||||
|
),
|
||||||
|
},
|
||||||
] satisfies AppRoute[];
|
] satisfies AppRoute[];
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ type Translator = (s: string) => string;
|
|||||||
export const snapshotTypes = [
|
export const snapshotTypes = [
|
||||||
"DATA",
|
"DATA",
|
||||||
"NONCONFORMITY_REGISTRIES",
|
"NONCONFORMITY_REGISTRIES",
|
||||||
|
"COMPLIANCE_REGISTRIES",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export function getSnapshotTypeLabel(__: Translator, type: string | null | undefined) {
|
export function getSnapshotTypeLabel(__: Translator, type: string | null | undefined) {
|
||||||
@@ -34,6 +35,8 @@ export function getSnapshotTypeUrlPath(type?: string): string {
|
|||||||
return "/data";
|
return "/data";
|
||||||
case "NONCONFORMITY_REGISTRIES":
|
case "NONCONFORMITY_REGISTRIES":
|
||||||
return "/nonconformity-registries";
|
return "/nonconformity-registries";
|
||||||
|
case "COMPLIANCE_REGISTRIES":
|
||||||
|
return "/compliance-registries";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ type (
|
|||||||
LastReviewDate *time.Time `db:"last_review_date"`
|
LastReviewDate *time.Time `db:"last_review_date"`
|
||||||
DueDate *time.Time `db:"due_date"`
|
DueDate *time.Time `db:"due_date"`
|
||||||
Status ComplianceRegistryStatus `db:"status"`
|
Status ComplianceRegistryStatus `db:"status"`
|
||||||
|
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||||
|
SourceID *gid.GID `db:"source_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"`
|
||||||
}
|
}
|
||||||
@@ -74,6 +76,8 @@ func (cr *ComplianceRegistry) LoadByID(
|
|||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
organization_id,
|
organization_id,
|
||||||
|
snapshot_id,
|
||||||
|
source_id,
|
||||||
reference_id,
|
reference_id,
|
||||||
area,
|
area,
|
||||||
source,
|
source,
|
||||||
@@ -119,6 +123,7 @@ func (crs *ComplianceRegistries) CountByOrganizationID(
|
|||||||
conn pg.Conn,
|
conn pg.Conn,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
organizationID gid.GID,
|
organizationID gid.GID,
|
||||||
|
filter *ComplianceRegistryFilter,
|
||||||
) (int, error) {
|
) (int, error) {
|
||||||
q := `
|
q := `
|
||||||
SELECT
|
SELECT
|
||||||
@@ -128,12 +133,14 @@ FROM
|
|||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND organization_id = @organization_id
|
AND organization_id = @organization_id
|
||||||
|
AND %s
|
||||||
`
|
`
|
||||||
|
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
maps.Copy(args, filter.SQLArguments())
|
||||||
|
|
||||||
row := conn.QueryRow(ctx, q, args)
|
row := conn.QueryRow(ctx, q, args)
|
||||||
|
|
||||||
@@ -152,6 +159,7 @@ func (crs *ComplianceRegistries) LoadByOrganizationID(
|
|||||||
scope Scoper,
|
scope Scoper,
|
||||||
organizationID gid.GID,
|
organizationID gid.GID,
|
||||||
cursor *page.Cursor[ComplianceRegistryOrderField],
|
cursor *page.Cursor[ComplianceRegistryOrderField],
|
||||||
|
filter *ComplianceRegistryFilter,
|
||||||
) error {
|
) error {
|
||||||
q := `
|
q := `
|
||||||
SELECT
|
SELECT
|
||||||
@@ -167,6 +175,8 @@ SELECT
|
|||||||
last_review_date,
|
last_review_date,
|
||||||
due_date,
|
due_date,
|
||||||
status,
|
status,
|
||||||
|
snapshot_id,
|
||||||
|
source_id,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
FROM
|
FROM
|
||||||
@@ -175,12 +185,14 @@ WHERE
|
|||||||
%s
|
%s
|
||||||
AND organization_id = @organization_id
|
AND organization_id = @organization_id
|
||||||
AND %s
|
AND %s
|
||||||
|
AND %s
|
||||||
`
|
`
|
||||||
|
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())
|
||||||
|
|
||||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||||
maps.Copy(args, scope.SQLArguments())
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
maps.Copy(args, filter.SQLArguments())
|
||||||
maps.Copy(args, cursor.SQLArguments())
|
maps.Copy(args, cursor.SQLArguments())
|
||||||
|
|
||||||
rows, err := conn.Query(ctx, q, args)
|
rows, err := conn.Query(ctx, q, args)
|
||||||
@@ -218,6 +230,8 @@ INSERT INTO compliance_registries (
|
|||||||
last_review_date,
|
last_review_date,
|
||||||
due_date,
|
due_date,
|
||||||
status,
|
status,
|
||||||
|
snapshot_id,
|
||||||
|
source_id,
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
) VALUES (
|
) VALUES (
|
||||||
@@ -234,6 +248,8 @@ INSERT INTO compliance_registries (
|
|||||||
@last_review_date,
|
@last_review_date,
|
||||||
@due_date,
|
@due_date,
|
||||||
@status,
|
@status,
|
||||||
|
@snapshot_id,
|
||||||
|
@source_id,
|
||||||
@created_at,
|
@created_at,
|
||||||
@updated_at
|
@updated_at
|
||||||
)
|
)
|
||||||
@@ -253,6 +269,8 @@ INSERT INTO compliance_registries (
|
|||||||
"last_review_date": cr.LastReviewDate,
|
"last_review_date": cr.LastReviewDate,
|
||||||
"due_date": cr.DueDate,
|
"due_date": cr.DueDate,
|
||||||
"status": cr.Status,
|
"status": cr.Status,
|
||||||
|
"snapshot_id": cr.SnapshotID,
|
||||||
|
"source_id": cr.SourceID,
|
||||||
"created_at": cr.CreatedAt,
|
"created_at": cr.CreatedAt,
|
||||||
"updated_at": cr.UpdatedAt,
|
"updated_at": cr.UpdatedAt,
|
||||||
}
|
}
|
||||||
@@ -286,6 +304,7 @@ UPDATE compliance_registries SET
|
|||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND id = @id
|
AND id = @id
|
||||||
|
AND snapshot_id IS NULL
|
||||||
`
|
`
|
||||||
|
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
@@ -324,6 +343,7 @@ DELETE FROM compliance_registries
|
|||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND id = @id
|
AND id = @id
|
||||||
|
AND snapshot_id IS NULL
|
||||||
`
|
`
|
||||||
|
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
@@ -338,3 +358,64 @@ WHERE
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (crs ComplianceRegistries) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||||
|
query := `
|
||||||
|
INSERT INTO compliance_registries (
|
||||||
|
id,
|
||||||
|
tenant_id,
|
||||||
|
snapshot_id,
|
||||||
|
source_id,
|
||||||
|
organization_id,
|
||||||
|
reference_id,
|
||||||
|
area,
|
||||||
|
source,
|
||||||
|
requirement,
|
||||||
|
actions_to_be_implemented,
|
||||||
|
regulator,
|
||||||
|
owner_id,
|
||||||
|
last_review_date,
|
||||||
|
due_date,
|
||||||
|
status,
|
||||||
|
created_at,
|
||||||
|
updated_at
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
generate_gid(decode_base64_unpadded(@tenant_id), @compliance_registry_entity_type),
|
||||||
|
@tenant_id,
|
||||||
|
@snapshot_id,
|
||||||
|
r.id,
|
||||||
|
r.organization_id,
|
||||||
|
r.reference_id,
|
||||||
|
r.area,
|
||||||
|
r.source,
|
||||||
|
r.requirement,
|
||||||
|
r.actions_to_be_implemented,
|
||||||
|
r.regulator,
|
||||||
|
r.owner_id,
|
||||||
|
r.last_review_date,
|
||||||
|
r.due_date,
|
||||||
|
r.status,
|
||||||
|
r.created_at,
|
||||||
|
r.updated_at
|
||||||
|
FROM compliance_registries r
|
||||||
|
WHERE %s AND r.organization_id = @organization_id AND r.snapshot_id IS NULL
|
||||||
|
`
|
||||||
|
|
||||||
|
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||||
|
|
||||||
|
args := pgx.StrictNamedArgs{
|
||||||
|
"tenant_id": scope.GetTenantID(),
|
||||||
|
"snapshot_id": snapshotID,
|
||||||
|
"organization_id": organizationID,
|
||||||
|
"compliance_registry_entity_type": ComplianceRegistryEntityType,
|
||||||
|
}
|
||||||
|
maps.Copy(args, scope.SQLArguments())
|
||||||
|
|
||||||
|
_, err := conn.Exec(ctx, query, args)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cannot insert compliance registry snapshots: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
54
pkg/coredata/compliance_registry_filter.go
Normal file
54
pkg/coredata/compliance_registry_filter.go
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||||
|
//
|
||||||
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
|
// copyright notice and this permission notice appear in all copies.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
// PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
package coredata
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/getprobo/probo/pkg/gid"
|
||||||
|
"github.com/jackc/pgx/v5"
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
ComplianceRegistryFilter struct {
|
||||||
|
snapshotID **gid.GID
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewComplianceRegistryFilter(snapshotID **gid.GID) *ComplianceRegistryFilter {
|
||||||
|
return &ComplianceRegistryFilter{
|
||||||
|
snapshotID: snapshotID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *ComplianceRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||||
|
args := pgx.NamedArgs{}
|
||||||
|
|
||||||
|
if f.snapshotID != nil && *f.snapshotID != nil {
|
||||||
|
args["filter_snapshot_id"] = **f.snapshotID
|
||||||
|
}
|
||||||
|
|
||||||
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *ComplianceRegistryFilter) SQLFragment() string {
|
||||||
|
if f.snapshotID == nil {
|
||||||
|
return "TRUE"
|
||||||
|
}
|
||||||
|
|
||||||
|
if *f.snapshotID == nil {
|
||||||
|
return "snapshot_id IS NULL"
|
||||||
|
} else {
|
||||||
|
return "snapshot_id = @filter_snapshot_id"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,13 +25,7 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewDatumFilter() *DatumFilter {
|
func NewDatumFilter(snapshotID **gid.GID) *DatumFilter {
|
||||||
return &DatumFilter{
|
|
||||||
snapshotID: nil,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDatumFilterBySnapshotID(snapshotID **gid.GID) *DatumFilter {
|
|
||||||
return &DatumFilter{
|
return &DatumFilter{
|
||||||
snapshotID: snapshotID,
|
snapshotID: snapshotID,
|
||||||
}
|
}
|
||||||
|
|||||||
11
pkg/coredata/migrations/20250828T201559Z.sql
Normal file
11
pkg/coredata/migrations/20250828T201559Z.sql
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
ALTER TABLE compliance_registries ADD COLUMN snapshot_id TEXT;
|
||||||
|
ALTER TABLE compliance_registries ADD COLUMN source_id TEXT;
|
||||||
|
|
||||||
|
ALTER TABLE compliance_registries ADD CONSTRAINT compliance_registries_snapshot_id_fkey
|
||||||
|
FOREIGN KEY (snapshot_id)
|
||||||
|
REFERENCES snapshots(id)
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
ON DELETE CASCADE;
|
||||||
|
|
||||||
|
ALTER TABLE compliance_registries ADD CONSTRAINT compliance_registries_source_id_snapshot_id_key
|
||||||
|
UNIQUE (source_id, snapshot_id);
|
||||||
@@ -25,18 +25,12 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewNonconformityRegistryFilter() *NonconformityRegistryFilter {
|
func NewNonconformityRegistryFilter(snapshotID **gid.GID) *NonconformityRegistryFilter {
|
||||||
return &NonconformityRegistryFilter{
|
return &NonconformityRegistryFilter{
|
||||||
snapshotID: nil,
|
snapshotID: nil,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewNonconformityRegistryFilterBySnapshotID(snapshotID **gid.GID) *NonconformityRegistryFilter {
|
|
||||||
return &NonconformityRegistryFilter{
|
|
||||||
snapshotID: snapshotID,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *NonconformityRegistryFilter) SQLArguments() pgx.NamedArgs {
|
func (f *NonconformityRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||||
args := pgx.NamedArgs{}
|
args := pgx.NamedArgs{}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ func GetSnapshottable(snapshotType SnapshotsType) (Snapshottable, error) {
|
|||||||
return Data{}, nil
|
return Data{}, nil
|
||||||
case SnapshotsTypeNonConformityRegistries:
|
case SnapshotsTypeNonConformityRegistries:
|
||||||
return NonconformityRegistries{}, nil
|
return NonconformityRegistries{}, nil
|
||||||
|
case SnapshotsTypeComplianceRegistries:
|
||||||
|
return ComplianceRegistries{}, nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unsupported snapshot type: %s", snapshotType)
|
return nil, fmt.Errorf("unsupported snapshot type: %s", snapshotType)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,20 +26,10 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewVendorFilter() *VendorFilter {
|
func NewVendorFilter(snapshotID **gid.GID, showOnTrustCenter *bool) *VendorFilter {
|
||||||
return &VendorFilter{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewVendorTrustCenterFilter() *VendorFilter {
|
|
||||||
showOnTrustCenter := true
|
|
||||||
return &VendorFilter{
|
return &VendorFilter{
|
||||||
showOnTrustCenter: &showOnTrustCenter,
|
snapshotID: snapshotID,
|
||||||
}
|
showOnTrustCenter: showOnTrustCenter,
|
||||||
}
|
|
||||||
|
|
||||||
func NewVendorFilterBySnapshotID(snapshotID **gid.GID) *VendorFilter {
|
|
||||||
return &VendorFilter{
|
|
||||||
snapshotID: snapshotID,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -231,9 +231,10 @@ func (s *ComplianceRegistryService) Delete(
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ComplianceRegistryService) CountByOrganizationID(
|
func (s ComplianceRegistryService) CountForOrganizationID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
organizationID gid.GID,
|
organizationID gid.GID,
|
||||||
|
filter *coredata.ComplianceRegistryFilter,
|
||||||
) (int, error) {
|
) (int, error) {
|
||||||
var count int
|
var count int
|
||||||
|
|
||||||
@@ -241,7 +242,7 @@ func (s ComplianceRegistryService) CountByOrganizationID(
|
|||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) (err error) {
|
func(conn pg.Conn) (err error) {
|
||||||
registries := coredata.ComplianceRegistries{}
|
registries := coredata.ComplianceRegistries{}
|
||||||
count, err = registries.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID)
|
count, err = registries.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID, filter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot count compliance registries: %w", err)
|
return fmt.Errorf("cannot count compliance registries: %w", err)
|
||||||
}
|
}
|
||||||
@@ -261,13 +262,14 @@ func (s ComplianceRegistryService) ListForOrganizationID(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
organizationID gid.GID,
|
organizationID gid.GID,
|
||||||
cursor *page.Cursor[coredata.ComplianceRegistryOrderField],
|
cursor *page.Cursor[coredata.ComplianceRegistryOrderField],
|
||||||
|
filter *coredata.ComplianceRegistryFilter,
|
||||||
) (*page.Page[*coredata.ComplianceRegistry, coredata.ComplianceRegistryOrderField], error) {
|
) (*page.Page[*coredata.ComplianceRegistry, coredata.ComplianceRegistryOrderField], error) {
|
||||||
var registries coredata.ComplianceRegistries
|
var registries coredata.ComplianceRegistries
|
||||||
|
|
||||||
err := s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
err := registries.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor)
|
err := registries.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor, filter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot load compliance registries: %w", err)
|
return fmt.Errorf("cannot load compliance registries: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1110,6 +1110,10 @@ input NonconformityRegistryFilter {
|
|||||||
snapshotId: ID
|
snapshotId: ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input ComplianceRegistryFilter {
|
||||||
|
snapshotId: ID
|
||||||
|
}
|
||||||
|
|
||||||
# Core Types
|
# Core Types
|
||||||
type TrustCenter implements Node {
|
type TrustCenter implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
@@ -1258,6 +1262,7 @@ type Organization implements Node {
|
|||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: ComplianceRegistryOrder
|
orderBy: ComplianceRegistryOrder
|
||||||
|
filter: ComplianceRegistryFilter
|
||||||
): ComplianceRegistryConnection! @goField(forceResolver: true)
|
): ComplianceRegistryConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
continualImprovementRegistries(
|
continualImprovementRegistries(
|
||||||
@@ -1721,6 +1726,8 @@ type NonconformityRegistry implements Node {
|
|||||||
|
|
||||||
type ComplianceRegistry implements Node {
|
type ComplianceRegistry implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
|
snapshotId: ID
|
||||||
|
sourceId: ID
|
||||||
organization: Organization! @goField(forceResolver: true)
|
organization: Organization! @goField(forceResolver: true)
|
||||||
referenceId: String!
|
referenceId: String!
|
||||||
area: String
|
area: String
|
||||||
|
|||||||
@@ -183,7 +183,9 @@ type ComplexityRoot struct {
|
|||||||
ReferenceID func(childComplexity int) int
|
ReferenceID func(childComplexity int) int
|
||||||
Regulator func(childComplexity int) int
|
Regulator func(childComplexity int) int
|
||||||
Requirement func(childComplexity int) int
|
Requirement func(childComplexity int) int
|
||||||
|
SnapshotID func(childComplexity int) int
|
||||||
Source func(childComplexity int) int
|
Source func(childComplexity int) int
|
||||||
|
SourceID func(childComplexity int) int
|
||||||
Status func(childComplexity int) int
|
Status func(childComplexity int) int
|
||||||
UpdatedAt func(childComplexity int) int
|
UpdatedAt func(childComplexity int) int
|
||||||
}
|
}
|
||||||
@@ -871,7 +873,7 @@ type ComplexityRoot struct {
|
|||||||
Organization struct {
|
Organization struct {
|
||||||
Assets func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.AssetOrderBy) int
|
Assets func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.AssetOrderBy) int
|
||||||
Audits func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.AuditOrderBy) int
|
Audits func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.AuditOrderBy) int
|
||||||
ComplianceRegistries func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ComplianceRegistryOrderBy) int
|
ComplianceRegistries func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ComplianceRegistryOrderBy, filter *types.ComplianceRegistryFilter) int
|
||||||
Connectors func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ConnectorOrder) int
|
Connectors func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ConnectorOrder) int
|
||||||
ContinualImprovementRegistries func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ContinualImprovementRegistriesOrderBy) int
|
ContinualImprovementRegistries func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ContinualImprovementRegistriesOrderBy) int
|
||||||
Controls func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy, filter *types.ControlFilter) int
|
Controls func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy, filter *types.ControlFilter) int
|
||||||
@@ -1669,7 +1671,7 @@ type OrganizationResolver interface {
|
|||||||
Data(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.DatumOrderBy, filter *types.DatumFilter) (*types.DatumConnection, error)
|
Data(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.DatumOrderBy, filter *types.DatumFilter) (*types.DatumConnection, error)
|
||||||
Audits(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.AuditOrderBy) (*types.AuditConnection, error)
|
Audits(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.AuditOrderBy) (*types.AuditConnection, error)
|
||||||
NonconformityRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.NonconformityRegistryOrderBy, filter *types.NonconformityRegistryFilter) (*types.NonconformityRegistryConnection, error)
|
NonconformityRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.NonconformityRegistryOrderBy, filter *types.NonconformityRegistryFilter) (*types.NonconformityRegistryConnection, error)
|
||||||
ComplianceRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ComplianceRegistryOrderBy) (*types.ComplianceRegistryConnection, error)
|
ComplianceRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ComplianceRegistryOrderBy, filter *types.ComplianceRegistryFilter) (*types.ComplianceRegistryConnection, error)
|
||||||
ContinualImprovementRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ContinualImprovementRegistriesOrderBy) (*types.ContinualImprovementRegistryConnection, error)
|
ContinualImprovementRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ContinualImprovementRegistriesOrderBy) (*types.ContinualImprovementRegistryConnection, error)
|
||||||
ProcessingActivityRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProcessingActivityRegistryOrderBy) (*types.ProcessingActivityRegistryConnection, error)
|
ProcessingActivityRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProcessingActivityRegistryOrderBy) (*types.ProcessingActivityRegistryConnection, error)
|
||||||
Snapshots(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.SnapshotOrderBy) (*types.SnapshotConnection, error)
|
Snapshots(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.SnapshotOrderBy) (*types.SnapshotConnection, error)
|
||||||
@@ -2155,6 +2157,13 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
|||||||
|
|
||||||
return e.complexity.ComplianceRegistry.Requirement(childComplexity), true
|
return e.complexity.ComplianceRegistry.Requirement(childComplexity), true
|
||||||
|
|
||||||
|
case "ComplianceRegistry.snapshotId":
|
||||||
|
if e.complexity.ComplianceRegistry.SnapshotID == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.ComplianceRegistry.SnapshotID(childComplexity), true
|
||||||
|
|
||||||
case "ComplianceRegistry.source":
|
case "ComplianceRegistry.source":
|
||||||
if e.complexity.ComplianceRegistry.Source == nil {
|
if e.complexity.ComplianceRegistry.Source == nil {
|
||||||
break
|
break
|
||||||
@@ -2162,6 +2171,13 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
|||||||
|
|
||||||
return e.complexity.ComplianceRegistry.Source(childComplexity), true
|
return e.complexity.ComplianceRegistry.Source(childComplexity), true
|
||||||
|
|
||||||
|
case "ComplianceRegistry.sourceId":
|
||||||
|
if e.complexity.ComplianceRegistry.SourceID == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return e.complexity.ComplianceRegistry.SourceID(childComplexity), true
|
||||||
|
|
||||||
case "ComplianceRegistry.status":
|
case "ComplianceRegistry.status":
|
||||||
if e.complexity.ComplianceRegistry.Status == nil {
|
if e.complexity.ComplianceRegistry.Status == nil {
|
||||||
break
|
break
|
||||||
@@ -5370,7 +5386,7 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
|||||||
return 0, false
|
return 0, false
|
||||||
}
|
}
|
||||||
|
|
||||||
return e.complexity.Organization.ComplianceRegistries(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.ComplianceRegistryOrderBy)), true
|
return e.complexity.Organization.ComplianceRegistries(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.ComplianceRegistryOrderBy), args["filter"].(*types.ComplianceRegistryFilter)), true
|
||||||
|
|
||||||
case "Organization.connectors":
|
case "Organization.connectors":
|
||||||
if e.complexity.Organization.Connectors == nil {
|
if e.complexity.Organization.Connectors == nil {
|
||||||
@@ -7655,6 +7671,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
|
|||||||
ec.unmarshalInputBulkPublishDocumentVersionsInput,
|
ec.unmarshalInputBulkPublishDocumentVersionsInput,
|
||||||
ec.unmarshalInputBulkRequestSignaturesInput,
|
ec.unmarshalInputBulkRequestSignaturesInput,
|
||||||
ec.unmarshalInputCancelSignatureRequestInput,
|
ec.unmarshalInputCancelSignatureRequestInput,
|
||||||
|
ec.unmarshalInputComplianceRegistryFilter,
|
||||||
ec.unmarshalInputComplianceRegistryOrder,
|
ec.unmarshalInputComplianceRegistryOrder,
|
||||||
ec.unmarshalInputConfirmEmailInput,
|
ec.unmarshalInputConfirmEmailInput,
|
||||||
ec.unmarshalInputConnectorOrder,
|
ec.unmarshalInputConnectorOrder,
|
||||||
@@ -9002,6 +9019,10 @@ input NonconformityRegistryFilter {
|
|||||||
snapshotId: ID
|
snapshotId: ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input ComplianceRegistryFilter {
|
||||||
|
snapshotId: ID
|
||||||
|
}
|
||||||
|
|
||||||
# Core Types
|
# Core Types
|
||||||
type TrustCenter implements Node {
|
type TrustCenter implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
@@ -9150,6 +9171,7 @@ type Organization implements Node {
|
|||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: ComplianceRegistryOrder
|
orderBy: ComplianceRegistryOrder
|
||||||
|
filter: ComplianceRegistryFilter
|
||||||
): ComplianceRegistryConnection! @goField(forceResolver: true)
|
): ComplianceRegistryConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
continualImprovementRegistries(
|
continualImprovementRegistries(
|
||||||
@@ -9613,6 +9635,8 @@ type NonconformityRegistry implements Node {
|
|||||||
|
|
||||||
type ComplianceRegistry implements Node {
|
type ComplianceRegistry implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
|
snapshotId: ID
|
||||||
|
sourceId: ID
|
||||||
organization: Organization! @goField(forceResolver: true)
|
organization: Organization! @goField(forceResolver: true)
|
||||||
referenceId: String!
|
referenceId: String!
|
||||||
area: String
|
area: String
|
||||||
@@ -15993,6 +16017,11 @@ func (ec *executionContext) field_Organization_complianceRegistries_args(ctx con
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
args["orderBy"] = arg4
|
args["orderBy"] = arg4
|
||||||
|
arg5, err := ec.field_Organization_complianceRegistries_argsFilter(ctx, rawArgs)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
args["filter"] = arg5
|
||||||
return args, nil
|
return args, nil
|
||||||
}
|
}
|
||||||
func (ec *executionContext) field_Organization_complianceRegistries_argsFirst(
|
func (ec *executionContext) field_Organization_complianceRegistries_argsFirst(
|
||||||
@@ -16060,6 +16089,19 @@ func (ec *executionContext) field_Organization_complianceRegistries_argsOrderBy(
|
|||||||
return zeroVal, nil
|
return zeroVal, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) field_Organization_complianceRegistries_argsFilter(
|
||||||
|
ctx context.Context,
|
||||||
|
rawArgs map[string]any,
|
||||||
|
) (*types.ComplianceRegistryFilter, error) {
|
||||||
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter"))
|
||||||
|
if tmp, ok := rawArgs["filter"]; ok {
|
||||||
|
return ec.unmarshalOComplianceRegistryFilter2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐComplianceRegistryFilter(ctx, tmp)
|
||||||
|
}
|
||||||
|
|
||||||
|
var zeroVal *types.ComplianceRegistryFilter
|
||||||
|
return zeroVal, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) field_Organization_connectors_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
func (ec *executionContext) field_Organization_connectors_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
||||||
var err error
|
var err error
|
||||||
args := map[string]any{}
|
args := map[string]any{}
|
||||||
@@ -21086,6 +21128,88 @@ func (ec *executionContext) fieldContext_ComplianceRegistry_id(_ context.Context
|
|||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _ComplianceRegistry_snapshotId(ctx context.Context, field graphql.CollectedField, obj *types.ComplianceRegistry) (ret graphql.Marshaler) {
|
||||||
|
fc, err := ec.fieldContext_ComplianceRegistry_snapshotId(ctx, field)
|
||||||
|
if err != nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
ec.Error(ctx, ec.Recover(ctx, r))
|
||||||
|
ret = graphql.Null
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return obj.SnapshotID, nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
if resTmp == nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(*gid.GID)
|
||||||
|
fc.Result = res
|
||||||
|
return ec.marshalOID2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_ComplianceRegistry_snapshotId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "ComplianceRegistry",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
return nil, errors.New("field of type ID does not have child fields")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) _ComplianceRegistry_sourceId(ctx context.Context, field graphql.CollectedField, obj *types.ComplianceRegistry) (ret graphql.Marshaler) {
|
||||||
|
fc, err := ec.fieldContext_ComplianceRegistry_sourceId(ctx, field)
|
||||||
|
if err != nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
ctx = graphql.WithFieldContext(ctx, fc)
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
ec.Error(ctx, ec.Recover(ctx, r))
|
||||||
|
ret = graphql.Null
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
|
ctx = rctx // use context from middleware stack in children
|
||||||
|
return obj.SourceID, nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ec.Error(ctx, err)
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
if resTmp == nil {
|
||||||
|
return graphql.Null
|
||||||
|
}
|
||||||
|
res := resTmp.(*gid.GID)
|
||||||
|
fc.Result = res
|
||||||
|
return ec.marshalOID2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) fieldContext_ComplianceRegistry_sourceId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
|
fc = &graphql.FieldContext{
|
||||||
|
Object: "ComplianceRegistry",
|
||||||
|
Field: field,
|
||||||
|
IsMethod: false,
|
||||||
|
IsResolver: false,
|
||||||
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
|
return nil, errors.New("field of type ID does not have child fields")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _ComplianceRegistry_organization(ctx context.Context, field graphql.CollectedField, obj *types.ComplianceRegistry) (ret graphql.Marshaler) {
|
func (ec *executionContext) _ComplianceRegistry_organization(ctx context.Context, field graphql.CollectedField, obj *types.ComplianceRegistry) (ret graphql.Marshaler) {
|
||||||
fc, err := ec.fieldContext_ComplianceRegistry_organization(ctx, field)
|
fc, err := ec.fieldContext_ComplianceRegistry_organization(ctx, field)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -21942,6 +22066,10 @@ func (ec *executionContext) fieldContext_ComplianceRegistryEdge_node(_ context.C
|
|||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "id":
|
case "id":
|
||||||
return ec.fieldContext_ComplianceRegistry_id(ctx, field)
|
return ec.fieldContext_ComplianceRegistry_id(ctx, field)
|
||||||
|
case "snapshotId":
|
||||||
|
return ec.fieldContext_ComplianceRegistry_snapshotId(ctx, field)
|
||||||
|
case "sourceId":
|
||||||
|
return ec.fieldContext_ComplianceRegistry_sourceId(ctx, field)
|
||||||
case "organization":
|
case "organization":
|
||||||
return ec.fieldContext_ComplianceRegistry_organization(ctx, field)
|
return ec.fieldContext_ComplianceRegistry_organization(ctx, field)
|
||||||
case "referenceId":
|
case "referenceId":
|
||||||
@@ -41945,7 +42073,7 @@ func (ec *executionContext) _Organization_complianceRegistries(ctx context.Conte
|
|||||||
}()
|
}()
|
||||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||||
ctx = rctx // use context from middleware stack in children
|
ctx = rctx // use context from middleware stack in children
|
||||||
return ec.resolvers.Organization().ComplianceRegistries(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.ComplianceRegistryOrderBy))
|
return ec.resolvers.Organization().ComplianceRegistries(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.ComplianceRegistryOrderBy), fc.Args["filter"].(*types.ComplianceRegistryFilter))
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ec.Error(ctx, err)
|
ec.Error(ctx, err)
|
||||||
@@ -49630,6 +49758,10 @@ func (ec *executionContext) fieldContext_UpdateComplianceRegistryPayload_complia
|
|||||||
switch field.Name {
|
switch field.Name {
|
||||||
case "id":
|
case "id":
|
||||||
return ec.fieldContext_ComplianceRegistry_id(ctx, field)
|
return ec.fieldContext_ComplianceRegistry_id(ctx, field)
|
||||||
|
case "snapshotId":
|
||||||
|
return ec.fieldContext_ComplianceRegistry_snapshotId(ctx, field)
|
||||||
|
case "sourceId":
|
||||||
|
return ec.fieldContext_ComplianceRegistry_sourceId(ctx, field)
|
||||||
case "organization":
|
case "organization":
|
||||||
return ec.fieldContext_ComplianceRegistry_organization(ctx, field)
|
return ec.fieldContext_ComplianceRegistry_organization(ctx, field)
|
||||||
case "referenceId":
|
case "referenceId":
|
||||||
@@ -59434,6 +59566,33 @@ func (ec *executionContext) unmarshalInputCancelSignatureRequestInput(ctx contex
|
|||||||
return it, nil
|
return it, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) unmarshalInputComplianceRegistryFilter(ctx context.Context, obj any) (types.ComplianceRegistryFilter, error) {
|
||||||
|
var it types.ComplianceRegistryFilter
|
||||||
|
asMap := map[string]any{}
|
||||||
|
for k, v := range obj.(map[string]any) {
|
||||||
|
asMap[k] = v
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldsInOrder := [...]string{"snapshotId"}
|
||||||
|
for _, k := range fieldsInOrder {
|
||||||
|
v, ok := asMap[k]
|
||||||
|
if !ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch k {
|
||||||
|
case "snapshotId":
|
||||||
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("snapshotId"))
|
||||||
|
data, err := ec.unmarshalOID2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, v)
|
||||||
|
if err != nil {
|
||||||
|
return it, err
|
||||||
|
}
|
||||||
|
it.SnapshotID = data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return it, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputComplianceRegistryOrder(ctx context.Context, obj any) (types.ComplianceRegistryOrderBy, error) {
|
func (ec *executionContext) unmarshalInputComplianceRegistryOrder(ctx context.Context, obj any) (types.ComplianceRegistryOrderBy, error) {
|
||||||
var it types.ComplianceRegistryOrderBy
|
var it types.ComplianceRegistryOrderBy
|
||||||
asMap := map[string]any{}
|
asMap := map[string]any{}
|
||||||
@@ -66673,6 +66832,10 @@ func (ec *executionContext) _ComplianceRegistry(ctx context.Context, sel ast.Sel
|
|||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
atomic.AddUint32(&out.Invalids, 1)
|
atomic.AddUint32(&out.Invalids, 1)
|
||||||
}
|
}
|
||||||
|
case "snapshotId":
|
||||||
|
out.Values[i] = ec._ComplianceRegistry_snapshotId(ctx, field, obj)
|
||||||
|
case "sourceId":
|
||||||
|
out.Values[i] = ec._ComplianceRegistry_sourceId(ctx, field, obj)
|
||||||
case "organization":
|
case "organization":
|
||||||
field := field
|
field := field
|
||||||
|
|
||||||
@@ -86692,6 +86855,14 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ec *executionContext) unmarshalOComplianceRegistryFilter2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐComplianceRegistryFilter(ctx context.Context, v any) (*types.ComplianceRegistryFilter, error) {
|
||||||
|
if v == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
res, err := ec.unmarshalInputComplianceRegistryFilter(ctx, v)
|
||||||
|
return &res, graphql.ErrorOnPath(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalOComplianceRegistryOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐComplianceRegistryOrderBy(ctx context.Context, v any) (*types.ComplianceRegistryOrderBy, error) {
|
func (ec *executionContext) unmarshalOComplianceRegistryOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐComplianceRegistryOrderBy(ctx context.Context, v any) (*types.ComplianceRegistryOrderBy, error) {
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ type (
|
|||||||
|
|
||||||
Resolver any
|
Resolver any
|
||||||
ParentID gid.GID
|
ParentID gid.GID
|
||||||
|
Filter *ComplianceRegistryFilter
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ func NewComplianceRegistryConnection(
|
|||||||
p *page.Page[*coredata.ComplianceRegistry, coredata.ComplianceRegistryOrderField],
|
p *page.Page[*coredata.ComplianceRegistry, coredata.ComplianceRegistryOrderField],
|
||||||
parentType any,
|
parentType any,
|
||||||
parentID gid.GID,
|
parentID gid.GID,
|
||||||
|
filter *ComplianceRegistryFilter,
|
||||||
) *ComplianceRegistryConnection {
|
) *ComplianceRegistryConnection {
|
||||||
edges := make([]*ComplianceRegistryEdge, len(p.Data))
|
edges := make([]*ComplianceRegistryEdge, len(p.Data))
|
||||||
for i, registry := range p.Data {
|
for i, registry := range p.Data {
|
||||||
@@ -49,12 +51,15 @@ func NewComplianceRegistryConnection(
|
|||||||
|
|
||||||
Resolver: parentType,
|
Resolver: parentType,
|
||||||
ParentID: parentID,
|
ParentID: parentID,
|
||||||
|
Filter: filter,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewComplianceRegistry(cr *coredata.ComplianceRegistry) *ComplianceRegistry {
|
func NewComplianceRegistry(cr *coredata.ComplianceRegistry) *ComplianceRegistry {
|
||||||
return &ComplianceRegistry{
|
return &ComplianceRegistry{
|
||||||
ID: cr.ID,
|
ID: cr.ID,
|
||||||
|
SnapshotID: cr.SnapshotID,
|
||||||
|
SourceID: cr.SourceID,
|
||||||
ReferenceID: cr.ReferenceID,
|
ReferenceID: cr.ReferenceID,
|
||||||
Area: cr.Area,
|
Area: cr.Area,
|
||||||
Source: cr.Source,
|
Source: cr.Source,
|
||||||
|
|||||||
@@ -109,6 +109,8 @@ type CancelSignatureRequestPayload struct {
|
|||||||
|
|
||||||
type ComplianceRegistry struct {
|
type ComplianceRegistry struct {
|
||||||
ID gid.GID `json:"id"`
|
ID gid.GID `json:"id"`
|
||||||
|
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
|
||||||
|
SourceID *gid.GID `json:"sourceId,omitempty"`
|
||||||
Organization *Organization `json:"organization"`
|
Organization *Organization `json:"organization"`
|
||||||
ReferenceID string `json:"referenceId"`
|
ReferenceID string `json:"referenceId"`
|
||||||
Area *string `json:"area,omitempty"`
|
Area *string `json:"area,omitempty"`
|
||||||
@@ -132,6 +134,10 @@ type ComplianceRegistryEdge struct {
|
|||||||
Node *ComplianceRegistry `json:"node"`
|
Node *ComplianceRegistry `json:"node"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ComplianceRegistryFilter struct {
|
||||||
|
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type ConfirmEmailInput struct {
|
type ConfirmEmailInput struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,7 +260,12 @@ func (r *complianceRegistryConnectionResolver) TotalCount(ctx context.Context, o
|
|||||||
|
|
||||||
switch obj.Resolver.(type) {
|
switch obj.Resolver.(type) {
|
||||||
case *organizationResolver:
|
case *organizationResolver:
|
||||||
count, err := prb.ComplianceRegistries.CountByOrganizationID(ctx, obj.ParentID)
|
complianceRegistryFilter := coredata.NewComplianceRegistryFilter(nil)
|
||||||
|
if obj.Filter != nil {
|
||||||
|
complianceRegistryFilter = coredata.NewComplianceRegistryFilter(&obj.Filter.SnapshotID)
|
||||||
|
}
|
||||||
|
|
||||||
|
count, err := prb.ComplianceRegistries.CountForOrganizationID(ctx, obj.ParentID, complianceRegistryFilter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot count compliance registries: %w", err))
|
panic(fmt.Errorf("cannot count compliance registries: %w", err))
|
||||||
}
|
}
|
||||||
@@ -3313,9 +3318,9 @@ func (r *nonconformityRegistryConnectionResolver) TotalCount(ctx context.Context
|
|||||||
|
|
||||||
switch obj.Resolver.(type) {
|
switch obj.Resolver.(type) {
|
||||||
case *organizationResolver:
|
case *organizationResolver:
|
||||||
nonconformityRegistryFilter := coredata.NewNonconformityRegistryFilterBySnapshotID(nil)
|
nonconformityRegistryFilter := coredata.NewNonconformityRegistryFilter(nil)
|
||||||
if obj.Filter != nil {
|
if obj.Filter != nil {
|
||||||
nonconformityRegistryFilter = coredata.NewNonconformityRegistryFilterBySnapshotID(&obj.Filter.SnapshotID)
|
nonconformityRegistryFilter = coredata.NewNonconformityRegistryFilter(&obj.Filter.SnapshotID)
|
||||||
}
|
}
|
||||||
|
|
||||||
count, err := prb.NonconformityRegistries.CountForOrganizationID(ctx, obj.ParentID, nonconformityRegistryFilter)
|
count, err := prb.NonconformityRegistries.CountForOrganizationID(ctx, obj.ParentID, nonconformityRegistryFilter)
|
||||||
@@ -3455,7 +3460,7 @@ func (r *organizationResolver) Vendors(ctx context.Context, obj *types.Organizat
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
var nilSnapshotID *gid.GID = nil
|
var nilSnapshotID *gid.GID = nil
|
||||||
vendorFilter := coredata.NewVendorFilterBySnapshotID(&nilSnapshotID)
|
vendorFilter := coredata.NewVendorFilter(&nilSnapshotID, nil)
|
||||||
|
|
||||||
page, err := prb.Vendors.ListForOrganizationID(ctx, obj.ID, cursor, vendorFilter)
|
page, err := prb.Vendors.ListForOrganizationID(ctx, obj.ID, cursor, vendorFilter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -3652,9 +3657,9 @@ func (r *organizationResolver) Data(ctx context.Context, obj *types.Organization
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
datumFilter := coredata.NewDatumFilterBySnapshotID(nil)
|
datumFilter := coredata.NewDatumFilter(nil)
|
||||||
if filter != nil {
|
if filter != nil {
|
||||||
datumFilter = coredata.NewDatumFilterBySnapshotID(&filter.SnapshotID)
|
datumFilter = coredata.NewDatumFilter(&filter.SnapshotID)
|
||||||
}
|
}
|
||||||
|
|
||||||
page, err := prb.Data.ListForOrganizationID(ctx, obj.ID, cursor, datumFilter)
|
page, err := prb.Data.ListForOrganizationID(ctx, obj.ID, cursor, datumFilter)
|
||||||
@@ -3707,9 +3712,9 @@ func (r *organizationResolver) NonconformityRegistries(ctx context.Context, obj
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
nonconformityRegistryFilter := coredata.NewNonconformityRegistryFilterBySnapshotID(nil)
|
nonconformityRegistryFilter := coredata.NewNonconformityRegistryFilter(nil)
|
||||||
if filter != nil {
|
if filter != nil {
|
||||||
nonconformityRegistryFilter = coredata.NewNonconformityRegistryFilterBySnapshotID(&filter.SnapshotID)
|
nonconformityRegistryFilter = coredata.NewNonconformityRegistryFilter(&filter.SnapshotID)
|
||||||
}
|
}
|
||||||
|
|
||||||
page, err := prb.NonconformityRegistries.ListForOrganizationID(ctx, obj.ID, cursor, nonconformityRegistryFilter)
|
page, err := prb.NonconformityRegistries.ListForOrganizationID(ctx, obj.ID, cursor, nonconformityRegistryFilter)
|
||||||
@@ -3721,7 +3726,7 @@ func (r *organizationResolver) NonconformityRegistries(ctx context.Context, obj
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ComplianceRegistries is the resolver for the complianceRegistries field.
|
// ComplianceRegistries is the resolver for the complianceRegistries field.
|
||||||
func (r *organizationResolver) ComplianceRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ComplianceRegistryOrderBy) (*types.ComplianceRegistryConnection, error) {
|
func (r *organizationResolver) ComplianceRegistries(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ComplianceRegistryOrderBy, filter *types.ComplianceRegistryFilter) (*types.ComplianceRegistryConnection, error) {
|
||||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.ComplianceRegistryOrderField]{
|
pageOrderBy := page.OrderBy[coredata.ComplianceRegistryOrderField]{
|
||||||
@@ -3737,12 +3742,17 @@ func (r *organizationResolver) ComplianceRegistries(ctx context.Context, obj *ty
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
page, err := prb.ComplianceRegistries.ListForOrganizationID(ctx, obj.ID, cursor)
|
complianceRegistryFilter := coredata.NewComplianceRegistryFilter(nil)
|
||||||
|
if filter != nil {
|
||||||
|
complianceRegistryFilter = coredata.NewComplianceRegistryFilter(&filter.SnapshotID)
|
||||||
|
}
|
||||||
|
|
||||||
|
page, err := prb.ComplianceRegistries.ListForOrganizationID(ctx, obj.ID, cursor, complianceRegistryFilter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("cannot list organization compliance registries: %w", err))
|
panic(fmt.Errorf("cannot list organization compliance registries: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewComplianceRegistryConnection(page, r, obj.ID), nil
|
return types.NewComplianceRegistryConnection(page, r, obj.ID, filter), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContinualImprovementRegistries is the resolver for the continualImprovementRegistries field.
|
// ContinualImprovementRegistries is the resolver for the continualImprovementRegistries field.
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ func (s VendorService) ListForOrganizationId(
|
|||||||
err := s.svc.pg.WithConn(
|
err := s.svc.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
filter := coredata.NewVendorTrustCenterFilter()
|
showOnTrustCenter := true
|
||||||
|
filter := coredata.NewVendorFilter(nil, &showOnTrustCenter)
|
||||||
err := vendors.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor, filter)
|
err := vendors.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor, filter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot load vendors: %w", err)
|
return fmt.Errorf("cannot load vendors: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user