Commit graph

255 commits

Author SHA1 Message Date
Artur Paikin
97cd38798b Merge branch 'master' into feature/upload-retry 2017-10-03 10:18:51 -04:00
Artur Paikin
37a9ae2e5a console.dir(msg) the original object
followup to #372
2017-10-03 00:20:33 -04:00
Artur Paikin
84a3f8cebe Large refactor: move pauseAll, resumeAll, retryAll to Core 2017-10-02 23:14:49 -04:00
Artur Paikin
7c0cc62b2c Merge pull request #373 from transloadit/feature/redux-dev-tools
Add support for Redux DevTools via a plugin
2017-10-02 17:23:40 -04:00
Artur Paikin
b430df0fdf don’t do anything if debug: false 2017-10-02 17:14:11 -04:00
Artur Paikin
be0ec9a15e remove 0 file warning 2017-10-01 00:17:49 -04:00
Artur Paikin
239a6f1d1c move ReduxDevTools from Core to a separate plugin 2017-09-30 17:52:00 -04:00
Artur Paikin
fcc2b7cb89 Add support for Redux DevTools
- sends state updates to devtools
- sets uppy state to state provided by devtools for time traveling
- we could add support for custom action type names, and then we’ll get actions like `UPPY_ADD_FILE` and such

try by installing and activating: https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en
2017-09-30 00:23:41 -04:00
Artur Paikin
4a2a5abc93 refactor log by adding timestamps and warnings; check for uploader plugins and 0 files in upload 2017-09-29 17:06:53 -04:00
Artur Paikin
8b0d74be6a Merge branch 'master' into feature/upload-retry 2017-09-29 15:45:41 -04:00
Artur Paikin
67dfcdff16 i18n all the things, error details balloon 2017-09-29 15:35:57 -04:00
Artur Paikin
5a82fb163c move pauseResume from Tus plugin to Core, add retry to remote too 2017-09-29 13:46:59 -04:00
Artur Paikin
b13b1cd7c0 clear error on retry 2017-09-29 00:39:59 -04:00
Renée Kooi
2ec1696455
plugins: add get/setPluginState methods 2017-09-26 17:10:47 +02:00
Artur Paikin
77f3b5d9d6 Merge branch 'master' into feature/upload-retry 2017-09-25 10:35:28 -04:00
Renée Kooi
cd7b035976
core: Still accept a string as user-provided rejections 2017-09-22 23:09:33 +02:00
Renée Kooi
8a3b411409
Always reject Promises with Error instances 2017-09-22 23:09:33 +02:00
Artur Paikin
674fe15f31 fix state update event 2017-09-18 18:24:34 -04:00
Artur Paikin
11002c8d43 Merge pull request #341 from sunil-shrestha/fix/clearCurrentUploads
set the newState before emiting "core:state-update" .
2017-09-18 18:04:24 -04:00
Artur Paikin
a4668d4f96 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/core/Core.js
#	src/plugins/Dashboard/index.js
2017-09-15 23:56:18 -04:00
Artur Paikin
4a85a4d1e0 refactor a little, add file.type.mime (before the migration to mime entirely) add comments 2017-09-14 22:39:21 -04:00
Artur Paikin
6fc35e3bb5 Merge branch 'master' into feature/upload-retry
# Conflicts:
#	src/core/Core.js
#	src/plugins/Dashboard/index.js
2017-09-14 14:12:18 -04:00
Artur Paikin
1f8a369f4f separate checkMinNumberOfFiles method 2017-09-14 13:20:45 -04:00
Artur Paikin
829713851e Adjust checkMinNumberOfFiles
Fixes #344
2017-09-14 12:51:19 -04:00
Artur Paikin
0eb2448a3d Fix calculateTotalProgress - NaN 2017-09-13 18:50:41 -04:00
Sunil Shrestha
2c951a884d set the newState before emiting "core:state-update" . 2017-09-13 14:40:33 +03:00
Artur Paikin
0e1a4b51a4 Merge pull request #335 from richardwillars/core-tests
[WIP] Remaining tests for src/core.js
2017-09-12 11:09:16 -04:00
Artur Paikin
e69151ca0c Merge pull request #319 from richardwillars/isOnline
Tell Uppy to be offline
2017-09-12 10:59:20 -04:00
Richard Willars
504a6977ac Adds tests for info messages (and fixes hideInfo method) 2017-09-12 09:09:25 +01:00
Artur Paikin
df659c5417 Merge pull request #328 from transloadit/chore/dashboard
Dashboard: show()/hide()/isOpen()
2017-09-11 21:16:56 -04:00
Richard Willars
6ecaad1bc6 Rename isOnline with updateOnlineStatus and removed params
isOnline renamed to updateOnlineStatus and removes params

updateOnlineStatus default to true

Improved the window.navigator.onLine check

Adds tests for updateOnlineStatus

Removes debug

Fixes isTouchDevice test

File cleanup

Simplifies mock for window.navigator.onLine
2017-09-11 15:01:29 +01:00
Artur Paikin
83f514232e bind info 2017-09-08 15:21:48 -04:00
Renée Kooi
2ef0f04ac2
core: Remove core:upload-complete event.
XHRUpload and Tus were relying on `core:upload-complete` to determine
when their uploads had all finished, but `core:upload-complete` could
fire before all XHR `onload` handlers were called. Then, because
XHRUpload and Tus would resolve their `handleUpload` promises at that
point, the `core:success` event could fire *before* all
`core:upload-success` events had fired, and before the plugins properly
handled responses. In particular, some files may not have `.uploadURL`
properties when `core:success` is fired:

https://community.transloadit.com/t/unable-to-get-to-work-the-awss3-plugin/14477/16

I think, that the XHR `onprogress` event would fire first at 100%, and
then the `onload` handler fired at some point later (after the response
was parsed or whatever the browser does to it). This could cause the
`core:upload-complete` event to fire before responses were handled by
Uppy.

The XHRUpload and Tus plugins now use the Promises that they were
already creating to wait for uploads to complete. This way they will
always have handled responses before handing over control to
postprocessors and before the `core:success` event is fired.

Since `core:upload-complete` is now unused, I just removed it for now.
2017-09-08 14:28:13 +02:00
Renée Kooi
2966c53668
core: fix comment indents 2017-09-08 13:51:40 +02:00
Renée Kooi
8a4cfed360 Merge pull request #316 from goto-bus-stop/promise-resolve
Handle sync returns and throws in possibly-async function options
2017-09-07 14:50:20 +02:00
Renée Kooi
dee1f69591
core: remove unnecessary instanceof check
This function will never be an instance of the `Uppy` class.
2017-09-05 19:19:30 +02:00
Renée Kooi
8011a5b88b
core: rm outdated comment 2017-09-05 19:19:03 +02:00
Renée Kooi
850c2bb526
Handle sync returns and throws in possibly-async function options
Fixes #315

This patch makes some function options that can return Promises a bit
easier to use. Previously, most of these required that the user returned
a Promise, even if they were doing sync work. Also, if an error was
thrown inside the provided function, it would actually throw the error
instead of rejecting a Promise, thus not allowing Uppy to show an error
notification or anything.

Instead, these options now use this pattern:

```js
Promise.resolve()
  .then(() => this.opts.onSomething(argument))
```

Inside a `.then()` handler, both a Promise and a plain value can be
returned, and the resulting Promise will be resolved with the correct
value. Also, any sync errors `throw`n inside a `.then()` handler cause
the returned Promise to be rejected.
2017-09-05 19:01:46 +02:00
Renée Kooi
15909b2c6b
core: Add reset-progress event hook for plugins 2017-09-04 19:00:35 +02:00
Renée Kooi
1e07cf1139 Merge pull request #309 from richardwillars/addplugin
Checks for plugin type and plugin id rather than name
2017-09-01 15:34:12 +02:00
Richard Willars
b7145e83f4 Removes 'none' string check on plugin type 2017-09-01 14:11:43 +01:00
Renée Kooi
fb5a7fb5cf Merge pull request #312 from richardwillars/updateAll
updateAll method uses iteratePlugins method
2017-09-01 14:55:26 +02:00
Richard Willars
cfc21fd179 updateAll method uses iteratePlugins method 2017-09-01 13:31:39 +01:00
Richard Willars
b0eb6c0a7e Checks for plugin type and plugin id rather than name 2017-09-01 11:38:11 +01:00
Artur Paikin
8baf64ebf7 Merge pull request #308 from transloadit/fix/submit-filecard-on-enter
Submit FileCard on enter key
2017-09-01 13:10:20 +03:00
Artur Paikin
cb62a1e623 minor refactoring 2017-08-31 21:52:08 +03:00
Artur Paikin
c771807adf Initial take on retrying failed uploads
- [ ] add XHRUpload support
- [ ] add StatusBar support, retry all? currently errored file = paused
file in StatusBar
- [ ] better UI to indicate that uploading failed and retry is
available?
2017-08-31 14:06:14 +03:00
Renée Kooi
2960be0d86
xhrupload: Use error messages from the endpoint, closes #303 2017-08-31 11:23:31 +02:00
Renée Kooi
1360689063
core: Throw clearer error when .useing undefined
Previously this would throw "Plugin is not a constructor" when trying to
instantiate the plugin. Now it checks that the Plugin is actually a
function (and hopefully a constructor…) and throws a more helpful error
if it is not.
2017-08-30 13:24:13 +02:00
Artur Paikin
f97f01f38b msg --> message 2017-08-28 13:28:52 +03:00