@@ -42,19 +42,23 @@ const FormRow = styled(Row)`
42
42
margin-bottom: 8px;
43
43
` ;
44
44
45
+ const ROLE_OPTIONS = [
46
+ {
47
+ value : "admin" ,
48
+ label : "admin" ,
49
+ } ,
50
+ ] ;
51
+
45
52
export const InviteUsersModal : React . FC < {
46
53
onClose : ( ) => void ;
47
54
} > = ( props ) => {
48
55
const formatMessage = useIntl ( ) . formatMessage ;
49
56
const { workspaceId } = useCurrentWorkspace ( ) ;
50
57
const { inviteUserLogic } = useUserHook ( ) ;
51
58
const { mutateAsync : invite } = inviteUserLogic ;
52
- const roleOptions = [
53
- {
54
- value : "admin" ,
55
- label : "admin" ,
56
- } ,
57
- ] ;
59
+
60
+ const isRoleVisible = false ; // Temporarily hiding roles because there's only 'Admin' in cloud.
61
+
58
62
return (
59
63
< Modal title = { < FormattedMessage id = "modals.addUser.title" /> } onClose = { props . onClose } >
60
64
< Formik
@@ -65,7 +69,7 @@ export const InviteUsersModal: React.FC<{
65
69
users : [
66
70
{
67
71
email : "" ,
68
- role : roleOptions [ 0 ] . value ,
72
+ role : ROLE_OPTIONS [ 0 ] . value ,
69
73
} ,
70
74
] ,
71
75
} }
@@ -88,11 +92,13 @@ export const InviteUsersModal: React.FC<{
88
92
< FormattedMessage id = "modals.addUser.email.label" />
89
93
</ H5 >
90
94
</ Cell >
91
- < Cell >
92
- < H5 >
93
- < FormattedMessage id = "modals.addUser.role.label" />
94
- </ H5 >
95
- </ Cell >
95
+ { isRoleVisible && (
96
+ < Cell >
97
+ < H5 >
98
+ < FormattedMessage id = "modals.addUser.role.label" />
99
+ </ H5 >
100
+ </ Cell >
101
+ ) }
96
102
</ FormHeader >
97
103
< FieldArray
98
104
name = "users"
@@ -105,22 +111,24 @@ export const InviteUsersModal: React.FC<{
105
111
{ ( { field
} :
FieldProps < string > ) => < Input { ...
field } placeholder = "[email protected] " /> }
106
112
</ Field >
107
113
</ Cell >
108
- < Cell >
109
- < Field name = { `users[${ index } ].role` } >
110
- { ( { field } : FieldProps ) => {
111
- return (
112
- < DropDown
113
- isDisabled
114
- value = { field . value }
115
- placeholder = { formatMessage ( {
116
- id : "modals.addUser.role.placeholder" ,
117
- } ) }
118
- options = { roleOptions }
119
- />
120
- ) ;
121
- } }
122
- </ Field >
123
- </ Cell >
114
+ { isRoleVisible && (
115
+ < Cell >
116
+ < Field name = { `users[${ index } ].role` } >
117
+ { ( { field } : FieldProps ) => {
118
+ return (
119
+ < DropDown
120
+ isDisabled
121
+ value = { field . value }
122
+ placeholder = { formatMessage ( {
123
+ id : "modals.addUser.role.placeholder" ,
124
+ } ) }
125
+ options = { ROLE_OPTIONS }
126
+ />
127
+ ) ;
128
+ } }
129
+ </ Field >
130
+ </ Cell >
131
+ ) }
124
132
</ FormRow >
125
133
) ) }
126
134
< Button
@@ -129,7 +137,7 @@ export const InviteUsersModal: React.FC<{
129
137
onClick = { ( ) =>
130
138
arrayHelpers . push ( {
131
139
email : "" ,
132
- role : roleOptions [ 0 ] . value ,
140
+ role : ROLE_OPTIONS [ 0 ] . value ,
133
141
} )
134
142
}
135
143
secondary
0 commit comments