Skip to content

Commit

Permalink
Merge pull request #25806 from Expensify/marcaaron-disableInviteUserW…
Browse files Browse the repository at this point in the history
…henAssigningTask

[CP staging] Disable assigning users who do not yet exist to tasks
  • Loading branch information
roryabraham authored Aug 24, 2023
2 parents 1cff304 + ba38bda commit 5132e7e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ function getOptions(
includeMoneyRequests = false,
excludeUnknownUsers = false,
includeP2P = true,
canInviteUser = true,
},
) {
if (!isPersonalDetailsReady(personalDetails)) {
Expand Down Expand Up @@ -874,7 +875,7 @@ function getOptions(
return {
personalDetails: personalDetailsOptions,
recentReports: recentReportOptions,
userToInvite,
userToInvite: canInviteUser ? userToInvite : null,
currentUserOption,
};
}
Expand Down Expand Up @@ -957,9 +958,20 @@ function getIOUConfirmationOptionsFromParticipants(participants, amountText) {
* @param {Array} [excludeLogins]
* @param {Boolean} [includeOwnedWorkspaceChats]
* @param {boolean} [includeP2P]
* @param {boolean} [canInviteUser]
* @returns {Object}
*/
function getNewChatOptions(reports, personalDetails, betas = [], searchValue = '', selectedOptions = [], excludeLogins = [], includeOwnedWorkspaceChats = false, includeP2P = true) {
function getNewChatOptions(
reports,
personalDetails,
betas = [],
searchValue = '',
selectedOptions = [],
excludeLogins = [],
includeOwnedWorkspaceChats = false,
includeP2P = true,
canInviteUser = true,
) {
return getOptions(reports, personalDetails, {
betas,
searchInputValue: searchValue.trim(),
Expand All @@ -970,6 +982,7 @@ function getNewChatOptions(reports, personalDetails, betas = [], searchValue = '
excludeLogins,
includeOwnedWorkspaceChats,
includeP2P,
canInviteUser,
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/pages/tasks/TaskAssigneeSelectorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ function TaskAssigneeSelectorModal(props) {
[],
CONST.EXPENSIFY_EMAILS,
false,
true,
false,
);

setHeaderMessage(OptionsListUtils.getHeaderMessage(recentReports?.length + personalDetails?.length !== 0 || currentUserOption, Boolean(userToInvite), searchValue));
Expand Down

0 comments on commit 5132e7e

Please sign in to comment.