mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 16:52:18 +00:00
Add type password
This commit is contained in:
parent
703223687f
commit
362f7badb0
@ -250,7 +250,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
<input
|
<input
|
||||||
className={`form-control ${!this.props.deactivateErrorHighlight && !isEmpty(this.state.errors) ? 'is-invalid': ''}`}
|
className={`form-control ${!this.props.deactivateErrorHighlight && !isEmpty(this.state.errors) ? 'is-invalid': ''}`}
|
||||||
onChange={this.props.onChange}
|
onChange={this.props.onChange}
|
||||||
value={this.props.value}
|
value={type === 'password' ? '********' : this.props.value}
|
||||||
name={this.props.name}
|
name={this.props.name}
|
||||||
id={this.props.label}
|
id={this.props.label}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ module.exports = mongoose => {
|
|||||||
convertType: mongooseType => {
|
convertType: mongooseType => {
|
||||||
switch (mongooseType.toLowerCase()) {
|
switch (mongooseType.toLowerCase()) {
|
||||||
case 'string':
|
case 'string':
|
||||||
|
case 'password':
|
||||||
case 'text':
|
case 'text':
|
||||||
return 'String';
|
return 'String';
|
||||||
case 'integer':
|
case 'integer':
|
||||||
|
|||||||
@ -25,6 +25,8 @@ class EditForm extends React.Component {
|
|||||||
|
|
||||||
getInputType = (type = '') => {
|
getInputType = (type = '') => {
|
||||||
switch (type.toLowerCase()) {
|
switch (type.toLowerCase()) {
|
||||||
|
case 'password':
|
||||||
|
return 'password';
|
||||||
case 'boolean':
|
case 'boolean':
|
||||||
return 'checkbox';
|
return 'checkbox';
|
||||||
case 'text':
|
case 'text':
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"password": {
|
"password": {
|
||||||
"type": "string",
|
"type": "password",
|
||||||
"minLength": 6
|
"minLength": 6
|
||||||
},
|
},
|
||||||
"resetPasswordToken": {
|
"resetPasswordToken": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user