From e6c52f7681dad5a73c85bac2c7986293eda76a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Wed, 19 Jun 2019 09:52:12 +0200 Subject: [PATCH] Use `opts.id` as the plugin ID for all plugins, fixes #1674 --- packages/@uppy/aws-s3-multipart/src/index.js | 2 +- packages/@uppy/aws-s3/src/index.js | 2 +- packages/@uppy/form/src/index.js | 2 +- packages/@uppy/golden-retriever/src/index.js | 2 +- packages/@uppy/react/src/__mocks__/DashboardPlugin.js | 2 +- packages/@uppy/react/src/__mocks__/DragDropPlugin.js | 2 +- packages/@uppy/react/src/__mocks__/ProgressBarPlugin.js | 2 +- packages/@uppy/react/src/__mocks__/StatusBarPlugin.js | 2 +- packages/@uppy/redux-dev-tools/src/index.js | 2 +- packages/@uppy/robodog/src/AttachFileInputs.js | 2 +- packages/@uppy/robodog/src/TransloaditFormResult.js | 2 +- packages/@uppy/robodog/src/TransloaditResultsPlugin.js | 2 +- packages/@uppy/transloadit/src/index.js | 2 +- packages/@uppy/tus/src/index.js | 2 +- packages/@uppy/xhr-upload/src/index.js | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/@uppy/aws-s3-multipart/src/index.js b/packages/@uppy/aws-s3-multipart/src/index.js index bd7d79245d..ef64a9971b 100644 --- a/packages/@uppy/aws-s3-multipart/src/index.js +++ b/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) diff --git a/packages/@uppy/aws-s3/src/index.js b/packages/@uppy/aws-s3/src/index.js index 5ca6f876c6..e39bfcd904 100644 --- a/packages/@uppy/aws-s3/src/index.js +++ b/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 = { diff --git a/packages/@uppy/form/src/index.js b/packages/@uppy/form/src/index.js index 564a003fb7..fb4ffb7898 100644 --- a/packages/@uppy/form/src/index.js +++ b/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 diff --git a/packages/@uppy/golden-retriever/src/index.js b/packages/@uppy/golden-retriever/src/index.js index bf57b55c33..e127ce5839 100644 --- a/packages/@uppy/golden-retriever/src/index.js +++ b/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 = { diff --git a/packages/@uppy/react/src/__mocks__/DashboardPlugin.js b/packages/@uppy/react/src/__mocks__/DashboardPlugin.js index c5c0b8b6b6..3153072c1b 100644 --- a/packages/@uppy/react/src/__mocks__/DashboardPlugin.js +++ b/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' } diff --git a/packages/@uppy/react/src/__mocks__/DragDropPlugin.js b/packages/@uppy/react/src/__mocks__/DragDropPlugin.js index 58b211481e..32e0851685 100644 --- a/packages/@uppy/react/src/__mocks__/DragDropPlugin.js +++ b/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' } diff --git a/packages/@uppy/react/src/__mocks__/ProgressBarPlugin.js b/packages/@uppy/react/src/__mocks__/ProgressBarPlugin.js index 752247bc64..9a96d5e676 100644 --- a/packages/@uppy/react/src/__mocks__/ProgressBarPlugin.js +++ b/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' } diff --git a/packages/@uppy/react/src/__mocks__/StatusBarPlugin.js b/packages/@uppy/react/src/__mocks__/StatusBarPlugin.js index e954fff543..2fa5c1db35 100644 --- a/packages/@uppy/react/src/__mocks__/StatusBarPlugin.js +++ b/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' } diff --git a/packages/@uppy/redux-dev-tools/src/index.js b/packages/@uppy/redux-dev-tools/src/index.js index bd04a14cad..a44f00425d 100644 --- a/packages/@uppy/redux-dev-tools/src/index.js +++ b/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 diff --git a/packages/@uppy/robodog/src/AttachFileInputs.js b/packages/@uppy/robodog/src/AttachFileInputs.js index 091af13476..d63e9429ca 100644 --- a/packages/@uppy/robodog/src/AttachFileInputs.js +++ b/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) diff --git a/packages/@uppy/robodog/src/TransloaditFormResult.js b/packages/@uppy/robodog/src/TransloaditFormResult.js index 31c6c39c47..429c01eb11 100644 --- a/packages/@uppy/robodog/src/TransloaditFormResult.js +++ b/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) diff --git a/packages/@uppy/robodog/src/TransloaditResultsPlugin.js b/packages/@uppy/robodog/src/TransloaditResultsPlugin.js index 1589a22578..fa87e5e317 100644 --- a/packages/@uppy/robodog/src/TransloaditResultsPlugin.js +++ b/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) } diff --git a/packages/@uppy/transloadit/src/index.js b/packages/@uppy/transloadit/src/index.js index 2eb19269b1..598148330d 100644 --- a/packages/@uppy/transloadit/src/index.js +++ b/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 = { diff --git a/packages/@uppy/tus/src/index.js b/packages/@uppy/tus/src/index.js index 9a77fa2216..68825d2aba 100644 --- a/packages/@uppy/tus/src/index.js +++ b/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 diff --git a/packages/@uppy/xhr-upload/src/index.js b/packages/@uppy/xhr-upload/src/index.js index 05026cb98e..bf358abb07 100644 --- a/packages/@uppy/xhr-upload/src/index.js +++ b/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 = {