add comments to explain the comparing to nullorg/nullrule when adding new users via the global users page

pull/10616/head
Iris Scholten 2018-02-08 12:46:02 -08:00
parent b0159aa5eb
commit 98a4a04b21
1 changed files with 5 additions and 0 deletions

View File

@ -42,6 +42,9 @@ class AllUsersTableRowNew extends Component {
provider,
scheme,
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,
}
onCreateUser(newUser)
@ -54,6 +57,8 @@ class AllUsersTableRowNew extends Component {
handleSelectOrganization = newOrganization => {
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
? {
...nullRole,