From 1cf971950ae93ca8d471ad519bdb6700c08fabab Mon Sep 17 00:00:00 2001 From: Yilin Gan Date: Fri, 13 Jul 2018 11:30:38 -0700 Subject: [PATCH 01/25] add file path for aws upload --- packages/strapi-plugin-content-manager/package.json | 2 +- packages/strapi-plugin-upload/controllers/Upload.js | 1 + packages/strapi-upload-aws-s3/lib/index.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index b112406143..a5bc113c5a 100755 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -46,4 +46,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/strapi-plugin-upload/controllers/Upload.js b/packages/strapi-plugin-upload/controllers/Upload.js index 28f6a22721..f9e769eea9 100644 --- a/packages/strapi-plugin-upload/controllers/Upload.js +++ b/packages/strapi-plugin-upload/controllers/Upload.js @@ -41,6 +41,7 @@ module.exports = { // Add details to the file to be able to create the relationships. if (refId && ref && field) { Object.assign(file, { + path: `${ref}/${field}`, related: [{ refId, ref, diff --git a/packages/strapi-upload-aws-s3/lib/index.js b/packages/strapi-upload-aws-s3/lib/index.js index 0545af0b36..bff9c2e195 100644 --- a/packages/strapi-upload-aws-s3/lib/index.js +++ b/packages/strapi-upload-aws-s3/lib/index.js @@ -71,7 +71,7 @@ module.exports = { return new Promise((resolve, reject) => { // upload file on S3 bucket S3.upload({ - Key: `${file.hash}${file.ext}`, + Key: `${file.path}/${file.hash}${file.ext}`, Body: new Buffer(file.buffer, 'binary'), ACL: 'public-read' }, (err, data) => { @@ -92,7 +92,7 @@ module.exports = { S3.deleteObjects({ Delete: { Objects: [{ - Key: `${file.hash}${file.ext}` + Key: `${file.path}/${file.hash}${file.ext}` }] } }, (err, data) => { From 7eb038b7d728da1161db194ef404823eea0d5812 Mon Sep 17 00:00:00 2001 From: Yilin Gan Date: Fri, 13 Jul 2018 11:33:44 -0700 Subject: [PATCH 02/25] add mime type for asw upload --- packages/strapi-upload-aws-s3/lib/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/strapi-upload-aws-s3/lib/index.js b/packages/strapi-upload-aws-s3/lib/index.js index bff9c2e195..07a089e611 100644 --- a/packages/strapi-upload-aws-s3/lib/index.js +++ b/packages/strapi-upload-aws-s3/lib/index.js @@ -73,7 +73,8 @@ module.exports = { S3.upload({ Key: `${file.path}/${file.hash}${file.ext}`, Body: new Buffer(file.buffer, 'binary'), - ACL: 'public-read' + ACL: 'public-read', + ContentType: file.mime, }, (err, data) => { if (err) { return reject(err); From 5e66ee59d0c395b347936dba9970149adc76ff59 Mon Sep 17 00:00:00 2001 From: Yilin Gan Date: Fri, 20 Jul 2018 10:16:50 -0700 Subject: [PATCH 03/25] update for undefined path --- packages/strapi-upload-aws-s3/lib/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/strapi-upload-aws-s3/lib/index.js b/packages/strapi-upload-aws-s3/lib/index.js index 07a089e611..b38e17b3a1 100644 --- a/packages/strapi-upload-aws-s3/lib/index.js +++ b/packages/strapi-upload-aws-s3/lib/index.js @@ -70,8 +70,9 @@ module.exports = { upload: (file) => { return new Promise((resolve, reject) => { // upload file on S3 bucket + const path = file.path ? `${file.path}/` : ''; S3.upload({ - Key: `${file.path}/${file.hash}${file.ext}`, + Key: `${path}${file.hash}${file.ext}`, Body: new Buffer(file.buffer, 'binary'), ACL: 'public-read', ContentType: file.mime, @@ -90,10 +91,11 @@ module.exports = { delete: (file) => { return new Promise((resolve, reject) => { // delete file on S3 bucket + const path = file.path ? `${file.path}/` : ''; S3.deleteObjects({ Delete: { Objects: [{ - Key: `${file.path}/${file.hash}${file.ext}` + Key: `${path}${file.hash}${file.ext}` }] } }, (err, data) => { From a2a6ff88cbd37c298753872f0adfb15058c76531 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 8 Aug 2018 00:18:58 +0200 Subject: [PATCH 04/25] fix(plugin-settings-manager): autoReload response --- .../strapi-plugin-settings-manager/admin/src/requirements.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-plugin-settings-manager/admin/src/requirements.js b/packages/strapi-plugin-settings-manager/admin/src/requirements.js index 0206a853fb..96730be6c0 100644 --- a/packages/strapi-plugin-settings-manager/admin/src/requirements.js +++ b/packages/strapi-plugin-settings-manager/admin/src/requirements.js @@ -3,7 +3,7 @@ import request from 'utils/request'; const shouldRenderCompo = (plugin) => new Promise((resolve, reject) => { request('/settings-manager/autoReload') .then(response => { - plugin.preventComponentRendering = !response.autoReload; + plugin.preventComponentRendering = !response.autoReload.enabled; plugin.blockerComponentProps = { blockerComponentTitle: 'components.AutoReloadBlocker.header', blockerComponentDescription: 'components.AutoReloadBlocker.description', From a1ca701053e25f42e079a8846251a15fd41edd92 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 8 Aug 2018 00:22:58 +0200 Subject: [PATCH 05/25] fix(content-type-builder): autoReload payload --- .../controllers/ContentTypeBuilder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-plugin-content-type-builder/controllers/ContentTypeBuilder.js b/packages/strapi-plugin-content-type-builder/controllers/ContentTypeBuilder.js index 0e8e7ac4da..67676a631b 100755 --- a/packages/strapi-plugin-content-type-builder/controllers/ContentTypeBuilder.js +++ b/packages/strapi-plugin-content-type-builder/controllers/ContentTypeBuilder.js @@ -188,7 +188,7 @@ module.exports = { autoReload: async ctx => { ctx.send({ - autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false), + autoReload: _.get(strapi.config.currentEnvironment, 'server.autoReload', { enabled: false }) }); }, From 942cfece7d40026a4543d28841f1e7798f3ecd4c Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 8 Aug 2018 00:24:39 +0200 Subject: [PATCH 06/25] fix(settings-manager): autoReload payload --- .../controllers/SettingsManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js b/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js index a5f29d7458..247f84551d 100755 --- a/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js +++ b/packages/strapi-plugin-settings-manager/controllers/SettingsManager.js @@ -334,8 +334,8 @@ module.exports = { autoReload: async ctx => { ctx.send({ - autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false), - environment: strapi.config.environment, + autoReload: _.get(strapi.config.currentEnvironment, 'server.autoReload', { enabled: false }), + environment: strapi.config.environment }); } }; From 38e71df4ac4639382ba7eb8ce9a69da625633159 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 8 Aug 2018 00:36:57 +0200 Subject: [PATCH 07/25] doc(frontend-uc): autoReload payload --- docs/3.x.x/en/plugin-development/frontend-use-cases.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/3.x.x/en/plugin-development/frontend-use-cases.md b/docs/3.x.x/en/plugin-development/frontend-use-cases.md index 74d65ad409..2b6f4e723a 100644 --- a/docs/3.x.x/en/plugin-development/frontend-use-cases.md +++ b/docs/3.x.x/en/plugin-development/frontend-use-cases.md @@ -346,7 +346,7 @@ const send = require('koa-send'); module.exports = { autoReload: async ctx => { - ctx.send({ autoReload: _.get(strapi.config.environments, 'development.server.autoReload', false) }); + ctx.send({ autoReload: _.get(strapi.config.currentEnvironment, 'server.autoReload', { enabled: false }) }); } } ``` @@ -374,8 +374,8 @@ import request from 'utils/request'; const shouldRenderCompo = (plugin) => new Promise((resolve, request) => { request('/my-plugin/autoReload') .then(response => { - // If autoReload is enabled the response is `{ autoReload: true }` - plugin.preventComponentRendering = !response.autoReload; + // If autoReload is enabled the response is `{ autoReload: { enabled: true } }` + plugin.preventComponentRendering = !response.autoReload.enabled; // Set the BlockerComponent props plugin.blockerComponentProps = { blockerComponentTitle: 'my-plugin.blocker.title', @@ -407,8 +407,8 @@ import MyCustomBlockerComponent from 'components/MyCustomBlockerComponent'; const shouldRenderCompo = (plugin) => new Promise((resolve, request) => { request('/my-plugin/autoReload') .then(response => { - // If autoReload is enabled the response is `{ autoReload: true }` - plugin.preventComponentRendering = !response.autoReload; + // If autoReload is enabled the response is `{ autoReload: { enabled: true } }` + plugin.preventComponentRendering = !response.autoReload.enabled; // Tell which component to be rendered instead plugin.blockerComponent = MyCustomBlockerComponent; From bc60bdb76a2950041774ebffb0b540d6bb893064 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 8 Aug 2018 00:38:30 +0200 Subject: [PATCH 08/25] fix(BlockerComponent): autoReload payload --- .../lib/src/components/BlockerComponent/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/strapi-helper-plugin/lib/src/components/BlockerComponent/index.js b/packages/strapi-helper-plugin/lib/src/components/BlockerComponent/index.js index e0e450d54a..97d0f66893 100644 --- a/packages/strapi-helper-plugin/lib/src/components/BlockerComponent/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/BlockerComponent/index.js @@ -59,7 +59,7 @@ const renderIde = () => (  "port": 1337,
-  "autoReload": true, +  "autoReload": { enabled: true },
 "proxi": { From 45a60ce044ed7374356d43bd6464f5e5ef48a31d Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 8 Aug 2018 00:42:08 +0200 Subject: [PATCH 09/25] doc(configurations): autoReload object --- docs/3.x.x/en/configurations/configurations.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/3.x.x/en/configurations/configurations.md b/docs/3.x.x/en/configurations/configurations.md index 56a2ba4d51..66e6ab89a5 100644 --- a/docs/3.x.x/en/configurations/configurations.md +++ b/docs/3.x.x/en/configurations/configurations.md @@ -335,7 +335,8 @@ Most of the application's configurations are defined by environment. It means th - `host` (string): Host name. Default value: `localhost`. - `port` (integer): Port on which the server should be running. Default value: `1337`. - - `autoReload` (boolean): Enable or disabled server reload on files update. Default value: depends on the environment. + - `autoReload` + - `enabled` (boolean): Enable or disabled server reload on files update. Default value: depends on the environment. - [`cron`](https://en.wikipedia.org/wiki/Cron) - `enabled` (boolean): Enable or disable CRON tasks to schedule jobs at specific dates. Default value: `false`. - `admin` From 2ede104be5966d3dcc59ff600aa62f3ad106b2fb Mon Sep 17 00:00:00 2001 From: Yilin Gan Date: Thu, 23 Aug 2018 11:43:05 -0700 Subject: [PATCH 10/25] update s3 delete & upload controller --- packages/strapi-plugin-upload/controllers/Upload.js | 10 ++++++++-- packages/strapi-upload-aws-s3/lib/index.js | 6 +----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/strapi-plugin-upload/controllers/Upload.js b/packages/strapi-plugin-upload/controllers/Upload.js index f9e769eea9..d811b5f510 100644 --- a/packages/strapi-plugin-upload/controllers/Upload.js +++ b/packages/strapi-plugin-upload/controllers/Upload.js @@ -24,7 +24,7 @@ module.exports = { } // Extract optional relational data. - const { refId, ref, source, field } = ctx.request.body.fields; + const { refId, ref, source, field, path } = ctx.request.body.fields; const { files = {} } = ctx.request.body.files; if (_.isEmpty(files)) { @@ -41,7 +41,6 @@ module.exports = { // Add details to the file to be able to create the relationships. if (refId && ref && field) { Object.assign(file, { - path: `${ref}/${field}`, related: [{ refId, ref, @@ -51,6 +50,13 @@ module.exports = { }); } + // Update uploading folder path for the file. + if (path) { + Object.assign(file, { + path + }); + } + return file; }); diff --git a/packages/strapi-upload-aws-s3/lib/index.js b/packages/strapi-upload-aws-s3/lib/index.js index b38e17b3a1..447c5f9d42 100644 --- a/packages/strapi-upload-aws-s3/lib/index.js +++ b/packages/strapi-upload-aws-s3/lib/index.js @@ -93,11 +93,7 @@ module.exports = { // delete file on S3 bucket const path = file.path ? `${file.path}/` : ''; S3.deleteObjects({ - Delete: { - Objects: [{ - Key: `${path}${file.hash}${file.ext}` - }] - } + Key: `${path}${file.hash}${file.ext}` }, (err, data) => { if (err) { return reject(err); From ae807faacc3393f7d6614640b2569ee090262e38 Mon Sep 17 00:00:00 2001 From: Yilin Gan Date: Thu, 23 Aug 2018 11:50:33 -0700 Subject: [PATCH 11/25] add documentation --- docs/3.x.x/en/guides/upload.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/3.x.x/en/guides/upload.md b/docs/3.x.x/en/guides/upload.md index 67a82b7054..96dfc72a64 100644 --- a/docs/3.x.x/en/guides/upload.md +++ b/docs/3.x.x/en/guides/upload.md @@ -13,6 +13,7 @@ The plugin exposes a single route `POST /upload` to upload one or multiple files **Parameters** - `files`: The file(s) to upload. The value(s) can be a Buffer or Stream. +- `path`: (optional): The folder where the file(s) will be uploaded to (only supported on strapi-upload-aws-s3 now). - `refId`: (optional): The ID of the entry which the file(s) will be linked to. - `ref`: (optional): The name of the model which the file(s) will be linked to (see more below). - `source`: (optional): The name of the plugin where the model is located. @@ -111,6 +112,7 @@ Let's say that you want to have a `User` model provided by the plugin `Users & P ```js { "files": "...", // Buffer or stream of file(s) + "path": "user/avatar", // Uploading folder of file(s). "refId": "5a993616b8e66660e8baf45c", // User's Id. "ref": "user", // Model name. "source": "users-permissions", // Plugin name. From d26696188120f728caf308f0b7799012c348719e Mon Sep 17 00:00:00 2001 From: Vladislav Arsenev Date: Fri, 24 Aug 2018 15:05:12 +0300 Subject: [PATCH 12/25] fix(multiple-files-cancel): discard action if canceled select file --- .../lib/src/components/InputFile/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/strapi-helper-plugin/lib/src/components/InputFile/index.js b/packages/strapi-helper-plugin/lib/src/components/InputFile/index.js index a65ba6f048..8763ba4ae6 100644 --- a/packages/strapi-helper-plugin/lib/src/components/InputFile/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/InputFile/index.js @@ -38,6 +38,10 @@ class InputFile extends React.Component { handleChange = ({ target }) => this.addFilesToProps(target.files); addFilesToProps = (files) => { + if (files.length === 0) { + return; + } + const initAcc = this.props.multiple ? cloneDeep(this.props.value) : {}; const value = Object.keys(files).reduce((acc, current) => { From 2c4c0fd9211226e84bf1dd2952a99b58d37b9536 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Sun, 26 Aug 2018 17:13:58 +0200 Subject: [PATCH 13/25] Fix JSDOM jest tests --- test/start.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/start.js b/test/start.js index 46b929444e..81cb0c0554 100644 --- a/test/start.js +++ b/test/start.js @@ -74,7 +74,8 @@ const main = async () => { return new Promise(async (resolve) => { // Run setup tests to generate the app. await jest({ - passWithNoTests: true + passWithNoTests: true, + testURL: 'http://localhost/' }, [process.cwd()]); const packages = fs.readdirSync(path.resolve(process.cwd(), 'packages')) @@ -84,6 +85,7 @@ const main = async () => { for (let i in packages) { await jest({ passWithNoTests: true, + testURL: 'http://localhost/' }, [`${process.cwd()}/packages/${packages[i]}`]); } From 2887f6e7be24f9c6e2422de982cc6a33f45cd4b9 Mon Sep 17 00:00:00 2001 From: Vladislav Arsenev Date: Mon, 27 Aug 2018 10:41:00 +0300 Subject: [PATCH 14/25] fix: validation-check-null - add check for length property may not exist --- .../strapi-helper-plugin/lib/src/utils/inputsValidations.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/strapi-helper-plugin/lib/src/utils/inputsValidations.js b/packages/strapi-helper-plugin/lib/src/utils/inputsValidations.js index c16cbc3f1f..cf24cf825c 100644 --- a/packages/strapi-helper-plugin/lib/src/utils/inputsValidations.js +++ b/packages/strapi-helper-plugin/lib/src/utils/inputsValidations.js @@ -23,7 +23,7 @@ const validateInput = (value, inputValidations = {}, type = 'text') => { } break; case 'maxLength': - if (value.length > validationValue) { + if (value && value.length > validationValue) { errors.push({ id: 'components.Input.error.validation.maxLength' }); } break; @@ -33,12 +33,12 @@ const validateInput = (value, inputValidations = {}, type = 'text') => { } break; case 'minLength': - if (value.length < validationValue) { + if (!value || value.length < validationValue) { errors.push({ id: 'components.Input.error.validation.minLength' }); } break; case 'required': - if (value.length === 0) { + if (value == null || value.length === 0) { errors.push({ id: 'components.Input.error.validation.required' }); } break; From 0ac7c132fcfd27e72a0d331e71c600e75e7f21c9 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Mon, 27 Aug 2018 14:01:56 +0200 Subject: [PATCH 15/25] Fix srv --- packages/strapi-generate-new/lib/before.js | 6 +++--- packages/strapi-hook-mongoose/lib/utils/connectivity.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/strapi-generate-new/lib/before.js b/packages/strapi-generate-new/lib/before.js index d61c74c006..00be647da5 100755 --- a/packages/strapi-generate-new/lib/before.js +++ b/packages/strapi-generate-new/lib/before.js @@ -145,14 +145,14 @@ module.exports = (scope, cb) => { when: !hasDatabaseConfig && scope.client.database === 'mongo', type: 'boolean', name: 'srv', - message: '+srv connection::', + message: '+srv connection:', default: _.get(scope.database, 'srv', false) }, { when: !hasDatabaseConfig, type: 'input', name: 'port', - message: 'Port(It will be ignored if you enable +srv):', + message: 'Port (It will be ignored if you enable +srv):', default: (answers) => { // eslint-disable-line no-unused-vars if (_.get(scope.database, 'port')) { return scope.database.port; @@ -259,7 +259,7 @@ module.exports = (scope, cb) => { require(path.join(`${scope.tmpPath}`, '/node_modules/', `${scope.client.connector}/lib/utils/connectivity.js`))(scope, cb.success, connectionValidation); } catch(err) { shell.rm('-r', scope.tmpPath); - console.log(err) + console.log(err); cb.success(); } }); diff --git a/packages/strapi-hook-mongoose/lib/utils/connectivity.js b/packages/strapi-hook-mongoose/lib/utils/connectivity.js index e0e5b50f53..cf1164750b 100644 --- a/packages/strapi-hook-mongoose/lib/utils/connectivity.js +++ b/packages/strapi-hook-mongoose/lib/utils/connectivity.js @@ -28,7 +28,7 @@ module.exports = (scope, success, error) => { connectOptions.useNewUrlParser = true; connectOptions.dbName = scope.database.settings.database; - Mongoose.connect(`mongodb${srv ? "+srv" : ""}://${scope.database.settings.host}:${!srv ? ":" + scope.database.settings.port : ""}/`, connectOptions, function (err) { + Mongoose.connect(`mongodb${srv ? '+srv' : ''}://${scope.database.settings.host}${!srv ? `:${scope.database.settings.port}` : ''}/`, connectOptions, function (err) { if (err) { console.log('⚠️ Database connection has failed! Make sure your database is running.'); return error(); From 44294d228df58ed0c3da650e02e4c0a9b99a9ca4 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Mon, 27 Aug 2018 14:57:47 +0200 Subject: [PATCH 16/25] Add missing pluralize dep fix #1690 --- packages/strapi-plugin-content-manager/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index 65522b7dc8..1383a0dfae 100755 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -28,6 +28,9 @@ "showdown": "^1.8.6", "strapi-helper-plugin": "3.0.0-alpha.13.1" }, + "dependencies": { + "pluralize": "^7.0.0" + }, "author": { "name": "Strapi team", "email": "hi@strapi.io", @@ -49,4 +52,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} From bcf681d9cc425e66c708841a0a6227c12c45f65d Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Mon, 27 Aug 2018 14:59:41 +0200 Subject: [PATCH 17/25] Fix space From e5e2af960cdfe460d4ee5e43b7146703ead87140 Mon Sep 17 00:00:00 2001 From: soupette Date: Mon, 27 Aug 2018 15:47:41 +0200 Subject: [PATCH 18/25] Fix input toggle true false --- .../lib/src/components/InputToggle/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/strapi-helper-plugin/lib/src/components/InputToggle/index.js b/packages/strapi-helper-plugin/lib/src/components/InputToggle/index.js index 4ad458b516..a435c08280 100644 --- a/packages/strapi-helper-plugin/lib/src/components/InputToggle/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/InputToggle/index.js @@ -15,7 +15,7 @@ class InputToggle extends React.Component { const target = { name: this.props.name, type: 'toggle', - value: e.target.id.includes('on'), + value: e.target.id.includes('__ON__'), }; this.props.onChange({ target }); @@ -48,7 +48,7 @@ class InputToggle extends React.Component { autoFocus={autoFocus} disabled={disabled} className={cn('btn', !value && styles.gradientOff)} - id={`off_${name}`} + id={`__OFF__${name}`} onClick={this.handleClick} tabIndex={tabIndex} type="button" @@ -58,7 +58,7 @@ class InputToggle extends React.Component {