Skip to content

Commit 4e15913

Browse files
authored
feat: update organization/members page (#6454)
* chore: remove owner dropdown, add remove-member modal to add members page * chore: revert use of overlay due to context requirement [skip CI] * chore: revert test change related to overlay * chore: remove user role dropdown * chore: reorder styles * chore: correct email source, remove relative import
1 parent 278bdaf commit 4e15913

File tree

14 files changed

+61
-101
lines changed

14 files changed

+61
-101
lines changed

cypress/e2e/cloud/globalHeader.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ describe('change-account change-org global header', () => {
6464
.click()
6565

6666
cy.location('pathname').should('eq', `/orgs/${idpeOrgID}/members`)
67-
cy.getByTestID('tabs--container')
67+
cy.getByTestID('user-list-invite--form-heading')
6868
.should('be.visible')
69-
.and('contain', 'Add a new user to your organization')
69+
.and('contain', 'Add members to')
7070
})
7171

7272
it('navigates to the org usage page', () => {

src/members/components/Members.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Members extends PureComponent<Props, State> {
5454
<TabbedPageHeader
5555
childrenLeft={
5656
<SearchWidget
57-
placeholderText="Filter members..."
57+
placeholderText="Search members"
5858
searchTerm={searchTerm}
5959
onSearch={this.handleFilterChange}
6060
/>

src/shared/copy/notifications/categories/accounts-users-orgs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ export const invitationResentSuccessful = (): Notification => ({
108108
message: `Invitation Re-sent`,
109109
})
110110

111-
export const inviteSent = (): Notification => ({
111+
export const inviteSent = ({email, orgName}): Notification => ({
112112
...defaultSuccessNotification,
113-
message: `Invitation Sent`,
113+
message: `Invitation sent to ${email} to join ${orgName}`,
114114
})
115115

116116
export const invitationWithdrawnFailed = (): Notification => ({

src/users/components/InviteListContextMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function InviteListContextMenu({invite}: Props) {
6464
<SquareButton
6565
titleText="Resend Invitation"
6666
icon={IconFont.Refresh_New}
67-
color={ComponentColor.Secondary}
67+
color={ComponentColor.Primary}
6868
onClick={handleResend}
6969
testID="resend-invite"
7070
/>

src/users/components/InviteListItem.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const getDate = datetime => {
1717
return new Date(datetime).toLocaleDateString()
1818
}
1919

20-
const InviteListItem: FC<Props> = ({invite}) => {
20+
export const InviteListItem: FC<Props> = ({invite}) => {
2121
const {email, role, expiresAt} = invite
2222

2323
return (
@@ -39,5 +39,3 @@ const InviteListItem: FC<Props> = ({invite}) => {
3939
</IndexList.Row>
4040
)
4141
}
42-
43-
export default InviteListItem

src/users/components/UserInviteSubmit.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ import {UsersContext} from 'src/users/context/users'
1313
// Constants
1414
import {roles} from 'src/users/constants'
1515

16-
const UserInviteSubmit: FC = () => {
16+
// Styles
17+
const buttonStyle = {
18+
marginLeft: '10px',
19+
maxWidth: '100px',
20+
}
21+
22+
export const UserInviteSubmit: FC = () => {
1723
const {draftInvite} = useContext(UsersContext)
1824

1925
const isRoleSelected = roles.includes(draftInvite.role)
@@ -37,14 +43,12 @@ const UserInviteSubmit: FC = () => {
3743
return (
3844
<Button
3945
icon={IconFont.Plus_New}
40-
text="Add &amp; Invite"
46+
text="Add"
4147
color={ComponentColor.Primary}
48+
style={buttonStyle}
4249
type={ButtonType.Submit}
4350
titleText={getTitleText()}
44-
className="user-list-invite--button"
4551
testID="user-list-invite--button"
4652
/>
4753
)
4854
}
49-
50-
export default UserInviteSubmit

src/users/components/UserList.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
.user-list-invite--form-panel {
22
margin-bottom: $cf-space-l + $cf-space-3xs;
3+
padding-bottom: 0px;
34

45
.user-list-invite--form-heading {
56
color: $c-neutrino;
7+
font-size: $cf-text-base-3;
8+
font-weight: 700;
9+
margin-bottom: 0px;
10+
padding-bottom: 0px;
611
}
712
}
813

@@ -27,6 +32,11 @@
2732
}
2833
}
2934

35+
.user-list-invite--instructions {
36+
font-weight: 500 !important;
37+
margin-bottom: $cf-space-xs !important;
38+
}
39+
3040
.user-role--dropdown--button,
3141
.user-role--dropdown-item,
3242
.user-role--dropdown-item,

src/users/components/UserList.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import React, {FC, useContext, useState} from 'react'
44
// Components
55
import {Columns, Grid, IndexList} from '@influxdata/clockface'
66
import {UsersContext} from 'src/users/context/users'
7-
import UserListItem from 'src/users/components/UserListItem'
8-
import InviteListItem from 'src/users/components/InviteListItem'
7+
import {UserListItem} from 'src/users/components/UserListItem'
8+
import {InviteListItem} from 'src/users/components/InviteListItem'
99

1010
// Utils
1111
import {SearchWidget} from 'src/shared/components/search_widget/SearchWidget'
1212
import {filter} from 'src/users/utils/filter'
1313

14-
const UserList: FC = () => {
14+
export const UserList: FC = () => {
1515
const {users, invites} = useContext(UsersContext)
1616

1717
const [searchTerm, setSearchTerm] = useState('')
@@ -31,7 +31,7 @@ const UserList: FC = () => {
3131
<Grid.Row>
3232
<Grid.Column widthMD={Columns.Ten} widthLG={Columns.Six}>
3333
<SearchWidget
34-
placeholderText="Filter members..."
34+
placeholderText="Search members"
3535
searchTerm={searchTerm}
3636
onSearch={setSearchTerm}
3737
/>
@@ -61,5 +61,3 @@ const UserList: FC = () => {
6161
</Grid>
6262
)
6363
}
64-
65-
export default UserList

src/users/components/UserListContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React, {FC} from 'react'
33
import {Page} from '@influxdata/clockface'
44

55
// Components
6-
import UserList from 'src/users/components/UserList'
7-
import UserListInviteForm from 'src/users/components/UserListInviteForm'
6+
import {UserList} from 'src/users/components/UserList'
7+
import {UserListInviteForm} from 'src/users/components/UserListInviteForm'
88
import OrgHeader from 'src/organizations/components/OrgHeader'
99
import OrgTabbedPage from 'src/organizations/components/OrgTabbedPage'
1010

src/users/components/UserListInviteForm.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// Libraries
22
import React, {ChangeEvent, FC, useContext, useState} from 'react'
3+
import {useSelector} from 'react-redux'
34

45
// Components
56
import {UsersContext} from 'src/users/context/users'
6-
import UserRoleDropdown from './UserRoleDropdown'
7-
import UserInviteSubmit from './UserInviteSubmit'
7+
import {UserInviteSubmit} from 'src/users/components/UserInviteSubmit'
88
import {
99
Columns,
1010
ComponentSize,
11+
FlexBox,
1112
FontWeight,
1213
Form,
1314
Grid,
@@ -19,17 +20,21 @@ import {
1920
} from '@influxdata/clockface'
2021
import {gaEvent} from 'src/cloud/utils/reporting'
2122

23+
// Selectors
24+
import {selectCurrentOrg} from 'src/identity/selectors'
25+
2226
// Constants
2327
import {GTM_INVITE_SENT} from 'src/users/constants'
2428

2529
interface 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

Comments
 (0)