Remove the Save button on the Approver single select list#71752
Remove the Save button on the Approver single select list#71752dangrous merged 4 commits intoExpensify:mainfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-hybrid.mp4Android: mWeb Chromeandroid-mweb.mp4iOS: HybridAppios-hybrid.moviOS: mWeb Safariios-mweb.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
| // For single-select approver lists, immediately perform the action instead of just updating selection | ||
| const newSelectedEmail = selectedApproverEmail === approver.login ? undefined : approver.login; |
There was a problem hiding this comment.
// For single-select approver lists, immediately perform the action instead of just updating selection
@lorretheboy What is this comment referring to, is there actually a single-select approver list case where setting newSelectedEmail as undefined is important for ? Asking because this didn't exist in the old code
♻️ If not, we could have things simplified / easier to read:
const toggleApprover = useCallback(
(approver: SelectionListApprover) => {
if (selectedApproverEmail === approver.login) {
clearApprovalWorkflowApprover({approverIndex, currentApprovalWorkflow});
} else {
const newSelectedEmail = approver.login;
const policyMemberEmailsToAccountIDs = getMemberAccountIDsForWorkspace(employeeList);
const accountID = Number(policyMemberEmailsToAccountIDs[newSelectedEmail] ?? '');
const {avatar, displayName = newSelectedEmail} = personalDetails?.[accountID] ?? {};
setApprovalWorkflowApprover({
approver: {
email: newSelectedEmail,
avatar,
displayName,
},
approverIndex,
currentApprovalWorkflow,
policyID: route.params.policyID,
});
}
if (isInitialCreationFlow) {
Navigation.navigate(ROUTES.WORKSPACE_WORKFLOWS_APPROVALS_NEW.getRoute(route.params.policyID));
} else {
goBack();
}
},
[selectedApproverEmail, employeeList, personalDetails, approverIndex, route.params.policyID, isInitialCreationFlow, goBack, currentApprovalWorkflow],
);There was a problem hiding this comment.
@ikevin127 Agree with you. I have updated the code. Thanks
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/dangrous in version: 9.2.27-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.2.27-6 🚀
|
Explanation of Change
Fixed Issues
$ #71357
PROPOSAL: #71357 (comment)
Tests
Prerequisite : Admin of a workspace with invited members
Offline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
ANDROID.mov
Android: mWeb Chrome
WEBSITE.ANDROID.mov
iOS: Native
WEBSITE.IOS.mov
iOS: mWeb Safari
IOS.mov
MacOS: Chrome / Safari
WEBSITE.mov
MacOS: Desktop
DESKTOP.mov