-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[No QA] Implement report primary action getter #57475
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
[No QA] Implement report primary action getter #57475
Conversation
@ikevin127 let's prioritize reviewing this PR! |
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.
Looking good. Left a few comments.
src/libs/ReportPrimaryActionUtils.ts
Outdated
policy: Policy, | ||
reportTransactions: Transaction[], | ||
violations: OnyxCollection<TransactionViolation[]>, | ||
): ValueOf<typeof CONST.REPORT.PRIMARY_ACTIONS> | undefined { |
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.
From the design doc, looks like the return type of this function should be:
ValueOf(typeof CONST.REPORT.PRIMARY_ACTIONS) | ''
which means that if there's no match, we should return empty string (from design doc):
// If there is no Primary action to return for this report, just return an empty string default return '';```
If there's an already agreed-upon reason for which we want undefined
instead of empty string then this comment can be ignored.
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.
Ah yea, nice catch. We can update it to return an empty string
Looks like we're missing this part from the doc:
and this part:
If this is expected for this PR, then we're good to move forward 👍 |
@ikevin127 this parts you mentioned above will be done as a separate PR once the logic for secondary/preview actions are ready 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.
@ikevin127 this parts you #57475 (comment) will be done as a separate PR once the logic for secondary/preview actions are ready as well.
Based on this, the changes LGTM 🚀
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
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 left some comments that I think need to be addressed
@luacmartins I applied suggestions 🫡 |
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
✋ 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/luacmartins in version: 9.1.9-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.1.9-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.1.9-8 🚀
|
@luacmartins
Explanation of Change
This PR implements logic responsible for getting primary action button that will be used in
MoneyReportHeader
Fixed Issues
$ #57436
PROPOSAL: N/A
Tests
Verify that
npm run test
passesOffline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
No UI changes
Android: mWeb Chrome
No UI changes
iOS: Native
No UI changes
iOS: mWeb Safari
No UI changes
MacOS: Chrome / Safari
No UI changes
MacOS: Desktop
No UI changes