mirror of
https://github.com/strapi/strapi.git
synced 2025-08-28 10:45:51 +00:00
Add new input lib to EditPage container
This commit is contained in:
parent
9740ab3869
commit
5b27933d66
@ -34,7 +34,7 @@ const inputs = {
|
|||||||
|
|
||||||
function InputsIndex(props) {
|
function InputsIndex(props) {
|
||||||
const Input = inputs[props.type] ? inputs[props.type] : DefaultInputError;
|
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 <Input {...props} value={inputValue} />;
|
return <Input {...props} value={inputValue} />;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import cn from 'classnames';
|
|||||||
|
|
||||||
// Design
|
// Design
|
||||||
import BackHeader from 'components/BackHeader';
|
import BackHeader from 'components/BackHeader';
|
||||||
import Input from 'components/Input';
|
import Input from 'components/InputsIndex';
|
||||||
import InputSearch from 'components/InputSearch';
|
import InputSearch from 'components/InputSearch';
|
||||||
import PluginHeader from 'components/PluginHeader';
|
import PluginHeader from 'components/PluginHeader';
|
||||||
import Plugins from 'components/Plugins';
|
import Plugins from 'components/Plugins';
|
||||||
@ -159,7 +159,7 @@ export class EditPage extends React.Component { // eslint-disable-line react/pre
|
|||||||
customBootstrapClass="col-md-12"
|
customBootstrapClass="col-md-12"
|
||||||
errors={get(this.props.editPage, ['formErrors', findIndex(this.props.editPage.formErrors, ['name', 'name']), 'errors'])}
|
errors={get(this.props.editPage, ['formErrors', findIndex(this.props.editPage.formErrors, ['name', 'name']), 'errors'])}
|
||||||
didCheckErrors={this.props.editPage.didCheckErrors}
|
didCheckErrors={this.props.editPage.didCheckErrors}
|
||||||
label="users-permissions.EditPage.form.roles.label.name"
|
label={{ id: 'users-permissions.EditPage.form.roles.label.name' }}
|
||||||
name="name"
|
name="name"
|
||||||
onChange={this.props.onChangeInput}
|
onChange={this.props.onChangeInput}
|
||||||
type="text"
|
type="text"
|
||||||
@ -170,7 +170,7 @@ export class EditPage extends React.Component { // eslint-disable-line react/pre
|
|||||||
<div className="row">
|
<div className="row">
|
||||||
<Input
|
<Input
|
||||||
customBootstrapClass="col-md-12"
|
customBootstrapClass="col-md-12"
|
||||||
label="users-permissions.EditPage.form.roles.label.description"
|
label={{ id: 'users-permissions.EditPage.form.roles.label.description' }}
|
||||||
name="description"
|
name="description"
|
||||||
onChange={this.props.onChangeInput}
|
onChange={this.props.onChangeInput}
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user