mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 01:09:49 +00:00
Merge branch 'relation/users' of github.com:strapi/strapi into relation/users
This commit is contained in:
commit
42fd5a6215
@ -165,6 +165,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
value={value}
|
value={value}
|
||||||
dateFormat='YYYY-MM-DD'
|
dateFormat='YYYY-MM-DD'
|
||||||
timeFormat='HH:mm:ss'
|
timeFormat='HH:mm:ss'
|
||||||
|
tabIndex={this.props.tabIndex}
|
||||||
utc={true}
|
utc={true}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
placeholder: this.props.placeholder,
|
placeholder: this.props.placeholder,
|
||||||
@ -214,6 +215,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
type="email"
|
type="email"
|
||||||
autoFocus={this.props.autoFocus}
|
autoFocus={this.props.autoFocus}
|
||||||
|
tabIndex={this.props.tabIndex}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FormattedMessage>
|
</FormattedMessage>
|
||||||
@ -244,6 +246,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
autoFocus={this.props.autoFocus}
|
autoFocus={this.props.autoFocus}
|
||||||
|
tabIndex={this.props.tabIndex}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FormattedMessage>
|
</FormattedMessage>
|
||||||
@ -278,6 +281,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
type={type}
|
type={type}
|
||||||
autoFocus={this.props.autoFocus}
|
autoFocus={this.props.autoFocus}
|
||||||
|
tabIndex={this.props.tabIndex}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FormattedMessage>
|
</FormattedMessage>
|
||||||
@ -366,6 +370,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
type="text"
|
type="text"
|
||||||
autoFocus={this.props.autoFocus}
|
autoFocus={this.props.autoFocus}
|
||||||
|
tabIndex={this.props.tabIndex}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FormattedMessage>
|
</FormattedMessage>
|
||||||
@ -406,6 +411,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
autoFocus={this.props.autoFocus}
|
autoFocus={this.props.autoFocus}
|
||||||
|
tabIndex={this.props.tabIndex}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</FormattedMessage>
|
</FormattedMessage>
|
||||||
@ -467,6 +473,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
autoFocus={this.props.autoFocus}
|
autoFocus={this.props.autoFocus}
|
||||||
|
tabIndex={this.props.tabIndex}
|
||||||
/>;
|
/>;
|
||||||
|
|
||||||
const link = !isEmpty(this.props.linkContent) ? <a href={this.props.linkContent.link} target="_blank"><FormattedMessage id={this.props.linkContent.description} /></a> : '';
|
const link = !isEmpty(this.props.linkContent) ? <a href={this.props.linkContent.link} target="_blank"><FormattedMessage id={this.props.linkContent.description} /></a> : '';
|
||||||
@ -616,6 +623,7 @@ Input.propTypes = {
|
|||||||
search: PropTypes.bool,
|
search: PropTypes.bool,
|
||||||
selectOptions: PropTypes.array,
|
selectOptions: PropTypes.array,
|
||||||
selectOptionsFetchSucceeded: PropTypes.bool,
|
selectOptionsFetchSucceeded: PropTypes.bool,
|
||||||
|
tabIndex: PropTypes.string,
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
validations: PropTypes.object.isRequired,
|
validations: PropTypes.object.isRequired,
|
||||||
@ -644,6 +652,7 @@ Input.defaultProps = {
|
|||||||
search: false,
|
search: false,
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
selectOptionsFetchSucceeded: false,
|
selectOptionsFetchSucceeded: false,
|
||||||
|
tabIndex: '0',
|
||||||
value: ''
|
value: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class EditForm extends React.Component {
|
|||||||
const displayedFields = merge(get(currentLayout), omit(currentSchema.fields, 'id'));
|
const displayedFields = merge(get(currentLayout), omit(currentSchema.fields, 'id'));
|
||||||
|
|
||||||
// List fields inputs
|
// List fields inputs
|
||||||
const fields = Object.keys(displayedFields).map(attr => {
|
const fields = Object.keys(displayedFields).map((attr, key) => {
|
||||||
const details = displayedFields[attr];
|
const details = displayedFields[attr];
|
||||||
const errorIndex = findIndex(this.props.formErrors, ['name', attr]);
|
const errorIndex = findIndex(this.props.formErrors, ['name', attr]);
|
||||||
const errors = errorIndex !== -1 ? this.props.formErrors[errorIndex].errors : [];
|
const errors = errorIndex !== -1 ? this.props.formErrors[errorIndex].errors : [];
|
||||||
@ -74,6 +74,7 @@ class EditForm extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Input
|
<Input
|
||||||
|
autoFocus={key === 0}
|
||||||
key={attr}
|
key={attr}
|
||||||
type={get(layout, 'type', this.getInputType(details.type))}
|
type={get(layout, 'type', this.getInputType(details.type))}
|
||||||
label={get(layout, 'label') || details.label || ''}
|
label={get(layout, 'label') || details.label || ''}
|
||||||
|
@ -119,6 +119,7 @@ class PopUpRelations extends React.Component { // eslint-disable-line react/pref
|
|||||||
return (
|
return (
|
||||||
<ModalBody className={`${styles.modalBody} ${styles.flex}`}>
|
<ModalBody className={`${styles.modalBody} ${styles.flex}`}>
|
||||||
<RelationBox
|
<RelationBox
|
||||||
|
autoFocus
|
||||||
tabIndex="1"
|
tabIndex="1"
|
||||||
relationType={get(this.props.values, ['params', 'nature'])}
|
relationType={get(this.props.values, ['params', 'nature'])}
|
||||||
contentTypeTargetPlaceholder={get(this.props.values, ['params', 'target'])}
|
contentTypeTargetPlaceholder={get(this.props.values, ['params', 'target'])}
|
||||||
|
@ -119,6 +119,7 @@ class RelationBox extends React.Component { // eslint-disable-line react/prefer-
|
|||||||
errors={this.props.errors}
|
errors={this.props.errors}
|
||||||
didCheckErrors={this.props.didCheckErrors}
|
didCheckErrors={this.props.didCheckErrors}
|
||||||
pluginID="content-type-builder"
|
pluginID="content-type-builder"
|
||||||
|
autoFocus={this.props.autoFocus}
|
||||||
/>;
|
/>;
|
||||||
|
|
||||||
const dropDown = !isEmpty(this.props.dropDownItems) ? this.renderDropdownMenu() : '';
|
const dropDown = !isEmpty(this.props.dropDownItems) ? this.renderDropdownMenu() : '';
|
||||||
@ -150,6 +151,7 @@ class RelationBox extends React.Component { // eslint-disable-line react/prefer-
|
|||||||
}
|
}
|
||||||
|
|
||||||
RelationBox.propTypes = {
|
RelationBox.propTypes = {
|
||||||
|
autoFocus: PropTypes.bool,
|
||||||
contentTypeTargetPlaceholder: PropTypes.string,
|
contentTypeTargetPlaceholder: PropTypes.string,
|
||||||
didCheckErrors: PropTypes.bool.isRequired,
|
didCheckErrors: PropTypes.bool.isRequired,
|
||||||
dropDownItems: PropTypes.array,
|
dropDownItems: PropTypes.array,
|
||||||
@ -165,6 +167,7 @@ RelationBox.propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
RelationBox.defaultProps = {
|
RelationBox.defaultProps = {
|
||||||
|
autoFocus: false,
|
||||||
contentTypeTargetPlaceholder: '',
|
contentTypeTargetPlaceholder: '',
|
||||||
dropDownItems: [],
|
dropDownItems: [],
|
||||||
errors: [],
|
errors: [],
|
||||||
|
@ -9,13 +9,15 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 3,
|
"minLength": 3,
|
||||||
"unique": true,
|
"unique": true,
|
||||||
"configurable": false
|
"configurable": false,
|
||||||
|
"required": true
|
||||||
},
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"type": "email",
|
"type": "email",
|
||||||
"minLength": 6,
|
"minLength": 6,
|
||||||
"unique": true,
|
"unique": true,
|
||||||
"configurable": false
|
"configurable": false,
|
||||||
|
"required": true
|
||||||
},
|
},
|
||||||
"provider": {
|
"provider": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -24,7 +26,8 @@
|
|||||||
"password": {
|
"password": {
|
||||||
"type": "password",
|
"type": "password",
|
||||||
"minLength": 6,
|
"minLength": 6,
|
||||||
"configurable": false
|
"configurable": false,
|
||||||
|
"required": true
|
||||||
},
|
},
|
||||||
"resetPasswordToken": {
|
"resetPasswordToken": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user