From 98a4a04b21ce3eee9758c0cc2217ba777b58e9cd Mon Sep 17 00:00:00 2001 From: Iris Scholten Date: Thu, 8 Feb 2018 12:46:02 -0800 Subject: [PATCH] add comments to explain the comparing to nullorg/nullrule when adding new users via the global users page --- ui/src/admin/components/chronograf/AllUsersTableRowNew.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/src/admin/components/chronograf/AllUsersTableRowNew.js b/ui/src/admin/components/chronograf/AllUsersTableRowNew.js index af828848c9..9d9fab2b09 100644 --- a/ui/src/admin/components/chronograf/AllUsersTableRowNew.js +++ b/ui/src/admin/components/chronograf/AllUsersTableRowNew.js @@ -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,