-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 Reddot pinned chat appears for approver after failed scanned #39970
Conversation
@eVoloshchak 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] |
@eVoloshchak Please help review PR once you have a chance |
@eVoloshchak In case you miss it |
Co-authored-by: Eugene Voloshchak <copyreading@gmail.com>
Co-authored-by: Eugene Voloshchak <copyreading@gmail.com>
@eVoloshchak Any updates here? |
@eVoloshchak I resolved your comment. Pls help review the PR |
@eVoloshchak Any update here? |
Reviewer Checklist
Screenshots/VideosAndroid: Native24-05-06-15-31-55.mp4Android: mWeb ChromeScreen.Recording.2024-05-06.at.15.22.25.moviOS: NativeScreen.Recording.2024-05-06.at.15.14.34.moviOS: mWeb SafariScreen.Recording.2024-05-06.at.15.17.10.movMacOS: Chrome / SafariScreen.Recording.2024-05-06.at.15.11.55.movMacOS: DesktopScreen.Recording.2024-05-06.at.15.17.50.mov |
@dukenv0307, looking good! |
@eVoloshchak I updated the test steps |
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.
LGTM!
@dukenv0307 do we need to do anything with the warning in your native android video? |
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.
This is probably a long shot, but are there automated tests we could add for this?
src/libs/ReportUtils.ts
Outdated
* NOTE: On LHN preview we show RBR only to the user that made the request. | ||
* https://github.com/Expensify/App/issues/37044#issuecomment-1984922236 | ||
*/ | ||
function hasMissingSmartscanFields(iouReportID: string, isLHNPreview?: boolean): boolean { |
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.
This isn't where we landed
I agree with this, we shouldn't change hasMissingSmartscanFields, instead we could create shouldShowRBRForMissingSmartscanFields method, which would in turn call hasMissingSmartscanFields conditionally
Let's change this
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.
I created shouldShowRBRForMissingSmartscanFields method
@dukenv0307, friendly bump on comments above |
@eVoloshchak @cead22 Do you have any feedback about my comment here? |
src/libs/ReportUtils.ts
Outdated
const isReportPreviewError = ReportActionsUtils.isReportPreviewAction(action) && hasMissingSmartscanFields(IOUReportID) && !isSettled(IOUReportID); | ||
const isReportPreviewError = | ||
ReportActionsUtils.isReportPreviewAction(action) && | ||
(isLHNPreview ? shouldShowRBRForMissingSmartscanFields(IOUReportID) : hasMissingSmartscanFields(IOUReportID)) && |
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.
This is a bit hard to read, let's move this into a separate variable, something like
const hasMissingFields = isLHNPreview ? shouldShowRBRForMissingSmartscanFields(IOUReportID) : hasMissingSmartscanFields(IOUReportID);
const isReportPreviewError = ReportActionsUtils.isReportPreviewAction(action) && hasMissingFields && !isSettled(IOUReportID);
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.
@eVoloshchak I updated and merged main as well.
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.
- How come we didn't implement
isRequestor
like in the proposal? - Can you update both test cases to sign in as User B and confirm things look right for that user?
src/libs/OptionsListUtils.ts
Outdated
reportActionErrors.smartscan = ErrorUtils.getMicroSecondOnyxError('report.genericSmartscanFailureMessage'); | ||
} | ||
} else if (ReportUtils.hasSmartscanError(Object.values(reportActions ?? {}))) { | ||
} else if (ReportUtils.hasSmartscanError(Object.values(reportActions ?? {}), true)) { |
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.
Are we calling ReportUtils.hasSmartscanError
from anywhere else? Do we need the second param?
Even if we need it, I don't think it should be a separate param, and instead we should have that check outside of the ReportUtils.hasSmartscanError
function, since that function name sounds like it shouldn't care about isLHNPreview
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.
Are we calling ReportUtils.hasSmartscanError from anywhere else?
No
Do we need the second param?
I think we still need to create a isLHNPreview
param then handle both case (isLHNPreview
is true
or false
) in hasSmartscanError
to reduce the duplicate logics.
As you can see, if we do like this, we just need to create a new variable, hasMissingField
and apply a minor change to isReportPreviewError
, the rest logic does not change.
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.
I think we still need to create a
isLHNPreview
param then handle both case (isLHNPreview
istrue
orfalse
) inhasSmartscanError
to reduce the duplicate logics.
I think I'm not following or I'm missing something, because if we always pass this as true, this doesn't make sense
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.
That makes sense. I removed isLHNPreview
in commit
I am working on it |
src/libs/ReportActionsUtils.ts
Outdated
/** | ||
* Check if the current user is the requestor of the action | ||
*/ | ||
function isRequestor(reportAction: OnyxEntry<ReportAction>): boolean { |
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.
Sorry I kinda missed this in the proposal and original review, but I was thinking about reports when thinking about isRequestor
, but for report actions, this name isn't great.
How about we call this something like ReportActionUtils.actionWasTakenByCurrentUser(reportAction)
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.
I renamed it in commit
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.
Cool, let me know when this is ready for re-review. 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 production by https://github.com/Julesssss in version: 1.4.79-11 🚀
|
Details
Fixed Issues
$ #37044
PROPOSAL: #37044 (comment)
Tests
Test case 1 (to make sure RBR on the LHN is only shown for the user that made the request):
Test case 2 (to make sure the RBRs on the report preview, money request preview, and the ones in the money request view are shown to every user that has access to them):
Offline tests
QA Steps
Test case 1 (to make sure RBR on the LHN is only shown for the user that made the request):
Test case 2 (to make sure the RBRs on the report preview, money request preview, and the ones in the money request view are shown to every user that has access to them):
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
Screen.Recording.2024-04-10.at.04.24.13.mov
Android: mWeb Chrome
Screen.Recording.2024-04-10.at.04.26.47.mov
iOS: Native
Screen.Recording.2024-04-10.at.04.23.43.mov
iOS: mWeb Safari
Screen.Recording.2024-04-10.at.04.21.01.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-10.at.04.12.16.mov
MacOS: Desktop
Screen.Recording.2024-04-10.at.04.17.21.mov