Commit graph

1833 commits

Author SHA1 Message Date
Andrew
eea0987f90
Fix @uppy/angular component crash by loosening package.json version constraints (#3210) 2021-10-01 14:01:36 +02:00
Mikael Finstad
56a67de550
Close window on auth callback error and show error to user (#3143)
* Close window on auth callback error

Because simply receiving a "Bad request" is very bad UX
For example if the user cancels the auth flow, or doesn't give companion access
it's better to go back

* Update packages/@uppy/companion/src/server/controllers/callback.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/companion/src/server/controllers/callback.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/companion/src/server/controllers/callback.js

* Update callback.js

* pull out reusable code to getDynamicStateFromRequest

* Signal auth error to client

* fix test mocking

* npm run build:locale-pack

* Update packages/@uppy/companion/src/server/controllers/callback.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* fix lint

* add i18n string that got lost during merge

* add french translation

* add dutch translation

* add norwegian translation

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-30 18:07:27 +07:00
Mikael Finstad
876f833bd1
Companion: Use GET instead of HEAD for getURLMeta + Cut off length of file names (#3048)
* rewrite to async/await

* Only fetch size (HEAD) if needed #3034

* Update packages/@uppy/companion/src/server/controllers/url.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Change HEAD to GET in getURLMeta

and abort request immediately upon response headers received
https://github.com/transloadit/uppy/issues/3034#issuecomment-908059234

* fix lint

* fix lint

* cut off length of file names

or else we get
"MetadataTooLarge: Your metadata headers exceed the maximum allowed metadata size" in tus / S3

* try to fix flaky test

* remove iife and cleanup code a bit

* fix lint by reordering code

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-30 17:27:13 +07:00
Mikael Finstad
f341c0f400
Include status code in HTTP error message (#3212)
Makes it easier to debug when we can see it in the log files

e.g.
```
companion: 2021-09-20T20:03:53.226Z [error] provider.onedrive.list.error ProviderApiError: Access Denied
companion: 2021-09-20T19:57:49.897Z [error] provider.onedrive.list.error ProviderApiError: Item does not exist
```
We don't know what is the error code here...
2021-09-30 16:59:48 +07:00
Mikael Finstad
12705e769f
Default allow headers (#3167)
* refactor cors middleware to avoid duplicates

* Make more ACAH headers default

Add the following headers to access-control-allow-headers by default:
Authorization, Origin, Content-Type, Accept
They are needed for basic operation. See https://github.com/transloadit/uppy/issues/3021
therefore also remove custom middlewares in examples and standalone

* Update outdated readme for S3

AWS now requires JSON instead of XML format

* Update packages/@uppy/companion/src/server/middlewares.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/companion/src/server/middlewares.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* fix review comments

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-30 16:37:23 +07:00
Mikael Finstad
1ae19a28c1
Make uploadUrls recommended (#3182)
* Make uploadUrls recommended

- warn on startup if uploadUrls is not specified as not specifying it is a security risk
- improve docs to make it more clear why uploadUrls should be specified (say that uploadUrls is required even though it is not, due to backward compatibility)
- no longer require_tld (it gives a false security) - fixes #2831

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* remove `example: []`

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-30 16:31:10 +07:00
Luca Trazzi
4ff584ca24
Fix typo in @uppy/core types (#3230)
Co-authored-by: lucatrazzi <luca.trazzi@garaio.com>
2021-09-29 13:51:46 +02:00
Dani Latorre
8b8783baca
Add support for opts.headers as a function in @uppy/tus (#3221) 2021-09-29 13:51:00 +02:00
Antoine du Hamel
d69031524c
@uppy/core: move Uppy class to its own module (#3225)
* @uppy/core: move `Uppy` class to its own module

Fixes: https://github.com/transloadit/uppy/issues/3220

* Rename snapshot file

* Update docs

* Update website/src/_posts/2021-08-2.0.md

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* Update migration guide

* Do not bundle preact with non-UI plugin packages

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2021-09-28 19:04:33 +02:00
Antoine du Hamel
46b0540e92
@uppy/image-editor: add workaround for when Cropper is loaded as ESM (#3218)
* @uppy/image-editor: add workaround for when `Cropper` is loaded as ESM

Fixes: https://github.com/transloadit/uppy/issues/3199

* Update packages/@uppy/image-editor/src/Editor.js

Co-authored-by: Kevin van Zonneveld <kevin@vanzonneveld.net>

* Add backlog entry

Co-authored-by: Kevin van Zonneveld <kevin@vanzonneveld.net>
2021-09-28 16:59:13 +02:00
Antoine du Hamel
7fd7b604d7
@uppy/react: update HTMLAttributes filter (#3215) 2021-09-28 16:58:50 +02:00
Antoine du Hamel
45325720e9
@uppy/companion: Object.fromEntries is not available on Node.js v10.x (#3209) 2021-09-28 16:58:12 +02:00
Antoine du Hamel
6b68876c68
@uppy/react: propagate prop mutation (#3208)
* @uppy/react: propagate prop mutation

Fixes: https://github.com/transloadit/uppy/issues/3203

* fixup! @uppy/react: propagate prop mutation

* fixup! @uppy/react: propagate prop mutation

* Apply changes to other Components

* Update TODOs
2021-09-28 16:57:58 +02:00
Merlijn Vos
a298e59f17
Show all details on mobile when showProgressDetails is true (#3174) 2021-09-20 15:47:28 +02:00
Antoine du Hamel
c84e218750
@uppt/xhr-upload: fix this.uppy is undefined error (#3207)
Fixes: https://github.com/transloadit/uppy/issues/3195
2021-09-20 15:45:38 +02:00
Antoine du Hamel
c33c4e43b2
@uppy/dashboard: fix linter (#3206) 2021-09-20 15:44:34 +02:00
Murderlon
b3b68c0777
Release 2021-09-20 11:51:06 +02:00
Karol Tyka
e6b474635b
Fix "attempted to use private field on non-instance" in SearchProvider (#3201) 2021-09-20 11:30:31 +02:00
Adrian Reithaug
ecd2dec9cd
Add 'done' to nb_NO.js (#3200) 2021-09-16 17:11:55 +02:00
Antoine du Hamel
b364708715
@uppy/transloadit: fix unhandledPromiseRejection failures (#3197)
* @uppy/transloadit: fix unhandledPromiseRejection failures

Fixes: https://github.com/transloadit/uppy/issues/3189

* Add transloadit2 to end2end test matrix
2021-09-16 15:24:20 +02:00
Marcelo Luiz Onhate
c7e0a5a883
fix: AbortController is not defined on Node.js (Server Side Render) (#3169)
* fix: AbortController is not defined

* use globalThis

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-13 14:55:10 +02:00
Antoine du Hamel
017c21a92c
@uppy/aws-s3-multipart: fix linter issues (#3188) 2021-09-10 15:54:07 +02:00
Murderlon
581c2f3a38
Fix eslint error in MultipartUploader 2021-09-10 13:22:12 +02:00
christianwengert
321cd8bfaf
Fix net::ERR_OUT_OF_MEMORY in @uppy/aws-s3-multipart (#3183)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-10 13:13:47 +02:00
Merlijn Vos
bbb035a9df
Fix autoOpenFileEditor for @uppy/dashboard (#3186) 2021-09-10 12:38:55 +02:00
Merlijn Vos
6e0ceeaba7
Update Google Drive for brand compliance (#3178) 2021-09-08 19:27:20 +02:00
Artur Paikin
86cb2294b0
remove resume option from transloadit plugin (#3149) 2021-09-03 01:55:23 +01:00
Bernhard P
b0804df44b
Add missing editFileWithFilename to de_DE locale (#3158) 2021-09-02 10:50:34 +02:00
Murderlon
246eafc51a
Release 2021-09-01 11:30:19 +02:00
Bernhard P
5856072279
Add methods to types for @uppy/xhr-upload (#3154) 2021-09-01 11:18:09 +02:00
Jhen-Jie Hong
5937bf2127
@uppy/aws-s3: fix invalid state error of XHR (#3130)
Co-authored-by: Murderlon <merlijn@soverin.net>
2021-09-01 11:16:54 +02:00
Jhen-Jie Hong
7763cedd50
Fix i18n in aws-s3, thumbnail-generator, and xhr-upload (#3142)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-08-31 13:54:17 +02:00
Merlijn Vos
2ce0c8b4dc
Fix React DashboardModal's target type (#3110) 2021-08-30 15:01:15 +02:00
JT
a771b86efb
Improve accuracy/compatibility of success/error callback types (#3141) 2021-08-30 13:04:10 +02:00
Valentin Oliver Loftsson
6c80dfca86
@uppy/vue: add Vue FileInput component (#3125) 2021-08-30 11:06:33 +02:00
Murderlon
8e4fae911a
Release 2021-08-26 16:21:37 +02:00
Ross Gardiner
c556197ac9
Fix aws-s3-multipart route ordering and query parameters (#3132) 2021-08-26 15:46:26 +02:00
JT
33e2a64b3e
Add metadata overload for off call in @uppy/core (#3137) 2021-08-26 13:34:16 +02:00
Merlijn Vos
b18d9ab648
Handle promise rejections in golden retriever service worker (#3131) 2021-08-26 10:46:30 +02:00
Artur Paikin
d69043aacc Release 2021-08-24 20:54:05 +01:00
Artur Paikin
b398248198 Update peerDependencies to ^2.0.0 in all uppy packages 2021-08-24 20:22:13 +01:00
Murderlon
ab771cbe1c
Release 2021-08-24 16:13:19 +02:00
Artur Paikin
dbe3ed25b3
build: add stylelint (#3124)
* add stylelint with stylelint-config-standard

* autofix style issues

* fix more linting issues

* add stylelint-scss

* fix two more

* add stylelint-config-rational-order and autofix order

https://github.com/constverum/stylelint-config-rational-order
2021-08-24 01:37:57 +01:00
Artur Paikin
17b361a286
Core: rename allowMultipleUploads to allowMultipleUploadBatches (#3115)
* allowNewUpload  --> allowMultipleUploadBatches

* noNewAlreadyUploading --> noMoreFilesAllowed

* Disallow drag-drop when allowNewUpload: false in Core

* Fix tests

* add deprecation notice to types

* Update Dashboard.js
2021-08-23 13:19:40 +01:00
Antoine du Hamel
ec87b232e9
meta: enforce no-unused-vars linter rule (#3118)
* meta: enforce `no-unused-vars` linter rule

* meta: fix `@typescript-eslint/no-unused-vars` linter warnings

* meta: enforce `no-unused-expressions` lint rule

* @uppy/companion: fix `tsc` build
2021-08-23 13:10:17 +01:00
Antoine du Hamel
0b801ccbad
@uppy/core: reject empty string as valid value for required meta fields (#3119) 2021-08-20 13:47:31 +01:00
Mikael Finstad
3059d733f6
Safely escape <script> injected code in companion send-token.js (#3101)
Fixes #2974
2021-08-19 18:27:24 +02:00
Antoine du Hamel
1f0e7a59c0
@uppy/dashboard: fix metafield form validation (#3113)
* @uppy/dashboard: fix metafield form validation

Browsers without support for the HTML `form` attribute would misbehave,
making it impossible to validate the form at all, and potentially validate an
unrelated upper form if users are embeding Uppy inside a a `<form>`.

Fixes: https://github.com/transloadit/uppy/issues/3111

* Add comments

* Fix docs and types
2021-08-19 15:19:48 +01:00
Antoine du Hamel
6b7ad5e7c7
Stricter linter (#3095)
* enforce some eslint rules

* enforce accessibility linter rules

* harden lint rules with only 1 or 2 warnings

* fix remaining rules with less than 3 warnings

* fix e2e tests

* fix remaining rules with less than 4 warnings

* fix remaining rules with less than 6 warnings

* fix `shuffleTaglines`

* fix companion build
2021-08-17 20:32:57 +02:00
Antoine du Hamel
405157ea49
@uppy/aws-s3: refactor to use private fields (#3094) 2021-08-17 20:14:49 +02:00