-
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
Update request money header title #29936
Changes from 5 commits
ae942cf
c34e284
52919fa
6514698
8ee843a
2e2b5c8
3fd048d
64780a1
9df120e
d4bce78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2834,6 +2834,13 @@ function setMoneyRequestParticipants(participants) { | |
Onyx.merge(ONYXKEYS.IOU, {participants}); | ||
} | ||
|
||
/** | ||
* @param {Boolean} isSplitRequest | ||
*/ | ||
function setMoneyRequestIsSplitRequest(isSplitRequest) { | ||
Onyx.merge(ONYXKEYS.IOU, {isSplitRequest}); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be better to update the existing code of Let's add new parameter to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fedirjh Thank you for your comment, please check again |
||
|
||
/** | ||
* @param {String} receiptPath | ||
* @param {String} receiptFilename | ||
|
@@ -2941,6 +2948,7 @@ export { | |
resetMoneyRequestTag, | ||
setMoneyRequestBillable, | ||
setMoneyRequestParticipants, | ||
setMoneyRequestIsSplitRequest, | ||
setMoneyRequestReceipt, | ||
setUpDistanceTransaction, | ||
navigateToNextPage, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import CONST from '../../../../CONST'; | |
import personalDetailsPropType from '../../../personalDetailsPropType'; | ||
import reportPropTypes from '../../../reportPropTypes'; | ||
import refPropTypes from '../../../../components/refPropTypes'; | ||
import * as IOU from '../../../../libs/actions/IOU'; | ||
|
||
const propTypes = { | ||
/** Beta features list */ | ||
|
@@ -159,6 +160,7 @@ function MoneyRequestParticipantsSelector({ | |
onAddParticipants([ | ||
{accountID: option.accountID, login: option.login, isPolicyExpenseChat: option.isPolicyExpenseChat, reportID: option.reportID, selected: true, searchText: option.searchText}, | ||
]); | ||
IOU.setMoneyRequestIsSplitRequest(false); | ||
navigateToRequest(); | ||
}; | ||
|
||
|
@@ -198,6 +200,11 @@ function MoneyRequestParticipantsSelector({ | |
]; | ||
} | ||
|
||
if (newSelectedOptions.length === 0) { | ||
IOU.setMoneyRequestIsSplitRequest(false); | ||
} else { | ||
IOU.setMoneyRequestIsSplitRequest(true); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's avoid these extra steps, let's update |
||
onAddParticipants(newSelectedOptions); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the best option is to use a new optimistic prop inside the IOU to store the type of the request, something like |
||
}, | ||
[participants, onAddParticipants], | ||
|
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.
Let's use one merge :
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.
@fedirjh Quickly updated
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 @DylanDylann I think there is one more change needed, let's pass an empty array when
iou.isSplitRequest
isfalse
.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 have a little bug: when closing the modal without splitting the request, the default type is set to 'split'
bugDesktop.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.
@fedirjh I think it is unnecessary, currently as code change we have 2 cases
iou.isSplitRequest = false
addSingleParticipant
(manual case) we must pass participants paramaddParticipantToSelection
,isSplitRequest = false
whennewSelectedOptions.length === 0
which meansnewSelectedOptions
is emptyThere 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.
@DylanDylann We have this bug, from a manual request, navigating back to the participant's page will display selected user + 'add to split button' in the bottom
CleanShot.2023-10-26.at.12.20.13.mp4