-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the getPolicyName function for when the report or policies are not ready #48621
Fix the getPolicyName function for when the report or policies are not ready #48621
Conversation
@allgandalf 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] |
src/libs/ReportUtils.ts
Outdated
|
||
if ((!allPolicies || Object.keys(allPolicies).length === 0) && !report?.policyName) { | ||
if (isEmptyObject(allPolicies) && !report?.policyName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allgandalf upon further consideration, I believe the second check is unreachable. My suggestion would be to eliminate it. Your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i too checked, it is unreachable , lets remove this
@allgandalf sorry, need to convert back to draft, I'll need to test more with jest |
@allgandalf My main solution failed the tests due to the possibility of using getPolicyName without any policies, but my other solution (Alternative 3) passed all the tests. Is it ok to move with my alternative 3 solution? I haven't jest tested my alternative 1, but seems that will pass all the jest tests as well. Failed tests1. opens a chat and load newer messagesApp/tests/ui/PaginationTest.tsx Line 312 in 8a35256
App/tests/unit/ReportUtilsTest.ts Line 208 in 8a35256
App/tests/unit/ReportUtilsTest.ts Line 246 in 8a35256
Line 93 in 8a35256
|
src/libs/ReportUtils.ts
Outdated
if ((!allPolicies || Object.keys(allPolicies).length === 0) && !report?.policyName) { | ||
if (isEmptyObject(allPolicies) && !report?.policyName) { | ||
return unavailableTranslation; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wildan-m This whole expression is unreachable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm aware of that. This is my latest suggestion.
@allgandalf what is your opinion?
…x/44480-fix-undesired-unavailable-workspace
Yes please, lets get this over the line |
@allgandalf The PR has been updated |
@wildan-m can you update your videos with the latest solution please |
…x/44480-fix-undesired-unavailable-workspace
@allgandalf sure, the videos has been updated |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-09-11.at.3.30.29.PM.movAndroid: mWeb ChromeScreen.Recording.2024-09-11.at.3.29.09.PM.moviOS: NativeScreen.Recording.2024-09-11.at.3.33.04.PM.moviOS: mWeb SafariScreen.Recording.2024-09-11.at.3.33.38.PM.movMacOS: Chrome / SafariScreen.Recording.2024-09-11.at.3.28.17.PM.movMacOS: DesktopScreen.Recording.2024-09-11.at.3.31.06.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well and LGTM
✋ 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 production by https://github.com/luacmartins in version: 9.0.33-4 🚀
|
Details
Fix concierge chat header on initial login
Fixed Issues
$ #44480
PROPOSAL: #44480 (comment)
Tests
Offline tests
Should always online
QA Steps
Same as test
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Kapture.2024-09-10.at.15.48.26.mp4
Android: mWeb Chrome
Kapture.2024-09-10.at.15.50.48.mp4
iOS: Native
Kapture.2024-09-10.at.15.45.49.mp4
iOS: mWeb Safari
Kapture.2024-09-10.at.15.49.24.mp4
MacOS: Chrome / Safari
Kapture.2024-09-10.at.15.42.18.mp4
MacOS: Desktop
Kapture.2024-09-10.at.15.56.43.mp4