Commit graph

827 commits

Author SHA1 Message Date
Renée Kooi
9174abf855
core: make mount()ing an unknown plugin a noop 2017-09-18 14:40:31 +02:00
Renée Kooi
36365b90f9
core: Avoid instantiating target plugin in mount(). 2017-09-18 14:40:31 +02:00
Renée Kooi
5c842703ce
Implement onRequestClose in main Dashboard plugin. 2017-09-18 14:40:30 +02:00
Renée Kooi
bae5e63be1
dashboard: support mounting StatusBar and Informer on subclasses 2017-09-18 14:40:29 +02:00
René Kooi
4e74a1ac19
uppy-react: Experiment with unmounting.
This implements unmounting for the inline Dashboard component.
To do that, the Dashboard plugin now has a method `uninstall`,
which removes all listeners and removes the Dashboard element
from the DOM. The `componentWillUnmount` handler removes the plugin
from Uppy's internal plugin list. If this approach is the way to
go, we'd add a method to core to remove plugins… I think in that
case, it'd be good to add some concept of View Plugins, so that
Acquirer plugins function like they do now but View plugins can be
mounted and unmounted.
2017-09-18 14:40:29 +02: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
4e808ca3d2 add aria-hidden to all icons for accessibility, remove console.log 2017-09-14 12:01:19 -04:00
Artur Paikin
df659c5417 Merge pull request #328 from transloadit/chore/dashboard
Dashboard: show()/hide()/isOpen()
2017-09-11 21:16:56 -04:00
Artur Paikin
91ec5dbdd6 refactor: openModal, closeModal, isModalOpen 2017-09-11 14:09:44 -04:00
Renée Kooi
383aa85025 Merge pull request #323 from goto-bus-stop/rm-upload-complete
core: Remove `core:upload-complete` event.
2017-09-11 09:59:30 +02:00
Artur Paikin
6b6ce35927 add findDOMElements that always returns an array of DOM elements 2017-09-10 21:35:10 -04:00
Artur Paikin
1e2a722b08 fix FileItem source icon position and copy 2017-09-10 14:24:20 -04:00
Artur Paikin
fbf53b4576 Merge pull request #321 from goto-bus-stop/chore/unmagic
transloadit: remove `this.state` getter
2017-09-09 19:16:33 -04:00
Renée Kooi
d4e5daa630
xhrupload,tus: Use promise-settle 2017-09-09 14:08:41 +02:00
Artur Paikin
c77c6a103d hideModal/showModal --> show/hide, isOpen, DashboardUI --> Dashboard 2017-09-08 15:24:30 -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
e5d83ed2f2
transloadit,webcam: Rename updateStatesetPluginState 2017-09-08 13:43:02 +02:00
Renée Kooi
c9eacb8a8d
transloadit: remove this.state getter 2017-09-07 20:26:41 +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
14ac43a63a
tus: remove unused default option 2017-09-06 14:50:37 +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
fea5892cf2
tus: Clear stored uploadUrl on reset-progress. 2017-09-04 19:01:11 +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
11ae9e332a Removes type property (should be added by the actual plugin) 2017-09-01 14:13:47 +01:00
Renée Kooi
11b820e68c
transloadit: Remove event listener correctly on uninstall 2017-09-01 12:31:07 +02:00
Renée Kooi
191a1de41f
transloadit: Fail the postprocessing step when /add_file fails. 2017-09-01 12:31:07 +02:00
Renée Kooi
727c4ee145
transloadit: Name some things. 2017-09-01 12:31:06 +02:00
Renée Kooi
0e479497e2
transloadit: Clarify how only :tl: metadata is sent to tus 2017-09-01 12:31:06 +02:00
Renée Kooi
13ac3350a4
transloadit: Emit core:upload-error if file cannot be added to assembly 2017-09-01 12:31:06 +02:00
Renée Kooi
d856023217
transloadit: Fix undefined opts 2017-09-01 12:31:06 +02:00
Renée Kooi
cebc0ee581
transloadit: First working URL import 2017-09-01 12:31:06 +02:00
Renée Kooi
cde56fa491
transloadit: Begin work on importing uploaded URLs into assembly.
Support uploading to elsewhere, then importing URLs into assembly.
2017-09-01 12:30:43 +02:00
Renée Kooi
617c5e525c
transloadit: Return assembly information from createAssembly.
We don't actually use this right now but this is what I would've
expected a method called `createAssembly` to do.
2017-09-01 12:27:24 +02: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
c75e80fed2 cleanup 2017-09-01 12:38:03 +03:00
Artur Paikin
6731b82905 add event listeners to input elements instead 2017-09-01 12:12:36 +03:00
Artur Paikin
1730baa5fe Merge pull request #305 from goto-bus-stop/feature/xhr-error
xhrupload: Support error messages from the endpoint
2017-09-01 12:00:52 +03:00
Artur Paikin
2f0d1b8581 don’t use onload, because fileCard is actually always in DOM
@goto-bus-stop could you help a bit here? I’m confused as to how to
remove an event listener when FileCard is closed, given that data
needed for that event listener lives in closure. Now it seems to me
that every time FileCard is open, a new listener is added
2017-09-01 02:06:23 +03:00
Artur Paikin
3b7dbc39e3 pass unique ID to onload; data-name="name" for name input 2017-09-01 01:47:20 +03:00
Artur Paikin
cb62a1e623 minor refactoring 2017-08-31 21:52:08 +03:00
Artur Paikin
c05ea5bbd8 when FileCard loads, set up an event listener for enter key and call props.done 2017-08-31 21:50:31 +03:00
Renée Kooi
c28c0c5551
dashboard: Prevent submitting outer form while editing metadata
Fixes #286

Using a `data-` attribute instead of the `name` attribute. Inputs with
`name` attributes submit the form they belong to when `enter` is
pressed, but inputs without do not:
https://stackoverflow.com/questions/3008035/stop-an-input-field-in-a-form-from-being-submitted
2017-08-31 11:38:44 +02:00
Renée Kooi
515902d836
s3: Use AWS-returned error message 2017-08-31 11:24:01 +02: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
ae530aed6a
webcam: Fix typo 2017-08-30 14:21:51 +02:00
Artur Paikin
22154d23af Merge pull request #292 from transloadit/info-details
Informer: add details `?` button that shows more info on hover or click
2017-08-29 22:51:36 +03:00
Artur Paikin
8711421c05 add closeModalOnClickOutside: false option 2017-08-29 22:41:04 +03:00
Artur Paikin
74137b1d26 make balloon wider 2017-08-28 13:32:17 +03:00
Artur Paikin
dc12ed1229 Informer: support “explanations”, a (?) button that shows more info on hover / click 2017-08-26 07:43:13 +03:00
Artur Paikin
1d3c2f053c set body as default target for ProgressBar 2017-08-25 01:43:13 +03:00