uppy/packages/@uppy/provider-views
Andrew e40cd018e1
Fix: Incorrect File Added Count (#2439)
On the dashboard, when uploading a folder, if files from that folder are not successfully added, the count would still say they are there

For example, If you're using Google Drive, and upload a folder with 3 images and 2 mp3 files. If you also have a restriction set to only allow images, Dashboard would still read something like "5 Files Added", even though only 3 would be there. I resolved this by making the `addFile` method in the `provider-views` package return a boolean value based on whether or not the file was added successfully. I then created a count variable with the `addFolder` method and added to that count for every successful addition. Using that count instead of the total count of files in the folder fixes this problem

Resolves #2038
2020-08-13 09:34:49 +02:00
..
src Fix: Incorrect File Added Count (#2439) 2020-08-13 09:34:49 +02:00
types docs,website: tutorial on adding custom providers (#2310) 2020-07-03 17:22:00 +01:00
LICENSE Move ProviderView to @uppy/provider-views. 2018-06-14 16:31:19 +02:00
package.json Release 2020-07-30 15:52:20 +01:00
README.md docs,website: tutorial on adding custom providers (#2310) 2020-07-03 17:22:00 +01:00

@uppy/provider-views

Uppy logo: a superman puppy in a pink suit

Build Status

View library for Uppy remote provider plugins.

Uppy is being developed by the folks at Transloadit, a versatile file encoding service.

Example

const Plugin = require('@uppy/core/lib/plugin')
const ProviderViews = require('@uppy/provider-views')

class GoogleDrive extends Plugin {
  constructor () { /* snip */ }
  install () {
    this.view = new ProviderViews(this)
    // snip
  }

  onFirstRender () {
    return this.view.getFolder('root', '/')
  }

  render (state) {
    return this.view.render(state)
  }
}

Installation

Unless you are creating a custom provider plugin, you do not need to install this.

$ npm install @uppy/provider-views --save

License

The MIT License.