Integrating new form binder
This commit is contained in:
@@ -23,14 +23,15 @@ export class UserForm extends React.Component {
|
||||
isDisabled: (r) => (r._id)
|
||||
},
|
||||
emailValidated: {
|
||||
initValue: false,
|
||||
isDisabled: (r) => (!r._id)
|
||||
},
|
||||
changeEmail: {
|
||||
nonValue: true,
|
||||
noValue: true,
|
||||
isDisabled: (r) => (!r._id)
|
||||
},
|
||||
resendEmail: {
|
||||
nonValue: true,
|
||||
noValue: true,
|
||||
isDisabled: (r) => (!r._id || !!r.getFieldValue('emailValidated'))
|
||||
},
|
||||
firstName: {
|
||||
@@ -41,20 +42,23 @@ export class UserForm extends React.Component {
|
||||
},
|
||||
administrator: {
|
||||
isValid: (r, v) => true,
|
||||
initValue: false,
|
||||
isDisabled: (r) => (api.loggedInUser._id === r._id), // Adding a new user
|
||||
alwaysGet: true,
|
||||
},
|
||||
remove: {
|
||||
nonValue: true,
|
||||
noValue: true,
|
||||
isVisible: (r) => (r._id),
|
||||
isDisabled: (r) => (api.loggedInUser._id === r._id)
|
||||
},
|
||||
reset: {
|
||||
nonValue: true,
|
||||
isDisabled: (r) => (!r.anyModified)
|
||||
noValue: true,
|
||||
isDisabled: (r) => {
|
||||
return !r.anyModified
|
||||
}
|
||||
},
|
||||
submit: {
|
||||
nonValue: true,
|
||||
noValue: true,
|
||||
isDisabled: (r) => (!r.anyModified || !r.allValid),
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user