refactor getPolicyExpenseReportOption#80209
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@DylanDylann 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6a3974484
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@DylanDylann It's ready for review |
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required.
|
@dukenv0307 Please add unit test to cover new params |
|
and also please resolve conflict |
Reviewer Checklist
Screenshots/Videos |
|
@dukenv0307 Test step, please 😄 |
|
@DylanDylann I found the way to test, can you please check again? |
I think we can do it in another PR |
|
@DylanDylann bump |
|
@codex reivew |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@DylanDylann Actually, they're the same, but I updated to use expenseReport as the safer approach |
|
@dukenv0307 We got Failed ESlint |
|
@DylanDylann It's weird, |
|
@DylanDylann merged main and it worked |
|
As discussed here, I think we should mark this PR as No QA |
|
cc @tgolen For review |
| const reportAttributesDerived = useReportAttributes(); | ||
| const [betas] = useOnyx(ONYXKEYS.BETAS); | ||
| const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(report?.chatReportID)}`); | ||
| const [privateIsArchived] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`, {selector: privateIsArchivedSelector}); |
There was a problem hiding this comment.
I think it is better to reuse useReportIsArchived()
There was a problem hiding this comment.
I thought about it, but useReportIsArchived returns a boolean while getPolicyExpenseReportOption and the downstream chain accept a string
There was a problem hiding this comment.
Hm, that's fair, but from what I can see, all the code referencing it uses !! before the value, so it's being cast to a boolean in the end anyway.
I can open a separate GH for this.
|
🚧 @tgolen has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/tgolen in version: 9.3.34-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.34-2 🚀
|
Explanation of Change
Refactor
getPolicyExpenseReportOptionto usereportNameValuePairfrom component instead of using it from Onyx.connectFixed Issues
$ #66380
PROPOSAL:
Tests
Precondition: For testing purpose, we need to mock the workspace to be Teacher Unite workspace
Onyx.merge('report_id', {policyID: 'ABD1345ED7293535'})
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-02-28.at.10.45.49.mov