-
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
order options by the last expense request time in "Submit Expense" flow #49568
order options by the last expense request time in "Submit Expense" flow #49568
Conversation
src/libs/OptionsListUtils.ts
Outdated
@@ -1979,6 +1994,22 @@ function getOptions( | |||
recentReportOptions.push(reportOption); | |||
} | |||
|
|||
// Add a field to sort the recent reports by the time of last IOU request | |||
if (action) { |
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 query I have is: Do we want to apply this ordering just to the create action? Because with at the moment this will also apply to sharing and categorizing.
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.
Yes, I think we should use it only for CREATE
.
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.
Perhaps it would be a little cleaner if we made this condition dependent on preferRecentExpenseReports
, seeing as we're defining that as action === CONST.IOU.ACTION.CREATE
.
src/libs/OptionsListUtils.ts
Outdated
@@ -2391,6 +2428,7 @@ function filterOptions(options: Options, searchInputValue: string, config?: Filt | |||
excludeLogins = [], | |||
preferChatroomsOverThreads = false, | |||
preferPolicyExpenseChat = false, | |||
action, |
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.
perhaps it would be better to define preferRecentExpenseReports
here and then we can put the action === CONST.IOU.ACTION.CREATE
condition in MoneyRequestParticipantsSelector
Reviewer Checklist
Screenshots/Videos |
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.
src/libs/ReportUtils.ts
Outdated
@@ -459,6 +459,7 @@ type OptionData = { | |||
tabIndex?: 0 | -1; | |||
isConciergeChat?: boolean; | |||
isBold?: boolean; | |||
lastIOUTime?: string; |
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.
lastIOUTime?: string; | |
lastIOUCreationDate?: string; |
Just trying to see if we can make this a bit more descriptive
src/libs/OptionsListUtils.ts
Outdated
@@ -1599,8 +1610,11 @@ function orderOptions(options: ReportUtils.OptionData[], searchValue: string | u | |||
// When option.login is an exact match with the search value, returning 0 puts it at the top of the option list | |||
return 0; | |||
}, | |||
// For Submit Expense flow, prioritze the most recent expense reports and then policy expense chats (without expense requests) |
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.
// For Submit Expense flow, prioritze the most recent expense reports and then policy expense chats (without expense requests) | |
// For Submit Expense flow, prioritize the most recent expense reports and then policy expense chats (without expense requests) |
✋ 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/MariaHCD in version: 9.0.41-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.41-10 🚀
|
Details
Change the order of options in the "Submit Expense" flow to:
Fixed Issues
$ #48608
PROPOSAL: #48608 (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
iouAndroid.mp4
Android: mWeb Chrome
iouAndroidmWeb.mp4
iOS: Native
iouiOS.mp4
iOS: mWeb Safari
iouiOSmWeb.mp4
MacOS: Chrome / Safari
iouChrome.mp4
MacOS: Desktop
iouDesktop.mp4