-
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
change report action button bg color if there's held expenses #53117
Conversation
@mananjadhav 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're missing the Search action button case.
Done, will update the recording videos soon |
This comment was marked as resolved.
This comment was marked as resolved.
Hi, I will be OOO for 1 day cc: @mananjadhav |
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.
We have conflicts
Done, conflicts resolved, merged latest changes from main cc: @luacmartins @mananjadhav please re-review |
src/components/SelectionList/Search/ExpenseItemHeaderNarrow.tsx
Outdated
Show resolved
Hide resolved
@NJ-2020 quick bump on the PR comments. |
Done, please re-review cc: @mananjadhav |
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.
Left a few more comments
const reportItemTotal = reportItem?.total ?? 0; | ||
const reportItemUnheldTotal = reportItem?.unheldTotal ?? 0; | ||
const isOnHold = reportItemTotal - reportItemUnheldTotal === 0; | ||
|
||
const isApproveAction = reportItem.action === CONST.SEARCH.ACTION_TYPES.APPROVE; | ||
const shouldUseSuccessStyle = isApproveAction ? !isOnHold : 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.
Can we use ReportUtils.hasHeldExpenses
like so?
const reportItemTotal = reportItem?.total ?? 0; | |
const reportItemUnheldTotal = reportItem?.unheldTotal ?? 0; | |
const isOnHold = reportItemTotal - reportItemUnheldTotal === 0; | |
const isApproveAction = reportItem.action === CONST.SEARCH.ACTION_TYPES.APPROVE; | |
const shouldUseSuccessStyle = isApproveAction ? !isOnHold : true; | |
const hasHeldExpenses = ReportUtils.hasHeldExpenses('', reportItem.transactions); |
@@ -202,6 +209,7 @@ function ReportListItem<TItem extends ListItem>({ | |||
<View style={StyleUtils.getSearchTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ACTION)}> | |||
<ActionCell | |||
action={reportItem.action} | |||
shouldUseSuccessStyle={shouldUseSuccessStyle} |
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.
shouldUseSuccessStyle={shouldUseSuccessStyle} | |
shouldUseSuccessStyle={!hasHeldExpenses} |
@@ -278,6 +283,7 @@ function TransactionListItemRow({ | |||
onButtonPress={onButtonPress} | |||
canSelectMultiple={canSelectMultiple} | |||
action={item.action} | |||
shouldUseSuccessStyle={shouldUseSuccessStyle} |
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.
shouldUseSuccessStyle={shouldUseSuccessStyle} | |
shouldUseSuccessStyle={!isOnHold} |
@@ -444,6 +450,7 @@ function TransactionListItemRow({ | |||
<View style={[StyleUtils.getSearchTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ACTION)]}> | |||
<ActionCell | |||
action={item.action} | |||
shouldUseSuccessStyle={shouldUseSuccessStyle} |
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.
shouldUseSuccessStyle={shouldUseSuccessStyle} | |
shouldUseSuccessStyle={!isOnHold} |
const isApproveAction = item.action === CONST.SEARCH.ACTION_TYPES.APPROVE; | ||
const shouldUseSuccessStyle = isApproveAction ? !isOnHold : 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.
Do we need to check if it's approve action? Shouldn't we always use the grey style if there's a transaction on hold?
const isApproveAction = item.action === CONST.SEARCH.ACTION_TYPES.APPROVE; | |
const shouldUseSuccessStyle = isApproveAction ? !isOnHold : true; |
Please re-review @mananjadhav |
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.
Code LGTM. All yours @mananjadhav
Testing the changes. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-grey-pay-button.movMacOS: Chrome / Safariweb-grey-pay-button.movMacOS: Desktopdesktop-grey-pay-button.mov |
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.0.74-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.74-8 🚀
|
Following up on this issue, On this PR, we missed the case where the approve button turns green when selected via the checkbox. To address this, we updated the button style by adding buttonDefaultHovered. More details can be found in the selected proposal: #53897 (comment) |
BTW we're reverting these changes and no longer changing button colors so if you're aware of any additional work changing the button colors, please stop immediately. |
Explanation of Change
Fixed Issues
$ #52569
PROPOSAL: #52569 (comment)
Tests
Same as QA
Offline tests
Same as QA
QA Steps
One Expense
More than 1 Expense
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
Screen.Recording.2024-12-03.at.15.29.52.mov
Android: mWeb Chrome
Screen.Recording.2024-12-04.at.07.13.44.mov
iOS: Native
Screen.Recording.2024-12-04.at.08.48.31.mov
iOS: mWeb Safari
Screen.Recording.2024-12-04.at.08.10.48.mov
MacOS: Chrome / Safari
Screen.Recording.2024-12-04.at.09.10.03.mov
MacOS: Desktop
Screen.Recording.2024-12-04.at.08.56.19.mov