add comments to explain the comparing to nullorg/nullrule when adding new users via the global users page
parent
b0159aa5eb
commit
98a4a04b21
|
@ -42,6 +42,9 @@ class AllUsersTableRowNew extends Component {
|
||||||
provider,
|
provider,
|
||||||
scheme,
|
scheme,
|
||||||
superAdmin,
|
superAdmin,
|
||||||
|
// since you can only choose one organization, there is only one role in a new row
|
||||||
|
// if no organization is selected ie the "None" organization,
|
||||||
|
// then set roles to an empty array instead of sending the null role to the server
|
||||||
roles: roles[0].organization === undefined ? [] : roles,
|
roles: roles[0].organization === undefined ? [] : roles,
|
||||||
}
|
}
|
||||||
onCreateUser(newUser)
|
onCreateUser(newUser)
|
||||||
|
@ -54,6 +57,8 @@ class AllUsersTableRowNew extends Component {
|
||||||
|
|
||||||
handleSelectOrganization = newOrganization => {
|
handleSelectOrganization = newOrganization => {
|
||||||
const newRoles = [
|
const newRoles = [
|
||||||
|
// if "None" was selected for organization, create a "null role" from the predefined null role
|
||||||
|
// else create a new role with the organization as the newOrganization's id
|
||||||
newOrganization.id === undefined
|
newOrganization.id === undefined
|
||||||
? {
|
? {
|
||||||
...nullRole,
|
...nullRole,
|
||||||
|
|
Loading…
Reference in New Issue