From 9862d02a66f027bbb7e98124518212f4a7762ae7 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 23 Jun 2023 13:48:07 +0700 Subject: [PATCH 1/6] disable admin checkbox --- src/pages/workspace/WorkspaceMembersPage.js | 23 ++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 4c170deb9ec5..314778e14ff8 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -292,6 +292,7 @@ function WorkspaceMembersPage(props) { */ const renderItem = useCallback( ({item}) => { + const disabled = props.session.email === item.login || item.role === 'admin'; const hasError = !_.isEmpty(item.errors) || errors[item.accountID]; const isChecked = _.contains(selectedEmployees, Number(item.accountID)); return ( @@ -302,6 +303,7 @@ function WorkspaceMembersPage(props) { > toggleUser(item.accountID, item.pendingAction)} accessibilityRole="checkbox" accessibilityState={{ @@ -313,12 +315,14 @@ function WorkspaceMembersPage(props) { pressDimmingValue={0.7} > toggleUser(item.accountID, item.pendingAction)} /> 0 ? ( - _.contains(selectedEmployees, Number(accountID)))} + toggleAllUsers(removableMembers)} - /> + accessibilityRole="checkbox" + accessibilityState={{ + checked: !_.isEmpty(removableMembers) && _.every(_.keys(removableMembers), (accountID) => _.contains(selectedEmployees, Number(accountID))), + }} + // disable hover dimming + hoverDimmingValue={1} + pressDimmingValue={0.7} + > + _.contains(selectedEmployees, Number(accountID)))} + onPress={() => toggleAllUsers(removableMembers)} + /> + {props.translate('workspace.people.selectAll')} From f0079d1f224f369b6ccafcae629c45bba6e59e8a Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 26 Jun 2023 17:21:26 +0700 Subject: [PATCH 2/6] add accessbilityLabel prop --- src/pages/workspace/WorkspaceMembersPage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 314778e14ff8..6b692f9399b0 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -459,6 +459,7 @@ function WorkspaceMembersPage(props) { accessibilityState={{ checked: !_.isEmpty(removableMembers) && _.every(_.keys(removableMembers), (accountID) => _.contains(selectedEmployees, Number(accountID))), }} + accessibilityLabel={props.translate('workspace.people.selectAll')} // disable hover dimming hoverDimmingValue={1} pressDimmingValue={0.7} From 293b85b4145ef0c9f08b387448889658b3fa5f70 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 27 Jun 2023 12:03:06 +0700 Subject: [PATCH 3/6] update comment --- src/pages/workspace/WorkspaceMembersPage.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 6b692f9399b0..777fdddc4295 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -310,7 +310,8 @@ function WorkspaceMembersPage(props) { checked: isChecked, }} accessibilityLabel={props.formatPhoneNumber(item.displayName)} - // disable hover dimming + + // Disable hover dimming hoverDimmingValue={1} pressDimmingValue={0.7} > @@ -460,7 +461,8 @@ function WorkspaceMembersPage(props) { checked: !_.isEmpty(removableMembers) && _.every(_.keys(removableMembers), (accountID) => _.contains(selectedEmployees, Number(accountID))), }} accessibilityLabel={props.translate('workspace.people.selectAll')} - // disable hover dimming + + // Disable hover dimming hoverDimmingValue={1} pressDimmingValue={0.7} > From 2acdc32137a1709dc16f4202528a13949210ca69 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 27 Jun 2023 12:18:00 +0700 Subject: [PATCH 4/6] fix lint --- src/pages/workspace/WorkspaceMembersPage.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 777fdddc4295..1700c81b2149 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -310,7 +310,6 @@ function WorkspaceMembersPage(props) { checked: isChecked, }} accessibilityLabel={props.formatPhoneNumber(item.displayName)} - // Disable hover dimming hoverDimmingValue={1} pressDimmingValue={0.7} @@ -461,7 +460,6 @@ function WorkspaceMembersPage(props) { checked: !_.isEmpty(removableMembers) && _.every(_.keys(removableMembers), (accountID) => _.contains(selectedEmployees, Number(accountID))), }} accessibilityLabel={props.translate('workspace.people.selectAll')} - // Disable hover dimming hoverDimmingValue={1} pressDimmingValue={0.7} From 91a7810a4d22b3e647cacd9f6982e797a570bdcf Mon Sep 17 00:00:00 2001 From: dukenv0307 <129500732+dukenv0307@users.noreply.github.com> Date: Wed, 28 Jun 2023 07:35:52 +0700 Subject: [PATCH 5/6] Update src/pages/workspace/WorkspaceMembersPage.js Co-authored-by: Carlos Alvarez --- src/pages/workspace/WorkspaceMembersPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 1700c81b2149..82a71142e1b3 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -310,7 +310,6 @@ function WorkspaceMembersPage(props) { checked: isChecked, }} accessibilityLabel={props.formatPhoneNumber(item.displayName)} - // Disable hover dimming hoverDimmingValue={1} pressDimmingValue={0.7} > From ac1e09dcb6c9ccb6ebdbbb1ca9bcc50ae95f8075 Mon Sep 17 00:00:00 2001 From: dukenv0307 <129500732+dukenv0307@users.noreply.github.com> Date: Wed, 28 Jun 2023 07:36:00 +0700 Subject: [PATCH 6/6] Update src/pages/workspace/WorkspaceMembersPage.js Co-authored-by: Carlos Alvarez --- src/pages/workspace/WorkspaceMembersPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 82a71142e1b3..0d3c09c197c0 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -459,7 +459,6 @@ function WorkspaceMembersPage(props) { checked: !_.isEmpty(removableMembers) && _.every(_.keys(removableMembers), (accountID) => _.contains(selectedEmployees, Number(accountID))), }} accessibilityLabel={props.translate('workspace.people.selectAll')} - // Disable hover dimming hoverDimmingValue={1} pressDimmingValue={0.7} >