From 4979e22dd952d575d20f1989fc2e94b2dfad02e5 Mon Sep 17 00:00:00 2001 From: Mohammed Faragallah Date: Thu, 2 May 2024 09:44:03 +0300 Subject: [PATCH] Upgrade react-dropzone to v14 --- packages/ra-no-code/package.json | 2 +- .../src/ui/ImportResourceDialog.tsx | 4 ++- packages/ra-ui-materialui/package.json | 2 +- yarn.lock | 26 +++++++++---------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/packages/ra-no-code/package.json b/packages/ra-no-code/package.json index b6ce4abdf04..0ce9f2db700 100644 --- a/packages/ra-no-code/package.json +++ b/packages/ra-no-code/package.json @@ -51,7 +51,7 @@ "prop-types": "^15.8.1", "ra-data-local-storage": "^5.0.0-alpha.1", "react-admin": "^5.0.0-alpha.1", - "react-dropzone": "^12.0.4" + "react-dropzone": "^14.2.3" }, "gitHead": "b227592132da6ae5f01438fa8269e04596cdfdd8" } diff --git a/packages/ra-no-code/src/ui/ImportResourceDialog.tsx b/packages/ra-no-code/src/ui/ImportResourceDialog.tsx index ead0c55e6dc..f7d864bd28a 100644 --- a/packages/ra-no-code/src/ui/ImportResourceDialog.tsx +++ b/packages/ra-no-code/src/ui/ImportResourceDialog.tsx @@ -65,7 +65,9 @@ export const ImportResourceDialog = (props: ImportResourceDialogProps) => { }; const { getRootProps, getInputProps } = useDropzone({ - accept: 'text/csv', + accept: { + 'text/csv': ['.csv'], + }, onDrop, }); const { ref, ...rootProps } = getRootProps(); diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index 6bd391d56e7..95949edb826 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -74,7 +74,7 @@ "lodash": "~4.17.5", "prop-types": "^15.8.1", "query-string": "^7.1.1", - "react-dropzone": "^12.0.4", + "react-dropzone": "^14.2.3", "react-error-boundary": "^3.1.4", "react-transition-group": "^4.4.5" }, diff --git a/yarn.lock b/yarn.lock index c7629c89b6e..f048b2b8b9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12241,12 +12241,12 @@ __metadata: languageName: node linkType: hard -"file-selector@npm:^0.4.0": - version: 0.4.0 - resolution: "file-selector@npm:0.4.0" +"file-selector@npm:^0.6.0": + version: 0.6.0 + resolution: "file-selector@npm:0.6.0" dependencies: - tslib: "npm:^2.0.3" - checksum: 2c55019ea5db84c0c27a5337028604d8a9fe9a53551eb20f4ad44541dfdfdda6bb576e950ac51d11fc3791247c9407734043a9c68a7fe473925631ffc03442e4 + tslib: "npm:^2.4.0" + checksum: 477ca1b56274db9fee1a8a623c4bfef580389726a5fef843af8c1f2f17f70ec2d1e41b29115777c92e120a15f1cca734c6ef36bb48bfa2ee027c68da16cd0d28 languageName: node linkType: hard @@ -18921,7 +18921,7 @@ __metadata: react: "npm:^18.0.0" react-admin: "npm:^5.0.0-alpha.1" react-dom: "npm:^18.2.0" - react-dropzone: "npm:^12.0.4" + react-dropzone: "npm:^14.2.3" react-router: "npm:^6.22.0" react-router-dom: "npm:^6.22.0" rimraf: "npm:^3.0.2" @@ -18966,7 +18966,7 @@ __metadata: ra-language-english: "npm:^5.0.0-alpha.1" react: "npm:^18.0.0" react-dom: "npm:^18.2.0" - react-dropzone: "npm:^12.0.4" + react-dropzone: "npm:^14.2.3" react-error-boundary: "npm:^3.1.4" react-hook-form: "npm:^7.43.9" react-is: "npm:^18.2.0" @@ -19237,16 +19237,16 @@ __metadata: languageName: node linkType: hard -"react-dropzone@npm:^12.0.4": - version: 12.0.4 - resolution: "react-dropzone@npm:12.0.4" +"react-dropzone@npm:^14.2.3": + version: 14.2.3 + resolution: "react-dropzone@npm:14.2.3" dependencies: attr-accept: "npm:^2.2.2" - file-selector: "npm:^0.4.0" + file-selector: "npm:^0.6.0" prop-types: "npm:^15.8.1" peerDependencies: - react: ">= 16.8" - checksum: 896f99a343b2e078f85023df93b5a75a04fdd53e3adafee778fcc905db2e5eb9eb68b6d4031ebe438af495b4619c4d2d0a43ca454868d2328df36c3436b72b30 + react: ">= 16.8 || 18.0.0" + checksum: 6433517c53309aca1bb4f4a535aeee297345ca1e11b123676f46c7682ffab34a3428cbda106448fc92b5c9a5e0fa5d225bc188adebcd4d302366bf6b1f9c3fc1 languageName: node linkType: hard