Skip to content

Commit a451de4

Browse files
authored
Merge pull request Expensify#42772 from margelo/@chrispader/after-revert-bump-onyx-to-2-0-42
Bump onyx to 2.0.48 (after revert)
2 parents ec3ad80 + e115cdc commit a451de4

File tree

103 files changed

+689
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+689
-679
lines changed

package-lock.json

+10-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"react-native-linear-gradient": "^2.8.1",
156156
"react-native-localize": "^2.2.6",
157157
"react-native-modal": "^13.0.0",
158-
"react-native-onyx": "2.0.32",
158+
"react-native-onyx": "2.0.48",
159159
"react-native-pager-view": "6.2.3",
160160
"react-native-pdf": "6.7.3",
161161
"react-native-performance": "^5.1.0",
@@ -293,7 +293,7 @@
293293
"ts-jest": "^29.1.2",
294294
"ts-node": "^10.9.2",
295295
"type-fest": "^4.10.2",
296-
"typescript": "^5.3.2",
296+
"typescript": "^5.4.5",
297297
"wait-port": "^0.2.9",
298298
"webpack": "^5.76.0",
299299
"webpack-bundle-analyzer": "^4.5.0",

src/components/AddressForm.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import useLocalize from '@hooks/useLocalize';
44
import useThemeStyles from '@hooks/useThemeStyles';
55
import * as ErrorUtils from '@libs/ErrorUtils';
66
import type {MaybePhraseKey} from '@libs/Localize';
7-
import Navigation from '@libs/Navigation/Navigation';
87
import * as ValidationUtils from '@libs/ValidationUtils';
98
import CONST from '@src/CONST';
109
import type {Country} from '@src/CONST';
@@ -149,8 +148,6 @@ function AddressForm({
149148
label={translate('common.addressLine', {lineNumber: 1})}
150149
onValueChange={(data: unknown, key: unknown) => {
151150
onAddressChanged(data, key);
152-
// This enforces the country selector to use the country from address instead of the country from URL
153-
Navigation.setParams({country: undefined});
154151
}}
155152
defaultValue={street1}
156153
renamedInputKeys={{

src/components/AttachmentModal.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,6 @@ export default withOnyx<AttachmentModalProps, AttachmentModalOnyxProps>({
620620
const transactionID = parentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? parentReportAction?.originalMessage.IOUTransactionID ?? '0' : '0';
621621
return `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`;
622622
},
623-
initWithStoredValues: false,
624623
},
625624
})(memo(AttachmentModal));
626625

src/components/AvatarWithDisplayName.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {useCallback, useEffect, useRef} from 'react';
22
import {View} from 'react-native';
3-
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
3+
import type {OnyxEntry} from 'react-native-onyx';
44
import {withOnyx} from 'react-native-onyx';
55
import type {ValueOf} from 'type-fest';
66
import useStyleUtils from '@hooks/useStyleUtils';
@@ -12,7 +12,7 @@ import * as ReportUtils from '@libs/ReportUtils';
1212
import CONST from '@src/CONST';
1313
import ONYXKEYS from '@src/ONYXKEYS';
1414
import ROUTES from '@src/ROUTES';
15-
import type {PersonalDetails, Policy, Report, ReportActions} from '@src/types/onyx';
15+
import type {PersonalDetails, PersonalDetailsList, Policy, Report, ReportActions} from '@src/types/onyx';
1616
import CaretWrapper from './CaretWrapper';
1717
import DisplayNames from './DisplayNames';
1818
import MultipleAvatars from './MultipleAvatars';
@@ -26,7 +26,7 @@ type AvatarWithDisplayNamePropsWithOnyx = {
2626
parentReportActions: OnyxEntry<ReportActions>;
2727

2828
/** Personal details of all users */
29-
personalDetails: OnyxCollection<PersonalDetails>;
29+
personalDetails: OnyxEntry<PersonalDetailsList>;
3030
};
3131

3232
type AvatarWithDisplayNameProps = AvatarWithDisplayNamePropsWithOnyx & {

src/components/HeaderWithBackButton/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function HeaderWithBackButton({
3030
onCloseButtonPress = () => Navigation.dismissModal(),
3131
onDownloadButtonPress = () => {},
3232
onThreeDotsButtonPress = () => {},
33-
report = null,
33+
report,
3434
policy,
3535
policyAvatar,
3636
shouldShowReportAvatarWithDisplay = false,

src/components/KYCWall/BaseKYCWall.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function KYCWall({
166166

167167
transferBalanceButtonRef.current = targetElement;
168168

169-
const isExpenseReport = ReportUtils.isExpenseReport(iouReport ?? null);
169+
const isExpenseReport = ReportUtils.isExpenseReport(iouReport);
170170
const paymentCardList = fundList ?? {};
171171

172172
// Check to see if user has a valid payment method on file and display the add payment popover if they don't

src/components/KeyboardAvoidingView/index.ios.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import React from 'react';
55
import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native';
6-
import type KeyboardAvoidingViewProps from './types';
6+
import type {KeyboardAvoidingViewProps} from './types';
77

88
function KeyboardAvoidingView(props: KeyboardAvoidingViewProps) {
99
// eslint-disable-next-line react/jsx-props-no-spreading

src/components/KeyboardAvoidingView/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import React from 'react';
55
import {View} from 'react-native';
6-
import type KeyboardAvoidingViewProps from './types';
6+
import type {KeyboardAvoidingViewProps} from './types';
77

88
function KeyboardAvoidingView(props: KeyboardAvoidingViewProps) {
99
const {behavior, contentContainerStyle, enabled, keyboardVerticalOffset, ...rest} = props;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
import {KeyboardAvoidingViewProps} from 'react-native';
1+
import type {KeyboardAvoidingViewProps} from 'react-native';
22

3-
export default KeyboardAvoidingViewProps;
3+
// eslint-disable-next-line import/prefer-default-export
4+
export type {KeyboardAvoidingViewProps};

src/components/LHNOptionsList/LHNOptionsList.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
9898
*/
9999
const renderItem = useCallback(
100100
({item: reportID}: RenderItemProps): ReactElement => {
101-
const itemFullReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`] ?? null;
102-
const itemReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`] ?? null;
103-
const itemParentReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${itemFullReport?.parentReportID}`] ?? null;
104-
const itemParentReportAction = itemParentReportActions?.[itemFullReport?.parentReportActionID ?? ''] ?? null;
105-
const itemPolicy = policy?.[`${ONYXKEYS.COLLECTION.POLICY}${itemFullReport?.policyID}`] ?? null;
101+
const itemFullReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
102+
const itemReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`];
103+
const itemParentReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${itemFullReport?.parentReportID}`];
104+
const itemParentReportAction = itemParentReportActions?.[itemFullReport?.parentReportActionID ?? ''];
105+
const itemPolicy = policy?.[`${ONYXKEYS.COLLECTION.POLICY}${itemFullReport?.policyID}`];
106106
const transactionID = itemParentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? itemParentReportAction.originalMessage.IOUTransactionID ?? '' : '';
107-
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`] ?? null;
107+
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`];
108108
const hasDraftComment = DraftCommentUtils.isValidDraftComment(draftComments?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`]);
109109
const sortedReportActions = ReportActionsUtils.getSortedReportActionsForDisplay(itemReportActions);
110110
const lastReportAction = sortedReportActions[0];

src/components/LHNOptionsList/OptionRowLHN.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
123123
const formattedDate = DateUtils.getStatusUntilDate(statusClearAfterDate);
124124
const statusContent = formattedDate ? `${statusText ? `${statusText} ` : ''}(${formattedDate})` : statusText;
125125
const report = ReportUtils.getReport(optionItem.reportID ?? '');
126-
const isStatusVisible = !!emojiCode && ReportUtils.isOneOnOneChat(!isEmptyObject(report) ? report : null);
126+
const isStatusVisible = !!emojiCode && ReportUtils.isOneOnOneChat(!isEmptyObject(report) ? report : undefined);
127127

128128
const isGroupChat = ReportUtils.isGroupChat(optionItem) || ReportUtils.isDeprecatedGroupDM(optionItem);
129129

src/components/LHNOptionsList/OptionRowLHNData.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function OptionRowLHNData({
3535

3636
const optionItemRef = useRef<OptionData>();
3737

38-
const shouldDisplayViolations = canUseViolations && ReportUtils.shouldDisplayTransactionThreadViolations(fullReport, transactionViolations, parentReportAction ?? null);
38+
const shouldDisplayViolations = canUseViolations && ReportUtils.shouldDisplayTransactionThreadViolations(fullReport, transactionViolations, parentReportAction);
3939

4040
const optionItem = useMemo(() => {
4141
// Note: ideally we'd have this as a dependent selector in onyx!

src/components/MoneyRequestConfirmationList.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ type MoneyRequestConfirmationListProps = MoneyRequestConfirmationListOnyxProps &
133133
selectedParticipants: Participant[];
134134

135135
/** Payee of the expense with login */
136-
payeePersonalDetails?: OnyxEntry<OnyxTypes.PersonalDetails>;
136+
payeePersonalDetails?: OnyxEntry<OnyxTypes.PersonalDetails> | null;
137137

138138
/** Should the list be read only, and not editable? */
139139
isReadOnly?: boolean;
@@ -184,7 +184,7 @@ type MoneyRequestConfirmationListProps = MoneyRequestConfirmationListOnyxProps &
184184
type MoneyRequestConfirmationListItem = Participant | ReportUtils.OptionData;
185185

186186
function MoneyRequestConfirmationList({
187-
transaction = null,
187+
transaction,
188188
onSendMoney,
189189
onConfirm,
190190
iouType = CONST.IOU.TYPE.SUBMIT,
@@ -709,7 +709,7 @@ function MoneyRequestConfirmationList({
709709
if (selectedParticipants.length === 0) {
710710
return;
711711
}
712-
if (!isEditingSplitBill && isMerchantRequired && (isMerchantEmpty || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction ?? null)))) {
712+
if (!isEditingSplitBill && isMerchantRequired && (isMerchantEmpty || (shouldDisplayFieldError && TransactionUtils.isMerchantMissing(transaction)))) {
713713
setFormError('iou.error.invalidMerchant');
714714
return;
715715
}
@@ -739,7 +739,7 @@ function MoneyRequestConfirmationList({
739739
return;
740740
}
741741

742-
if (isEditingSplitBill && TransactionUtils.areRequiredFieldsEmpty(transaction ?? null)) {
742+
if (isEditingSplitBill && TransactionUtils.areRequiredFieldsEmpty(transaction)) {
743743
setDidConfirmSplit(true);
744744
setFormError('iou.error.genericSmartscanFailureMessage');
745745
return;
@@ -861,8 +861,8 @@ function MoneyRequestConfirmationList({
861861
style={[styles.moneyRequestMenuItem, styles.mt2]}
862862
titleStyle={styles.moneyRequestConfirmationAmount}
863863
disabled={didConfirm}
864-
brickRoadIndicator={shouldDisplayFieldError && TransactionUtils.isAmountMissing(transaction ?? null) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
865-
errorText={shouldDisplayFieldError && TransactionUtils.isAmountMissing(transaction ?? null) ? translate('common.error.enterAmount') : ''}
864+
brickRoadIndicator={shouldDisplayFieldError && TransactionUtils.isAmountMissing(transaction) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
865+
errorText={shouldDisplayFieldError && TransactionUtils.isAmountMissing(transaction) ? translate('common.error.enterAmount') : ''}
866866
/>
867867
),
868868
shouldShow: shouldShowSmartScanFields,
@@ -1096,7 +1096,7 @@ function MoneyRequestConfirmationList({
10961096
isThumbnail,
10971097
fileExtension,
10981098
isLocalFile,
1099-
} = receiptPath && receiptFilename ? ReceiptUtils.getThumbnailAndImageURIs(transaction ?? null, receiptPath, receiptFilename) : ({} as ReceiptUtils.ThumbnailAndImageURI);
1099+
} = receiptPath && receiptFilename ? ReceiptUtils.getThumbnailAndImageURIs(transaction, receiptPath, receiptFilename) : ({} as ReceiptUtils.ThumbnailAndImageURI);
11001100

11011101
const resolvedThumbnail = isLocalFile ? receiptThumbnail : tryResolveUrlFromApiRoot(receiptThumbnail ?? '');
11021102
const resolvedReceiptImage = isLocalFile ? receiptImage : tryResolveUrlFromApiRoot(receiptImage ?? '');

src/components/ShowContextMenuContext.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ type ShowContextMenuContextProps = {
1919

2020
const ShowContextMenuContext = createContext<ShowContextMenuContextProps>({
2121
anchor: null,
22-
report: null,
23-
action: null,
24-
transactionThreadReport: null,
22+
report: undefined,
23+
action: undefined,
24+
transactionThreadReport: undefined,
2525
checkIfContextMenuActive: () => {},
2626
});
2727

src/languages/types.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {ReportAction} from '@src/types/onyx';
1+
import type {OnyxInputOrEntry, ReportAction} from '@src/types/onyx';
22
import type {Unit} from '@src/types/onyx/Policy';
33
import type en from './en';
44

@@ -40,15 +40,15 @@ type LocalTimeParams = {
4040
};
4141

4242
type EditActionParams = {
43-
action: ReportAction | null;
43+
action: OnyxInputOrEntry<ReportAction>;
4444
};
4545

4646
type DeleteActionParams = {
47-
action: ReportAction | null;
47+
action: OnyxInputOrEntry<ReportAction>;
4848
};
4949

5050
type DeleteConfirmationParams = {
51-
action: ReportAction | null;
51+
action: OnyxInputOrEntry<ReportAction>;
5252
};
5353

5454
type BeginningOfChatHistoryDomainRoomPartOneParams = {
@@ -299,11 +299,10 @@ type DistanceRateOperationsParams = {count: number};
299299
type ReimbursementRateParams = {unit: Unit};
300300

301301
export type {
302-
AdminCanceledRequestParams,
303-
ApprovedAmountParams,
304302
AddressLineParams,
303+
AdminCanceledRequestParams,
305304
AlreadySignedInParams,
306-
UserSplitParams,
305+
ApprovedAmountParams,
307306
BeginningOfChatHistoryAdminRoomPartOneParams,
308307
BeginningOfChatHistoryAnnounceRoomPartOneParams,
309308
BeginningOfChatHistoryAnnounceRoomPartTwo,
@@ -324,8 +323,10 @@ export type {
324323
FormattedMaxLengthParams,
325324
GoBackMessageParams,
326325
GoToRoomParams,
326+
HeldRequestParams,
327327
InstantSummaryParams,
328328
LocalTimeParams,
329+
LogSizeParams,
329330
LoggedInAsParams,
330331
ManagerApprovedAmountParams,
331332
ManagerApprovedParams,
@@ -339,11 +340,13 @@ export type {
339340
PaidElsewhereWithAmountParams,
340341
PaidWithExpensifyWithAmountParams,
341342
ParentNavigationSummaryParams,
343+
PaySomeoneParams,
342344
PayerOwesAmountParams,
343345
PayerOwesParams,
344346
PayerPaidAmountParams,
345347
PayerPaidParams,
346348
PayerSettledParams,
349+
ReimbursementRateParams,
347350
RemovedTheRequestParams,
348351
RenamedRoomActionParams,
349352
ReportArchiveReasonsClosedParams,
@@ -375,7 +378,9 @@ export type {
375378
UntilTimeParams,
376379
UpdatedTheDistanceParams,
377380
UpdatedTheRequestParams,
381+
UsePlusButtonParams,
378382
UserIsAlreadyMemberParams,
383+
UserSplitParams,
379384
ViolationsAutoReportedRejectedExpenseParams,
380385
ViolationsCashExpenseWithNoReceiptParams,
381386
ViolationsConversionSurchargeParams,
@@ -392,14 +397,9 @@ export type {
392397
ViolationsTaxOutOfPolicyParams,
393398
WaitingOnBankAccountParams,
394399
WalletProgramParams,
395-
UsePlusButtonParams,
396400
WeSentYouMagicSignInLinkParams,
397401
WelcomeEnterMagicCodeParams,
398402
WelcomeNoteParams,
399403
WelcomeToRoomParams,
400404
ZipCodeExampleFormatParams,
401-
LogSizeParams,
402-
HeldRequestParams,
403-
PaySomeoneParams,
404-
ReimbursementRateParams,
405405
};

0 commit comments

Comments
 (0)