Add assets snapshots

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-08-29 19:05:17 +02:00
parent 612149afc8
commit 89036d3a0f
25 changed files with 839 additions and 186 deletions

View File

@@ -5,10 +5,10 @@ import { useTranslate } from "@probo/i18n";
import { promisifyMutation, sprintf } from "@probo/helpers";
export const assetsQuery = graphql`
query AssetGraphListQuery($organizationId: ID!) {
query AssetGraphListQuery($organizationId: ID!, $snapshotId: ID) {
node(id: $organizationId) {
... on Organization {
...AssetsPageFragment
...AssetsPageFragment @arguments(snapshotId: $snapshotId)
}
}
}
@@ -19,6 +19,7 @@ export const assetNodeQuery = graphql`
node(id: $assetId) {
... on Asset {
id
snapshotId
name
amount
criticity
@@ -54,6 +55,7 @@ export const createAssetMutation = graphql`
assetEdge @prependEdge(connections: $connections) {
node {
id
snapshotId
name
amount
criticity
@@ -63,7 +65,7 @@ export const createAssetMutation = graphql`
id
fullName
}
vendors(first: 10) {
vendors(first: 50) {
edges {
node {
id
@@ -84,6 +86,7 @@ export const updateAssetMutation = graphql`
updateAsset(input: $input) {
asset {
id
snapshotId
name
amount
criticity

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<8ddee1e0195c3af2818a78e1224ad297>>
* @generated SignedSource<<9f6605e9adebeee2a681da0278642501>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -40,6 +40,7 @@ export type AssetGraphCreateMutation$data = {
readonly fullName: string;
readonly id: string;
};
readonly snapshotId: string | null | undefined;
readonly vendors: {
readonly edges: ReadonlyArray<{
readonly node: {
@@ -107,6 +108,13 @@ v5 = {
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "snapshotId",
"storageKey": null
},
(v4/*: any*/),
{
"alias": null,
@@ -161,7 +169,7 @@ v5 = {
{
"kind": "Literal",
"name": "first",
"value": 10
"value": 50
}
],
"concreteType": "VendorConnection",
@@ -201,7 +209,7 @@ v5 = {
"storageKey": null
}
],
"storageKey": "vendors(first:10)"
"storageKey": "vendors(first:50)"
},
{
"alias": null,
@@ -282,16 +290,16 @@ return {
]
},
"params": {
"cacheID": "f1d2e4e85879e08931d9d6815cc51ec1",
"cacheID": "f11f5052ed6dd175bd701812c0cd136b",
"id": null,
"metadata": {},
"name": "AssetGraphCreateMutation",
"operationKind": "mutation",
"text": "mutation AssetGraphCreateMutation(\n $input: CreateAssetInput!\n) {\n createAsset(input: $input) {\n assetEdge {\n node {\n id\n name\n amount\n criticity\n assetType\n dataTypesStored\n owner {\n id\n fullName\n }\n vendors(first: 10) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n }\n }\n }\n}\n"
"text": "mutation AssetGraphCreateMutation(\n $input: CreateAssetInput!\n) {\n createAsset(input: $input) {\n assetEdge {\n node {\n id\n snapshotId\n name\n amount\n criticity\n assetType\n dataTypesStored\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "5053ed385668e9f51d916a194ea8936d";
(node as any).hash = "3cec119022d8dffb8536d93294e2633b";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<8758668524dc47bc04757126d7f423b3>>
* @generated SignedSource<<8d257a13d23e2dd68542540dd12ca35b>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -12,6 +12,7 @@ import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type AssetGraphListQuery$variables = {
organizationId: string;
snapshotId?: string | null | undefined;
};
export type AssetGraphListQuery$data = {
readonly node: {
@@ -29,6 +30,11 @@ var v0 = [
"defaultValue": null,
"kind": "LocalArgument",
"name": "organizationId"
},
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "snapshotId"
}
],
v1 = [
@@ -38,28 +44,40 @@ v1 = [
"variableName": "organizationId"
}
],
v2 = {
v2 = [
{
"kind": "Variable",
"name": "snapshotId",
"variableName": "snapshotId"
}
],
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v3 = {
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v4 = [
v5 = [
{
"fields": (v2/*: any*/),
"kind": "ObjectValue",
"name": "filter"
},
{
"kind": "Literal",
"name": "first",
"value": 10
}
],
v5 = {
v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
@@ -85,7 +103,7 @@ return {
"kind": "InlineFragment",
"selections": [
{
"args": null,
"args": (v2/*: any*/),
"kind": "FragmentSpread",
"name": "AssetsPageFragment"
}
@@ -114,14 +132,14 @@ return {
"name": "node",
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"alias": null,
"args": (v4/*: any*/),
"args": (v5/*: any*/),
"concreteType": "AssetConnection",
"kind": "LinkedField",
"name": "assets",
@@ -143,8 +161,15 @@ return {
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v5/*: any*/),
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "snapshotId",
"storageKey": null
},
(v6/*: any*/),
{
"alias": null,
"args": null,
@@ -181,7 +206,7 @@ return {
"name": "owner",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/),
{
"alias": null,
"args": null,
@@ -222,8 +247,8 @@ return {
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v5/*: any*/),
(v4/*: any*/),
(v6/*: any*/),
{
"alias": null,
"args": null,
@@ -247,7 +272,7 @@ return {
"name": "createdAt",
"storageKey": null
},
(v2/*: any*/)
(v3/*: any*/)
],
"storageKey": null
},
@@ -313,13 +338,13 @@ return {
]
}
],
"storageKey": "assets(first:10)"
"storageKey": null
},
{
"alias": null,
"args": (v4/*: any*/),
"args": (v5/*: any*/),
"filters": [
"orderBy"
"filter"
],
"handle": "connection",
"key": "AssetsPage_assets",
@@ -336,16 +361,16 @@ return {
]
},
"params": {
"cacheID": "7e293e732d5ff8246a1ed772e1c33984",
"cacheID": "29eec1243d3cceb5d9931562635e1f24",
"id": null,
"metadata": {},
"name": "AssetGraphListQuery",
"operationKind": "query",
"text": "query AssetGraphListQuery(\n $organizationId: ID!\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...AssetsPageFragment\n }\n id\n }\n}\n\nfragment AssetsPageFragment on Organization {\n assets(first: 10) {\n edges {\n node {\n id\n name\n amount\n criticity\n assetType\n dataTypesStored\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
"text": "query AssetGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...AssetsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment AssetsPageFragment_3iomuz on Organization {\n assets(first: 10, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n snapshotId\n name\n amount\n criticity\n assetType\n dataTypesStored\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
}
};
})();
(node as any).hash = "88644d5fcb5f2e017df4b5d6373ce27f";
(node as any).hash = "4cbb1234b0884823285d3660334a2b29";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<bdc352ae0c426ad29ff6e0f53dc357cf>>
* @generated SignedSource<<f1d88685da6d13c894f029b8ac4cf3e4>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -28,6 +28,7 @@ export type AssetGraphNodeQuery$data = {
readonly fullName: string;
readonly id: string;
};
readonly snapshotId?: string | null | undefined;
readonly updatedAt?: any;
readonly vendors?: {
readonly edges: ReadonlyArray<{
@@ -72,38 +73,45 @@ v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"name": "snapshotId",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "amount",
"name": "name",
"storageKey": null
},
v5 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "criticity",
"name": "amount",
"storageKey": null
},
v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "assetType",
"name": "criticity",
"storageKey": null
},
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataTypesStored",
"name": "assetType",
"storageKey": null
},
v8 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataTypesStored",
"storageKey": null
},
v9 = {
"alias": null,
"args": null,
"concreteType": "People",
@@ -122,7 +130,7 @@ v8 = {
],
"storageKey": null
},
v9 = {
v10 = {
"alias": null,
"args": [
{
@@ -153,7 +161,7 @@ v9 = {
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
{
"alias": null,
"args": null,
@@ -177,14 +185,14 @@ v9 = {
],
"storageKey": "vendors(first:50)"
},
v10 = {
v11 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
v11 = {
v12 = {
"alias": null,
"args": null,
"kind": "ScalarField",
@@ -218,7 +226,8 @@ return {
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
(v11/*: any*/)
(v11/*: any*/),
(v12/*: any*/)
],
"type": "Asset",
"abstractKey": null
@@ -263,7 +272,8 @@ return {
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
(v11/*: any*/)
(v11/*: any*/),
(v12/*: any*/)
],
"type": "Asset",
"abstractKey": null
@@ -274,16 +284,16 @@ return {
]
},
"params": {
"cacheID": "cd1d7c48ccf01acee749af3b8948fb9a",
"cacheID": "6c6e10d25c9bd116703346393adb7a3f",
"id": null,
"metadata": {},
"name": "AssetGraphNodeQuery",
"operationKind": "query",
"text": "query AssetGraphNodeQuery(\n $assetId: ID!\n) {\n node(id: $assetId) {\n __typename\n ... on Asset {\n id\n name\n amount\n criticity\n assetType\n dataTypesStored\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n category\n }\n }\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
"text": "query AssetGraphNodeQuery(\n $assetId: ID!\n) {\n node(id: $assetId) {\n __typename\n ... on Asset {\n id\n snapshotId\n name\n amount\n criticity\n assetType\n dataTypesStored\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n category\n }\n }\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
}
};
})();
(node as any).hash = "47e84c9ea1c9ab9310ad493219c12f3f";
(node as any).hash = "60053f70c9a65d4658be7b830a3dae72";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<ead1e328f3bc8ddc8f4c98cee6838ee9>>
* @generated SignedSource<<6bc692e9d9ab5b78611dc2a326227761>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -37,6 +37,7 @@ export type AssetGraphUpdateMutation$data = {
readonly fullName: string;
readonly id: string;
};
readonly snapshotId: string | null | undefined;
readonly updatedAt: any;
readonly vendors: {
readonly edges: ReadonlyArray<{
@@ -101,6 +102,13 @@ v3 = [
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "snapshotId",
"storageKey": null
},
(v2/*: any*/),
{
"alias": null,
@@ -229,16 +237,16 @@ return {
"selections": (v3/*: any*/)
},
"params": {
"cacheID": "f5e4ccc38f842f4965c32676ae407012",
"cacheID": "1447ea6f965bbd6fcdba1ebc72e2d23f",
"id": null,
"metadata": {},
"name": "AssetGraphUpdateMutation",
"operationKind": "mutation",
"text": "mutation AssetGraphUpdateMutation(\n $input: UpdateAssetInput!\n) {\n updateAsset(input: $input) {\n asset {\n id\n name\n amount\n criticity\n assetType\n dataTypesStored\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n updatedAt\n }\n }\n}\n"
"text": "mutation AssetGraphUpdateMutation(\n $input: UpdateAssetInput!\n) {\n updateAsset(input: $input) {\n asset {\n id\n snapshotId\n name\n amount\n criticity\n assetType\n dataTypesStored\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "257fa8f1a9996808403fa65a06b61ba2";
(node as any).hash = "21b0c94b6245eb849e6118a58fb97490";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<4453e7e28a9c546de765219f287f129a>>
* @generated SignedSource<<676223ac3bde5a9edf7e3d68fe3ed981>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -38,7 +38,6 @@ export type ProcessingActivityRegistryGraphNodeQuery$data = {
readonly retentionPeriod?: string | null | undefined;
readonly securityMeasures?: string | null | undefined;
readonly snapshotId?: string | null | undefined;
readonly sourceId?: string | null | undefined;
readonly specialOrCriminalData?: ProcessingActivityRegistrySpecialOrCriminalData;
readonly transferImpactAssessment?: ProcessingActivityRegistryTransferImpactAssessment;
readonly transferSafeguards?: ProcessingActivityRegistryTransferSafeguards | null | undefined;
@@ -83,115 +82,108 @@ v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "sourceId",
"name": "name",
"storageKey": null
},
v5 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"name": "purpose",
"storageKey": null
},
v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "purpose",
"name": "dataSubjectCategory",
"storageKey": null
},
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataSubjectCategory",
"name": "personalDataCategory",
"storageKey": null
},
v8 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "personalDataCategory",
"name": "specialOrCriminalData",
"storageKey": null
},
v9 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "specialOrCriminalData",
"name": "consentEvidenceLink",
"storageKey": null
},
v10 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "consentEvidenceLink",
"name": "lawfulBasis",
"storageKey": null
},
v11 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "lawfulBasis",
"name": "recipients",
"storageKey": null
},
v12 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "recipients",
"name": "location",
"storageKey": null
},
v13 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "location",
"name": "internationalTransfers",
"storageKey": null
},
v14 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "internationalTransfers",
"name": "transferSafeguards",
"storageKey": null
},
v15 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "transferSafeguards",
"name": "retentionPeriod",
"storageKey": null
},
v16 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "retentionPeriod",
"name": "securityMeasures",
"storageKey": null
},
v17 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "securityMeasures",
"name": "dataProtectionImpactAssessment",
"storageKey": null
},
v18 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataProtectionImpactAssessment",
"storageKey": null
},
v19 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "transferImpactAssessment",
"storageKey": null
},
v20 = {
v19 = {
"alias": null,
"args": null,
"concreteType": "Organization",
@@ -200,18 +192,18 @@ v20 = {
"plural": false,
"selections": [
(v2/*: any*/),
(v5/*: any*/)
(v4/*: any*/)
],
"storageKey": null
},
v21 = {
v20 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
v22 = {
v21 = {
"alias": null,
"args": null,
"kind": "ScalarField",
@@ -255,8 +247,7 @@ return {
(v18/*: any*/),
(v19/*: any*/),
(v20/*: any*/),
(v21/*: any*/),
(v22/*: any*/)
(v21/*: any*/)
],
"type": "ProcessingActivityRegistry",
"abstractKey": null
@@ -311,8 +302,7 @@ return {
(v18/*: any*/),
(v19/*: any*/),
(v20/*: any*/),
(v21/*: any*/),
(v22/*: any*/)
(v21/*: any*/)
],
"type": "ProcessingActivityRegistry",
"abstractKey": null
@@ -323,16 +313,16 @@ return {
]
},
"params": {
"cacheID": "b8a3edd61ea5d94cc3594f40f181d27f",
"cacheID": "10b9608f3b93e930c05f415a0ac9fbec",
"id": null,
"metadata": {},
"name": "ProcessingActivityRegistryGraphNodeQuery",
"operationKind": "query",
"text": "query ProcessingActivityRegistryGraphNodeQuery(\n $processingActivityRegistryId: ID!\n) {\n node(id: $processingActivityRegistryId) {\n __typename\n ... on ProcessingActivityRegistry {\n id\n snapshotId\n sourceId\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
"text": "query ProcessingActivityRegistryGraphNodeQuery(\n $processingActivityRegistryId: ID!\n) {\n node(id: $processingActivityRegistryId) {\n __typename\n ... on ProcessingActivityRegistry {\n id\n snapshotId\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
}
};
})();
(node as any).hash = "6714c1965f54321530f73a5b7ef86fa6";
(node as any).hash = "c1728cff79a3773498b383bb32728cf6";
export default node;