Skip to content

Commit b8fd39e

Browse files
committed
Merge branch 'main' into fix/65983
2 parents 6ea6bc4 + f1a97e2 commit b8fd39e

32 files changed

Lines changed: 445 additions & 67 deletions

Mobile-Expensify

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ android {
114114
minSdkVersion rootProject.ext.minSdkVersion
115115
targetSdkVersion rootProject.ext.targetSdkVersion
116116
multiDexEnabled rootProject.ext.multiDexEnabled
117-
versionCode 1009018707
118-
versionName "9.1.87-7"
117+
versionCode 1009018709
118+
versionName "9.1.87-9"
119119
// Supported language variants must be declared here to avoid from being removed during the compilation.
120120
// This also helps us to not include unnecessary language variants in the APK.
121121
resConfigs "en", "es"

ios/NewExpensify/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</dict>
4545
</array>
4646
<key>CFBundleVersion</key>
47-
<string>9.1.87.7</string>
47+
<string>9.1.87.9</string>
4848
<key>FullStory</key>
4949
<dict>
5050
<key>OrgId</key>

ios/NotificationServiceExtension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleShortVersionString</key>
1414
<string>9.1.87</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.1.87.7</string>
16+
<string>9.1.87.9</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionPointIdentifier</key>

ios/ShareViewController/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleShortVersionString</key>
1414
<string>9.1.87</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.1.87.7</string>
16+
<string>9.1.87.9</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionAttributes</key>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "9.1.87-7",
3+
"version": "9.1.87-9",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
@@ -46,7 +46,7 @@
4646
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
4747
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4848
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
49-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=322 --cache --cache-location=node_modules/.cache/eslint",
49+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=324 --cache --cache-location=node_modules/.cache/eslint",
5050
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
5151
"lint-watch": "npx eslint-watch --watch --changed",
5252
"shellcheck": "./scripts/shellCheck.sh",

src/ROUTES.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,11 @@ const ROUTES = {
728728
},
729729
MONEY_REQUEST_EDIT_REPORT: {
730730
route: ':action/:iouType/report/:reportID/edit',
731-
getRoute: (action: IOUAction, iouType: IOUType, reportID?: string, backTo = '') => {
731+
getRoute: (action: IOUAction, iouType: IOUType, reportID?: string, shouldTurnOffSelectionMode?: boolean, backTo = '') => {
732732
if (!reportID) {
733733
Log.warn('Invalid reportID while building route MONEY_REQUEST_EDIT_REPORT');
734734
}
735-
return getUrlWithBackToParam(`${action as string}/${iouType as string}/report/${reportID}/edit`, backTo);
735+
return getUrlWithBackToParam(`${action as string}/${iouType as string}/report/${reportID}/edit${shouldTurnOffSelectionMode ? `?shouldTurnOffSelectionMode=true` : ``}`, backTo);
736736
},
737737
},
738738
SETTINGS_TAGS_ROOT: {

src/components/Search/SearchFiltersParticipantsSelector.tsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}:
4545
const {options, areOptionsInitialized} = useOptionsList({
4646
shouldInitialize: didScreenTransitionEnd,
4747
});
48-
4948
const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {canBeMissing: false, initWithStoredValues: false});
5049
const [reportAttributesDerived] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {canBeMissing: true, selector: (val) => val?.reports});
5150
const [selectedOptions, setSelectedOptions] = useState<OptionData[]>([]);
@@ -64,6 +63,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}:
6463
},
6564
{
6665
excludeLogins: CONST.EXPENSIFY_EMAILS_OBJECT,
66+
includeCurrentUser: true,
6767
},
6868
);
6969
}, [areOptionsInitialized, options.personalDetails, options.reports]);
@@ -73,12 +73,21 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}:
7373
}, [defaultOptions, selectedOptions]);
7474

7575
const chatOptions = useMemo(() => {
76-
return filterAndOrderOptions(unselectedOptions, cleanSearchTerm, {
76+
const filteredOptions = filterAndOrderOptions(unselectedOptions, cleanSearchTerm, {
7777
selectedOptions,
7878
excludeLogins: CONST.EXPENSIFY_EMAILS_OBJECT,
7979
maxRecentReportsToShow: CONST.IOU.MAX_RECENT_REPORTS_TO_SHOW,
8080
canInviteUser: false,
8181
});
82+
83+
const {currentUserOption} = unselectedOptions;
84+
85+
// Ensure current user is not in personalDetails when they should be excluded
86+
if (currentUserOption) {
87+
filteredOptions.personalDetails = filteredOptions.personalDetails.filter((detail) => detail.accountID !== currentUserOption.accountID);
88+
}
89+
90+
return filteredOptions;
8291
}, [unselectedOptions, cleanSearchTerm, selectedOptions]);
8392

8493
const {sections, headerMessage} = useMemo(() => {
@@ -100,18 +109,26 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}:
100109

101110
const selectedCurrentUser = formattedResults.section.data.find((option) => option.accountID === chatOptions.currentUserOption?.accountID);
102111

103-
if (chatOptions.currentUserOption) {
112+
// If the current user is already selected, remove them from the recent reports and personal details
113+
if (selectedCurrentUser) {
114+
chatOptions.recentReports = chatOptions.recentReports.filter((report) => report.accountID !== selectedCurrentUser.accountID);
115+
chatOptions.personalDetails = chatOptions.personalDetails.filter((detail) => detail.accountID !== selectedCurrentUser.accountID);
116+
}
117+
118+
// If the current user is not selected, add them to the top of the list
119+
if (!selectedCurrentUser && chatOptions.currentUserOption) {
104120
const formattedName = getDisplayNameForParticipant({
105121
accountID: chatOptions.currentUserOption.accountID,
106122
shouldAddCurrentUserPostfix: true,
107123
personalDetailsData: personalDetails,
108124
});
109-
if (selectedCurrentUser) {
110-
selectedCurrentUser.text = formattedName;
111-
} else {
112-
chatOptions.currentUserOption.text = formattedName;
113-
chatOptions.recentReports = [chatOptions.currentUserOption, ...chatOptions.recentReports];
114-
}
125+
chatOptions.currentUserOption.text = formattedName;
126+
127+
newSections.push({
128+
title: '',
129+
data: [chatOptions.currentUserOption],
130+
shouldShow: true,
131+
});
115132
}
116133

117134
newSections.push(formattedResults.section);

src/components/TransactionItemRow/DataCells/ChatBubbleCell.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
99
import useStyleUtils from '@hooks/useStyleUtils';
1010
import useTheme from '@hooks/useTheme';
1111
import useThemeStyles from '@hooks/useThemeStyles';
12+
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
1213
import {getIOUActionForTransactionID} from '@libs/ReportActionsUtils';
1314
import {isChatThread} from '@libs/ReportUtils';
1415
import variables from '@styles/variables';
@@ -23,7 +24,9 @@ function ChatBubbleCell({transaction, containerStyles, isInSingleTransactionRepo
2324
const theme = useTheme();
2425
const styles = useThemeStyles();
2526
const {shouldUseNarrowLayout} = useResponsiveLayout();
26-
const [iouReportAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transaction.reportID}`, {
27+
const nonEmptyStringTransactionReportID = getNonEmptyStringOnyxID(transaction.reportID);
28+
29+
const [iouReportAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${nonEmptyStringTransactionReportID}`, {
2730
selector: (reportActions) => getIOUActionForTransactionID(Object.values(reportActions ?? {}), transaction.transactionID),
2831
canBeMissing: true,
2932
});
@@ -32,7 +35,7 @@ function ChatBubbleCell({transaction, containerStyles, isInSingleTransactionRepo
3235
canBeMissing: true,
3336
});
3437

35-
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transaction.reportID}`, {
38+
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${nonEmptyStringTransactionReportID}`, {
3639
canBeMissing: false,
3740
});
3841

0 commit comments

Comments
 (0)