11// Libraries
22import React , { ChangeEvent , FC , useContext , useState } from 'react'
3+ import { useSelector } from 'react-redux'
34
45// Components
56import { UsersContext } from 'src/users/context/users'
6- import UserRoleDropdown from './UserRoleDropdown'
7- import UserInviteSubmit from './UserInviteSubmit'
7+ import { UserInviteSubmit } from 'src/users/components/UserInviteSubmit'
88import {
99 Columns ,
1010 ComponentSize ,
11+ FlexBox ,
1112 FontWeight ,
1213 Form ,
1314 Grid ,
@@ -19,17 +20,21 @@ import {
1920} from '@influxdata/clockface'
2021import { gaEvent } from 'src/cloud/utils/reporting'
2122
23+ // Selectors
24+ import { selectCurrentOrg } from 'src/identity/selectors'
25+
2226// Constants
2327import { GTM_INVITE_SENT } from 'src/users/constants'
2428
2529interface InviteErrors {
2630 email ?: string
2731}
2832
29- const UserListInviteForm : FC = ( ) => {
33+ export const UserListInviteForm : FC = ( ) => {
3034 const [ errors , setErrors ] = useState < InviteErrors > ( { } )
3135 const { draftInvite, handleEditDraftInvite, handleInviteUser} =
3236 useContext ( UsersContext )
37+ const org = useSelector ( selectCurrentOrg )
3338
3439 const onInviteUser = ( ) => {
3540 handleInviteUser ( )
@@ -52,32 +57,31 @@ const UserListInviteForm: FC = () => {
5257 weight = { FontWeight . Light }
5358 element = { HeadingElement . H2 }
5459 className = "user-list-invite--form-heading"
60+ testID = "user-list-invite--form-heading"
5561 >
56- Add a new user to your organization
62+ Add members to { org . name }
5763 </ Heading >
5864 </ Panel . Header >
5965 < Panel . Body size = { ComponentSize . Small } >
66+ < FlexBox className = "user-list-invite--instructions" >
67+ Members added will have "Owner" access to the organization's
68+ resources.
69+ </ FlexBox >
6070 < Form onSubmit = { onInviteUser } className = "user-list-invite--form" >
6171 < Form . Element
62- label = "Enter user Email Address"
63- className = "element email--input"
72+ label = "Email Address"
73+ className = "email--input"
6474 errorMessage = { errors . email }
6575 >
6676 < Input
6777 testID = "email--input"
68- placeholder = "email address "
78+ placeholder = "name@company.com "
6979 onChange = { onChangeInvitee }
7080 value = { draftInvite . email }
7181 type = { InputType . Email }
7282 required = { true }
7383 />
7484 </ Form . Element >
75- < Form . Element
76- label = "Assign a Role"
77- className = "element role--dropdown"
78- >
79- < UserRoleDropdown />
80- </ Form . Element >
8185 < Form . Element label = "" className = "element submit--button" >
8286 < UserInviteSubmit />
8387 </ Form . Element >
@@ -89,5 +93,3 @@ const UserListInviteForm: FC = () => {
8993 </ Grid >
9094 )
9195}
92-
93- export default UserListInviteForm
0 commit comments