Parcourir la source

Merge branch 'master' into feature/transloadit-error

Kevin van Zonneveld il y a 6 ans
Parent
commit
05ec7b09ab
30 fichiers modifiés avec 83 ajouts et 51 suppressions
  1. 1 0
      CHANGELOG.md
  2. 5 2
      bin/locale-packs.js
  3. 3 0
      packages/@uppy/locales/src/de_DE.js
  4. 3 0
      packages/@uppy/locales/src/fr_FR.js
  5. 3 0
      packages/@uppy/locales/src/nl_NL.js
  6. 0 3
      packages/@uppy/provider-views/src/AuthView.js
  7. 4 12
      packages/@uppy/provider-views/src/index.js
  8. 6 1
      packages/@uppy/robodog/src/form.js
  9. 6 1
      packages/@uppy/xhr-upload/src/index.js
  10. 1 1
      website/src/_posts/2019-04-liftoff-25.md
  11. 1 1
      website/src/_posts/2019-04-liftoff-27.md
  12. 1 1
      website/src/_posts/2019-04-liftoff-28.md
  13. 1 1
      website/src/_posts/2019-04-liftoff-29.md
  14. 39 0
      website/src/_posts/2019-04-liftoff-30.md
  15. 0 19
      website/src/_posts/2019-04-liftoff-31.md
  16. 9 9
      website/src/docs/robodog-form.md
  17. BIN
      website/src/images/blog/30daystoliftoff/03.jpg
  18. BIN
      website/src/images/blog/30daystoliftoff/04.jpg
  19. BIN
      website/src/images/blog/30daystoliftoff/05.jpg
  20. BIN
      website/src/images/blog/30daystoliftoff/08.jpg
  21. BIN
      website/src/images/blog/30daystoliftoff/09.jpg
  22. BIN
      website/src/images/blog/30daystoliftoff/11.jpg
  23. BIN
      website/src/images/blog/30daystoliftoff/14.webp
  24. BIN
      website/src/images/blog/30daystoliftoff/16.jpg
  25. BIN
      website/src/images/blog/30daystoliftoff/2019-04-day30-board.png
  26. BIN
      website/src/images/blog/30daystoliftoff/2019-04-day30-posts.png
  27. BIN
      website/src/images/blog/30daystoliftoff/21.jpg
  28. BIN
      website/src/images/blog/30daystoliftoff/30.gif
  29. BIN
      website/src/images/blog/30daystoliftoff/31.gif
  30. 0 0
      website/src/images/blog/30daystoliftoff/day30.jpg

+ 1 - 0
CHANGELOG.md

@@ -102,6 +102,7 @@ PRs are welcome! Please do open an issue to discuss first if it's a big feature,
 - [ ] @uppy/companion: investigate 423 and 500 issues with React Native + Url plugin when pause/resuming an upload
 - [ ] docs: add docs on locales — how to use from NPM and CDN
 - [ ] @uppy/transloadit: finish Transloadit-Client header on https://github.com/transloadit/uppy/tree/feature/transloadit-client
+- [ ] companion: reports an error at first sign in. we did a hotfix in https://github.com/transloadit/uppy/pull/1478#issuecomment-485937942 but need a proper fix for that (@ife). Also: what about changing the location of that tooltip? So legit errors also don't block buttons?
 
 ## 1.0 Goals
 

+ 5 - 2
bin/locale-packs.js

@@ -189,15 +189,18 @@ function test () {
   const leadingLocaleName = 'en_US'
 
   const followerLocales = {}
+  const followerValues = {}
   const localePackagePath = path.join(__dirname, '..', 'packages', '@uppy', 'locales', 'src', '*.js')
   glob.sync(localePackagePath).forEach((localePath) => {
     const localeName = path.basename(localePath, '.js')
     // Builds array with items like: 'uploadingXFiles.2'
-    followerLocales[localeName] = Object.keys(flat(require(localePath).strings))
+    followerValues[localeName] = flat(require(localePath).strings)
+    followerLocales[localeName] = Object.keys(followerValues[localeName])
   })
 
   // Take aside our leading locale: en_US
   const leadingLocale = followerLocales[leadingLocaleName]
+  const leadingValues = followerValues[leadingLocaleName]
   delete followerLocales[leadingLocaleName]
 
   // Compare all follower Locales (RU, DE, etc) with our leader en_US
@@ -211,7 +214,7 @@ function test () {
     missing.forEach((key) => {
       // Items missing are a non-fatal warning because we don't want CI to bum out over all languages
       // as soon as we add some English
-      warnings.push(`${chalk.cyan(followerName)} locale has missing string: '${chalk.red(key)}' that is present in ${chalk.cyan(leadingLocaleName)}. `)
+      warnings.push(`${chalk.cyan(followerName)} locale has missing string: '${chalk.red(key)}' that is present in ${chalk.cyan(leadingLocaleName)} with value: ${chalk.yellow(leadingValues[key])}`)
     })
     excess.forEach((key) => {
       // Items in excess are a fatal because we should clean up follower languages once we remove English strings

+ 3 - 0
packages/@uppy/locales/src/de_DE.js

@@ -7,6 +7,8 @@ de_DE.strings = {
   addingMoreFiles: 'Dateien hinzufügen',
   allowAccessDescription: 'Um Bilder oder Videos mit Ihrer Kamera aufzunehmen, erlauben Sie dieser Website bitte Zugriff auf Ihre Kamera.',
   allowAccessTitle: 'Bitte erlauben Sie Zugriff auf Ihre Kamera',
+  authenticateWith: 'Mit %{pluginName} verbinden',
+  authenticateWithTitle: 'Bitte authentifizieren Sie sich mit %{pluginName}, um Dateien auszuwählen',
   back: 'Zurück',
   browse: 'durchsuchen',
   cancel: 'Abbrechen',
@@ -64,6 +66,7 @@ de_DE.strings = {
   pause: 'Pausieren',
   pauseUpload: 'Upload pausieren',
   paused: 'Pausiert',
+  poweredBy: 'Angetrieben von',
   preparingUpload: 'Upload vorbereiten...',
   processingXFiles: {
     '0': '%{smart_count} Datei verarbeiten',

+ 3 - 0
packages/@uppy/locales/src/fr_FR.js

@@ -7,6 +7,8 @@ fr_FR.strings = {
   addingMoreFiles: 'En train d\'ajouter des fichiers',
   allowAccessDescription: 'Pour prendre des photos ou enregistrer une vidéo avec votre caméra, veuillez autoriser l\'accès à votre caméra pour ce site.',
   allowAccessTitle: 'Veuillez autoriser l\'accès à votre caméra',
+  authenticateWith: 'Se connecter à %{pluginName}',
+  authenticateWithTitle: 'Veuillez vous authentifier avec %{pluginName} pour sélectionner les fichiers',
   back: 'Retour',
   browse: 'naviguer',
   cancel: 'Annuler',
@@ -64,6 +66,7 @@ fr_FR.strings = {
   pause: 'Pause',
   pauseUpload: 'Mettre en pause le téléchargement',
   paused: 'En pause',
+  poweredBy: 'Soutenu par',
   preparingUpload: 'Préparation du téléchargement...',
   processingXFiles: {
     '0': 'Traitement de %{smart_count} fichier',

+ 3 - 0
packages/@uppy/locales/src/nl_NL.js

@@ -7,6 +7,8 @@ nl_NL.strings = {
   addingMoreFiles: 'Bezig met extra bestanden toe te voegen',
   allowAccessDescription: 'Geef toestemming om foto\'s of videobeelden te kunnen maken.',
   allowAccessTitle: 'Geef toestemming om je camera te gebruiken',
+  authenticateWith: 'Verbinden met %{pluginName}',
+  authenticateWithTitle: 'Verbindt met %{pluginName} om bestanden te selecteren',
   back: 'Terug',
   browse: 'blader',
   cancel: 'Annuleer',
@@ -64,6 +66,7 @@ nl_NL.strings = {
   pause: 'Pauze',
   pauseUpload: 'Pauzeer upload',
   paused: 'Gepauzeerd',
+  poweredBy: 'Mogelijk gemaakt door',
   preparingUpload: 'Upload voorbereiden...',
   processingXFiles: {
     '0': 'Bezig met %{smart_count} bestand te verwerken',

+ 0 - 3
packages/@uppy/provider-views/src/AuthView.js

@@ -25,9 +25,6 @@ class AuthBlock extends Component {
       >
         {this.props.i18nArray('authenticateWith', { pluginName: this.props.pluginName })}
       </button>
-      {this.props.demo &&
-        <button class="uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn" onclick={this.props.handleDemoAuth}>Proceed with Demo Account</button>
-      }
     </div>
   }
 }

+ 4 - 12
packages/@uppy/provider-views/src/index.js

@@ -58,7 +58,6 @@ module.exports = class ProviderView {
     this.logout = this.logout.bind(this)
     this.preFirstRender = this.preFirstRender.bind(this)
     this.handleAuth = this.handleAuth.bind(this)
-    this.handleDemoAuth = this.handleDemoAuth.bind(this)
     this.sortByTitle = this.sortByTitle.bind(this)
     this.sortByDate = this.sortByDate.bind(this)
     this.isActiveRow = this.isActiveRow.bind(this)
@@ -410,13 +409,6 @@ module.exports = class ProviderView {
     })
   }
 
-  handleDemoAuth () {
-    const state = this.plugin.getPluginState()
-    this.plugin.setPluginState({}, state, {
-      authenticated: true
-    })
-  }
-
   handleAuth () {
     const authState = btoa(JSON.stringify({ origin: location.origin }))
     const link = `${this.provider.authUrl()}?state=${authState}`
@@ -453,7 +445,10 @@ module.exports = class ProviderView {
   handleError (error) {
     const uppy = this.plugin.uppy
     uppy.log(error.toString())
-    const message = uppy.i18n(error.isAuthError ? 'companionAuthError' : 'companionError')
+    if (error.isAuthError) {
+      return
+    }
+    const message = uppy.i18n('companionError')
     uppy.info({message: message, details: error.toString()}, 'error', 5000)
   }
 
@@ -534,9 +529,7 @@ module.exports = class ProviderView {
           <AuthView
             pluginName={this.plugin.title}
             pluginIcon={this.plugin.icon}
-            demo={this.plugin.opts.demo}
             handleAuth={this.handleAuth}
-            handleDemoAuth={this.handleDemoAuth}
             i18n={this.plugin.uppy.i18n}
             i18nArray={this.plugin.uppy.i18nArray} />
         </CloseWrapper>
@@ -553,7 +546,6 @@ module.exports = class ProviderView {
       sortByTitle: this.sortByTitle,
       sortByDate: this.sortByDate,
       logout: this.logout,
-      demo: this.plugin.opts.demo,
       isActiveRow: this.isActiveRow,
       isChecked: this.isChecked,
       toggleCheckbox: this.toggleCheckbox,

+ 6 - 1
packages/@uppy/robodog/src/form.js

@@ -18,10 +18,15 @@ function form (target, opts) {
     name: 'transloadit'
   })
 
+  let submitOnSuccess = true
+  if (opts.hasOwnProperty('submitOnSuccess')) {
+    submitOnSuccess = !!opts.submitOnSuccess
+  }
+
   uppy.use(Form, {
     target,
     triggerUploadOnSubmit: true,
-    submitOnSuccess: true,
+    submitOnSuccess: submitOnSuccess,
     addResultToForm: false // using custom implementation instead
   })
 

+ 6 - 1
packages/@uppy/xhr-upload/src/index.js

@@ -372,7 +372,12 @@ module.exports = class XHRUpload extends Plugin {
       const formData = new FormData()
       files.forEach((file, i) => {
         const opts = this.getOptions(file)
-        formData.append(opts.fieldName, file.data)
+
+        if (file.name) {
+          formData.append(opts.fieldName, file.data, file.name)
+        } else {
+          formData.append(opts.fieldName, file.data)
+        }
       })
 
       const xhr = new XMLHttpRequest()

+ 1 - 1
website/src/_posts/2019-04-liftoff-25.md

@@ -13,6 +13,6 @@ Why have a Good Friday when you can have a Great Friday instead!? Today is the b
 
 <!--more-->
 
-Even though there's still quite a bit to do before the **Uppy 1.0 launch next week**, we're taking these few days for ourselves to fully recharge the batteries before breaking into our final sprint on Tuesday. :running: Be sure to check in with us during the weekend, though, for some fun little updates in our 30 Days to Liftoff!
+Even though there's still quite a bit to do before the **Uppy 1.0 launch next week**, we're taking these few days for ourselves to fully recharge the batteries before breaking into our final sprint on [Tuesday](/blog/2019/04/liftoff-29/). :running: Be sure to check in with us during the weekend, though, for some fun little updates in our 30 Days to Liftoff!
 
 Have a Great Friday everyone!

+ 1 - 1
website/src/_posts/2019-04-liftoff-27.md

@@ -13,5 +13,5 @@ Happy Easter everyone! :egg::rabbit: It's like a regular Sunday, but with a cher
 
 <!--more-->
 
-We'll be back tomorrow on Day 28 with another small easter egg from the Uppy team!
+We'll be back tomorrow on [Day 28](/blog/2019/04/liftoff-28/) with another small easter egg from the Uppy team!
 

+ 1 - 1
website/src/_posts/2019-04-liftoff-28.md

@@ -19,4 +19,4 @@ Here's an 80's-style montage of GIFs to give you an idea of what we're doing to
 <center><img width="400"  src="https://media.giphy.com/media/cLcxtL1z8t8oo/giphy.gif"><br/><br/></center>
 <center><img width="400"  src="https://media.giphy.com/media/ngzhAbaGP1ovS/giphy.gif"><br/><br/></center>
 
-See you back tomorrow on Day 29 of our 30 Days to Liftoff! We'll have a lot more to share as we prepare for Uppy's Big Day. Give us a follow on [Twitter](https://twitter.com/uppy_io) or on [RSS](https://uppy.io/atom.xml) to stay up to date with everything.
+See you back tomorrow on [Day 29](/blog/2019/04/liftoff-29/) of our 30 Days to Liftoff! We'll have a lot more to share as we prepare for Uppy's Big Day. Give us a follow on [Twitter](https://twitter.com/uppy_io) or on [RSS](https://uppy.io/atom.xml) to stay up to date with everything.

+ 1 - 1
website/src/_posts/2019-04-liftoff-29.md

@@ -32,4 +32,4 @@ In terms of progress and completed features, things are looking good. We don't h
 
 - [Evgenia](https://github.com/lakesare) has continued her work on [accessibility issues with Uppy's provider views](https://github.com/transloadit/uppy/issues/created_by/nqst) and is planning on adding her improvements in the coming days.
 
-Don't forget that today is Day 29 of our '30 Days to Liftoff' challenge. With **Uppy 1.0** on its way and our blog post challenge coming to an end, we hope you won't miss these quick updates too much! If you can't stand to miss our grand finale tomorrow, make sure to follow us on [Twitter](https://twitter.com/uppy_io) and have a look at our [RSS feed](https://uppy.io/atom.xml).
+Don't forget that today is Day 29 of our '30 Days to Liftoff' challenge. With **Uppy 1.0** on its way and our blog post challenge coming to an end, we hope you won't miss these quick updates too much! If you can't stand to miss our grand finale [tomorrow](/blog/2019/04/liftoff-30/), make sure to follow us on [Twitter](https://twitter.com/uppy_io) and have a look at our [RSS feed](https://uppy.io/atom.xml).

+ 39 - 0
website/src/_posts/2019-04-liftoff-30.md

@@ -0,0 +1,39 @@
+---
+title: "Day 30"
+date: 2019-04-24
+author: kvz
+image: "https://uppy.io/images/blog/30daystoliftoff/day30.jpg"
+series: 30 Days to Liftoff
+seriesSuffix: 'of 30'
+---
+
+And then there were none! Zero days left in our thirty-day blog post challenge. I can't believe this is already the final day of our push to get Uppy to 1.0. There's still a bunch of things that we'd like to finish before shipping, so let's dive right in.
+
+<center><br /><img width="400" src="/images/blog/30daystoliftoff/day30.jpg"><br /><br /></center>
+
+<!--more-->
+
+- [Tim](https://github.com/tim-kos) added additional information to the [migration guide](https://uppy.io/docs/robodog/form/#Migrating-From-the-jQuery-SDK), so Transloadit customers looking to move from the jQuery SDK to Uppy Robodog will have an easier time doing so. He also implemented support for a jQuery SDK parameter that didn't work in Robodog.form yet, and smashed out the [German Locale Pack](https://github.com/transloadit/uppy/pull/1475)!
+
+- [Abdel](https://github.com/kiloreux) [translated](https://github.com/transloadit/uppy/pull/1481) Uppy to French. <img src="https://avatars1.githubusercontent.com/u/20061212?s=460&v=4" width="16" align="absmiddle">
+
+- [Artur](https://github.com/arturi) [documented](https://github.com/transloadit/uppy/pull/1468) the Thumbnail Generator plugin and made a few more hardcoded English strings translatable via Locale Packs. For instance, we can even translate "[Powered By](https://github.com/transloadit/uppy/commit/6d36309b72b62e215caa172a6300a0f0c7083ce8)" now 
+
+We also had a team call where we discussed which _To Do's_ we can leave behind for the launch, and which ones we'd really like to get in. To save time for actually working on these tasks, instead of typing, let me share a screenshot of what we agreed upon:
+
+<center><a rel="noreferrer noopener" target="_blank" href="/images/blog/30daystoliftoff/2019-04-day30-board.png"><img src="/images/blog/30daystoliftoff/2019-04-day30-board.png"></a><br /><br /></center>
+
+It's gonna be a close call. [Ife](https://github.com/ifedapoolarewaju), especially, has a lot on his plate with that "[600MB issue](https://github.com/tus/tus-js-client/issues/146)" still untackled, but we did get [Marius](https://github.com/Acconut) on board with the way we want to solve it, so now it's full steam ahead.
+
+Before I'm going back to the team and help out where I can, I'd like to thank you for reading along with us for these past thirty days. To be honest, at times, we regretted making this commitment.
+
+<center><br /><img src="/images/blog/30daystoliftoff/2019-04-day30-posts.png"><br /><br /></center>
+
+A post a day can steal focus, but we learned a lot. It quickly became clear that in order to set ourselves up for success, we needed to plan ahead and establish some basic rules. Strict deadlines, for instance, helped out a lot: the first iteration needed to be in before lunch, with a second one done shortly after lunch. Otherwise, folks would end up working overtime or even on the next day, when it was already time for the next post. 
+
+Luckily, we had our content team to take ownership of the whole process and keep these distractions away from the Uppy core team as much as possible. In the end, we really enjoyed sharing our development process with the world and giving interested developers a better understanding of what we're trying to accomplish, and how.
+
+We hope to see you tomorrow again for our 1.0 launch, which will be accompanied by a meaty release post! Make sure to follow us on [Twitter](https://twitter.com/uppy_io) or via our [RSS feed](https://uppy.io/atom.xml) if you don't want to miss it!
+
+
+<!-- <center><img width="400" src="https://media.giphy.com/media/11syU6ZZ6PsGRO/giphy.gif"><br/><br/></center> -->

+ 0 - 19
website/src/_posts/2019-04-liftoff-31.md

@@ -1,19 +0,0 @@
----
-title: "Day 12"
-date: 2019-04-06
-author: kvz
-published: false
-image: "https://uppy.io/images/blog/30daystoliftoff/15.jpg"
-series: 30 Days to Liftoff
-seriesSuffix: 'of 30'
----
-
-Work hard, play hard! In the weekend it's time to contemplate, stand back, relax, and enjoy some GIFs, handpicked by our crew:
-
-<center><img width="400" src="https://media.giphy.com/media/RnX4q6yYDoYCI/giphy.gif"><br/><br/></center>
-<center><img width="400" src="https://media.giphy.com/media/3orieRftQRDJLIlpQc/giphy.gif"><br/><br/></center>
-<center><img width="400" src="https://media.giphy.com/media/gUUI0yuLMnFPq/giphy.gif"><br/><br/></center>
-<center><img width="400" src="https://media.giphy.com/media/9MJgNOmdBheJrcOHui/giphy.gif"><br/><br/></center>
-<center><img width="400" src="https://media.giphy.com/media/11syU6ZZ6PsGRO/giphy.gif"><br/><br/></center>
-
-Just the thing we need to recharge those :battery::battery: to :100: so we can make a dent on Monday again. Hope you'll have a good one! :kissing_heart: 

+ 9 - 9
website/src/docs/robodog-form.md

@@ -223,14 +223,14 @@ There are no `on*()` _options_ anymore, but `.on('...')` methods are provided in
 
 | jQuery SDK option | Robodog Event |
 |---------------|--------------------------|
-| `onStart` | `.on('transloadit:assembly-created')` |
-| `onExecuting` | `.on('transloadit:assembly-executing')` |
-| `onFileSelect` | `.on('file-added')` |
-| `onProgress` | `.on('upload-progress` |
-| `onUpload` | `.on('transloadit:upload')` |
-| `onResult` | `.on('transloadit:result')` |
-| `onCancel` | `.on('transloadit:cancel')` or `.on('file-cancel')` for individual files |
-| `onError` | `.on('error')` |
-| `onSuccess` | `.on('transloadit:complete')` |
+| `onStart` | `.on('transloadit:assembly-created', (assembly) => {})` |
+| `onExecuting` | `.on('transloadit:assembly-executing', (assembly) => {})` |
+| `onFileSelect` | `.on('file-added', (file) => {})` |
+| `onProgress` | `.on('progress`, (percentage) => {})) for total upload progress taking all files into account.<br />`.on('upload-progress', (file, progress) => {})` for file-specific upload progress. |
+| `onUpload` | `.on('transloadit:upload', (file) => {}))` |
+| `onResult` | `.on('transloadit:result', (stepName, resultFile) => {}))` |
+| `onCancel` | `.on('transloadit:cancel', (assembly) => {}))`<br />or `.on('file-removed', (file) => {})` for individual files |
+| `onError` | `.on('error', (error) => {})` <br /><br />The error object might contain an `.assembly` property with an Assembly status for errors that happened during the execution of the Assembly. |
+| `onSuccess` | `.on('transloadit:complete', (assembly) => {})` |
 | `onDisconnect` | Currently unavailable, use something like [`is-offline`](https://www.npmjs.com/package/is-offline) |
 | `onReconnect` | Currently unavailable, use something like [`is-offline`](https://www.npmjs.com/package/is-offline) |

BIN
website/src/images/blog/30daystoliftoff/03.jpg


BIN
website/src/images/blog/30daystoliftoff/04.jpg


BIN
website/src/images/blog/30daystoliftoff/05.jpg


BIN
website/src/images/blog/30daystoliftoff/08.jpg


BIN
website/src/images/blog/30daystoliftoff/09.jpg


BIN
website/src/images/blog/30daystoliftoff/11.jpg


BIN
website/src/images/blog/30daystoliftoff/14.webp


BIN
website/src/images/blog/30daystoliftoff/16.jpg


BIN
website/src/images/blog/30daystoliftoff/2019-04-day30-board.png


BIN
website/src/images/blog/30daystoliftoff/2019-04-day30-posts.png


BIN
website/src/images/blog/30daystoliftoff/21.jpg


BIN
website/src/images/blog/30daystoliftoff/30.gif


BIN
website/src/images/blog/30daystoliftoff/31.gif


+ 0 - 0
website/src/images/blog/30daystoliftoff/23.jpg → website/src/images/blog/30daystoliftoff/day30.jpg