Add type password

This commit is contained in:
Aurelsicoko 2017-11-28 13:51:50 +01:00
parent 703223687f
commit 362f7badb0
4 changed files with 5 additions and 2 deletions

View File

@ -250,7 +250,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
<input
className={`form-control ${!this.props.deactivateErrorHighlight && !isEmpty(this.state.errors) ? 'is-invalid': ''}`}
onChange={this.props.onChange}
value={this.props.value}
value={type === 'password' ? '********' : this.props.value}
name={this.props.name}
id={this.props.label}
onBlur={handleBlur}

View File

@ -14,6 +14,7 @@ module.exports = mongoose => {
convertType: mongooseType => {
switch (mongooseType.toLowerCase()) {
case 'string':
case 'password':
case 'text':
return 'String';
case 'integer':

View File

@ -25,6 +25,8 @@ class EditForm extends React.Component {
getInputType = (type = '') => {
switch (type.toLowerCase()) {
case 'password':
return 'password';
case 'boolean':
return 'checkbox';
case 'text':

View File

@ -20,7 +20,7 @@
"type": "string"
},
"password": {
"type": "string",
"type": "password",
"minLength": 6
},
"resetPasswordToken": {