fix: admin can access member details page after member leaves#41492
fix: admin can access member details page after member leaves#41492madmax330 merged 7 commits intoExpensify:mainfrom
Conversation
|
@alitoshmatov 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] |
|
Sorry I was busy with other issues, I will finish reviewing tomorrow |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chromeemployee-page404-mweb.moviOS: Nativeemployee-page404-ios.mp4iOS: mWeb Safariemployee-page404-safari.mp4MacOS: Chrome / Safariemployee-page404-web.movMacOS: Desktopemployee-age404-desktop.mov |
| Navigation.navigate(ROUTES.WORKSPACE_OWNER_CHANGE_CHECK.getRoute(policyID, accountID, 'amountOwed' as ValueOf<typeof CONST.POLICY.OWNERSHIP_ERRORS>)); | ||
| }, [accountID, policyID]); | ||
|
|
||
| // eslint-disable-next-line rulesdir/no-negated-variables |
There was a problem hiding this comment.
Hmm I don't think you should use the lint rule here.
You can just change the conditional
There was a problem hiding this comment.
I think the lint rule is a bit too strict, it should only block actual negated variable names like shouldNotShow but not shouldShowNotFoundPage because the not here is not really a negated adverb. I think it's fine since we're already using it many places in App.
But I still updated as your feedback.
const shouldShowPage = member && (member.pendingAction !== DELETE || prevMember?.pendingAction !== DELETE);There was a problem hiding this comment.
Ah ok, that makes sense, I guess that OK
Maybe you can add a comment to explain why the lint exception is appropriate.
I agree that shouldShowPage is a confusing name.
|
✋ 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/madmax330 in version: 1.4.75-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.75-1 🚀
|
|
|
||
| // eslint-disable-next-line rulesdir/no-negated-variables | ||
| const shouldShowNotFoundPage = | ||
| !member || (member.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && prevMember?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE); |
| if (!prevMember || prevMember?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || member?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) { | ||
| return; | ||
| } | ||
| Navigation.goBack(); |
There was a problem hiding this comment.
This navigation should happen after the interactions are complete for iOS. It caused #65142.
Details
The side bar for the member remains open on the admin side after member leaves the workspace. This PR fixes that.
Fixed Issues
$ #40416
PROPOSAL: #40416 (comment)
Tests
=====
Offline tests
QA Steps
=====
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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
video_2024-05-04_23-21-05.mp4
Android: mWeb Chrome
video_2024-05-04_23-21-00.mp4
iOS: Native
Screen.Recording.2024-05-04.at.22.57.13-compressed.mov
iOS: mWeb Safari
Screen.Recording.2024-05-04.at.22.54.45-compressed.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-04.at.22.43.11-compressed.mov
Untitled.mov
MacOS: Desktop
Screen.Recording.2024-05-04.at.22.50.35-compressed.mov