-
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
Allow setting merchant for split bill #30721
Conversation
@aimane-chnaif 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] |
Please pull main as the branch is 1 week behind |
Done @aimane-chnaif |
bump @aimane-chnaif |
Custom merchant seems not working Screen.Recording.2023-11-14.at.9.08.06.PM.mov |
Should be fixed now @aimane-chnaif, sorry about that. I remember pushing this commit but I guess something went wrong and I didn't notice. |
!_.isEmpty(requestMerchant) && !props.isBillSplit && requestMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && requestMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT; | ||
const shouldShowDescription = !_.isEmpty(description) && !shouldShowMerchant; | ||
const shouldShowMerchant = !_.isEmpty(requestMerchant) && requestMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && requestMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT; | ||
const merchantOrDescription = shouldShowMerchant ? requestMerchant : description || ''; |
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.
Our design is we either show the merchant if it's not the default one or empty, otherwise we show the description.
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.
cc @trjExpensify @shawnborton this is going to fix the merchant having a small font size as well. How does this look like?
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.
That looks good to me, but I'll defer to Shawn.
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.
That looks good to me. Can you also take a look at this one while you are here? Thanks!
Please fix conflict when you're back |
@marcochavezf can you please check #30680 (comment)? |
#31604 is conflicting on MoneyRequestPreview |
Hmm if I understand correctly, this PR and #31604 are fixing the problem, correct? |
{(shouldShowDescription || shouldShowMerchant) && <Text style={[styles.colorMuted]}>{merchantOrDescription}</Text>} | ||
{!isCurrentUserManager && props.shouldShowPendingConversionMessage && ( | ||
<Text style={[styles.textLabel, styles.colorMuted]}>{translate('iou.pendingConversionMessage')}</Text> | ||
)} | ||
{(shouldShowDescription || (shouldShowMerchant && props.isBillSplit)) && ( | ||
<Text style={[styles.colorMuted]}>{shouldShowDescription ? description : requestMerchant}</Text> | ||
)} |
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.
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.
Updated, I think it doesn't look right, also removed muted style for the description or merchant
bump @aimane-chnaif, can we try and get this merged today please |
The major concern is still remaining |
Sorry I missed that, that's an intentional change in this PR. SmartScan should take care of those fields and not the user. |
bump @aimane-chnaif |
@youssef-lr please pull main. going to re-test now |
This maybe out of scope but manually updating split scan fields when offline is ignored Repro step:
Screen.Recording.2023-12-25.at.3.27.13.AM.mov |
Yeah it's out of scope. I'll look into that though. Thanks for catching this! |
@@ -1156,7 +1156,7 @@ function createSplitsAndOnyxData(participants, currentUserLogin, currentUserAcco | |||
'', | |||
'', | |||
'', | |||
merchant, | |||
merchant || Localize.translateLocal('iou.request'), |
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 causes regression when user language is Spanish and merchant is not set
Screen.Recording.2023-12-25.at.4.37.27.AM.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.
It's okay, we're going to deprecate the Request
merchant soon on P2P requests. Here's the plan from a private issue:
Make manual IOU expenses only have manually entered amount and description:
a. Don't show Merchant or Date fields in a hidden "detailed" section
b. Don't show Merchant: Request this is confusing and seems brokenShow Merchant and/or Date on SmartScanned IOU expenses only if they succeeded.
a. Don't show Merchant: Unknown
b. Don't show a RBR if the merchant isn't read
c. If the SmartScan fails to get one or the other, just hide that field -- exactly like a manual requestFor expenses on expense reports, however, require Merchant, Date, and Amount -- and show a RBR if any are missing, for both manual and SmartScanned expenses
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movweb-scan.movMacOS: Desktopdesktop.mov |
✋ 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/youssef-lr in version: 1.4.17-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.17-8 🚀
|
@@ -337,7 +346,6 @@ function IOURequestStepConfirmation({ | |||
bankAccountRoute={ReportUtils.getBankAccountRoute(report)} | |||
iouMerchant={transaction.merchant} | |||
iouCreated={transaction.created} | |||
isScanRequest={requestType === CONST.IOU.REQUEST_TYPE.SCAN} |
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 change caused a regression #33588
Details
Fixed Issues
$ #29732
$ #29691
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 methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop