@@ -84,58 +84,58 @@ export const AvailableWorkspaceUsers = ({ workspaceId, activeUser }: AvailableWo
8484 } ;
8585
8686 const AddContributorAction = ( { user } : { user : User } ) => (
87- < HasPermission
88- operations = { [ OPERATION . ADD_USER_TO_WORKSPACE ] }
89- resources = { [ { type : RESOURCE_TYPE . WORKSPACE , id : workspaceId } ] }
87+ < ActionButton
88+ aria-label = { `Add ${ user . email } to workspace` }
89+ onPress = { ( ) => handleAddUserWithRole ( user , USER_ROLE . WORKSPACE_CONTRIBUTOR ) }
90+ id = { `${ user . id } -add-to-workspace` }
9091 >
91- < ActionButton
92- aria-label = { `Add ${ user . email } to workspace` }
93- onPress = { ( ) => handleAddUserWithRole ( user , USER_ROLE . WORKSPACE_CONTRIBUTOR ) }
94- id = { `${ user . id } -add-to-workspace` }
95- >
96- { updateUserRoleMutation . isPending || updateMemberRoleMutation . isPending ? (
97- < Loading mode = { 'inline' } size = { 'S' } />
98- ) : (
99- < Add />
100- ) }
101- </ ActionButton >
102- </ HasPermission >
92+ { updateUserRoleMutation . isPending || updateMemberRoleMutation . isPending ? (
93+ < Loading mode = { 'inline' } size = { 'S' } />
94+ ) : (
95+ < Add />
96+ ) }
97+ </ ActionButton >
10398 ) ;
10499
105100 if ( availableUsers . length === 0 ) {
106101 return < > </ > ;
107102 }
108103
109104 return (
110- < Flex direction = { 'column' } gap = { 'size-200' } >
111- < Heading level = { 3 } > Available users to add to this workspace</ Heading >
112- < View >
113- < UsersTable
114- tableId = { 'available-workspace-users-table-id' }
115- isFetchingNextPage = { isFetchingNextPage }
116- isLoading = { isLoading }
117- totalCount = { orgTotal }
118- users = { availableUsers }
119- hasFilters = { false }
120- activeUser = { activeUser }
121- getNextPage = { async ( ) => {
122- // Load more from both lists to keep difference accurate
123- await Promise . all ( [ getNextOrgPage ( ) , getNextWsPage ( ) ] ) ;
124- } }
125- usersQueryParams = { { } }
126- setUsersQueryParams = { ( ) => { } }
127- UserActions = { ( { user } ) => < AddContributorAction user = { user } /> }
128- ignoredColumns = { [
129- USERS_TABLE_COLUMNS . LAST_LOGIN ,
130- USERS_TABLE_COLUMNS . REGISTRATION_STATUS ,
131- USERS_TABLE_COLUMNS . ROLES ,
132- ] }
133- resourceId = { workspaceId }
134- workspaces = { workspaces }
135- isProjectUsersTable = { false }
136- organizationId = { organizationId }
137- />
138- </ View >
139- </ Flex >
105+ < HasPermission
106+ operations = { [ OPERATION . ADD_USER_TO_WORKSPACE ] }
107+ resources = { [ { type : RESOURCE_TYPE . WORKSPACE , id : workspaceId } ] }
108+ >
109+ < Flex direction = { 'column' } gap = { 'size-200' } >
110+ < Heading level = { 3 } > Available users to add to this workspace</ Heading >
111+ < View >
112+ < UsersTable
113+ tableId = { 'available-workspace-users-table-id' }
114+ isFetchingNextPage = { isFetchingNextPage }
115+ isLoading = { isLoading }
116+ totalCount = { orgTotal }
117+ users = { availableUsers }
118+ hasFilters = { false }
119+ activeUser = { activeUser }
120+ getNextPage = { async ( ) => {
121+ // Load more from both lists to keep difference accurate
122+ await Promise . all ( [ getNextOrgPage ( ) , getNextWsPage ( ) ] ) ;
123+ } }
124+ usersQueryParams = { { } }
125+ setUsersQueryParams = { ( ) => { } }
126+ UserActions = { ( { user } ) => < AddContributorAction user = { user } /> }
127+ ignoredColumns = { [
128+ USERS_TABLE_COLUMNS . LAST_LOGIN ,
129+ USERS_TABLE_COLUMNS . REGISTRATION_STATUS ,
130+ USERS_TABLE_COLUMNS . ROLES ,
131+ ] }
132+ resourceId = { workspaceId }
133+ workspaces = { workspaces }
134+ isProjectUsersTable = { false }
135+ organizationId = { organizationId }
136+ />
137+ </ View >
138+ </ Flex >
139+ </ HasPermission >
140140 ) ;
141141} ;
0 commit comments