-
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: Expensify card link navigates to wallet #50039
Conversation
I cannot run android native. Will update the video later. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-10-02_14.57.27.mp4Android: mWeb Chromeandroid-chrome-2024-10-02_14.01.22.mp4iOS: Nativeios-app-2024-10-02_14.48.17.mp4iOS: mWeb Safariios-safari-2024-10-02_14.52.41.mp4MacOS: Chrome / Safaridesktop-chrome-2024-10-02_13.53.47.mp4MacOS: Desktopdesktop-app-2024-10-02_13.58.01.mp4 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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.
A couple of bugs to sort out!
Fixed this bug.
Screen.Recording.2024-10-03.at.16.42.47.mov
Screen.Recording.2024-10-03.at.16.43.16.mov |
When we are on the report page and then click on the card link, it will navigate to the card detail page in RHN. But in background, which screen should be displayed? There are two options:
Screen.Recording.2024-10-03.at.16.43.16.mov
|
I think it probably makes sense to have the report in the background (central pane), unless it adds unnecessary complexity. Let's do that for now, we can revert if @iwiznia feels strongly about it! |
@truph01 Could you also add the Android native video when you get a chance? Thanks! |
It's probably a bit better to keep the report (or whatever page you were in) in the background, so when you close the RHP you are in the same place you were before |
I cannot receive magic code now. Did you encounter the same? @jjcoffee |
@truph01 Should be fixed now! |
Admin:Screen.Recording.2024-10-05.at.06.36.56.movOthers:Screen.Recording.2024-10-05.at.06.37.36.mov |
This comment was marked as resolved.
This comment was marked as resolved.
I encountered the same when I tested on Android. I try to call "npm run android" and start metro "npx react-native start :8081" again, then it works properly. Can you try it? |
src/libs/ReportActionsUtils.ts
Outdated
function getCardIssuedMessage(reportAction: OnyxEntry<ReportAction>, shouldRenderHTML = false) { | ||
const assigneeAccountID = (getOriginalMessage(reportAction) as IssueNewCardOriginalMessage)?.assigneeAccountID; | ||
function getCardIssuedMessage(reportAction: OnyxEntry<ReportAction>, shouldRenderHTML = false, policyID = '-1') { | ||
const assigneeAccountID = isActionOfType( |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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!
@@ -1728,13 +1729,24 @@ function isCardIssuedAction(reportAction: OnyxEntry<ReportAction>) { | |||
return isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED, CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED_VIRTUAL, CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS); | |||
} | |||
|
|||
function getCardIssuedMessage(reportAction: OnyxEntry<ReportAction>, shouldRenderHTML = false) { | |||
const assigneeAccountID = (getOriginalMessage(reportAction) as IssueNewCardOriginalMessage)?.assigneeAccountID; | |||
function getCardIssuedMessage(reportAction: OnyxEntry<ReportAction>, shouldRenderHTML = false, policyID = '-1') { |
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.
Why -1 and not 0 or null? (same in all the ones below)
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.
Because the policyID
prop of the report
is policyID?: string
, so I need to add the fallback value as '-1' to fix the type error based on the docs: https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#default-value-for-inexistent-ids
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.
Posted about this here https://expensify.slack.com/archives/C01GTK53T8Q/p1728329641957179 and we will be undoing this, but I'll go ahead and merge this
const assigneeDetails = PersonalDetailsUtils.getPersonalDetailsByIDs([assigneeAccountID], currentUserAccountID ?? -1).at(0); | ||
|
||
const isPolicyAdmin = PolicyUtils.isPolicyAdmin(PolicyUtils.getPolicy(policyID)); |
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 this is wrong if policyID is -1, no?
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.
Yep, isPolicyAdmin
will be false
if policyID is -1
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 sounds wrong, because -1
is not checked here
Line 579 in 9e1f21a
if (!allPolicies || !policyID) { |
But also checking with the team about the -1 recommendation you linked above
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 sounds wrong, because -1 is not checked here
- If policyID = -1, then condition:
Line 579 in 9e1f21a
if (!allPolicies || !policyID) { |
is false
so undefined will be returned because of:
Line 582 in 9e1f21a
return allPolicies[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`]; |
I think getPolicy(-1) = undefined
makes sense.
But also checking with the team about the -1 recommendation you linked above
- Waiting for the final decision
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.0.46-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.46-5 🚀
|
Details
Fixed Issues
$ #49804
PROPOSAL: #49804 (comment)
Tests
Offline tests
QA Steps
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-10-05.at.07.01.06.mov
Android: mWeb Chrome
Screen.Recording.2024-10-02.at.15.24.19.mov
iOS: Native
Screen.Recording.2024-10-02.at.15.20.27.mov
iOS: mWeb Safari
Screen.Recording.2024-10-02.at.15.18.33.mov
MacOS: Chrome / Safari
Screen.Recording.2024-10-02.at.15.09.03.mov
MacOS: Desktop
Screen.Recording.2024-10-02.at.15.15.35.mov