diff --git a/CHANGELOG.md b/CHANGELOG.md
index 200be45ca..9e3bca3e2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -47,6 +47,7 @@ Ideas that will be planned and find their way into a release at one point
- [ ] possibility to edit/delete more than one file at once #118, #97
- [ ] optimize problematic filenames #72
- [ ] an uploader plugin to receive files in a callback instead of uploading them
+- [ ] core: calling `upload` immediately after `addFile` does not upload all files (#249 @goto-bus-stop)
## 1.0 Goals
@@ -55,7 +56,7 @@ What we need to do to release Uppy 1.0
- [x] feature: restrictions: by size, number of files, file type
- [x] feature: beta file recovering after closed tab / browser crash
- [ ] feature: improved UI for Provider, Google Drive and Instagram, grid/list views
-- [ ] feature: finish the direct-to-s3 upload plugin and test it with the flow to then upload to :transloadit: afterwards. This is because this might influence the inner flow of the plugin architecture quite a bit
+- [x] feature: finish the direct-to-s3 upload plugin and test it with the flow to then upload to :transloadit: afterwards. This is because this might influence the inner flow of the plugin architecture quite a bit
- [ ] feature: Uppy should work well with React/Redux and React Native
- [ ] feature: preset for Transloadit that mimics jQuery SDK
- [ ] QA: test how everything works together: user experience from `npm install` to production build with Webpack, using in React/Redux environment (npm pack)
@@ -95,9 +96,8 @@ Theme: React and Retry
- [ ] core: add error in file progress state? error UI, question mark button, `core:error` (@arturi)
- [ ] core: retry or show error when upload can’t start / fails (offline, wrong endpoint) — now it just sits there (@arturi @goto-bus-stop)
-- [ ] core: calling `upload` immediately after `addFile` does not upload all files (#249 @goto-bus-stop)
- [ ] core: React / Redux PRs (@arturi @goto-bus-stop)
-- [ ] transloadit: upload to S3, then import into :tl: assembly using `/add_file?s3url=${url}` (@goto-bus-stop)
+- [x] transloadit: upload to S3, then import into :tl: assembly using `/add_file?s3url=${url}` (@goto-bus-stop)
- [ ] goldenretriver: add “ghost” files (@arturi @goto-bus-stop)
- [ ] dashboard: cancel button for any kind of uploads? currently resume/pause only for tus, and cancel for XHR (@arturi @goto-bus-stop)
- [x] informer: support “explanations”, a (?) button that shows more info on hover / click
diff --git a/src/core/Core.js b/src/core/Core.js
index 60e2682d4..eb6d187f7 100644
--- a/src/core/Core.js
+++ b/src/core/Core.js
@@ -72,6 +72,7 @@ class Uppy {
this.initSocket = this.initSocket.bind(this)
this.log = this.log.bind(this)
this.addFile = this.addFile.bind(this)
+ this.removeFile = this.removeFile.bind(this)
this.calculateProgress = this.calculateProgress.bind(this)
this.resetProgress = this.resetProgress.bind(this)
@@ -115,10 +116,8 @@ class Uppy {
*
*/
updateAll (state) {
- Object.keys(this.plugins).forEach((pluginType) => {
- this.plugins[pluginType].forEach((plugin) => {
- plugin.update(state)
- })
+ this.iteratePlugins(plugin => {
+ plugin.update(state)
})
}
@@ -444,7 +443,11 @@ class Uppy {
this.on('core:upload-error', (fileID, error) => {
const fileName = this.state.files[fileID].name
- this.info(`Failed to upload: ${fileName}`, 'error', 5000)
+ let message = `Failed to upload ${fileName}`
+ if (typeof error === 'object' && error.message) {
+ message = `${message}: ${error.message}`
+ }
+ this.info(message, 'error', 5000)
})
this.on('core:upload', () => {
@@ -609,21 +612,21 @@ class Uppy {
// Instantiate
const plugin = new Plugin(this, opts)
- const pluginName = plugin.id
+ const pluginId = plugin.id
this.plugins[plugin.type] = this.plugins[plugin.type] || []
- if (!pluginName) {
- throw new Error('Your plugin must have a name')
+ if (!pluginId) {
+ throw new Error('Your plugin must have an id')
}
if (!plugin.type) {
throw new Error('Your plugin must have a type')
}
- let existsPluginAlready = this.getPlugin(pluginName)
+ let existsPluginAlready = this.getPlugin(pluginId)
if (existsPluginAlready) {
- let msg = `Already found a plugin named '${existsPluginAlready.name}'.
- Tried to use: '${pluginName}'.
+ let msg = `Already found a plugin named '${existsPluginAlready.id}'.
+ Tried to use: '${pluginId}'.
Uppy is currently limited to running one of every plugin.
Share your use case with us over at
https://github.com/transloadit/uppy/issues/
diff --git a/src/plugins/AwsS3/index.js b/src/plugins/AwsS3/index.js
index f396daa23..998dde642 100644
--- a/src/plugins/AwsS3/index.js
+++ b/src/plugins/AwsS3/index.js
@@ -66,6 +66,14 @@ module.exports = class AwsS3 extends Plugin {
key: getValue('Key'),
etag: getValue('ETag')
}
+ },
+ getResponseError (xhr) {
+ // If no response, we don't have a specific error message, use the default.
+ if (!xhr.responseXML) {
+ return
+ }
+ const error = xhr.responseXML.querySelector('Error > Message')
+ return new Error(error.textContent)
}
})
})
diff --git a/src/plugins/Dashboard/FileCard.js b/src/plugins/Dashboard/FileCard.js
index 5e7fd3775..51602b8b4 100644
--- a/src/plugins/Dashboard/FileCard.js
+++ b/src/plugins/Dashboard/FileCard.js
@@ -6,9 +6,13 @@ module.exports = function fileCard (props) {
const file = props.fileCardFor ? props.files[props.fileCardFor] : false
const meta = {}
- function tempStoreMeta (ev) {
+ const tempStoreMetaOrSubmit = (ev) => {
+ if (ev.keyCode === 13) {
+ props.done(meta, file.id)
+ }
+
const value = ev.target.value
- const name = ev.target.attributes.name.value
+ const name = ev.target.dataset.name
meta[name] = value
}
@@ -18,11 +22,11 @@ module.exports = function fileCard (props) {
return html`