-
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
[HOLD] Implement Uneven Splits #40386
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@@ -0,0 +1,206 @@ | |||
import React, {useCallback, useEffect, useRef, useState} from 'react'; |
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 now I copied and pasted code from MoneyRequestAmountForm
, we're working on making the underlying amount input reusable here #40382
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
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.
As for the split stuff this is looking awesome.
I'm still getting the jumpy Next button and Missing translation, but since you've mentioned this isn't related to this PR, I'll go ahead and approve.
Thanks for going through all these details. It was worth it 😄
The "Paid by" appears to be sticky as well now when you scroll, which is not correct |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
QA please don't check this off until the PR above is CP'ed. |
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.71-6 🚀
|
We had minor UI issue from this PR, more information here #41751 (comment) |
@@ -616,6 +658,10 @@ function MoneyRequestConfirmationList({ | |||
return; | |||
} | |||
|
|||
if (formError) { |
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 caused a bug. RCA here - #41336 (comment)
@@ -709,14 +757,28 @@ function MoneyRequestConfirmationList({ | |||
<FormHelpMessage | |||
style={[styles.ph1, styles.mb2]} | |||
isError | |||
message={formError} | |||
message={!shouldShowReadOnlySplits ? debouncedFormError : formError} |
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.
Hi ✋ Coming from #43184
The check shouldShowReadOnlySplits
should be used on the split request, so adding isTypeSplit
to avoid the debouncedFormError
called on the non-split request.
? IOUUtils.calculateAmount(selectedParticipants.length, iouAmount, iouCurrencyCode ?? '', isPayer) | ||
: transaction.comment.splits.find((split) => split.accountID === participantOption.accountID)?.amount; | ||
} | ||
return { |
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 did not prevent opening up the profile page for non-existing accounts thereby resulting in #42841
} | ||
|
||
setFormError(''); | ||
}, [isTypeSplit, transaction?.splitShares, iouAmount, iouCurrencyCode, setFormError, translate]); |
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.
FYI, We need to include isFocused
and transaction
in the dependency array, because we reset the form error whenever the screen gains or loses focus here
This caused this bug: #45199
More info in this proposal: #45199 (comment)
Details
Fixed Issues
$ #40616
Tests
Creating an uneven split from Global Create
Creating an uneven split from a group chat
Error handling
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