From 36b4be02c789f94c52e055d4871a09cf435107c0 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Mon, 28 Oct 2024 08:17:57 +0100 Subject: [PATCH 1/3] TASK: Remove unnecessary node-sass --- .../JavaScript/media-module/package.json | 1 - yarn.lock | 651 +----------------- 2 files changed, 32 insertions(+), 620 deletions(-) diff --git a/Resources/Private/JavaScript/media-module/package.json b/Resources/Private/JavaScript/media-module/package.json index a6372cc1e..a77855ffb 100644 --- a/Resources/Private/JavaScript/media-module/package.json +++ b/Resources/Private/JavaScript/media-module/package.json @@ -56,7 +56,6 @@ "@types/react-dom": "^17.0.20", "@types/react-dropzone": "^5.1.0", "apollo-server-express": "^2.26.1", - "node-sass": "^8.0.0", "parcel": "^2.9.1" } } diff --git a/yarn.lock b/yarn.lock index 534076c1f..0037f71cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2147,7 +2147,7 @@ __metadata: languageName: node linkType: hard -"@gar/promisify@npm:^1.0.1, @gar/promisify@npm:^1.1.3": +"@gar/promisify@npm:^1.1.3": version: 1.1.3 resolution: "@gar/promisify@npm:1.1.3" checksum: 4059f790e2d07bf3c3ff3e0fec0daa8144fe35c1f6e0111c9921bd32106adaa97a4ab096ad7dab1e28ee6a9060083c4d1a4ada42a7f5f3f7a96b8812e2b757c1 @@ -2471,7 +2471,6 @@ __metadata: graphql: ^15.8.0 lodash.clonedeep: ^4.5.0 media-type: ^0.3.1 - node-sass: ^8.0.0 parcel: ^2.9.1 react: ^17.0.2 react-dnd: ^10.0.2 @@ -2735,16 +2734,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/fs@npm:^1.0.0": - version: 1.1.1 - resolution: "@npmcli/fs@npm:1.1.1" - dependencies: - "@gar/promisify": ^1.0.1 - semver: ^7.3.5 - checksum: f5ad92f157ed222e4e31c352333d0901df02c7c04311e42a81d8eb555d4ec4276ea9c635011757de20cc476755af33e91622838de573b17e52e2e7703f0a9965 - languageName: node - linkType: hard - "@npmcli/fs@npm:^2.1.0": version: 2.1.2 resolution: "@npmcli/fs@npm:2.1.2" @@ -2755,16 +2744,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/move-file@npm:^1.0.1": - version: 1.1.2 - resolution: "@npmcli/move-file@npm:1.1.2" - dependencies: - mkdirp: ^1.0.4 - rimraf: ^3.0.2 - checksum: c96381d4a37448ea280951e46233f7e541058cf57a57d4094dd4bdcaae43fa5872b5f2eb6bfb004591a68e29c5877abe3cdc210cb3588cbf20ab2877f31a7de7 - languageName: node - linkType: hard - "@npmcli/move-file@npm:^2.0.0": version: 2.0.1 resolution: "@npmcli/move-file@npm:2.0.1" @@ -3707,13 +3686,6 @@ __metadata: languageName: node linkType: hard -"@tootallnate/once@npm:1": - version: 1.1.2 - resolution: "@tootallnate/once@npm:1.1.2" - checksum: e1fb1bbbc12089a0cb9433dc290f97bddd062deadb6178ce9bcb93bb7c1aecde5e60184bc7065aec42fe1663622a213493c48bbd4972d931aae48315f18e1be9 - languageName: node - linkType: hard - "@tootallnate/once@npm:2": version: 2.0.0 resolution: "@tootallnate/once@npm:2.0.0" @@ -4007,13 +3979,6 @@ __metadata: languageName: node linkType: hard -"@types/minimist@npm:^1.2.0": - version: 1.2.2 - resolution: "@types/minimist@npm:1.2.2" - checksum: b8da83c66eb4aac0440e64674b19564d9d86c80ae273144db9681e5eeff66f238ade9515f5006ffbfa955ceff8b89ad2bd8ec577d7caee74ba101431fb07045d - languageName: node - linkType: hard - "@types/node@npm:*": version: 18.14.6 resolution: "@types/node@npm:18.14.6" @@ -4042,13 +4007,6 @@ __metadata: languageName: node linkType: hard -"@types/normalize-package-data@npm:^2.4.0": - version: 2.4.1 - resolution: "@types/normalize-package-data@npm:2.4.1" - checksum: e87bccbf11f95035c89a132b52b79ce69a1e3652fe55962363063c9c0dae0fe2477ebc585e03a9652adc6f381d24ba5589cc5e51849df4ced3d3e004a7d40ed5 - languageName: node - linkType: hard - "@types/parse-json@npm:^4.0.0": version: 4.0.0 resolution: "@types/parse-json@npm:4.0.0" @@ -4663,7 +4621,7 @@ __metadata: languageName: node linkType: hard -"agentkeepalive@npm:^4.1.3, agentkeepalive@npm:^4.2.1": +"agentkeepalive@npm:^4.2.1": version: 4.3.0 resolution: "agentkeepalive@npm:4.3.0" dependencies: @@ -5279,13 +5237,6 @@ __metadata: languageName: node linkType: hard -"async-foreach@npm:^0.1.3": - version: 0.1.3 - resolution: "async-foreach@npm:0.1.3" - checksum: cc43dee65de4decfa521d9444fb87edb2d475e7125d7f63d0d12004d12953e382135a2ea89a83b145ee1b9ec140550c804e1bfca24085d6faeb52c2902acd1f1 - languageName: node - linkType: hard - "async-retry@npm:^1.2.1": version: 1.3.1 resolution: "async-retry@npm:1.3.1" @@ -6749,32 +6700,6 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^15.2.0": - version: 15.3.0 - resolution: "cacache@npm:15.3.0" - dependencies: - "@npmcli/fs": ^1.0.0 - "@npmcli/move-file": ^1.0.1 - chownr: ^2.0.0 - fs-minipass: ^2.0.0 - glob: ^7.1.4 - infer-owner: ^1.0.4 - lru-cache: ^6.0.0 - minipass: ^3.1.1 - minipass-collect: ^1.0.2 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.2 - mkdirp: ^1.0.3 - p-map: ^4.0.0 - promise-inflight: ^1.0.1 - rimraf: ^3.0.2 - ssri: ^8.0.1 - tar: ^6.0.2 - unique-filename: ^1.1.1 - checksum: a07327c27a4152c04eb0a831c63c00390d90f94d51bb80624a66f4e14a6b6360bbf02a84421267bd4d00ca73ac9773287d8d7169e8d2eafe378d2ce140579db8 - languageName: node - linkType: hard - "cacache@npm:^16.1.0": version: 16.1.3 resolution: "cacache@npm:16.1.3" @@ -6884,17 +6809,6 @@ __metadata: languageName: node linkType: hard -"camelcase-keys@npm:^6.2.2": - version: 6.2.2 - resolution: "camelcase-keys@npm:6.2.2" - dependencies: - camelcase: ^5.3.1 - map-obj: ^4.0.0 - quick-lru: ^4.0.1 - checksum: 43c9af1adf840471e54c68ab3e5fe8a62719a6b7dbf4e2e86886b7b0ff96112c945736342b837bd2529ec9d1c7d1934e5653318478d98e0cf22c475c04658e2a - languageName: node - linkType: hard - "camelcase@npm:^4.1.0": version: 4.1.0 resolution: "camelcase@npm:4.1.0" @@ -6916,24 +6830,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30000929": - version: 1.0.30001478 - resolution: "caniuse-lite@npm:1.0.30001478" - checksum: 27a370dcb32a6a35e186307aabc570da1cd0fccc849913665e7df6822a87286de99509b163304e0586c23c539a991717fb68ed84b85bbd21b2cb86475ae5ffb2 - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001449": - version: 1.0.30001460 - resolution: "caniuse-lite@npm:1.0.30001460" - checksum: dad91eb82aa65aecf33ad6a04ad620b9df6f0152020dc6c1874224e8c6f4aa50695f585201b3dfcd2760b3c43326a86c9505cc03af856698fbef67b267ef786f - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001580": - version: 1.0.30001587 - resolution: "caniuse-lite@npm:1.0.30001587" - checksum: fb50aa9beaaae42f9feae92ce038f6ff71e97510f024ef1bef2666f3adcfd36d6c59e5675442e5fe795575193f71bc826cb7721d4b0f6d763e82d193bea57863 +"caniuse-lite@npm:^1.0.30000929, caniuse-lite@npm:^1.0.30001449, caniuse-lite@npm:^1.0.30001580": + version: 1.0.30001671 + resolution: "caniuse-lite@npm:1.0.30001671" + checksum: a90b4a55e05135ebf9fa31473a7db0285a6fd472d2d96b01723fe566b6d1412d6f05179ded5a265e831da9b2adb3412f7bbbfa334869c2af0bafe34a894625bb languageName: node linkType: hard @@ -7872,17 +7772,7 @@ __metadata: languageName: node linkType: hard -"decamelize-keys@npm:^1.1.0": - version: 1.1.1 - resolution: "decamelize-keys@npm:1.1.1" - dependencies: - decamelize: ^1.1.0 - map-obj: ^1.0.0 - checksum: fc645fe20b7bda2680bbf9481a3477257a7f9304b1691036092b97ab04c0ab53e3bf9fcc2d2ae382536568e402ec41fb11e1d4c3836a9abe2d813dd9ef4311e0 - languageName: node - linkType: hard - -"decamelize@npm:^1.1.0, decamelize@npm:^1.1.1, decamelize@npm:^1.2.0": +"decamelize@npm:^1.1.1": version: 1.2.0 resolution: "decamelize@npm:1.2.0" checksum: ad8c51a7e7e0720c70ec2eeb1163b66da03e7616d7b98c9ef43cce2416395e84c1e9548dd94f5f6ffecfee9f8b94251fc57121a8b021f2ff2469b2bae247b8aa @@ -8401,7 +8291,7 @@ __metadata: languageName: node linkType: hard -"encoding@npm:^0.1.11, encoding@npm:^0.1.12, encoding@npm:^0.1.13": +"encoding@npm:^0.1.11, encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" dependencies: @@ -9326,16 +9216,6 @@ __metadata: languageName: node linkType: hard -"find-up@npm:^4.1.0": - version: 4.1.0 - resolution: "find-up@npm:4.1.0" - dependencies: - locate-path: ^5.0.0 - path-exists: ^4.0.0 - checksum: 4c172680e8f8c1f78839486e14a43ef82e9decd0e74145f40707cc42e7420506d5ec92d9a11c22bd2c48fb0c384ea05dd30e10dd152fefeec6f2f75282a8b844 - languageName: node - linkType: hard - "flat-cache@npm:^3.0.4": version: 3.0.4 resolution: "flat-cache@npm:3.0.4" @@ -9566,15 +9446,6 @@ __metadata: languageName: node linkType: hard -"gaze@npm:^1.0.0": - version: 1.1.3 - resolution: "gaze@npm:1.1.3" - dependencies: - globule: ^1.0.0 - checksum: d5fd375a029c07346154806a076bde21290598179d01ffbe7bc3e54092fa65814180bd27fc2b577582737733eec77cdbb7a572a4e73dff934dde60317223cde6 - languageName: node - linkType: hard - "gensync@npm:^1.0.0-beta.2": version: 1.0.0-beta.2 resolution: "gensync@npm:1.0.0-beta.2" @@ -9749,7 +9620,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.0.0, glob@npm:^7.0.3, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": +"glob@npm:^7.0.3, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -9776,20 +9647,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:~7.1.1": - version: 7.1.7 - resolution: "glob@npm:7.1.7" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^3.0.4 - once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: b61f48973bbdcf5159997b0874a2165db572b368b931135832599875919c237fc05c12984e38fe828e69aa8a921eb0e8a4997266211c517c9cfaae8a93988bb8 - languageName: node - linkType: hard - "global-modules@npm:2.0.0": version: 2.0.0 resolution: "global-modules@npm:2.0.0" @@ -9891,17 +9748,6 @@ __metadata: languageName: node linkType: hard -"globule@npm:^1.0.0": - version: 1.3.4 - resolution: "globule@npm:1.3.4" - dependencies: - glob: ~7.1.1 - lodash: ^4.17.21 - minimatch: ~3.0.2 - checksum: 258b6865c77d54fbd4c91dd6931d99baf81b1485fdf4bd2c053b1a10eab015163cb646e6c96812d5c8b027fb07adfc0b7c7fb13bbbb571f3c12ea60bd7fda2f5 - languageName: node - linkType: hard - "graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.2, graceful-fs@npm:^4.2.6": version: 4.2.10 resolution: "graceful-fs@npm:4.2.10" @@ -10065,13 +9911,6 @@ __metadata: languageName: node linkType: hard -"hard-rejection@npm:^2.1.0": - version: 2.1.0 - resolution: "hard-rejection@npm:2.1.0" - checksum: 7baaf80a0c7fff4ca79687b4060113f1529589852152fa935e6787a2bc96211e784ad4588fb3048136ff8ffc9dfcf3ae385314a5b24db32de20bea0d1597f9dc - languageName: node - linkType: hard - "has-ansi@npm:^2.0.0": version: 2.0.0 resolution: "has-ansi@npm:2.0.0" @@ -10263,22 +10102,6 @@ __metadata: languageName: node linkType: hard -"hosted-git-info@npm:^2.1.4": - version: 2.8.9 - resolution: "hosted-git-info@npm:2.8.9" - checksum: c955394bdab888a1e9bb10eb33029e0f7ce5a2ac7b3f158099dc8c486c99e73809dca609f5694b223920ca2174db33d32b12f9a2a47141dc59607c29da5a62dd - languageName: node - linkType: hard - -"hosted-git-info@npm:^4.0.1": - version: 4.1.0 - resolution: "hosted-git-info@npm:4.1.0" - dependencies: - lru-cache: ^6.0.0 - checksum: c3f87b3c2f7eb8c2748c8f49c0c2517c9a95f35d26f4bf54b2a8cba05d2e668f3753548b6ea366b18ec8dadb4e12066e19fa382a01496b0ffa0497eb23cbe461 - languageName: node - linkType: hard - "htmlnano@npm:^2.0.0": version: 2.0.3 resolution: "htmlnano@npm:2.0.3" @@ -10394,17 +10217,6 @@ __metadata: languageName: node linkType: hard -"http-proxy-agent@npm:^4.0.1": - version: 4.0.1 - resolution: "http-proxy-agent@npm:4.0.1" - dependencies: - "@tootallnate/once": 1 - agent-base: 6 - debug: 4 - checksum: c6a5da5a1929416b6bbdf77b1aca13888013fe7eb9d59fc292e25d18e041bb154a8dfada58e223fc7b76b9b2d155a87e92e608235201f77d34aa258707963a82 - languageName: node - linkType: hard - "http-proxy-agent@npm:^5.0.0": version: 5.0.0 resolution: "http-proxy-agent@npm:5.0.0" @@ -10924,7 +10736,7 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.5.0, is-core-module@npm:^2.9.0": +"is-core-module@npm:^2.9.0": version: 2.11.0 resolution: "is-core-module@npm:2.11.0" dependencies: @@ -11193,13 +11005,6 @@ __metadata: languageName: node linkType: hard -"is-plain-obj@npm:^1.1.0": - version: 1.1.0 - resolution: "is-plain-obj@npm:1.1.0" - checksum: 0ee04807797aad50859652a7467481816cbb57e5cc97d813a7dcd8915da8195dc68c436010bf39d195226cde6a2d352f4b815f16f26b7bf486a5754290629931 - languageName: node - linkType: hard - "is-plain-obj@npm:^2.1.0": version: 2.1.0 resolution: "is-plain-obj@npm:2.1.0" @@ -11387,13 +11192,6 @@ __metadata: languageName: node linkType: hard -"js-base64@npm:^2.4.9": - version: 2.6.4 - resolution: "js-base64@npm:2.6.4" - checksum: 5f4084078d6c46f8529741d110df84b14fac3276b903760c21fa8cc8521370d607325dfe1c1a9fbbeaae1ff8e602665aaeef1362427d8fef704f9e3659472ce8 - languageName: node - linkType: hard - "js-md4@npm:^0.3.2": version: 0.3.2 resolution: "js-md4@npm:0.3.2" @@ -11591,7 +11389,7 @@ __metadata: languageName: node linkType: hard -"kind-of@npm:^6.0.0, kind-of@npm:^6.0.2, kind-of@npm:^6.0.3": +"kind-of@npm:^6.0.0, kind-of@npm:^6.0.2": version: 6.0.3 resolution: "kind-of@npm:6.0.3" checksum: 3ab01e7b1d440b22fe4c31f23d8d38b4d9b91d9f291df683476576493d5dfd2e03848a8b05813dd0c3f0e835bc63f433007ddeceb71f05cb25c45ae1b19c6d3b @@ -11867,15 +11665,6 @@ __metadata: languageName: node linkType: hard -"locate-path@npm:^5.0.0": - version: 5.0.0 - resolution: "locate-path@npm:5.0.0" - dependencies: - p-locate: ^4.1.0 - checksum: 83e51725e67517287d73e1ded92b28602e3ae5580b301fe54bfb76c0c723e3f285b19252e375712316774cf52006cb236aed5704692c32db0d5d089b69696e30 - languageName: node - linkType: hard - "locate-path@npm:^6.0.0": version: 6.0.0 resolution: "locate-path@npm:6.0.0" @@ -11962,7 +11751,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:4.6.1 || ^4.16.1, lodash@npm:^4.14.0, lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.13, lodash@npm:^4.17.15, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.2.0": +"lodash@npm:4.6.1 || ^4.16.1, lodash@npm:^4.14.0, lodash@npm:^4.17.10, lodash@npm:^4.17.13, lodash@npm:^4.17.15, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.2.0": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 @@ -12125,7 +11914,7 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^10.0.3, make-fetch-happen@npm:^10.0.4": +"make-fetch-happen@npm:^10.0.3": version: 10.2.1 resolution: "make-fetch-happen@npm:10.2.1" dependencies: @@ -12149,30 +11938,6 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^9.1.0": - version: 9.1.0 - resolution: "make-fetch-happen@npm:9.1.0" - dependencies: - agentkeepalive: ^4.1.3 - cacache: ^15.2.0 - http-cache-semantics: ^4.1.0 - http-proxy-agent: ^4.0.1 - https-proxy-agent: ^5.0.0 - is-lambda: ^1.0.1 - lru-cache: ^6.0.0 - minipass: ^3.1.3 - minipass-collect: ^1.0.2 - minipass-fetch: ^1.3.2 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - negotiator: ^0.6.2 - promise-retry: ^2.0.1 - socks-proxy-agent: ^6.0.0 - ssri: ^8.0.0 - checksum: 0eb371c85fdd0b1584fcfdf3dc3c62395761b3c14658be02620c310305a9a7ecf1617a5e6fb30c1d081c5c8aaf177fa133ee225024313afabb7aa6a10f1e3d04 - languageName: node - linkType: hard - "map-cache@npm:^0.2.2": version: 0.2.2 resolution: "map-cache@npm:0.2.2" @@ -12180,20 +11945,6 @@ __metadata: languageName: node linkType: hard -"map-obj@npm:^1.0.0": - version: 1.0.1 - resolution: "map-obj@npm:1.0.1" - checksum: 9949e7baec2a336e63b8d4dc71018c117c3ce6e39d2451ccbfd3b8350c547c4f6af331a4cbe1c83193d7c6b786082b6256bde843db90cb7da2a21e8fcc28afed - languageName: node - linkType: hard - -"map-obj@npm:^4.0.0": - version: 4.3.0 - resolution: "map-obj@npm:4.3.0" - checksum: fbc554934d1a27a1910e842bc87b177b1a556609dd803747c85ece420692380827c6ae94a95cce4407c054fa0964be3bf8226f7f2cb2e9eeee432c7c1985684e - languageName: node - linkType: hard - "map-visit@npm:^1.0.0": version: 1.0.0 resolution: "map-visit@npm:1.0.0" @@ -12282,26 +12033,6 @@ __metadata: languageName: node linkType: hard -"meow@npm:^9.0.0": - version: 9.0.0 - resolution: "meow@npm:9.0.0" - dependencies: - "@types/minimist": ^1.2.0 - camelcase-keys: ^6.2.2 - decamelize: ^1.2.0 - decamelize-keys: ^1.1.0 - hard-rejection: ^2.1.0 - minimist-options: 4.1.0 - normalize-package-data: ^3.0.0 - read-pkg-up: ^7.0.1 - redent: ^3.0.0 - trim-newlines: ^3.0.0 - type-fest: ^0.18.0 - yargs-parser: ^20.2.3 - checksum: 99799c47247f4daeee178e3124f6ef6f84bde2ba3f37652865d5d8f8b8adcf9eedfc551dd043e2455cd8206545fd848e269c0c5ab6b594680a0ad4d3617c9639 - languageName: node - linkType: hard - "merge-descriptors@npm:1.0.1": version: 1.0.1 resolution: "merge-descriptors@npm:1.0.1" @@ -12455,13 +12186,6 @@ __metadata: languageName: node linkType: hard -"min-indent@npm:^1.0.0": - version: 1.0.1 - resolution: "min-indent@npm:1.0.1" - checksum: bfc6dd03c5eaf623a4963ebd94d087f6f4bbbfd8c41329a7f09706b0cb66969c4ddd336abeb587bc44bc6f08e13bf90f0b374f9d71f9f01e04adc2cd6f083ef1 - languageName: node - linkType: hard - "mini-css-extract-plugin@npm:^0.5.0": version: 0.5.0 resolution: "mini-css-extract-plugin@npm:0.5.0" @@ -12527,26 +12251,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:~3.0.2": - version: 3.0.8 - resolution: "minimatch@npm:3.0.8" - dependencies: - brace-expansion: ^1.1.7 - checksum: 850cca179cad715133132693e6963b0db64ab0988c4d211415b087fc23a3e46321e2c5376a01bf5623d8782aba8bdf43c571e2e902e51fdce7175c7215c29f8b - languageName: node - linkType: hard - -"minimist-options@npm:4.1.0": - version: 4.1.0 - resolution: "minimist-options@npm:4.1.0" - dependencies: - arrify: ^1.0.1 - is-plain-obj: ^1.1.0 - kind-of: ^6.0.3 - checksum: 8c040b3068811e79de1140ca2b708d3e203c8003eb9a414c1ab3cd467fc5f17c9ca02a5aef23bedc51a7f8bfbe77f87e9a7e31ec81fba304cda675b019496f4e - languageName: node - linkType: hard - "minimist@npm:^1.1.0, minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" @@ -12563,21 +12267,6 @@ __metadata: languageName: node linkType: hard -"minipass-fetch@npm:^1.3.2": - version: 1.4.1 - resolution: "minipass-fetch@npm:1.4.1" - dependencies: - encoding: ^0.1.12 - minipass: ^3.1.0 - minipass-sized: ^1.0.3 - minizlib: ^2.0.0 - dependenciesMeta: - encoding: - optional: true - checksum: ec93697bdb62129c4e6c0104138e681e30efef8c15d9429dd172f776f83898471bc76521b539ff913248cc2aa6d2b37b652c993504a51cc53282563640f29216 - languageName: node - linkType: hard - "minipass-fetch@npm:^2.0.3": version: 2.1.2 resolution: "minipass-fetch@npm:2.1.2" @@ -12602,7 +12291,7 @@ __metadata: languageName: node linkType: hard -"minipass-pipeline@npm:^1.2.2, minipass-pipeline@npm:^1.2.4": +"minipass-pipeline@npm:^1.2.4": version: 1.2.4 resolution: "minipass-pipeline@npm:1.2.4" dependencies: @@ -12620,7 +12309,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0, minipass@npm:^3.1.0, minipass@npm:^3.1.1, minipass@npm:^3.1.3, minipass@npm:^3.1.6": +"minipass@npm:^3.0.0, minipass@npm:^3.1.1, minipass@npm:^3.1.6": version: 3.3.6 resolution: "minipass@npm:3.3.6" dependencies: @@ -12636,7 +12325,7 @@ __metadata: languageName: node linkType: hard -"minizlib@npm:^2.0.0, minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": +"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" dependencies: @@ -12841,7 +12530,7 @@ __metadata: languageName: node linkType: hard -"nan@npm:^2.12.1, nan@npm:^2.17.0": +"nan@npm:^2.12.1": version: 2.17.0 resolution: "nan@npm:2.17.0" dependencies: @@ -12930,7 +12619,7 @@ __metadata: languageName: node linkType: hard -"negotiator@npm:0.6.3, negotiator@npm:^0.6.2, negotiator@npm:^0.6.3": +"negotiator@npm:0.6.3, negotiator@npm:^0.6.3": version: 0.6.3 resolution: "negotiator@npm:0.6.3" checksum: b8ffeb1e262eff7968fc90a2b6767b04cfd9842582a9d0ece0af7049537266e7b2506dfb1d107a32f06dd849ab2aea834d5830f7f4d0e5cb7d36e1ae55d021d9 @@ -13072,26 +12761,6 @@ __metadata: languageName: node linkType: hard -"node-gyp@npm:^8.4.1": - version: 8.4.1 - resolution: "node-gyp@npm:8.4.1" - dependencies: - env-paths: ^2.2.0 - glob: ^7.1.4 - graceful-fs: ^4.2.6 - make-fetch-happen: ^9.1.0 - nopt: ^5.0.0 - npmlog: ^6.0.0 - rimraf: ^3.0.2 - semver: ^7.3.5 - tar: ^6.1.2 - which: ^2.0.2 - bin: - node-gyp: bin/node-gyp.js - checksum: 341710b5da39d3660e6a886b37e210d33f8282047405c2e62c277bcc744c7552c5b8b972ebc3a7d5c2813794e60cc48c3ebd142c46d6e0321db4db6c92dd0355 - languageName: node - linkType: hard - "node-gyp@npm:^9.3.1, node-gyp@npm:latest": version: 9.3.1 resolution: "node-gyp@npm:9.3.1" @@ -13164,30 +12833,6 @@ __metadata: languageName: node linkType: hard -"node-sass@npm:^8.0.0": - version: 8.0.0 - resolution: "node-sass@npm:8.0.0" - dependencies: - async-foreach: ^0.1.3 - chalk: ^4.1.2 - cross-spawn: ^7.0.3 - gaze: ^1.0.0 - get-stdin: ^4.0.1 - glob: ^7.0.3 - lodash: ^4.17.15 - make-fetch-happen: ^10.0.4 - meow: ^9.0.0 - nan: ^2.17.0 - node-gyp: ^8.4.1 - sass-graph: ^4.0.1 - stdout-stream: ^1.4.0 - true-case-path: ^2.2.1 - bin: - node-sass: bin/node-sass - checksum: 92c1c78600a89b9cc03ce1fe1212e107163973dbdd2c548751cd3187c56713c944952a477aedcb8f2c332fba6e098fd992e25ee62552c1ba80f75e252f6ef3c3 - languageName: node - linkType: hard - "nodemon@npm:^2.0.22": version: 2.0.22 resolution: "nodemon@npm:2.0.22" @@ -13208,17 +12853,6 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^5.0.0": - version: 5.0.0 - resolution: "nopt@npm:5.0.0" - dependencies: - abbrev: 1 - bin: - nopt: bin/nopt.js - checksum: d35fdec187269503843924e0114c0c6533fb54bbf1620d0f28b4b60ba01712d6687f62565c55cc20a504eff0fbe5c63e22340c3fad549ad40469ffb611b04f2f - languageName: node - linkType: hard - "nopt@npm:^6.0.0": version: 6.0.0 resolution: "nopt@npm:6.0.0" @@ -13241,30 +12875,6 @@ __metadata: languageName: node linkType: hard -"normalize-package-data@npm:^2.5.0": - version: 2.5.0 - resolution: "normalize-package-data@npm:2.5.0" - dependencies: - hosted-git-info: ^2.1.4 - resolve: ^1.10.0 - semver: 2 || 3 || 4 || 5 - validate-npm-package-license: ^3.0.1 - checksum: 7999112efc35a6259bc22db460540cae06564aa65d0271e3bdfa86876d08b0e578b7b5b0028ee61b23f1cae9fc0e7847e4edc0948d3068a39a2a82853efc8499 - languageName: node - linkType: hard - -"normalize-package-data@npm:^3.0.0": - version: 3.0.3 - resolution: "normalize-package-data@npm:3.0.3" - dependencies: - hosted-git-info: ^4.0.1 - is-core-module: ^2.5.0 - semver: ^7.3.4 - validate-npm-package-license: ^3.0.1 - checksum: bbcee00339e7c26fdbc760f9b66d429258e2ceca41a5df41f5df06cc7652de8d82e8679ff188ca095cad8eff2b6118d7d866af2b68400f74602fbcbce39c160a - languageName: node - linkType: hard - "normalize-path@npm:^2.1.1": version: 2.1.1 resolution: "normalize-path@npm:2.1.1" @@ -13618,7 +13228,7 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^2.0.0, p-limit@npm:^2.2.0": +"p-limit@npm:^2.0.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" dependencies: @@ -13654,15 +13264,6 @@ __metadata: languageName: node linkType: hard -"p-locate@npm:^4.1.0": - version: 4.1.0 - resolution: "p-locate@npm:4.1.0" - dependencies: - p-limit: ^2.2.0 - checksum: 513bd14a455f5da4ebfcb819ef706c54adb09097703de6aeaa5d26fe5ea16df92b48d1ac45e01e3944ce1e6aa2a66f7f8894742b8c9d6e276e16cd2049a2b870 - languageName: node - linkType: hard - "p-locate@npm:^5.0.0": version: 5.0.0 resolution: "p-locate@npm:5.0.0" @@ -14628,13 +14229,6 @@ __metadata: languageName: node linkType: hard -"quick-lru@npm:^4.0.1": - version: 4.0.1 - resolution: "quick-lru@npm:4.0.1" - checksum: bea46e1abfaa07023e047d3cf1716a06172c4947886c053ede5c50321893711577cb6119360f810cc3ffcd70c4d7db4069c3cee876b358ceff8596e062bd1154 - languageName: node - linkType: hard - "raf@npm:^3.1.0, raf@npm:^3.4.1": version: 3.4.1 resolution: "raf@npm:3.4.1" @@ -15028,29 +14622,6 @@ __metadata: languageName: node linkType: hard -"read-pkg-up@npm:^7.0.1": - version: 7.0.1 - resolution: "read-pkg-up@npm:7.0.1" - dependencies: - find-up: ^4.1.0 - read-pkg: ^5.2.0 - type-fest: ^0.8.1 - checksum: e4e93ce70e5905b490ca8f883eb9e48b5d3cebc6cd4527c25a0d8f3ae2903bd4121c5ab9c5a3e217ada0141098eeb661313c86fa008524b089b8ed0b7f165e44 - languageName: node - linkType: hard - -"read-pkg@npm:^5.2.0": - version: 5.2.0 - resolution: "read-pkg@npm:5.2.0" - dependencies: - "@types/normalize-package-data": ^2.4.0 - normalize-package-data: ^2.5.0 - parse-json: ^5.0.0 - type-fest: ^0.6.0 - checksum: eb696e60528b29aebe10e499ba93f44991908c57d70f2d26f369e46b8b9afc208ef11b4ba64f67630f31df8b6872129e0a8933c8c53b7b4daf0eace536901222 - languageName: node - linkType: hard - "readable-stream@npm:1 || 2, readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.2, readable-stream@npm:^2.1.5, readable-stream@npm:^2.2.2, readable-stream@npm:^2.3.3, readable-stream@npm:^2.3.6, readable-stream@npm:~2.3.6": version: 2.3.7 resolution: "readable-stream@npm:2.3.7" @@ -15137,16 +14708,6 @@ __metadata: languageName: node linkType: hard -"redent@npm:^3.0.0": - version: 3.0.0 - resolution: "redent@npm:3.0.0" - dependencies: - indent-string: ^4.0.0 - strip-indent: ^3.0.0 - checksum: fa1ef20404a2d399235e83cc80bd55a956642e37dd197b4b612ba7327bf87fa32745aeb4a1634b2bab25467164ab4ed9c15be2c307923dd08b0fe7c52431ae6b - languageName: node - linkType: hard - "redux@npm:^4.0.4": version: 4.1.0 resolution: "redux@npm:4.1.0" @@ -15421,7 +14982,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.22.1": +"resolve@npm:^1.14.2, resolve@npm:^1.22.1": version: 1.22.1 resolution: "resolve@npm:1.22.1" dependencies: @@ -15460,7 +15021,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.22.1#~builtin": +"resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.22.1#~builtin": version: 1.22.1 resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d" dependencies: @@ -15642,20 +15203,6 @@ __metadata: languageName: node linkType: hard -"sass-graph@npm:^4.0.1": - version: 4.0.1 - resolution: "sass-graph@npm:4.0.1" - dependencies: - glob: ^7.0.0 - lodash: ^4.17.11 - scss-tokenizer: ^0.4.3 - yargs: ^17.2.1 - bin: - sassgraph: bin/sassgraph - checksum: 896f99253bd77a429a95e483ebddee946e195b61d3f84b3e1ccf8ad843265ec0585fa40bf55fbf354c5f57eb9fd0349834a8b190cd2161ab1234cb9af10e3601 - languageName: node - linkType: hard - "sass@npm:^1.58.3": version: 1.60.0 resolution: "sass@npm:1.60.0" @@ -15708,25 +15255,6 @@ __metadata: languageName: node linkType: hard -"scss-tokenizer@npm:^0.4.3": - version: 0.4.3 - resolution: "scss-tokenizer@npm:0.4.3" - dependencies: - js-base64: ^2.4.9 - source-map: ^0.7.3 - checksum: f3697bb155ae23d88c7cd0275988a73231fe675fbbd250b4e56849ba66319fc249a597f3799a92f9890b12007f00f8f6a7f441283e634679e2acdb2287a341d1 - languageName: node - linkType: hard - -"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.0, semver@npm:^5.7.1": - version: 5.7.1 - resolution: "semver@npm:5.7.1" - bin: - semver: ./bin/semver - checksum: 57fd0acfd0bac382ee87cd52cd0aaa5af086a7dc8d60379dfe65fea491fb2489b6016400813930ecd61fd0952dae75c115287a1b16c234b1550887117744dfaf - languageName: node - linkType: hard - "semver@npm:5.5.0": version: 5.5.0 resolution: "semver@npm:5.5.0" @@ -15747,6 +15275,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.0, semver@npm:^5.7.1": + version: 5.7.1 + resolution: "semver@npm:5.7.1" + bin: + semver: ./bin/semver + checksum: 57fd0acfd0bac382ee87cd52cd0aaa5af086a7dc8d60379dfe65fea491fb2489b6016400813930ecd61fd0952dae75c115287a1b16c234b1550887117744dfaf + languageName: node + linkType: hard + "semver@npm:^6.0.0, semver@npm:^6.3.0": version: 6.3.0 resolution: "semver@npm:6.3.0" @@ -16114,17 +15651,6 @@ __metadata: languageName: node linkType: hard -"socks-proxy-agent@npm:^6.0.0": - version: 6.2.1 - resolution: "socks-proxy-agent@npm:6.2.1" - dependencies: - agent-base: ^6.0.2 - debug: ^4.3.3 - socks: ^2.6.2 - checksum: 9ca089d489e5ee84af06741135c4b0d2022977dad27ac8d649478a114cdce87849e8d82b7c22b51501a4116e231241592946fc7fae0afc93b65030ee57084f58 - languageName: node - linkType: hard - "socks-proxy-agent@npm:^7.0.0": version: 7.0.0 resolution: "socks-proxy-agent@npm:7.0.0" @@ -16246,40 +15772,6 @@ __metadata: languageName: node linkType: hard -"spdx-correct@npm:^3.0.0": - version: 3.2.0 - resolution: "spdx-correct@npm:3.2.0" - dependencies: - spdx-expression-parse: ^3.0.0 - spdx-license-ids: ^3.0.0 - checksum: e9ae98d22f69c88e7aff5b8778dc01c361ef635580e82d29e5c60a6533cc8f4d820803e67d7432581af0cc4fb49973125076ee3b90df191d153e223c004193b2 - languageName: node - linkType: hard - -"spdx-exceptions@npm:^2.1.0": - version: 2.3.0 - resolution: "spdx-exceptions@npm:2.3.0" - checksum: cb69a26fa3b46305637123cd37c85f75610e8c477b6476fa7354eb67c08128d159f1d36715f19be6f9daf4b680337deb8c65acdcae7f2608ba51931540687ac0 - languageName: node - linkType: hard - -"spdx-expression-parse@npm:^3.0.0": - version: 3.0.1 - resolution: "spdx-expression-parse@npm:3.0.1" - dependencies: - spdx-exceptions: ^2.1.0 - spdx-license-ids: ^3.0.0 - checksum: a1c6e104a2cbada7a593eaa9f430bd5e148ef5290d4c0409899855ce8b1c39652bcc88a725259491a82601159d6dc790bedefc9016c7472f7de8de7361f8ccde - languageName: node - linkType: hard - -"spdx-license-ids@npm:^3.0.0": - version: 3.0.12 - resolution: "spdx-license-ids@npm:3.0.12" - checksum: 92a4dddce62ce1db6fe54a7a839cf85e06abc308fc83b776a55b44e4f1906f02e7ebd506120847039e976bbbad359ea8bdfafb7925eae5cd7e73255f02e0b7d6 - languageName: node - linkType: hard - "split-string@npm:^3.0.1, split-string@npm:^3.0.2": version: 3.1.0 resolution: "split-string@npm:3.1.0" @@ -16312,15 +15804,6 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^8.0.0, ssri@npm:^8.0.1": - version: 8.0.1 - resolution: "ssri@npm:8.0.1" - dependencies: - minipass: ^3.1.1 - checksum: bc447f5af814fa9713aa201ec2522208ae0f4d8f3bda7a1f445a797c7b929a02720436ff7c478fb5edc4045adb02b1b88d2341b436a80798734e2494f1067b36 - languageName: node - linkType: hard - "ssri@npm:^9.0.0": version: 9.0.1 resolution: "ssri@npm:9.0.1" @@ -16368,15 +15851,6 @@ __metadata: languageName: node linkType: hard -"stdout-stream@npm:^1.4.0": - version: 1.4.1 - resolution: "stdout-stream@npm:1.4.1" - dependencies: - readable-stream: ^2.0.1 - checksum: 205bee8c3ba4e1e1d471b9302764405d2ee5dd272af6e9a71c95a9af6cf2ad8f4d102099a917c591ba9e14c1b2b5f5244f7a526e9d3cf311327cecd7c2bd4c2e - languageName: node - linkType: hard - "stream-browserify@npm:^2.0.1": version: 2.0.2 resolution: "stream-browserify@npm:2.0.2" @@ -16587,15 +16061,6 @@ __metadata: languageName: node linkType: hard -"strip-indent@npm:^3.0.0": - version: 3.0.0 - resolution: "strip-indent@npm:3.0.0" - dependencies: - min-indent: ^1.0.0 - checksum: 18f045d57d9d0d90cd16f72b2313d6364fd2cb4bf85b9f593523ad431c8720011a4d5f08b6591c9d580f446e78855c5334a30fb91aa1560f5d9f95ed1b4a0530 - languageName: node - linkType: hard - "strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" @@ -16722,7 +16187,7 @@ __metadata: languageName: node linkType: hard -"tar@npm:^6.0.2, tar@npm:^6.1.11, tar@npm:^6.1.2": +"tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.1.13 resolution: "tar@npm:6.1.13" dependencies: @@ -17251,13 +16716,6 @@ __metadata: languageName: node linkType: hard -"trim-newlines@npm:^3.0.0": - version: 3.0.1 - resolution: "trim-newlines@npm:3.0.1" - checksum: b530f3fadf78e570cf3c761fb74fef655beff6b0f84b29209bac6c9622db75ad1417f4a7b5d54c96605dcd72734ad44526fef9f396807b90839449eb543c6206 - languageName: node - linkType: hard - "trim-right@npm:^1.0.1": version: 1.0.1 resolution: "trim-right@npm:1.0.1" @@ -17265,13 +16723,6 @@ __metadata: languageName: node linkType: hard -"true-case-path@npm:^2.2.1": - version: 2.2.1 - resolution: "true-case-path@npm:2.2.1" - checksum: fd5f1c2a87a122a65ffb1f84b580366be08dac7f552ea0fa4b5a6ab0a013af950b0e752beddb1c6c1652e6d6a2b293b7b3fd86a5a1706242ad365b68f1b5c6f1 - languageName: node - linkType: hard - "truncate-utf8-bytes@npm:^1.0.0": version: 1.0.2 resolution: "truncate-utf8-bytes@npm:1.0.2" @@ -17428,13 +16879,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.18.0": - version: 0.18.1 - resolution: "type-fest@npm:0.18.1" - checksum: e96dcee18abe50ec82dab6cbc4751b3a82046da54c52e3b2d035b3c519732c0b3dd7a2fa9df24efd1a38d953d8d4813c50985f215f1957ee5e4f26b0fe0da395 - languageName: node - linkType: hard - "type-fest@npm:^0.20.2": version: 0.20.2 resolution: "type-fest@npm:0.20.2" @@ -17449,20 +16893,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.6.0": - version: 0.6.0 - resolution: "type-fest@npm:0.6.0" - checksum: b2188e6e4b21557f6e92960ec496d28a51d68658018cba8b597bd3ef757721d1db309f120ae987abeeda874511d14b776157ff809f23c6d1ce8f83b9b2b7d60f - languageName: node - linkType: hard - -"type-fest@npm:^0.8.1": - version: 0.8.1 - resolution: "type-fest@npm:0.8.1" - checksum: d61c4b2eba24009033ae4500d7d818a94fd6d1b481a8111612ee141400d5f1db46f199c014766b9fa9b31a6a7374d96fc748c6d688a78a3ce5a33123839becb7 - languageName: node - linkType: hard - "type-is@npm:^1.6.16, type-is@npm:~1.6.17, type-is@npm:~1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18" @@ -17913,16 +17343,6 @@ __metadata: languageName: node linkType: hard -"validate-npm-package-license@npm:^3.0.1": - version: 3.0.4 - resolution: "validate-npm-package-license@npm:3.0.4" - dependencies: - spdx-correct: ^3.0.0 - spdx-expression-parse: ^3.0.0 - checksum: 35703ac889d419cf2aceef63daeadbe4e77227c39ab6287eeb6c1b36a746b364f50ba22e88591f5d017bc54685d8137bc2d328d0a896e4d3fd22093c0f32a9ad - languageName: node - linkType: hard - "vary@npm:^1, vary@npm:~1.1.2": version: 1.1.2 resolution: "vary@npm:1.1.2" @@ -18316,13 +17736,6 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^20.2.3": - version: 20.2.9 - resolution: "yargs-parser@npm:20.2.9" - checksum: 8bb69015f2b0ff9e17b2c8e6bfe224ab463dd00ca211eece72a4cd8a906224d2703fb8a326d36fdd0e68701e201b2a60ed7cf81ce0fd9b3799f9fe7745977ae3 - languageName: node - linkType: hard - "yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" @@ -18386,7 +17799,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^17.2.1, yargs@npm:^17.7.1": +"yargs@npm:^17.7.1": version: 17.7.1 resolution: "yargs@npm:17.7.1" dependencies: From 6bf6e46b6fdeb151507ce30b8aa26211d1c5fa08 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Fri, 25 Oct 2024 20:00:32 +0200 Subject: [PATCH 2/3] FEATURE: Prevent deletion of referenced asset collections Resolves: #245 --- .../Resolver/Type/AssetCollectionResolver.php | 31 +++++++++++++++++++ .../Resolver/Type/MutationResolver.php | 9 ++++-- Resources/Private/GraphQL/schema.root.graphql | 1 + .../src/components/DeleteButton.tsx | 2 +- .../src/fragments/assetCollection.ts | 1 + .../typings/AssetCollection.ts | 1 + 6 files changed, 41 insertions(+), 4 deletions(-) diff --git a/Classes/GraphQL/Resolver/Type/AssetCollectionResolver.php b/Classes/GraphQL/Resolver/Type/AssetCollectionResolver.php index 1a44ea659..541c258c0 100644 --- a/Classes/GraphQL/Resolver/Type/AssetCollectionResolver.php +++ b/Classes/GraphQL/Resolver/Type/AssetCollectionResolver.php @@ -17,6 +17,8 @@ use Flowpack\Media\Ui\Service\AssetCollectionService; use Neos\Flow\Annotations as Flow; use Neos\Media\Domain\Repository\AssetRepository; +use Neos\Neos\Domain\Model\Site; +use Neos\Neos\Domain\Repository\SiteRepository; use t3n\GraphQL\ResolverInterface; use Neos\Media\Domain\Model\AssetCollection; use Neos\Flow\Persistence\PersistenceManagerInterface; @@ -44,6 +46,14 @@ class AssetCollectionResolver implements ResolverInterface */ protected $assetCollectionService; + /** + * @Flow\Inject + * @var SiteRepository + */ + protected $siteRepository; + + protected array|null $siteDefaultAssetCollections = null; + public function id(AssetCollection $assetCollection): string { return $this->persistenceManager->getIdentifierByObject($assetCollection); @@ -53,4 +63,25 @@ public function assetCount(AssetCollection $assetCollection): int { return $this->assetCollectionService->getAssetCollectionAssetCount($this->id($assetCollection)); } + + /** + * Returns true if the asset collection is empty and is not assigned as default collection for a site + */ + public function canDelete(AssetCollection $assetCollection): bool + { + if ($this->siteDefaultAssetCollections === null) { + $this->siteDefaultAssetCollections = []; + /** @var Site $site */ + foreach ($this->siteRepository->findAll() as $site) { + $siteAssetCollection = $site->getAssetCollection(); + if (!$siteAssetCollection) { + continue; + } + $this->siteDefaultAssetCollections[$this->id($site->getAssetCollection())] = true; + } + } + + return !array_key_exists($this->id($assetCollection), $this->siteDefaultAssetCollections) + && $this->assetCount($assetCollection) === 0; + } } diff --git a/Classes/GraphQL/Resolver/Type/MutationResolver.php b/Classes/GraphQL/Resolver/Type/MutationResolver.php index a93db99ba..1076e438e 100644 --- a/Classes/GraphQL/Resolver/Type/MutationResolver.php +++ b/Classes/GraphQL/Resolver/Type/MutationResolver.php @@ -652,10 +652,13 @@ public function deleteAssetCollection($_, array $variables): array throw new Exception('Asset collection not found', 1591972269); } + if ($this->assetCollectionService->getAssetCollectionAssetCount($id) > 0) { + throw new Exception('Asset collection is not empty', 1730102095); + } + /** @noinspection PhpUndefinedMethodInspection */ - foreach ($this->siteRepository->findByAssetCollection($assetCollection) as $site) { - $site->setAssetCollection(null); - $this->siteRepository->update($site); + if ($this->siteRepository->findOneByAssetCollection($assetCollection)) { + throw new Exception('Asset collection is referenced as default collection of a site', 1730101671); } $this->assetCollectionRepository->remove($assetCollection); diff --git a/Resources/Private/GraphQL/schema.root.graphql b/Resources/Private/GraphQL/schema.root.graphql index 9fd350ca5..e6e8355bd 100644 --- a/Resources/Private/GraphQL/schema.root.graphql +++ b/Resources/Private/GraphQL/schema.root.graphql @@ -279,6 +279,7 @@ type AssetCollection { tags: [Tag!]! assetCount: Int! path: AssetCollectionPath + canDelete: Boolean! } """ diff --git a/Resources/Private/JavaScript/asset-collections/src/components/DeleteButton.tsx b/Resources/Private/JavaScript/asset-collections/src/components/DeleteButton.tsx index 894bbf8dd..edad69b60 100644 --- a/Resources/Private/JavaScript/asset-collections/src/components/DeleteButton.tsx +++ b/Resources/Private/JavaScript/asset-collections/src/components/DeleteButton.tsx @@ -74,7 +74,7 @@ const DeleteButton: React.FC = () => { style="transparent" hoverStyle="error" disabled={ - (!selectedAssetCollection || !config.canManageAssetCollections) && + (!selectedAssetCollection || !config.canManageAssetCollections || !selectedAssetCollection.canDelete) && (!selectedTag || !config.canManageTags) } title={translate('assetCollectionTree.toolbar.delete', 'Delete')} diff --git a/Resources/Private/JavaScript/asset-collections/src/fragments/assetCollection.ts b/Resources/Private/JavaScript/asset-collections/src/fragments/assetCollection.ts index d4795b015..99e832471 100644 --- a/Resources/Private/JavaScript/asset-collections/src/fragments/assetCollection.ts +++ b/Resources/Private/JavaScript/asset-collections/src/fragments/assetCollection.ts @@ -14,6 +14,7 @@ export const ASSET_COLLECTION_FRAGMENT = gql` } assetCount path + canDelete } ${TAG_FRAGMENT} `; diff --git a/Resources/Private/JavaScript/asset-collections/typings/AssetCollection.ts b/Resources/Private/JavaScript/asset-collections/typings/AssetCollection.ts index 10d78908d..e094b1ede 100644 --- a/Resources/Private/JavaScript/asset-collections/typings/AssetCollection.ts +++ b/Resources/Private/JavaScript/asset-collections/typings/AssetCollection.ts @@ -13,4 +13,5 @@ interface AssetCollection extends GraphQlEntity { tags?: Tag[]; assetCount: number; path?: string; + canDelete: boolean; } From 05bff0d4606136d56531bd9128059125918eb1dc Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Mon, 28 Oct 2024 09:14:29 +0100 Subject: [PATCH 3/3] TASK: Adjust tests to collection removal protection --- .../JavaScript/dev-server/src/fixtures/index.ts | 16 ++++++++++++++-- .../Private/JavaScript/dev-server/src/server.ts | 2 ++ phpstan.neon | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Resources/Private/JavaScript/dev-server/src/fixtures/index.ts b/Resources/Private/JavaScript/dev-server/src/fixtures/index.ts index 52cad7cec..8e4ff0b20 100644 --- a/Resources/Private/JavaScript/dev-server/src/fixtures/index.ts +++ b/Resources/Private/JavaScript/dev-server/src/fixtures/index.ts @@ -77,6 +77,7 @@ const assetCollections: AssetCollection[] = range(3).map((index) => ({ : null, // TODO: Recalculate assetCount of assetCollections after generation of assets assetCount: 0, + canDelete: true, })); const getUsageDetailsForAsset = (assetId: string): UsageDetailsGroup[] => { @@ -154,6 +155,17 @@ const assets = range(150).map((index) => { const isCloud = index > 120; const filename = getExampleFilename(index); + const collectionsForAsset = range(index % 2).map( + (i) => assetCollections[(i * 2 + index) % assetCollections.length] + ); + + collectionsForAsset.forEach((collection) => { + collection.assetCount++; + collection.canDelete = false; + }); + + const tagsForAsset = range(index % 3).map((i) => tags[(i * 3 + index) % tags.length]); + return { __typename: 'Asset', id: index.toString(), @@ -163,8 +175,8 @@ const assets = range(150).map((index) => { label: `Example asset ${index + 1}`, caption: `The caption for example asset ${index + 1}`, filename: 'example1.jpg', - tags: range(index % 3).map((i) => tags[(i * 3 + index) % tags.length]), - collections: range(index % 2).map((i) => assetCollections[(i * 2 + index) % assetCollections.length]), + tags: tagsForAsset, + collections: collectionsForAsset, copyrightNotice: 'The Neos team', lastModified: new Date(`2020-06-16 15:${Math.floor((150 - index) / 60)}:${(150 - index) % 60}`), iptcProperties: index % 5 === 0 ? getIptcProperties(index) : [], diff --git a/Resources/Private/JavaScript/dev-server/src/server.ts b/Resources/Private/JavaScript/dev-server/src/server.ts index a1d9df7d4..4e6235e47 100644 --- a/Resources/Private/JavaScript/dev-server/src/server.ts +++ b/Resources/Private/JavaScript/dev-server/src/server.ts @@ -217,6 +217,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); deleteAssetCollection: ($_, { id }: { id: string }): boolean => { const assetCollection = assetCollections.find((assetCollection) => assetCollection.id === id); if (!assetCollection) return false; + if (assetCollection.assetCount > 0) return false; assetCollections = assetCollections.filter((assetCollection) => assetCollection.id !== id); return true; }, @@ -236,6 +237,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); : null, tags: [], assetCount: 0, + canDelete: true, }; assetCollections.push(newCollection); return newCollection; diff --git a/phpstan.neon b/phpstan.neon index 81c93a815..7a12b1867 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,3 +4,4 @@ parameters: - Classes ignoreErrors: - '#Call to an undefined method [a-zA-Z0-9\\_]+Repository::findBy[a-zA-Z]+\(\)#' + - '#Call to an undefined method [a-zA-Z0-9\\_]+Repository::findOneBy[a-zA-Z]+\(\)#'