From 5b27933d66a5218169fd389f68ea41f8c89ce25c Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Tue, 6 Feb 2018 18:14:30 +0100 Subject: [PATCH] Add new input lib to EditPage container --- .../lib/src/components/InputsIndex/index.js | 2 +- .../admin/src/containers/EditPage/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/strapi-helper-plugin/lib/src/components/InputsIndex/index.js b/packages/strapi-helper-plugin/lib/src/components/InputsIndex/index.js index 4fbbf753e4..b929abd9d2 100644 --- a/packages/strapi-helper-plugin/lib/src/components/InputsIndex/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/InputsIndex/index.js @@ -34,7 +34,7 @@ const inputs = { function InputsIndex(props) { const Input = inputs[props.type] ? inputs[props.type] : DefaultInputError; - const inputValue = props.type === 'checkbox' ? props.value || false : props.value || ''; + const inputValue = props.type === 'checkbox' || props.type === 'toggle' ? props.value || false : props.value || ''; return ; } diff --git a/packages/strapi-plugin-users-permissions/admin/src/containers/EditPage/index.js b/packages/strapi-plugin-users-permissions/admin/src/containers/EditPage/index.js index 621594bc30..fa4e06ff01 100644 --- a/packages/strapi-plugin-users-permissions/admin/src/containers/EditPage/index.js +++ b/packages/strapi-plugin-users-permissions/admin/src/containers/EditPage/index.js @@ -15,7 +15,7 @@ import cn from 'classnames'; // Design import BackHeader from 'components/BackHeader'; -import Input from 'components/Input'; +import Input from 'components/InputsIndex'; import InputSearch from 'components/InputSearch'; import PluginHeader from 'components/PluginHeader'; import Plugins from 'components/Plugins'; @@ -159,7 +159,7 @@ export class EditPage extends React.Component { // eslint-disable-line react/pre customBootstrapClass="col-md-12" errors={get(this.props.editPage, ['formErrors', findIndex(this.props.editPage.formErrors, ['name', 'name']), 'errors'])} didCheckErrors={this.props.editPage.didCheckErrors} - label="users-permissions.EditPage.form.roles.label.name" + label={{ id: 'users-permissions.EditPage.form.roles.label.name' }} name="name" onChange={this.props.onChangeInput} type="text" @@ -170,7 +170,7 @@ export class EditPage extends React.Component { // eslint-disable-line react/pre