Browse Source

Use `opts.id` as the plugin ID for all plugins, fixes #1674

Renée Kooi 5 years ago
parent
commit
e6c52f7681

+ 1 - 1
packages/@uppy/aws-s3-multipart/src/index.js

@@ -39,7 +39,7 @@ module.exports = class AwsS3Multipart extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
     this.type = 'uploader'
-    this.id = 'AwsS3Multipart'
+    this.id = this.opts.id || 'AwsS3Multipart'
     this.title = 'AWS S3 Multipart'
     this.client = new RequestClient(uppy, opts)
 

+ 1 - 1
packages/@uppy/aws-s3/src/index.js

@@ -33,7 +33,7 @@ module.exports = class AwsS3 extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
     this.type = 'uploader'
-    this.id = 'AwsS3'
+    this.id = this.opts.id || 'AwsS3'
     this.title = 'AWS S3'
 
     this.defaultLocale = {

+ 1 - 1
packages/@uppy/form/src/index.js

@@ -14,7 +14,7 @@ module.exports = class Form extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
     this.type = 'acquirer'
-    this.id = 'Form'
+    this.id = this.opts.id || 'Form'
     this.title = 'Form'
 
     // set default options

+ 1 - 1
packages/@uppy/golden-retriever/src/index.js

@@ -16,7 +16,7 @@ module.exports = class GoldenRetriever extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
     this.type = 'debugger'
-    this.id = 'GoldenRetriever'
+    this.id = this.opts.id || 'GoldenRetriever'
     this.title = 'Golden Retriever'
 
     const defaultOptions = {

+ 1 - 1
packages/@uppy/react/src/__mocks__/DashboardPlugin.js

@@ -4,7 +4,7 @@ module.exports = class Dashboard extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
 
-    this.id = opts.id
+    this.id = this.opts.id
     this.type = 'orchestrator'
   }
 

+ 1 - 1
packages/@uppy/react/src/__mocks__/DragDropPlugin.js

@@ -4,7 +4,7 @@ module.exports = class DragDrop extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
 
-    this.id = opts.id
+    this.id = this.opts.id
     this.type = 'acquirer'
   }
 

+ 1 - 1
packages/@uppy/react/src/__mocks__/ProgressBarPlugin.js

@@ -4,7 +4,7 @@ module.exports = class ProgressBar extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
 
-    this.id = opts.id
+    this.id = this.opts.id
     this.type = 'progressindicator'
   }
 

+ 1 - 1
packages/@uppy/react/src/__mocks__/StatusBarPlugin.js

@@ -4,7 +4,7 @@ module.exports = class StatusBar extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
 
-    this.id = opts.id
+    this.id = this.opts.id
     this.type = 'progressindicator'
   }
 

+ 1 - 1
packages/@uppy/redux-dev-tools/src/index.js

@@ -12,7 +12,7 @@ module.exports = class ReduxDevTools extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
     this.type = 'debugger'
-    this.id = 'ReduxDevTools'
+    this.id = this.opts.id || 'ReduxDevTools'
     this.title = 'Redux DevTools'
 
     // set default options

+ 1 - 1
packages/@uppy/robodog/src/AttachFileInputs.js

@@ -9,7 +9,7 @@ class AttachFileInputs extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
 
-    this.id = opts.id || 'AttachFileInputs'
+    this.id = this.opts.id || 'AttachFileInputs'
     this.type = 'acquirer'
 
     this.handleChange = this.handleChange.bind(this)

+ 1 - 1
packages/@uppy/robodog/src/TransloaditFormResult.js

@@ -10,7 +10,7 @@ class TransloaditFormResult extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
 
-    this.id = opts.id || 'TransloaditFormResult'
+    this.id = this.opts.id || 'TransloaditFormResult'
     this.type = 'modifier'
 
     this.handleUpload = this.handleUpload.bind(this)

+ 1 - 1
packages/@uppy/robodog/src/TransloaditResultsPlugin.js

@@ -8,7 +8,7 @@ class TransloaditResultsPlugin extends Plugin {
     super(uppy, opts)
 
     this.type = 'modifier'
-    this.id = 'TransloaditResultsPlugin'
+    this.id = this.opts.id || 'TransloaditResultsPlugin'
     this._afterUpload = this._afterUpload.bind(this)
   }
 

+ 1 - 1
packages/@uppy/transloadit/src/index.js

@@ -30,7 +30,7 @@ module.exports = class Transloadit extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
     this.type = 'uploader'
-    this.id = 'Transloadit'
+    this.id = this.opts.id || 'Transloadit'
     this.title = 'Transloadit'
 
     this.defaultLocale = {

+ 1 - 1
packages/@uppy/tus/src/index.js

@@ -53,7 +53,7 @@ module.exports = class Tus extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
     this.type = 'uploader'
-    this.id = 'Tus'
+    this.id = this.opts.id || 'Tus'
     this.title = 'Tus'
 
     // set default options

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

@@ -27,7 +27,7 @@ module.exports = class XHRUpload extends Plugin {
   constructor (uppy, opts) {
     super(uppy, opts)
     this.type = 'uploader'
-    this.id = 'XHRUpload'
+    this.id = this.opts.id || 'XHRUpload'
     this.title = 'XHRUpload'
 
     this.defaultLocale = {