Skip to content

Commit

Permalink
Merge pull request #27868 from namhihi237/fix-select-workspace
Browse files Browse the repository at this point in the history
[CP Staging] fix select workspace request money

(cherry picked from commit e7bcd7f)
  • Loading branch information
mountiny authored and OSBotify committed Sep 21, 2023
1 parent a3df9a8 commit e50fb7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ function getPolicyExpenseReportOption(report) {
],
selected: report.selected,
isPolicyExpenseChat: true,
searchText: report.searchText,
};
}

Expand Down Expand Up @@ -226,6 +227,7 @@ function getParticipantsOption(participant, personalDetails) {
],
phoneNumber: lodashGet(detail, 'phoneNumber', ''),
selected: participant.selected,
searchText: participant.searchText,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ function MoneyRequestParticipantsSelector({
* @param {Object} option
*/
const addSingleParticipant = (option) => {
onAddParticipants([{accountID: option.accountID, login: option.login, isPolicyExpenseChat: option.isPolicyExpenseChat, reportID: option.reportID, selected: true}]);
onAddParticipants([
{accountID: option.accountID, login: option.login, isPolicyExpenseChat: option.isPolicyExpenseChat, reportID: option.reportID, selected: true, searchText: option.searchText},
]);
navigateToRequest();
};

Expand Down Expand Up @@ -187,7 +189,14 @@ function MoneyRequestParticipantsSelector({
} else {
newSelectedOptions = [
...participants,
{accountID: option.accountID, login: option.login, isPolicyExpenseChat: option.isPolicyExpenseChat, reportID: option.reportID, selected: true},
{
accountID: option.accountID,
login: option.login,
isPolicyExpenseChat: option.isPolicyExpenseChat,
reportID: option.reportID,
selected: true,
searchText: option.searchText,
},
];
}

Expand Down Expand Up @@ -223,7 +232,7 @@ function MoneyRequestParticipantsSelector({
Boolean(newChatOptions.userToInvite),
searchTerm.trim(),
maxParticipantsReached,
_.some(participants, (participant) => participant.login.toLowerCase().includes(searchTerm.trim().toLowerCase())),
_.some(participants, (participant) => participant.searchText.toLowerCase().includes(searchTerm.trim().toLowerCase())),
);
const isOptionsDataReady = ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(personalDetails);

Expand Down

0 comments on commit e50fb7a

Please sign in to comment.