Skip to content

Commit

Permalink
Merge pull request #21134 from Expensify/OSBotify-cherry-pick-staging…
Browse files Browse the repository at this point in the history
…-21113

🍒 Cherry pick PR #21113 to staging 🍒
  • Loading branch information
OSBotify authored Jun 20, 2023
2 parents f7eb7c4 + a10b11c commit 23f59d1
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001032907
versionName "1.3.29-7"
versionCode 1001032908
versionName "1.3.29-8"
}

splits {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.29.7</string>
<string>1.3.29.8</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.29.7</string>
<string>1.3.29.8</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.29-7",
"version": "1.3.29-8",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
10 changes: 5 additions & 5 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ function MoneyRequestConfirmationList(props) {
const formattedParticipantsList = _.union(formattedSelectedParticipants, formattedUnselectedParticipants);

const myIOUAmount = IOUUtils.calculateAmount(selectedParticipants.length, props.iouAmount, true);
const formattedPayeePersonalDetails = OptionsListUtils.getIOUConfirmationOptionsFromPayeePersonalDetail(
const formattedPayeeOption = OptionsListUtils.getIOUConfirmationOptionsFromPayeePersonalDetail(
payeePersonalDetails,
CurrencyUtils.convertToDisplayString(myIOUAmount, props.iouCurrencyCode),
);

sections.push(
{
title: translate('moneyRequestConfirmationList.whoPaid'),
data: [formattedPayeePersonalDetails],
data: [formattedPayeeOption],
shouldShow: true,
indexOffset: 0,
},
Expand Down Expand Up @@ -211,21 +211,21 @@ function MoneyRequestConfirmationList(props) {
const toggleOption = useCallback(
(option) => {
// Return early if selected option is currently logged in user.
if (option.login === props.session.email) {
if (option.accountID === props.session.accountID) {
return;
}

setParticipants((prevParticipants) => {
const newParticipants = _.map(prevParticipants, (participant) => {
if (participant.login === option.login) {
if (participant.accountID === option.accountID) {
return {...participant, selected: !participant.selected};
}
return participant;
});
return newParticipants;
});
},
[props.session.email],
[props.session.accountID],
);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/OptionRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class OptionRow extends Component {

// We only create tooltips for the first 10 users or so since some reports have hundreds of users, causing performance to degrade.
const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(
(this.props.option.participantsList || this.props.option.login ? [this.props.option] : []).slice(0, 10),
(this.props.option.participantsList || this.props.option.accountID ? [this.props.option] : []).slice(0, 10),
isMultipleParticipant,
);
let subscriptColor = themeColors.appBG;
Expand Down
2 changes: 1 addition & 1 deletion src/components/OptionsList/BaseOptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class BaseOptionsList extends Component {
hoverStyle={this.props.optionHoveredStyle}
optionIsFocused={!this.props.disableFocusOptions && !isDisabled && this.props.focusedIndex === index + section.indexOffset}
onSelectRow={this.props.onSelectRow}
isSelected={Boolean(_.find(this.props.selectedOptions, (option) => option.login === item.login))}
isSelected={Boolean(_.find(this.props.selectedOptions, (option) => option.accountID === item.accountID))}
showSelectedState={this.props.canSelectMultipleOptions}
boldStyle={this.props.boldStyle}
isDisabled={isDisabled}
Expand Down
8 changes: 5 additions & 3 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,19 @@ function isPersonalDetailsReady(personalDetails) {
function getParticipantsOptions(report, personalDetails) {
const participants = lodashGet(report, 'participantAccountIDs', []);
return _.map(getPersonalDetailsForAccountIDs(participants, personalDetails), (details) => ({
keyForList: details.login,
keyForList: String(details.accountID),
login: details.login,
accountID: details.accountID,
text: details.displayName,
firstName: lodashGet(details, 'firstName', ''),
lastName: lodashGet(details, 'lastName', ''),
alternateText: Str.isSMSLogin(details.login || '') ? LocalePhoneNumber.formatPhoneNumber(details.login) : details.login,
alternateText: Str.isSMSLogin(details.login || '') ? LocalePhoneNumber.formatPhoneNumber(details.login) : details.login || details.displayName,
icons: [
{
source: UserUtils.getAvatar(details.avatar, details.accountID),
name: details.login,
type: CONST.ICON_TYPE_AVATAR,
id: details.accountID,
},
],
payPalMeAddress: lodashGet(details, 'payPalMeAddress', ''),
Expand Down Expand Up @@ -857,12 +858,13 @@ function getSearchOptions(reports, personalDetails, searchValue = '', betas) {
function getIOUConfirmationOptionsFromPayeePersonalDetail(personalDetail, amountText) {
return {
text: personalDetail.displayName ? personalDetail.displayName : personalDetail.login,
alternateText: personalDetail.login,
alternateText: personalDetail.login || personalDetail.displayName,
icons: [
{
source: UserUtils.getAvatar(personalDetail.avatar, personalDetail.accountID),
name: personalDetail.login,
type: CONST.ICON_TYPE_AVATAR,
id: personalDetail.accountID,
},
],
descriptiveText: amountText,
Expand Down
8 changes: 4 additions & 4 deletions src/pages/iou/MoneyRequestModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const propTypes = {
}),

/** Personal details of all the users */
personalDetails: PropTypes.shape({
allPersonalDetails: PropTypes.shape({
/** Primary login of participant */
login: PropTypes.string,

Expand Down Expand Up @@ -81,7 +81,7 @@ const defaultProps = {
currentUserPersonalDetails: {
localCurrencyCode: CONST.CURRENCY.USD,
},
personalDetails: {},
allPersonalDetails: {},
iou: {
error: false,
selectedCurrencyCode: null,
Expand All @@ -108,7 +108,7 @@ function MoneyRequestModal(props) {
const [selectedOptions, setSelectedOptions] = useState(
ReportUtils.isPolicyExpenseChat(props.report)
? OptionsListUtils.getPolicyExpenseReportOptions(props.report)
: OptionsListUtils.getParticipantsOptions(props.report, props.personalDetails),
: OptionsListUtils.getParticipantsOptions(props.report, props.allPersonalDetails),
);
const [amount, setAmount] = useState(0);

Expand Down Expand Up @@ -442,7 +442,7 @@ export default compose(
iou: {
key: ONYXKEYS.IOU,
},
personalDetails: {
allPersonalDetails: {
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
},
}),
Expand Down

0 comments on commit 23f59d1

Please sign in to comment.