Merge remote-tracking branch 'origin/master' into ivo/inc_body_restore

This commit is contained in:
Karol Wypchlo 2021-11-04 14:54:58 +01:00
commit f6ea612126
No known key found for this signature in database
GPG Key ID: C92C016317A964D0
5 changed files with 11 additions and 8 deletions

View File

@ -0,0 +1,2 @@
- fixed uploaded directory name (was "undefined" before)
- fixed empty directory upload progress (size was not calculated for directories)

View File

@ -25,7 +25,7 @@
"gatsby-plugin-postcss": "^4.14.0",
"gatsby-plugin-purgecss": "^6.1.0",
"gatsby-plugin-react-helmet": "^4.14.0",
"gatsby-plugin-robots-txt": "^1.6.13",
"gatsby-plugin-robots-txt": "^1.6.14",
"gatsby-plugin-sharp": "^4.0.1",
"gatsby-plugin-svgr": "^3.0.0-beta.0",
"gatsby-remark-classes": "^1.0.2",

View File

@ -47,8 +47,9 @@ const Uploader = () => {
const handleDrop = async (files) => {
if (mode === "directory" && files.length) {
const name = getRootDirectory(files[0]); // get the file path from the first file
const size = files.reduce((acc, file) => acc + file.size, 0);
files = [{ name, files }];
files = [{ name, size, files }];
}
setUploads((uploads) => [...files.map((file) => ({ id: nanoid(), file, mode, status: "enqueued" })), ...uploads]);

View File

@ -85,7 +85,7 @@ export default function UploaderElement({ onUploadStateChange, upload }) {
if (upload.mode === "directory") {
const files = upload.file.files;
const directory = files.reduce((acc, file) => ({ ...acc, [getRelativeFilePath(file)]: file }), {});
const name = encodeURIComponent(upload.name);
const name = encodeURIComponent(upload.file.name);
response = await client.uploadDirectory(directory, name, { onUploadProgress });
} else {

View File

@ -6175,12 +6175,12 @@ gatsby-plugin-react-helmet@^4.14.0:
dependencies:
"@babel/runtime" "^7.15.4"
gatsby-plugin-robots-txt@^1.6.13:
version "1.6.13"
resolved "https://registry.yarnpkg.com/gatsby-plugin-robots-txt/-/gatsby-plugin-robots-txt-1.6.13.tgz#01e1ce68e3f4e07f957ac9a20cd2a9e12fdd3f79"
integrity sha512-MUPJsvkALwSmfRb1L3IVNmzIqwV35fol1RVot425ZYXvtD+s0OtZli5VnhLNxsX0beodyavzFl0SRJCCQZz0/g==
gatsby-plugin-robots-txt@^1.6.14:
version "1.6.14"
resolved "https://registry.yarnpkg.com/gatsby-plugin-robots-txt/-/gatsby-plugin-robots-txt-1.6.14.tgz#e7ce50b137fecc81c1ac384ddc544a4bafd8da89"
integrity sha512-5NLdgKPw7xHjvowNDU5aWzl/g3M3WU0Equn73aXGGdEue9Nuq7zh/Lh3oX+OM+MZolRCiM9GNHxdIvYPDWNXgA==
dependencies:
"@babel/runtime" "^7.14.0"
"@babel/runtime" "^7.15.4"
generate-robotstxt "^8.0.3"
gatsby-plugin-sharp@^4.0.1: