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 <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}

View File

@ -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':

View File

@ -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':

View File

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