-
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
Allow selecting a payer from the splits page #40388
Conversation
@dukenv0307 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] |
item: ( | ||
<MenuItem | ||
label={translate('moneyRequestConfirmationList.paidBy')} | ||
interactive={!transaction?.isFromGlobalCreate} |
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.
@nkdengineer Why do you use this condition? Do you mean that we shouldn't allow editing payer in split request created global
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 because when we create split request from global, maybe we cannot know the current user accountID of other user. So I'm disabling this.
@youssef-lr What do you think about this?
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.
maybe we cannot know the current user accountID of other user
Good point, but this is only true if we're splitting with new accounts as we'll only have their optimistic accountIDs. We can handle this in the backend though so it should be fine to just send the optimistic accountID, we'll use the real accountID once it's created in the backend.
So to answer your question @nkdengineer we should still allow selection of payer from Global Create.
src/components/MoneyTemporaryForRefactorRequestConfirmationList.tsx
Outdated
Show resolved
Hide resolved
@rafecolton @joekaufmanexpensify Screen.Recording.2024-04-18.at.15.04.49.movWhen creating split request in workspace the payer list only have the request creator. Should we disable the payer field on the confirmation page in this case? |
src/libs/actions/IOU.ts
Outdated
@@ -5808,6 +5817,10 @@ function setMoneyRequestParticipantsFromReport(transactionID: string, report: On | |||
? [{accountID: 0, reportID: chatReport?.reportID, isPolicyExpenseChat: ReportUtils.isPolicyExpenseChat(chatReport), selected: true}] | |||
: (chatReport?.participantAccountIDs ?? []).filter((accountID) => currentUserAccountID !== accountID).map((accountID) => ({accountID, selected: true})); | |||
|
|||
if (iouType === CONST.IOU.TYPE.SPLIT) { |
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.
@nkdengineer Could you explain about this change?
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.
+1, we're also removing the option to select participants from the split.
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 moved this logic to confirmation page since we're now allow skip confirmation step for QAB. The new design include the current user in split amounts section, that is the reason I add the current user to participants of transaction #40379 (comment).
@nkdengineer you have merge conflicts, please resolve. Also would mind resolving any comments that you no longer need feedback on? I'll go through the remaining ones later today and give some feedback. |
I resolved the conflict and update the translation key. |
@nkdengineer heads up we have conflicts again |
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.
Found a little bug messing around with this while working on https://github.com/Expensify/Expensify/issues/388965
- Create a new group and add two other users
- Create a new manual split within that group
- Try to uncheck the current payer - it doesn't work (expected)
- Uncheck a different user who is not the current payer
- Set the user you just unchecked as the payer
Now you are taken back to the split creation screen...
- Expected behavior: Payer is checked (included in the split) and cannot be unchecked
- Actual behavior: Payer is unchecked (not included in the split) AND trying to include them by checking the box is blocked 🙈
@nkdengineer Currently, I see 2 payer fields |
@dukenv0307 Please ignore it, after testing complete we will hide the first paid by menu item before merging. Context here: #40388 |
Bump @dukenv0307, we hope to get this merged today please 🙏🏼🙏🏼 |
I'm reviewing. Will finish in a few hours. |
@nkdengineer Could you help to merge the latest main? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-04-26.at.17.26.29.movAndroid: mWeb ChromeScreen.Recording.2024-04-26.at.16.03.47.moviOS: NativeScreen.Recording.2024-04-26.at.16.02.26.moviOS: mWeb SafariScreen.Recording.2024-04-26.at.16.00.45.movMacOS: Chrome / SafariScreen.Recording.2024-04-26.at.15.14.55.movMacOS: DesktopScreen.Recording.2024-04-26.at.15.57.23.mov |
src/libs/actions/IOU.ts
Outdated
@@ -3594,6 +3613,7 @@ function splitBillAndOpenReport({ | |||
createdReportActionID: splitData.createdReportActionID, | |||
policyID: splitData.policyID, | |||
chatType: splitData.chatType, | |||
splitPayerAccountIDs: [], |
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.
@nkdengineer Is this expectation?
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 should also add splitPayerAccountIDs
here. I passed splitPayerAccountIDs
to splitBillAndOpenReport
but missed to pass it to API.
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.
@dukenv0307 Updated and merged main.
One more comment, everything else looks good |
@nkdengineer BUG: The payer field is wrong after creating split request (It always be the current user even though we change the payer) Screen.Recording.2024-04-26.at.15.14.55.mov |
@dukenv0307 This will require BE change and I think it will be fixed here #40386. One more note, we will hide this option before merging this PR and all logics to change or display the paid by after API is complete will be handled here #40386. |
@youssef-lr Should we note this comment to #40386 |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #40379 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
@youssef-lr Everything else looks good. All yours |
Will test against the back-end changes here in a bit. @nkdengineer can you please resolve merge conflicts again? |
✋ 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/rafecolton in version: 1.4.69-0 🚀
|
This PR is failing because of issue #40379 The issue is reproducible in: All Platforms 1714555140450.Screen_Recording_2024-05-01_at_12.18.06_in_the_afternoon.mp41714546054224.40388_web.mp41714575665304.RPReplay_Final1714575196.mp41714574894549.az_recorder_20240501_104526.mp41714574355802.RPReplay_Final1714574179.mp4 |
@kbecciv yeah unfortunately it won't really be possible to QA this PR by itself, as the feature is actually disabled here and the back-end requirements are not merged yet. I think we could skip it and test when the other PRs for #40379 are merged. @youssef-lr what do you think? |
I agree with @rafecolton, this feature will be enabled again in this PR #40386. |
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.69-2 🚀
|
Details
Fixed Issues
$ #40379
PROPOSAL: #40379 (comment)
Tests
Paid by
field appearsPaid by
field is updatedOffline tests
Same as above
QA Steps
Paid by
field appearsPaid by
field is updatedPR 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
Screen.Recording.2024-04-18.at.12.59.37.mov
Android: mWeb Chrome
Screen.Recording.2024-04-18.at.12.57.23.mov
iOS: Native
Screen.Recording.2024-04-18.at.13.04.54.mov
iOS: mWeb Safari
Screen.Recording.2024-04-18.at.12.56.32.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-18.at.12.55.21.mov
MacOS: Desktop
Screen.Recording.2024-04-18.at.13.06.15.mov