From 7f27d611f3a22361e39fa3ddac20ad3a587fcaf0 Mon Sep 17 00:00:00 2001 From: dominictb Date: Fri, 9 May 2025 16:56:24 +0700 Subject: [PATCH 1/3] fix spellings in src/libs --- cspell.json | 2 + src/CONST.ts | 32 ++++++++-------- src/ROUTES.ts | 6 +-- ...ams.ts => AddCommentOrAttachmentParams.ts} | 4 +- .../ChangeTransactionsReportParams.ts | 2 +- .../CreateAppleDigitalWalletParams.ts | 4 +- ...Params.ts => RenamePolicyTagListParams.ts} | 4 +- src/libs/API/parameters/index.ts | 4 +- src/libs/API/types.ts | 14 +++---- src/libs/Authentication.ts | 4 +- src/libs/CardUtils.ts | 2 +- src/libs/DateUtils.ts | 4 +- src/libs/DebugUtils.ts | 2 +- src/libs/Fullstory/index.native.ts | 2 +- src/libs/IOUUtils.ts | 6 +-- src/libs/InputUtils/index.native.ts | 4 +- src/libs/InputUtils/index.ts | 4 +- src/libs/InputUtils/types.ts | 4 +- src/libs/Middleware/Logging.ts | 2 +- src/libs/Middleware/SaveResponseInOnyx.ts | 2 +- .../Navigation/AppNavigator/AuthScreens.tsx | 6 +-- .../ModalStackNavigators/index.tsx | 2 +- .../createSplitNavigator/SplitRouter.ts | 2 +- .../useNavigationResetOnLayoutChange.ts | 2 +- src/libs/Navigation/Navigation.ts | 2 +- src/libs/Navigation/OnyxTabNavigator.tsx | 2 +- .../types/NavigationBuilder.ts | 2 +- src/libs/Navigation/linkingConfig/config.ts | 2 +- .../clearReportNotifications/index.native.ts | 2 +- src/libs/OptionsListUtils.ts | 2 +- src/libs/PersonalDetailsUtils.ts | 2 +- src/libs/PolicyUtils.ts | 14 +++---- src/libs/Pusher/index.native.ts | 2 +- src/libs/Pusher/index.ts | 6 +-- src/libs/Pusher/types.ts | 4 +- src/libs/PusherConnectionManager.ts | 2 +- src/libs/ReportActionsUtils.ts | 10 ++--- src/libs/ReportPreviewActionUtils.ts | 4 +- src/libs/ReportPrimaryActionUtils.ts | 4 +- src/libs/ReportSecondaryActionUtils.ts | 10 ++--- src/libs/ReportUtils.ts | 38 ++++++++++--------- src/libs/SearchQueryUtils.ts | 5 ++- src/libs/SearchUIUtils.ts | 2 +- src/libs/SidebarUtils.ts | 6 +-- src/libs/SubscriptionUtils.ts | 14 +++---- src/libs/TaxOptionsListUtils.ts | 6 +-- src/libs/TransactionUtils/index.ts | 18 ++++----- src/libs/Violations/ViolationsUtils.ts | 2 +- src/libs/WorkspacesSettingsUtils.ts | 2 +- src/libs/actions/App.ts | 2 +- src/libs/actions/BankAccounts.ts | 4 +- src/libs/actions/Delegate.ts | 2 +- src/libs/actions/IOU.ts | 28 +++++++------- src/libs/actions/Modal.ts | 2 +- .../configs/conciergeChatReportID.ts | 2 +- .../OnyxDerived/configs/reportAttributes.ts | 4 +- .../utils/DeferredOnyxUpdates.ts | 4 +- src/libs/actions/PersonalDetails.ts | 10 ++--- src/libs/actions/Policy/Policy.ts | 4 +- src/libs/actions/Policy/Tag.ts | 10 ++--- src/libs/actions/Report.ts | 22 +++++------ .../actions/RoomMembersUserSearchPhrase.ts | 2 +- .../Session/AttachmentImageReauthenticator.ts | 2 +- src/libs/actions/Session/index.ts | 4 +- src/libs/actions/Subscription.ts | 2 +- src/libs/actions/Transaction.ts | 28 +++++++------- src/libs/actions/User.ts | 24 ++++++------ src/libs/actions/connections/index.ts | 2 +- src/libs/asyncOpenURL/index.ts | 2 +- src/libs/asyncOpenURL/index.website.ts | 4 +- src/libs/convertToLTRForComposer/index.ts | 2 +- src/libs/fileDownload/index.ios.ts | 2 +- src/libs/getPlatform/index.ts | 2 +- .../NonUSD/SignerInfo/index.tsx | 8 ++-- src/pages/ScheduleCall/ScheduleCallPage.tsx | 2 +- src/pages/Share/SubmitDetailsPage.tsx | 2 +- src/pages/TransactionReceiptPage.tsx | 2 +- .../report/ContextMenu/ContextMenuActions.tsx | 4 +- .../home/report/PureReportActionItem.tsx | 4 +- src/pages/home/report/ReportFooter.tsx | 2 +- src/pages/iou/SplitBillDetailsPage.tsx | 2 +- .../step/IOURequestStepConfirmation.tsx | 4 +- .../step/IOURequestStepScan/index.native.tsx | 2 +- .../request/step/IOURequestStepScan/index.tsx | 4 +- .../SubscriptionPlan/SubscriptionPlanCard.tsx | 6 +-- .../SubscriptionPlanCardActionButton.tsx | 6 +-- .../SubscriptionSettings/index.native.tsx | 2 +- .../SubscriptionSettings/index.tsx | 4 +- .../WorkspaceOverviewPlanTypePage.tsx | 6 +-- .../workspace/tags/WorkspaceEditTagsPage.tsx | 4 +- tests/actions/IOUTest.ts | 18 ++++----- tests/actions/PolicyTagTest.ts | 6 +-- tests/actions/ReportPreviewActionUtilsTest.ts | 2 +- tests/unit/TransactionUtilsTest.ts | 2 +- 94 files changed, 276 insertions(+), 269 deletions(-) rename src/libs/API/parameters/{AddCommentOrAttachementParams.ts => AddCommentOrAttachmentParams.ts} (79%) rename src/libs/API/parameters/{RenamePolicyTaglistParams.ts => RenamePolicyTagListParams.ts} (54%) diff --git a/cspell.json b/cspell.json index 5a9e4543b048..47eaa637866d 100644 --- a/cspell.json +++ b/cspell.json @@ -170,6 +170,7 @@ "exchrate", "exfy", "exitstatus", + "Expensable", "expensescount", "Expensi", "Expensicon", @@ -511,6 +512,7 @@ "stdev", "stdlib", "storepass", + "STORYLANE", "strikethrough", "Strikethrough", "subcomponents", diff --git a/src/CONST.ts b/src/CONST.ts index 42205e316765..36f66298f1ee 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -853,7 +853,7 @@ const CONST = { ANDROID: 'android', WEB: 'web', DESKTOP: 'desktop', - MOBILEWEB: 'mobileweb', + MOBILE_WEB: 'mobileweb', }, PLATFORM_SPECIFIC_KEYS: { CTRL: { @@ -1187,7 +1187,7 @@ const CONST = { MAX_COUNT_BEFORE_FOCUS_UPDATE: 30, MIN_INITIAL_REPORT_ACTION_COUNT: 15, UNREPORTED_REPORT_ID: '0', - SPLIT_REPORTID: '-2', + SPLIT_REPORT_ID: '-2', SECONDARY_ACTIONS: { SUBMIT: 'submit', APPROVE: 'approve', @@ -1699,7 +1699,7 @@ const CONST = { UNKNOWN_ERROR: 'Unknown error', REQUEST_CANCELLED: 'AbortError', FAILED_TO_FETCH: 'Failed to fetch', - ENSURE_BUGBOT: 'ENSURE_BUGBOT', + ENSURE_BUG_BOT: 'ENSURE_BUG_BOT', PUSHER_ERROR: 'PusherError', WEB_SOCKET_ERROR: 'WebSocketError', NETWORK_REQUEST_FAILED: 'Network request failed', @@ -1983,7 +1983,7 @@ const CONST = { // Video MimeTypes allowed by iOS photos app. VIDEO: /\.(mov|mp4)$/, }, - IOS_CAMERAROLL_ACCESS_ERROR: 'Access to photo library was denied', + IOS_CAMERA_ROLL_ACCESS_ERROR: 'Access to photo library was denied', ADD_PAYMENT_MENU_POSITION_Y: 226, ADD_PAYMENT_MENU_POSITION_X: 356, EMOJI_PICKER_ITEM_TYPES: { @@ -2752,11 +2752,11 @@ const CONST = { AMOUNT_MAX_LENGTH: 8, DISTANCE_REQUEST_AMOUNT_MAX_LENGTH: 14, RECEIPT_STATE: { - SCANREADY: 'SCANREADY', + SCAN_READY: 'SCANREADY', OPEN: 'OPEN', SCANNING: 'SCANNING', - SCANCOMPLETE: 'SCANCOMPLETE', - SCANFAILED: 'SCANFAILED', + SCAN_COMPLETE: 'SCANCOMPLETE', + SCAN_FAILED: 'SCANFAILED', }, FILE_TYPES: { HTML: 'html', @@ -3392,7 +3392,7 @@ const CONST = { PRICING_TYPE_2025: 'team2025Pricing', TYPE: { ANNUAL: 'yearly2018', - PAYPERUSE: 'monthly2018', + PAY_PER_USE: 'monthly2018', }, }, get SUBSCRIPTION_PRICES() { @@ -3400,44 +3400,44 @@ const CONST = { [this.PAYMENT_CARD_CURRENCY.USD]: { [this.POLICY.TYPE.CORPORATE]: { [this.SUBSCRIPTION.TYPE.ANNUAL]: 900, - [this.SUBSCRIPTION.TYPE.PAYPERUSE]: 1800, + [this.SUBSCRIPTION.TYPE.PAY_PER_USE]: 1800, }, [this.POLICY.TYPE.TEAM]: { [this.SUBSCRIPTION.TYPE.ANNUAL]: 500, - [this.SUBSCRIPTION.TYPE.PAYPERUSE]: 1000, + [this.SUBSCRIPTION.TYPE.PAY_PER_USE]: 1000, [this.SUBSCRIPTION.PRICING_TYPE_2025]: 500, }, }, [this.PAYMENT_CARD_CURRENCY.AUD]: { [this.POLICY.TYPE.CORPORATE]: { [this.SUBSCRIPTION.TYPE.ANNUAL]: 1500, - [this.SUBSCRIPTION.TYPE.PAYPERUSE]: 3000, + [this.SUBSCRIPTION.TYPE.PAY_PER_USE]: 3000, }, [this.POLICY.TYPE.TEAM]: { [this.SUBSCRIPTION.TYPE.ANNUAL]: 700, - [this.SUBSCRIPTION.TYPE.PAYPERUSE]: 1400, + [this.SUBSCRIPTION.TYPE.PAY_PER_USE]: 1400, [this.SUBSCRIPTION.PRICING_TYPE_2025]: 800, }, }, [this.PAYMENT_CARD_CURRENCY.GBP]: { [this.POLICY.TYPE.CORPORATE]: { [this.SUBSCRIPTION.TYPE.ANNUAL]: 700, - [this.SUBSCRIPTION.TYPE.PAYPERUSE]: 1400, + [this.SUBSCRIPTION.TYPE.PAY_PER_USE]: 1400, }, [this.POLICY.TYPE.TEAM]: { [this.SUBSCRIPTION.TYPE.ANNUAL]: 400, - [this.SUBSCRIPTION.TYPE.PAYPERUSE]: 800, + [this.SUBSCRIPTION.TYPE.PAY_PER_USE]: 800, [this.SUBSCRIPTION.PRICING_TYPE_2025]: 500, }, }, [this.PAYMENT_CARD_CURRENCY.NZD]: { [this.POLICY.TYPE.CORPORATE]: { [this.SUBSCRIPTION.TYPE.ANNUAL]: 1600, - [this.SUBSCRIPTION.TYPE.PAYPERUSE]: 3200, + [this.SUBSCRIPTION.TYPE.PAY_PER_USE]: 3200, }, [this.POLICY.TYPE.TEAM]: { [this.SUBSCRIPTION.TYPE.ANNUAL]: 800, - [this.SUBSCRIPTION.TYPE.PAYPERUSE]: 1600, + [this.SUBSCRIPTION.TYPE.PAY_PER_USE]: 1600, [this.SUBSCRIPTION.PRICING_TYPE_2025]: 900, }, }, diff --git a/src/ROUTES.ts b/src/ROUTES.ts index b0e2d6d83ff0..139a73bd06ae 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -2493,9 +2493,9 @@ const ROUTES = { route: 'r/:reportID/schedule-call/book', getRoute: (reportID: string) => `r/${reportID}/schedule-call/book` as const, }, - SCHEDULE_CALL_CONFIRMATON: { - route: 'r/:reportID/schedule-call/confimation', - getRoute: (reportID: string) => `r/${reportID}/schedule-call/confimation` as const, + SCHEDULE_CALL_CONFIRMATION: { + route: 'r/:reportID/schedule-call/confirmation', + getRoute: (reportID: string) => `r/${reportID}/schedule-call/confirmation` as const, }, } as const; diff --git a/src/libs/API/parameters/AddCommentOrAttachementParams.ts b/src/libs/API/parameters/AddCommentOrAttachmentParams.ts similarity index 79% rename from src/libs/API/parameters/AddCommentOrAttachementParams.ts rename to src/libs/API/parameters/AddCommentOrAttachmentParams.ts index d1b653f26de1..b2ee6bbc6661 100644 --- a/src/libs/API/parameters/AddCommentOrAttachementParams.ts +++ b/src/libs/API/parameters/AddCommentOrAttachmentParams.ts @@ -1,6 +1,6 @@ import type {FileObject} from '@components/AttachmentModal'; -type AddCommentOrAttachementParams = { +type AddCommentOrAttachmentParams = { reportID: string; reportActionID?: string; commentReportActionID?: string | null; @@ -12,4 +12,4 @@ type AddCommentOrAttachementParams = { idempotencyKey?: string; }; -export default AddCommentOrAttachementParams; +export default AddCommentOrAttachmentParams; diff --git a/src/libs/API/parameters/ChangeTransactionsReportParams.ts b/src/libs/API/parameters/ChangeTransactionsReportParams.ts index e9e3a0fb15aa..05dfcdb496ab 100644 --- a/src/libs/API/parameters/ChangeTransactionsReportParams.ts +++ b/src/libs/API/parameters/ChangeTransactionsReportParams.ts @@ -1,5 +1,5 @@ /** - * A map linking the optimistic MOVEDTRANSACTION or UNREPORTEDTRANSACTION reportActionID to the transactionID. + * A map linking the optimistic MOVED_TRANSACTION or UNREPORTED_TRANSACTION reportActionID to the transactionID. * If we're creating the transactionThread as part of moving the transaction, we should also send the optimistic * transactionThreadReportID and transactionThreadCreatedReportActionID */ diff --git a/src/libs/API/parameters/CreateAppleDigitalWalletParams.ts b/src/libs/API/parameters/CreateAppleDigitalWalletParams.ts index 702687c23c17..e030f3e1e01c 100644 --- a/src/libs/API/parameters/CreateAppleDigitalWalletParams.ts +++ b/src/libs/API/parameters/CreateAppleDigitalWalletParams.ts @@ -1,4 +1,4 @@ -type CreateAppleSigitalWalletParams = { +type CreateAppleDigitalWalletParams = { platform: string; appVersion: string; // stringified {"certificates": string[]} @@ -7,4 +7,4 @@ type CreateAppleSigitalWalletParams = { nonceSignature: string; }; -export default CreateAppleSigitalWalletParams; +export default CreateAppleDigitalWalletParams; diff --git a/src/libs/API/parameters/RenamePolicyTaglistParams.ts b/src/libs/API/parameters/RenamePolicyTagListParams.ts similarity index 54% rename from src/libs/API/parameters/RenamePolicyTaglistParams.ts rename to src/libs/API/parameters/RenamePolicyTagListParams.ts index dd7d08209d32..dafcf28afded 100644 --- a/src/libs/API/parameters/RenamePolicyTaglistParams.ts +++ b/src/libs/API/parameters/RenamePolicyTagListParams.ts @@ -1,8 +1,8 @@ -type RenamePolicyTaglistParams = { +type RenamePolicyTagListParams = { policyID: string; oldName: string; newName: string; tagListIndex: number; }; -export default RenamePolicyTaglistParams; +export default RenamePolicyTagListParams; diff --git a/src/libs/API/parameters/index.ts b/src/libs/API/parameters/index.ts index 5db0f0d46287..a0040ba88289 100644 --- a/src/libs/API/parameters/index.ts +++ b/src/libs/API/parameters/index.ts @@ -97,7 +97,7 @@ export type {default as ValidateTwoFactorAuthParams} from './ValidateTwoFactorAu export type {default as DisableTwoFactorAuthParams} from './DisableTwoFactorAuthParams'; export type {default as VerifyIdentityForBankAccountParams} from './VerifyIdentityForBankAccountParams'; export type {default as AnswerQuestionsForWalletParams} from './AnswerQuestionsForWalletParams'; -export type {default as AddCommentOrAttachementParams} from './AddCommentOrAttachementParams'; +export type {default as AddCommentOrAttachmentParams} from './AddCommentOrAttachmentParams'; export type {default as ReadNewestActionParams} from './ReadNewestActionParams'; export type {default as MarkAsUnreadParams} from './MarkAsUnreadParams'; export type {default as TogglePinnedChatParams} from './TogglePinnedChatParams'; @@ -187,7 +187,7 @@ export type {default as SetWorkspaceReimbursementParams} from './SetWorkspaceRei export type {default as SetWorkspaceDefaultSpendCategoryParams} from './SetWorkspaceDefaultSpendCategoryParams'; export type {default as SetPolicyRequiresTag} from './SetPolicyRequiresTag'; export type {default as SetPolicyTagsRequired} from './SetPolicyTagsRequired'; -export type {default as RenamePolicyTaglistParams} from './RenamePolicyTaglistParams'; +export type {default as RenamePolicyTagListParams} from './RenamePolicyTagListParams'; export type {default as SwitchToOldDotParams} from './SwitchToOldDotParams'; export type {default as TrackExpenseParams} from './TrackExpenseParams'; export type {default as EnablePolicyCategoriesParams} from './EnablePolicyCategoriesParams'; diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index b4034bde5a13..8f5fbe92f0d2 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -2,7 +2,7 @@ import type {ValueOf} from 'type-fest'; import type CONST from '@src/CONST'; import type {SageIntacctMappingValue} from '@src/types/onyx/Policy'; import type {EmptyObject} from '@src/types/utils/EmptyObject'; -// We have to disable esling for this import because otherwise the import will be 300 lines long +// We have to disable eslint for this import because otherwise the import will be 300 lines long // eslint-disable-next-line no-restricted-syntax import type * as Parameters from './parameters'; import type SignInUserParams from './parameters/SignInUserParams'; @@ -168,7 +168,7 @@ const WRITE_COMMANDS = { DELETE_POLICY_REPORT_FIELD: 'DeletePolicyReportField', SET_POLICY_TAGS_REQUIRED: 'SetPolicyTagsRequired', SET_POLICY_REQUIRES_TAG: 'SetPolicyRequiresTag', - RENAME_POLICY_TAG_LIST: 'RenamePolicyTaglist', + RENAME_POLICY_TAG_LIST: 'renamePolicyTagList', DELETE_POLICY_TAGS: 'DeletePolicyTags', UPDATE_POLICY_TAG_GL_CODE: 'UpdatePolicyTagGLCode', CREATE_TASK: 'CreateTask', @@ -558,10 +558,10 @@ type WriteCommandParameters = { [WRITE_COMMANDS.UNLINK_LOGIN]: Parameters.UnlinkLoginParams; [WRITE_COMMANDS.ENABLE_TWO_FACTOR_AUTH]: null; [WRITE_COMMANDS.DISABLE_TWO_FACTOR_AUTH]: Parameters.DisableTwoFactorAuthParams; - [WRITE_COMMANDS.ADD_COMMENT]: Parameters.AddCommentOrAttachementParams; - [WRITE_COMMANDS.ADD_ATTACHMENT]: Parameters.AddCommentOrAttachementParams; + [WRITE_COMMANDS.ADD_COMMENT]: Parameters.AddCommentOrAttachmentParams; + [WRITE_COMMANDS.ADD_ATTACHMENT]: Parameters.AddCommentOrAttachmentParams; [WRITE_COMMANDS.CREATE_APP_REPORT]: Parameters.CreateAppReportParams; - [WRITE_COMMANDS.ADD_TEXT_AND_ATTACHMENT]: Parameters.AddCommentOrAttachementParams; + [WRITE_COMMANDS.ADD_TEXT_AND_ATTACHMENT]: Parameters.AddCommentOrAttachmentParams; [WRITE_COMMANDS.CONNECT_BANK_ACCOUNT_WITH_PLAID]: Parameters.ConnectBankAccountParams; [WRITE_COMMANDS.ADD_PERSONAL_BANK_ACCOUNT]: Parameters.AddPersonalBankAccountParams; [WRITE_COMMANDS.RESTART_BANK_ACCOUNT_SETUP]: Parameters.RestartBankAccountSetupParams; @@ -628,7 +628,7 @@ type WriteCommandParameters = { [WRITE_COMMANDS.DELETE_POLICY_REPORT_FIELD]: Parameters.DeletePolicyReportField; [WRITE_COMMANDS.SET_POLICY_REQUIRES_TAG]: Parameters.SetPolicyRequiresTag; [WRITE_COMMANDS.SET_POLICY_TAGS_REQUIRED]: Parameters.SetPolicyTagsRequired; - [WRITE_COMMANDS.RENAME_POLICY_TAG_LIST]: Parameters.RenamePolicyTaglistParams; + [WRITE_COMMANDS.RENAME_POLICY_TAG_LIST]: Parameters.RenamePolicyTagListParams; [WRITE_COMMANDS.CREATE_POLICY_TAG]: Parameters.CreatePolicyTagsParams; [WRITE_COMMANDS.RENAME_POLICY_TAG]: Parameters.RenamePolicyTagsParams; [WRITE_COMMANDS.UPDATE_POLICY_TAG_GL_CODE]: Parameters.UpdatePolicyTagGLCodeParams; @@ -955,7 +955,7 @@ type WriteCommandParameters = { [WRITE_COMMANDS.JOIN_ACCESSIBLE_POLICY]: Parameters.JoinAccessiblePolicyParams; [WRITE_COMMANDS.ASK_TO_JOIN_POLICY]: Parameters.AskToJoinPolicyParams; - // Dismis Product Training + // Dismiss Product Training [WRITE_COMMANDS.DISMISS_PRODUCT_TRAINING]: Parameters.DismissProductTrainingParams; [WRITE_COMMANDS.ADD_WORK_EMAIL]: Parameters.AddWorkEmailParams; diff --git a/src/libs/Authentication.ts b/src/libs/Authentication.ts index 1237e681d7cf..15067d709072 100644 --- a/src/libs/Authentication.ts +++ b/src/libs/Authentication.ts @@ -105,10 +105,10 @@ function reauthenticate(command = ''): Promise | undefined { return; } - // If we reauthenticated due to an expired delegate token, restore the delegate's original account. + // If we reauthenticate due to an expired delegate token, restore the delegate's original account. // This is because the credentials used to reauthenticate were for the delegate's original account, and not for the account they were connected as. if (isConnectedAsDelegate()) { - Log.info('Reauthenticated while connected as a delegate. Restoring original account.'); + Log.info('Reauthenticate while connected as a delegate. Restoring original account.'); restoreDelegateSession(response); return; } diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index aa3f8679612f..9c02abfc8f17 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -325,7 +325,7 @@ function getCardFeedIcon(cardFeed: CompanyCardFeed | typeof CONST.EXPENSIFY_CARD } /** - * Verify if the feed is a custom feed. Those are also refered to as commercial feeds. + * Verify if the feed is a custom feed. Those are also referred to as commercial feeds. */ function isCustomFeed(feed: CompanyCardFeedWithNumber): boolean { return [CONST.COMPANY_CARD.FEED_BANK_NAME.MASTER_CARD, CONST.COMPANY_CARD.FEED_BANK_NAME.VISA, CONST.COMPANY_CARD.FEED_BANK_NAME.AMEX].some((value) => feed.startsWith(value)); diff --git a/src/libs/DateUtils.ts b/src/libs/DateUtils.ts index a07e131aaecc..c9206814fcd7 100644 --- a/src/libs/DateUtils.ts +++ b/src/libs/DateUtils.ts @@ -358,7 +358,7 @@ function getCurrentTimezone(): Required { } /** - * @returns [January, Fabruary, March, April, May, June, July, August, ...] + * @returns [January, February, March, April, May, June, July, August, ...] */ function getMonthNames(preferredLocale: Locale): string[] { if (preferredLocale) { @@ -374,7 +374,7 @@ function getMonthNames(preferredLocale: Locale): string[] { } /** - * @returns [Monday, Thuesday, Wednesday, ...] + * @returns [Monday, Tuesday, Wednesday, ...] */ function getDaysOfWeek(preferredLocale: Locale): string[] { if (preferredLocale) { diff --git a/src/libs/DebugUtils.ts b/src/libs/DebugUtils.ts index ab725d193787..c567e1dbe0d1 100644 --- a/src/libs/DebugUtils.ts +++ b/src/libs/DebugUtils.ts @@ -226,7 +226,7 @@ function onyxDataToDraftData(data: OnyxEntry>) { /** * Whether a string representation is an empty value * - * @param value - string representantion + * @param value - string representation * @returns whether the value is an empty value */ function isEmptyValue(value: string): boolean { diff --git a/src/libs/Fullstory/index.native.ts b/src/libs/Fullstory/index.native.ts index d1f1bc2223d2..12d7282959a5 100644 --- a/src/libs/Fullstory/index.native.ts +++ b/src/libs/Fullstory/index.native.ts @@ -32,7 +32,7 @@ const FS = { * Initializes the FullStory metadata with the provided metadata information. */ consentAndIdentify: (value: OnyxEntry) => { - // On the first subscribe for UserMetadta, this function will be called. We need + // On the first subscribe for UserMetadata, this function will be called. We need // to confirm that we actually have any value here before proceeding. if (!value?.accountID) { return; diff --git a/src/libs/IOUUtils.ts b/src/libs/IOUUtils.ts index e357eed12835..263a67f723c7 100644 --- a/src/libs/IOUUtils.ts +++ b/src/libs/IOUUtils.ts @@ -77,7 +77,7 @@ function updateIOUOwnerAndTotal>( currency: string, isDeleting = false, isUpdating = false, - isOnhold = false, + isOnHold = false, ): TReport { // For the update case, we have calculated the diff amount in the calculateDiffAmount function so there is no need to compare currencies here if ((currency !== iouReport?.currency && !isUpdating) || !iouReport) { @@ -93,12 +93,12 @@ function updateIOUOwnerAndTotal>( if (actorAccountID === iouReport.ownerAccountID) { iouReportUpdate.total += isDeleting ? -amount : amount; - if (!isOnhold) { + if (!isOnHold) { iouReportUpdate.unheldTotal += isDeleting ? -amount : amount; } } else { iouReportUpdate.total += isDeleting ? amount : -amount; - if (!isOnhold) { + if (!isOnHold) { iouReportUpdate.unheldTotal += isDeleting ? amount : -amount; } } diff --git a/src/libs/InputUtils/index.native.ts b/src/libs/InputUtils/index.native.ts index 6cf00877ca9a..7f950f0a49d3 100644 --- a/src/libs/InputUtils/index.native.ts +++ b/src/libs/InputUtils/index.native.ts @@ -1,7 +1,7 @@ -import type {MoveSelectiontoEnd, ScrollInput} from './types'; +import type {MoveSelectionToEnd, ScrollInput} from './types'; const scrollToBottom: ScrollInput = () => {}; const scrollToRight: ScrollInput = () => {}; -const moveSelectionToEnd: MoveSelectiontoEnd = () => {}; +const moveSelectionToEnd: MoveSelectionToEnd = () => {}; export {scrollToBottom, moveSelectionToEnd, scrollToRight}; diff --git a/src/libs/InputUtils/index.ts b/src/libs/InputUtils/index.ts index e992be5ca233..55c3653082e5 100644 --- a/src/libs/InputUtils/index.ts +++ b/src/libs/InputUtils/index.ts @@ -1,4 +1,4 @@ -import type {MoveSelectiontoEnd, ScrollInput} from './types'; +import type {MoveSelectionToEnd, ScrollInput} from './types'; const scrollToBottom: ScrollInput = (input) => { if (!('scrollTop' in input)) { @@ -17,7 +17,7 @@ const scrollToRight: ScrollInput = (input) => { input.scrollLeft = input.scrollWidth; }; -const moveSelectionToEnd: MoveSelectiontoEnd = (input) => { +const moveSelectionToEnd: MoveSelectionToEnd = (input) => { if (!('setSelectionRange' in input)) { return; } diff --git a/src/libs/InputUtils/types.ts b/src/libs/InputUtils/types.ts index 394cdb8722ab..c0be24244475 100644 --- a/src/libs/InputUtils/types.ts +++ b/src/libs/InputUtils/types.ts @@ -1,6 +1,6 @@ import type {TextInput} from 'react-native'; type ScrollInput = (input: HTMLInputElement | TextInput) => void; -type MoveSelectiontoEnd = (input: HTMLInputElement | TextInput) => void; +type MoveSelectionToEnd = (input: HTMLInputElement | TextInput) => void; -export type {ScrollInput, MoveSelectiontoEnd}; +export type {ScrollInput, MoveSelectionToEnd}; diff --git a/src/libs/Middleware/Logging.ts b/src/libs/Middleware/Logging.ts index dc449270ff88..976e67e19b6c 100644 --- a/src/libs/Middleware/Logging.ts +++ b/src/libs/Middleware/Logging.ts @@ -147,7 +147,7 @@ const Logging: Middleware = (response, request) => { Log.info('[Network] API request error: A record already exists with this ID', false, logParams); } else { // If we get any error that is not known log an alert so we can learn more about it and document it here. - Log.alert(`${CONST.ERROR.ENSURE_BUGBOT} unknown API request error caught while processing request`, logParams, false); + Log.alert(`${CONST.ERROR.ENSURE_BUG_BOT} unknown API request error caught while processing request`, logParams, false); } // Re-throw this error so the next handler can manage it diff --git a/src/libs/Middleware/SaveResponseInOnyx.ts b/src/libs/Middleware/SaveResponseInOnyx.ts index 1a092f131e04..2b432cd52608 100644 --- a/src/libs/Middleware/SaveResponseInOnyx.ts +++ b/src/libs/Middleware/SaveResponseInOnyx.ts @@ -17,7 +17,7 @@ const SaveResponseInOnyx: Middleware = (requestResponse, request) => requestResponse.then((response = {}) => { const onyxUpdates = response?.onyxData ?? []; - // Sometimes we call requests that are successfull but they don't have any response or any success/failure/finally data to set. Let's return early since + // Sometimes we call requests that are successful but they don't have any response or any success/failure/finally data to set. Let's return early since // we don't need to store anything here. if (!onyxUpdates && !request.successData && !request.failureData && !request.finallyData) { return Promise.resolve(response); diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 25d245516f67..003c5be0829c 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -484,11 +484,11 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie if (Number.isNaN(clearAfterTime.getTime())) { return; } - const subMilisecondsTime = clearAfterTime.getTime() - currentTime.getTime(); - if (subMilisecondsTime > 0) { + const subMillisecondsTime = clearAfterTime.getTime() - currentTime.getTime(); + if (subMillisecondsTime > 0) { const timeoutID = setTimeout(() => { clearStatus(); - }, subMilisecondsTime); + }, subMillisecondsTime); return () => { clearTimeout(timeoutID); }; diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index bd13b29b1dd4..70511d41ed6f 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -50,7 +50,7 @@ type Screens = Partial React.ComponentType>>; /** * Create a modal stack navigator with an array of sub-screens. * - * @param screens key/value pairs where the key is the name of the screen and the value is a functon that returns the lazy-loaded component + * @param screens key/value pairs where the key is the name of the screen and the value is a function that returns the lazy-loaded component * @param getScreenOptions optional function that returns the screen options, override the default options */ function createModalStackNavigator(screens: Screens, getScreenOptions?: GetModalStackScreenOptions): React.ComponentType { diff --git a/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts b/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts index 03feab84a082..3b695358d804 100644 --- a/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts +++ b/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts @@ -31,7 +31,7 @@ function adaptStateIfNecessary({state, options: {sidebarScreen, defaultCentralSc const lastRoute = state.routes.at(-1) as NavigationPartialRoute; const routePolicyID = getRoutePolicyID(lastRoute); - // If invalid policy page is displayed on narrow layout, sidebar screen should not be pushed to the navigation state to avoid adding reduntant not found page + // If invalid policy page is displayed on narrow layout, sidebar screen should not be pushed to the navigation state to avoid adding redundant not found page if (isNarrowLayout && !!routePolicyID) { if (shouldDisplayPolicyNotFoundPage(routePolicyID)) { return; diff --git a/src/libs/Navigation/AppNavigator/useNavigationResetOnLayoutChange.ts b/src/libs/Navigation/AppNavigator/useNavigationResetOnLayoutChange.ts index 82a085fca2ec..697163b32b76 100644 --- a/src/libs/Navigation/AppNavigator/useNavigationResetOnLayoutChange.ts +++ b/src/libs/Navigation/AppNavigator/useNavigationResetOnLayoutChange.ts @@ -5,7 +5,7 @@ import navigationRef from '@libs/Navigation/navigationRef'; import type {CustomEffectsHookProps} from '@libs/Navigation/PlatformStackNavigation/types'; /** - * This hook resets the navigation root state when changing the layout size, resetting the state calls the getRehydredState method in CustomFullScreenRouter.tsx. + * This hook resets the navigation root state when changing the layout size, resetting the state calls the getRehydratedState method in CustomFullScreenRouter.tsx. * It is also called when the navigator is created to set the initial state correctly. * When the screen size is changed, it is necessary to check whether the application displays the content correctly. * When the app is opened on a small layout and the user resizes it to wide, a second screen has to be present in the navigation state to fill the space. diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 8a204ab436b3..4a955eed2e60 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -268,7 +268,7 @@ type GoBackOptions = { /** * Specifies whether goBack should pop to top when invoked. - * Additionaly, to execute popToTop, set the value of the global variable ShouldPopAllStateOnUP to true using the setShouldPopAllStateOnUP function. + * Additionally, to execute popToTop, set the value of the global variable ShouldPopAllStateOnUP to true using the setShouldPopAllStateOnUP function. */ shouldPopToTop?: boolean; }; diff --git a/src/libs/Navigation/OnyxTabNavigator.tsx b/src/libs/Navigation/OnyxTabNavigator.tsx index 683ed1ae2043..8edad04d27da 100644 --- a/src/libs/Navigation/OnyxTabNavigator.tsx +++ b/src/libs/Navigation/OnyxTabNavigator.tsx @@ -76,7 +76,7 @@ function OnyxTabNavigator({ const [focusTrapContainerElementMapping, setFocusTrapContainerElementMapping] = useState>({}); const [selectedTab, selectedTabResult] = useOnyx(`${ONYXKEYS.COLLECTION.SELECTED_TAB}${id}`); - // This callback is used to register the focus trap container element of each avaiable tab screen + // This callback is used to register the focus trap container element of each available tab screen const setTabFocusTrapContainerElement = useCallback((tabName: string, containerElement: HTMLElement | null) => { setFocusTrapContainerElementMapping((prevMapping) => { const resultMapping = {...prevMapping}; diff --git a/src/libs/Navigation/PlatformStackNavigation/types/NavigationBuilder.ts b/src/libs/Navigation/PlatformStackNavigation/types/NavigationBuilder.ts index 892fc7f113b8..d756a30ef703 100644 --- a/src/libs/Navigation/PlatformStackNavigation/types/NavigationBuilder.ts +++ b/src/libs/Navigation/PlatformStackNavigation/types/NavigationBuilder.ts @@ -35,7 +35,7 @@ type PlatformNavigationBuilderNavigation< ActionHelpers extends StackActionHelpers = StackActionHelpers, > = NavigationHelpers & ActionHelpers; -// Represents the type of a single descripter returned by useNavigationBuilder +// Represents the type of a single descriptor returned by useNavigationBuilder type PlatformNavigationBuilderDescriptor< NavigationOptions extends PlatformSpecificNavigationOptions, EventMap extends PlatformSpecificEventMap & EventMapBase, diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 62d639d8a477..59426681b50f 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -1610,7 +1610,7 @@ const config: LinkingOptions['config'] = { path: ROUTES.SCHEDULE_CALL_BOOK.route, }, [SCREENS.SCHEDULE_CALL.CONFIRMATION]: { - path: ROUTES.SCHEDULE_CALL_CONFIRMATON.route, + path: ROUTES.SCHEDULE_CALL_CONFIRMATION.route, }, }, }, diff --git a/src/libs/Notification/clearReportNotifications/index.native.ts b/src/libs/Notification/clearReportNotifications/index.native.ts index e33f3e9bf335..94cc1ca06474 100644 --- a/src/libs/Notification/clearReportNotifications/index.native.ts +++ b/src/libs/Notification/clearReportNotifications/index.native.ts @@ -35,7 +35,7 @@ const clearReportNotifications: ClearReportNotifications = (reportID: string | u reportNotificationIDs.forEach((notificationID) => Airship.push.clearNotification(notificationID)); }) .catch((error: unknown) => { - Log.alert(`${CONST.ERROR.ENSURE_BUGBOT} [PushNotification] BrowserNotifications.clearReportNotifications threw an error. This should never happen.`, {reportID, error}); + Log.alert(`${CONST.ERROR.ENSURE_BUG_BOT} [PushNotification] BrowserNotifications.clearReportNotifications threw an error. This should never happen.`, {reportID, error}); }); }; diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 251a0db581b9..3807ea8f0073 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -825,7 +825,7 @@ function getLastMessageTextForReport( return lastMessageTextFromReport || (getReportLastMessage(reportID).lastMessageText ?? ''); } - // When the last report action has unkown mentions (@Hidden), we want to consistently show @Hidden in LHN and report screen + // When the last report action has unknown mentions (@Hidden), we want to consistently show @Hidden in LHN and report screen // so we reconstruct the last message text of the report from the last report action. if (!lastMessageTextFromReport && lastReportAction && hasHiddenDisplayNames(getMentionedAccountIDsFromAction(lastReportAction))) { lastMessageTextFromReport = Parser.htmlToText(getReportActionHtml(lastReportAction)); diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index e3622c55fee2..564f0a09760f 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -80,7 +80,7 @@ function getDisplayNameOrDefault( displayName = displayName.replace(CONST.REGEX.MERGED_ACCOUNT_PREFIX, ''); } - // If the displayName is not set by the user, the backend sets the diplayName same as the login so + // If the displayName is not set by the user, the backend sets the displayName same as the login so // we need to remove the sms domain from the displayName if it is an sms login. if (Str.isSMSLogin(login)) { if (displayName === login) { diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index a650b5d4ac4f..1df263dbef67 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -596,7 +596,7 @@ function getDefaultApprover(policy: OnyxEntry | SearchPolicy): string { } function getRuleApprovers(policy: OnyxEntry | SearchPolicy, expenseReport: OnyxEntry) { - const categoryAppovers: string[] = []; + const categoryApprovers: string[] = []; const tagApprovers: string[] = []; const allReportTransactions = getAllSortedTransactions(expenseReport?.reportID); @@ -606,10 +606,10 @@ function getRuleApprovers(policy: OnyxEntry | SearchPolicy, expenseRepor const transaction = allReportTransactions.at(i); const tag = getTag(transaction); const category = getCategory(transaction); - const categoryAppover = getCategoryApproverRule(policy?.rules?.approvalRules ?? [], category)?.approver; + const categoryApprover = getCategoryApproverRule(policy?.rules?.approvalRules ?? [], category)?.approver; const tagApprover = getTagApproverRule(policy, tag)?.approver; - if (categoryAppover) { - categoryAppovers.push(categoryAppover); + if (categoryApprover) { + categoryApprovers.push(categoryApprover); } if (tagApprover) { @@ -617,7 +617,7 @@ function getRuleApprovers(policy: OnyxEntry | SearchPolicy, expenseRepor } } - return [...categoryAppovers, ...tagApprovers]; + return [...categoryApprovers, ...tagApprovers]; } function getManagerAccountID(policy: OnyxEntry | SearchPolicy, expenseReport: OnyxEntry) { @@ -1370,7 +1370,7 @@ const getDescriptionForPolicyDomainCard = (domainName: string): string => { return domainName; }; -function isPrefferedExporter(policy: Policy) { +function isPreferredExporter(policy: Policy) { const user = getCurrentUserEmail(); const exporters = [ policy.connections?.intacct?.config?.export?.exporter, @@ -1532,7 +1532,7 @@ export { getMostFrequentEmailDomain, getDescriptionForPolicyDomainCard, getManagerAccountID, - isPrefferedExporter, + isPreferredExporter, areAllGroupPoliciesExpenseChatDisabled, getActiveEmployeeWorkspaces, isUserInvitedToWorkspace, diff --git a/src/libs/Pusher/index.native.ts b/src/libs/Pusher/index.native.ts index aef541baf699..b3873b943422 100644 --- a/src/libs/Pusher/index.native.ts +++ b/src/libs/Pusher/index.native.ts @@ -299,7 +299,7 @@ function registerSocketEventCallback(cb: SocketEventCallback) { */ function disconnect() { if (!socket) { - Log.info('[Pusher] Attempting to disconnect from Pusher before initialisation has occurred, ignoring.'); + Log.info('[Pusher] Attempting to disconnect from Pusher before initialization has occurred, ignoring.'); return; } diff --git a/src/libs/Pusher/index.ts b/src/libs/Pusher/index.ts index 282ac54b6f1b..69d873abc6aa 100644 --- a/src/libs/Pusher/index.ts +++ b/src/libs/Pusher/index.ts @@ -12,7 +12,7 @@ import type { EventCallbackError, EventData, PusherEventName, - PusherSubscribtionErrorData, + PusherSubscriptionErrorData, PusherWithAuthParams, SocketEventCallback, SocketEventName, @@ -226,7 +226,7 @@ function subscribe( onResubscribe(); }); - channel.bind('pusher:subscription_error', (data: PusherSubscribtionErrorData = {}) => { + channel.bind('pusher:subscription_error', (data: PusherSubscriptionErrorData = {}) => { const {type, error, status} = data; Log.hmmm('[Pusher] Issue authenticating with Pusher during subscribe attempt.', { channelName, @@ -341,7 +341,7 @@ function registerCustomAuthorizer(authorizer: ChannelAuthorizerGenerator) { */ function disconnect() { if (!socket) { - Log.info('[Pusher] Attempting to disconnect from Pusher before initialisation has occurred, ignoring.'); + Log.info('[Pusher] Attempting to disconnect from Pusher before initialization has occurred, ignoring.'); return; } diff --git a/src/libs/Pusher/types.ts b/src/libs/Pusher/types.ts index 8072b5bd6017..c264464a2dd5 100644 --- a/src/libs/Pusher/types.ts +++ b/src/libs/Pusher/types.ts @@ -59,7 +59,7 @@ type PusherWithAuthParams = InstanceType & { type PusherEventName = LiteralUnion, string>; -type PusherSubscribtionErrorData = {type?: string; error?: string; status?: string}; +type PusherSubscriptionErrorData = {type?: string; error?: string; status?: string}; type PusherModule = { init: (args: Args) => Promise; @@ -97,5 +97,5 @@ export type { SocketEventCallback, PusherWithAuthParams, PusherEventName, - PusherSubscribtionErrorData, + PusherSubscriptionErrorData, }; diff --git a/src/libs/PusherConnectionManager.ts b/src/libs/PusherConnectionManager.ts index bc3ef45d8592..3f0c89ddaaa9 100644 --- a/src/libs/PusherConnectionManager.ts +++ b/src/libs/PusherConnectionManager.ts @@ -44,7 +44,7 @@ function init() { // It's not clear why some errors are wrapped in a WebSocketError type - this error could mean different things depending on the contents. Log.hmmm('[PusherConnectionManager] WebSocketError', {error}); } else { - Log.alert(`${CONST.ERROR.ENSURE_BUGBOT} [PusherConnectionManager] Unknown error event`, {error}); + Log.alert(`${CONST.ERROR.ENSURE_BUG_BOT} [PusherConnectionManager] Unknown error event`, {error}); } } break; diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 42336d4d37cb..65b8337da203 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1236,8 +1236,8 @@ function getOneTransactionThreadReportID( iouRequestTypesSet.has(actionType) && action.childReportID && // Include deleted IOU reportActions if: - // - they have an assocaited IOU transaction ID or - // - they have visibile childActions (like comments) that we'd want to display + // - they have an associated IOU transaction ID or + // - they have visible childActions (like comments) that we'd want to display // - the action is pending deletion and the user is offline (!!originalMessage?.IOUTransactionID || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing @@ -1784,7 +1784,7 @@ function getExportIntegrationMessageHTML(reportAction: OnyxEntry): } function getExportIntegrationActionFragments(reportAction: OnyxEntry): Array<{text: string; url: string}> { - if (reportAction?.actionName !== 'EXPORTINTEGRATION') { + if (reportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION) { throw Error(`received wrong action type. actionName: ${reportAction?.actionName}`); } @@ -2167,7 +2167,7 @@ function getWorkspaceUpdateFieldMessage(action: ReportAction): string { return getReportActionText(action); } -function getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage(action: ReportAction): string { +function getPolicyChangeLogMaxExpenseAmountNoReceiptMessage(action: ReportAction): string { const {oldMaxExpenseAmountNoReceipt, newMaxExpenseAmountNoReceipt, currency} = getOriginalMessage(action as ReportAction) ?? {}; @@ -2508,7 +2508,7 @@ export { getWorkspaceUpdateFieldMessage, getWorkspaceCurrencyUpdateMessage, getWorkspaceFrequencyUpdateMessage, - getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage, + getPolicyChangeLogMaxExpenseAmountNoReceiptMessage, getPolicyChangeLogMaxExpenseAmountMessage, getPolicyChangeLogDefaultBillableMessage, getPolicyChangeLogDefaultTitleEnforcedMessage, diff --git a/src/libs/ReportPreviewActionUtils.ts b/src/libs/ReportPreviewActionUtils.ts index 9660d57f3ef8..b8c58cb8d71b 100644 --- a/src/libs/ReportPreviewActionUtils.ts +++ b/src/libs/ReportPreviewActionUtils.ts @@ -12,7 +12,7 @@ import { hasAccountingConnections, hasIntegrationAutoSync, isPolicyAdmin, - isPrefferedExporter, + isPreferredExporter, } from './PolicyUtils'; import { getMoneyRequestSpendBreakdown, @@ -135,7 +135,7 @@ function canPay(report: Report, violations: OnyxCollection, policy?: Policy, reportActions?: OnyxEntry | ReportAction[]) { const isExpense = isExpenseReport(report); - const isExporter = policy ? isPrefferedExporter(policy) : false; + const isExporter = policy ? isPreferredExporter(policy) : false; const isReimbursed = isSettled(report); const isClosed = isClosedReport(report); const isApproved = isReportApproved({report}); diff --git a/src/libs/ReportPrimaryActionUtils.ts b/src/libs/ReportPrimaryActionUtils.ts index af9325117065..1e6792591171 100644 --- a/src/libs/ReportPrimaryActionUtils.ts +++ b/src/libs/ReportPrimaryActionUtils.ts @@ -11,7 +11,7 @@ import { getSubmitToAccountID, hasAccountingConnections, hasIntegrationAutoSync, - isPrefferedExporter, + isPreferredExporter, } from './PolicyUtils'; import {getAllReportActions, getOneTransactionThreadReportID} from './ReportActionsUtils'; import { @@ -168,7 +168,7 @@ function isExportAction(report: Report, policy?: Policy, reportActions?: ReportA return false; } - const isReportExporter = isPrefferedExporter(policy); + const isReportExporter = isPreferredExporter(policy); if (!isReportExporter) { return false; } diff --git a/src/libs/ReportSecondaryActionUtils.ts b/src/libs/ReportSecondaryActionUtils.ts index a83d356e95e5..9c68b7da26d4 100644 --- a/src/libs/ReportSecondaryActionUtils.ts +++ b/src/libs/ReportSecondaryActionUtils.ts @@ -12,7 +12,7 @@ import { getSubmitToAccountID, hasAccountingConnections, hasIntegrationAutoSync, - isPrefferedExporter, + isPreferredExporter, } from './PolicyUtils'; import {getIOUActionForReportID, isPayAction} from './ReportActionsUtils'; import { @@ -269,7 +269,7 @@ function isMarkAsExportedAction(report: Report, policy?: Policy): boolean { const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN; - const isExporter = isPrefferedExporter(policy); + const isExporter = isPreferredExporter(policy); return (isAdmin && syncEnabled) || (isExporter && !syncEnabled); } @@ -282,11 +282,11 @@ function isHoldAction(report: Report, reportTransactions: Transaction[]): boolea return false; } - const isTransactionOnHold = isHoldActionForTransation(report, transaction); + const isTransactionOnHold = isHoldActionForTransaction(report, transaction); return isTransactionOnHold; } -function isHoldActionForTransation(report: Report, reportTransaction: Transaction): boolean { +function isHoldActionForTransaction(report: Report, reportTransaction: Transaction): boolean { const isExpenseReport = isExpenseReportUtils(report); const isIOUReport = isIOUReportUtils(report); const iouOrExpenseReport = isExpenseReport || isIOUReport; @@ -407,7 +407,7 @@ function getSecondaryReportActions( function getSecondaryTransactionThreadActions(parentReport: Report, reportTransaction: Transaction): Array> { const options: Array> = []; - if (isHoldActionForTransation(parentReport, reportTransaction)) { + if (isHoldActionForTransaction(parentReport, reportTransaction)) { options.push(CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD); } diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index e86d74acf89a..9ae5856d0dfd 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -77,7 +77,7 @@ import {hasCreditBankAccount} from './actions/ReimbursementAccount/store'; import {handleReportChanged} from './actions/Report'; import type {GuidedSetupData, TaskForParameters} from './actions/Report'; import {isAnonymousUser as isAnonymousUserSession} from './actions/Session'; -import type {AddCommentOrAttachementParams} from './API/parameters'; +import type {AddCommentOrAttachmentParams} from './API/parameters'; import {convertToDisplayString} from './CurrencyUtils'; import DateUtils from './DateUtils'; import {hasValidDraftComment} from './DraftCommentUtils'; @@ -149,7 +149,7 @@ import { getOriginalMessage, getPolicyChangeLogDefaultBillableMessage, getPolicyChangeLogDefaultTitleEnforcedMessage, - getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage, + getPolicyChangeLogMaxExpenseAmountNoReceiptMessage, getRenamedAction, getReportAction, getReportActionHtml, @@ -3897,7 +3897,7 @@ function canEditFieldOfMoneyRequest(reportAction: OnyxInputOrEntry * * - It was written by the current user * - It's an ADD_COMMENT that is not an attachment - * - It's an expense where conditions for editability are defined in canEditMoneyRequest method + * - It's an expense where conditions for modifications are defined in canEditMoneyRequest method * - It's not pending deletion */ function canEditReportAction(reportAction: OnyxInputOrEntry): boolean { @@ -4734,7 +4734,7 @@ function getReportNameInternal({ } if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT)) { - return getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage(parentReportAction); + return getPolicyChangeLogMaxExpenseAmountNoReceiptMessage(parentReportAction); } if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DEFAULT_BILLABLE)) { @@ -5942,7 +5942,7 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa originalMessage.paymentType = paymentType; } else { // In case of pay someone action, we dont store the comment - // and there is no single transctionID to link the action to. + // and there is no single transactionID to link the action to. delete originalMessage.IOUTransactionID; delete originalMessage.comment; originalMessage.paymentType = paymentType; @@ -6113,7 +6113,7 @@ function buildOptimisticMovedReportAction(fromPolicyID: string | undefined, toPo } /** - * Builds an optimistic CHANGEPOLICY report action with a randomly generated reportActionID. + * Builds an optimistic CHANGE_POLICY report action with a randomly generated reportActionID. * This action is used when we change the workspace of a report. */ function buildOptimisticChangePolicyReportAction(fromPolicyID: string | undefined, toPolicyID: string, automaticAction = false): ReportAction { @@ -6161,7 +6161,11 @@ function buildOptimisticChangePolicyReportAction(fromPolicyID: string | undefine }; } -function buildOptimisticTransactionAction(type: 'MOVEDTRANSACTION' | 'UNREPORTEDTRANSACTION', transactionThreadReportID: string | undefined, targetReportID: string): ReportAction { +function buildOptimisticTransactionAction( + type: typeof CONST.REPORT.ACTIONS.TYPE.MOVED_TRANSACTION | typeof CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION, + transactionThreadReportID: string | undefined, + targetReportID: string, +): ReportAction { const reportName = allReports?.[targetReportID]?.reportName ?? ''; const url = `${environmentURL}/r/${targetReportID}`; const [actionText, messageHtml] = @@ -6206,7 +6210,7 @@ function buildOptimisticMovedTransactionAction(transactionThreadReportID: string /** * Builds an optimistic UNREPORTED_TRANSACTION report action with a randomly generated reportActionID. - * This action is used when we unreport a transaction. + * This action is used when we un-report a transaction. */ function buildOptimisticUnreportedTransactionAction(transactionThreadReportID: string | undefined, fromReportID: string) { return buildOptimisticTransactionAction(CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION, transactionThreadReportID, fromReportID); @@ -6304,7 +6308,7 @@ function buildOptimisticReportPreview( } /** - * Builds an optimistic ACTIONABLETRACKEXPENSEWHISPER action with a randomly generated reportActionID. + * Builds an optimistic ACTIONABLE_TRACK_EXPENSE_WHISPER action with a randomly generated reportActionID. */ function buildOptimisticActionableTrackExpenseWhisper(iouAction: OptimisticIOUReportAction, transactionID: string): ReportAction { const currentTime = DateUtils.getDBTime(); @@ -9706,7 +9710,7 @@ function prepareOnboardingOnyxData( const message = typeof onboardingMessage.message === 'function' ? onboardingMessage.message(onboardingTaskParams) : onboardingMessage.message; const textComment = buildOptimisticAddCommentReportAction(message, undefined, actorAccountID, 1); const textCommentAction: OptimisticAddCommentReportAction = textComment.reportAction; - const textMessage: AddCommentOrAttachementParams = { + const textMessage: AddCommentOrAttachmentParams = { reportID: targetChatReportID, reportActionID: textCommentAction.reportActionID, reportComment: textComment.commentText, @@ -10216,7 +10220,7 @@ function isChatUsedForOnboarding(optionOrReport: OnyxEntry | OptionData, return (optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport); } - // Onboarding guides are assigned to signups with emails that do not contain a '+' and select the "Manage my team's expenses" intent. + // Onboarding guides are assigned to signup with emails that do not contain a '+' and select the "Manage my team's expenses" intent. // Guides and onboarding tasks are posted to the #admins room to facilitate the onboarding process. return onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !currentUserEmail?.includes('+') ? isAdminRoom(optionOrReport) @@ -10356,7 +10360,7 @@ function isExported(reportActions: OnyxEntry | ReportAction[]) { const reportActionList = Array.isArray(reportActions) ? reportActions : Object.values(reportActions); for (const action of reportActionList) { if (isExportIntegrationAction(action)) { - // We consider any reports marked manually as exported to be exported, so we shortcircuit here. + // We consider any reports marked manually as exported to be exported, so we shortcut here. if (getOriginalMessage(action)?.markedManually) { return true; } @@ -10368,8 +10372,8 @@ function isExported(reportActions: OnyxEntry | ReportAction[]) { } // We need to make sure that there was at least one successful export to consider the report exported. - // We add one EXPORTINTEGRATION action to the report when we start exporting it (with pendingAction: 'add') and then another EXPORTINTEGRATION when the export finishes successfully. - // If the export fails, we add an INTEGRATIONS_MESSAGE action to the report, but the initial EXPORTINTEGRATION action is still present, so we compare the counts of these two actions to determine if the report was exported successfully. + // We add one EXPORT_INTEGRATION action to the report when we start exporting it (with pendingAction: 'add') and then another EXPORT_INTEGRATION when the export finishes successfully. + // If the export fails, we add an INTEGRATIONS_MESSAGE action to the report, but the initial EXPORT_INTEGRATION action is still present, so we compare the counts of these two actions to determine if the report was exported successfully. return exportIntegrationActionsCount > integrationMessageActionsCount; } @@ -10474,7 +10478,7 @@ function getApprovalChain(policy: OnyxEntry, expenseReport: OnyxEntry { - // Don't push submiiter to approve as a rule approver + // Don't push submitter to approve as a rule approver if (fullApprovalChain.includes(ruleApprover) || ruleApprover === submitterEmail) { return; } @@ -10591,8 +10595,8 @@ function isSelectedManagerMcTest(email: string | null | undefined): boolean { */ function isTestTransactionReport(report: OnyxEntry): boolean { const managerID = report?.managerID ?? CONST.DEFAULT_NUMBER_ID; - const persionalDetails = allPersonalDetails?.[managerID]; - return isSelectedManagerMcTest(persionalDetails?.login); + const personalDetails = allPersonalDetails?.[managerID]; + return isSelectedManagerMcTest(personalDetails?.login); } function isWaitingForSubmissionFromCurrentUser(chatReport: OnyxEntry, policy: OnyxEntry) { diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts index ba1c985eaef0..ee885d1e742e 100644 --- a/src/libs/SearchQueryUtils.ts +++ b/src/libs/SearchQueryUtils.ts @@ -43,6 +43,7 @@ const operatorToCharMap = { /** * A mapping object that maps filter names from the internal codebase format to user-friendly names. */ +// cspell:disable const UserFriendlyKeyMap: Record = { type: 'type', status: 'status', @@ -77,7 +78,7 @@ const UserFriendlyKeyMap: Record { * @returns Whether the workspace owner has an overdue grace period. */ function hasOverdueGracePeriod(): boolean { - return !!ownerBillingGraceEndPeriod ?? false; + return !!ownerBillingGraceEndPeriod; } /** @@ -233,7 +233,7 @@ function hasCardAuthenticatedError() { * @returns Whether there is a billing dispute pending. */ function hasBillingDisputePending() { - return !!billingDisputePending ?? false; + return !!billingDisputePending; } /** @@ -344,14 +344,14 @@ function getEarlyDiscountInfo(): DiscountInfo | null { * @returns Whether there is a retry billing error. */ function hasRetryBillingError(): boolean { - return !!retryBillingFailed ?? false; + return !!retryBillingFailed; } /** * @returns Whether the retry billing was successful. */ function isRetryBillingSuccessful(): boolean { - return !!retryBillingSuccessful ?? false; + return !!retryBillingSuccessful; } type SubscriptionStatus = { @@ -599,7 +599,7 @@ function checkIfHasTeam2025Pricing() { return differenceInDays(firstPolicyDate, CONST.SUBSCRIPTION.TEAM_2025_PRICING_START_DATE) >= 0; } -function getSubscriptionPrice(plan: PersonalPolicyTypeExludedProps | null, preferredCurrency: PreferredCurrency, privateSubscriptionType: SubscriptionType | undefined): number { +function getSubscriptionPrice(plan: PersonalPolicyTypeExcludedProps | null, preferredCurrency: PreferredCurrency, privateSubscriptionType: SubscriptionType | undefined): number { if (!privateSubscriptionType || !plan) { return 0; } @@ -614,7 +614,7 @@ function getSubscriptionPrice(plan: PersonalPolicyTypeExludedProps | null, prefe } function getSubscriptionPlanInfo( - subscriptionPlan: PersonalPolicyTypeExludedProps | null, + subscriptionPlan: PersonalPolicyTypeExcludedProps | null, privateSubscriptionType: SubscriptionType | undefined, preferredCurrency: PreferredCurrency, isFromComparisonModal: boolean, diff --git a/src/libs/TaxOptionsListUtils.ts b/src/libs/TaxOptionsListUtils.ts index 1c5896f2d932..99dfcd9551f3 100644 --- a/src/libs/TaxOptionsListUtils.ts +++ b/src/libs/TaxOptionsListUtils.ts @@ -32,8 +32,8 @@ type TaxSection = { * Sorts tax rates alphabetically by name. */ function sortTaxRates(taxRates: TaxRates): TaxRate[] { - const sortedtaxRates = lodashSortBy(taxRates, (taxRate) => taxRate.name); - return sortedtaxRates; + const sortedTaxRates = lodashSortBy(taxRates, (taxRate) => taxRate.name); + return sortedTaxRates; } /** @@ -89,7 +89,7 @@ function getTaxRatesSection({ // If all tax are disabled but there's a previously selected tag, show only the selected tag if (numberOfTaxRates === 0 && selectedOptions.length > 0) { policyRatesSections.push({ - // "Selected" sectiong + // "Selected" section title: '', shouldShow: false, data: getTaxRatesOptions(selectedTaxRateWithDisabledState), diff --git a/src/libs/TransactionUtils/index.ts b/src/libs/TransactionUtils/index.ts index e43306352be4..1c24b56efc4c 100644 --- a/src/libs/TransactionUtils/index.ts +++ b/src/libs/TransactionUtils/index.ts @@ -286,7 +286,7 @@ function buildOptimisticTransaction(params: BuildOptimisticTransactionParams): T merchant: merchant || CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, created: created || DateUtils.getDBTime(), pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, - receipt: receipt?.source ? {source: receipt.source, state: receipt.state ?? CONST.IOU.RECEIPT_STATE.SCANREADY} : {}, + receipt: receipt?.source ? {source: receipt.source, state: receipt.state ?? CONST.IOU.RECEIPT_STATE.SCAN_READY} : {}, filename: (receipt?.source ? receipt?.name ?? filename : filename).toString(), category, tag, @@ -326,7 +326,7 @@ function isMerchantMissing(transaction: OnyxEntry) { // eslint-disable-next-line @typescript-eslint/no-unused-vars function shouldShowAttendees(iouType: IOUType, policy: OnyxEntry): boolean { return false; - // To be renabled once feature is complete: https://github.com/Expensify/App/issues/44725 + // To be enabled once feature is complete: https://github.com/Expensify/App/issues/44725 // Keep this disabled for per diem expense return iouType === CONST.IOU.TYPE.SUBMIT && !!policy?.id && (policy?.type === CONST.POLICY.TYPE.CORPORATE || policy?.type === CONST.POLICY.TYPE.TEAM); } @@ -590,7 +590,7 @@ function getPostedDate(transaction: OnyxInputOrEntry): string { } /** - * Return the formated posted date from the transaction. + * Return the formatted posted date from the transaction. */ function getFormattedPostedDate(transaction: OnyxInputOrEntry, dateFormat: string = CONST.DATE.FNS_FORMAT_STRING): string { const postedDate = getPostedDate(transaction); @@ -808,22 +808,22 @@ function isPosted(transaction: Transaction): boolean { } function isReceiptBeingScanned(transaction: OnyxInputOrEntry): boolean { - return [CONST.IOU.RECEIPT_STATE.SCANREADY, CONST.IOU.RECEIPT_STATE.SCANNING].some((value) => value === transaction?.receipt?.state); + return [CONST.IOU.RECEIPT_STATE.SCAN_READY, CONST.IOU.RECEIPT_STATE.SCANNING].some((value) => value === transaction?.receipt?.state); } function didReceiptScanSucceed(transaction: OnyxEntry): boolean { - return [CONST.IOU.RECEIPT_STATE.SCANCOMPLETE].some((value) => value === transaction?.receipt?.state); + return [CONST.IOU.RECEIPT_STATE.SCAN_COMPLETE].some((value) => value === transaction?.receipt?.state); } /** - * Check if the transaction has a non-smartscanning receipt and is missing required fields + * Check if the transaction has a non-smart-scanning receipt and is missing required fields */ function hasMissingSmartscanFields(transaction: OnyxInputOrEntry): boolean { return !!(transaction && !isDistanceRequest(transaction) && !isReceiptBeingScanned(transaction) && areRequiredFieldsEmpty(transaction)); } /** - * Get all transaction violations of the transaction with given tranactionID. + * Get all transaction violations of the transaction with given transactionID. */ function getTransactionViolations(transactionID: string | undefined, transactionViolations: OnyxCollection | undefined): TransactionViolations | undefined { const transaction = getTransaction(transactionID); @@ -913,8 +913,8 @@ function allHavePendingRTERViolation(transactionIds: string[], transactionViolat return transactionsWithRTERViolations.length > 0 && transactionsWithRTERViolations.every((value) => value === true); } -function checkIfShouldShowMarkAsCashButton(hasRTERVPendingViolation: boolean, shouldDisplayBrokenConnectionViolation: boolean, report: OnyxEntry, policy: OnyxEntry) { - if (hasRTERVPendingViolation) { +function checkIfShouldShowMarkAsCashButton(hasRTERPendingViolation: boolean, shouldDisplayBrokenConnectionViolation: boolean, report: OnyxEntry, policy: OnyxEntry) { + if (hasRTERPendingViolation) { return true; } return ( diff --git a/src/libs/Violations/ViolationsUtils.ts b/src/libs/Violations/ViolationsUtils.ts index 5768291ec7c3..00a374ee95e2 100644 --- a/src/libs/Violations/ViolationsUtils.ts +++ b/src/libs/Violations/ViolationsUtils.ts @@ -89,7 +89,7 @@ function getTagViolationForIndependentTags(policyTagList: PolicyTagLists, transa (violation) => violation.name !== CONST.VIOLATIONS.SOME_TAG_LEVELS_REQUIRED && violation.name !== CONST.VIOLATIONS.TAG_OUT_OF_POLICY, ); - // We first get the errorIndexes for someTagLevelsRequired. If it's not empty, we puth SOME_TAG_LEVELS_REQUIRED in Onyx. + // We first get the errorIndexes for someTagLevelsRequired. If it's not empty, we push SOME_TAG_LEVELS_REQUIRED in Onyx. // Otherwise, we put TAG_OUT_OF_POLICY in Onyx (when applicable) const errorIndexes = []; for (let i = 0; i < policyTagKeys.length; i++) { diff --git a/src/libs/WorkspacesSettingsUtils.ts b/src/libs/WorkspacesSettingsUtils.ts index 0ab5050c540d..f213c047f3a5 100644 --- a/src/libs/WorkspacesSettingsUtils.ts +++ b/src/libs/WorkspacesSettingsUtils.ts @@ -229,7 +229,7 @@ function getWorkspacesUnreadStatuses(reports: OnyxCollection, reportActi const currentReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`] ?? {}; const oneTransactionThreadReportID = getOneTransactionThreadReportID(report.reportID, currentReportActions); const oneTransactionThreadReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${oneTransactionThreadReportID}`]; - // When the only message of a report is deleted lastVisibileActionCreated is not reset leading to wrongly + // When the only message of a report is deleted lastVisibleActionCreated is not reset leading to wrongly // setting it Unread so we add additional condition here to avoid read workspace indicator from being bold. workspacesUnreadStatuses[policyID] = isUnread(report, oneTransactionThreadReport) && !!report.lastActorAccountID; }); diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index a3de61a22733..8b95c70fc9a6 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -387,7 +387,7 @@ function getMissingOnyxUpdates(updateIDFrom = 0, updateIDTo: number | string = 0 // It is SUPER BAD FORM to return promises from action methods. // DO NOT FOLLOW THIS PATTERN!!!!! - // It was absolutely necessary in order to block OnyxUpdates while fetching the missing updates from the server or else the udpates aren't applied in the proper order. + // It was absolutely necessary in order to block OnyxUpdates while fetching the missing updates from the server or else the updates aren't applied in the proper order. // eslint-disable-next-line rulesdir/no-api-side-effects-method return API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.GET_MISSING_ONYX_MESSAGES, parameters, getOnyxDataForOpenOrReconnect()); } diff --git a/src/libs/actions/BankAccounts.ts b/src/libs/actions/BankAccounts.ts index a3d2c5bfdf17..e7ee3ea5112e 100644 --- a/src/libs/actions/BankAccounts.ts +++ b/src/libs/actions/BankAccounts.ts @@ -626,7 +626,7 @@ function clearReimbursementAccountSaveCorpayOnboardingBeneficialOwners() { Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isSuccess: null, isSavingCorpayOnboardingBeneficialOwnersFields: null}); } -function clearReimbursementAccoungSaveCorplayOnboardingDirectorInformation() { +function clearReimbursementAccountSaveCorpayOnboardingDirectorInformation() { Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isSuccess: null, isSavingCorpayOnboardingDirectorInformation: null}); } @@ -918,7 +918,7 @@ export { saveCorpayOnboardingBeneficialOwners, saveCorpayOnboardingDirectorInformation, clearReimbursementAccountSaveCorpayOnboardingBeneficialOwners, - clearReimbursementAccoungSaveCorplayOnboardingDirectorInformation, + clearReimbursementAccountSaveCorpayOnboardingDirectorInformation, clearCorpayBankAccountFields, finishCorpayBankAccountOnboarding, clearReimbursementAccountFinishCorpayBankAccountOnboarding, diff --git a/src/libs/actions/Delegate.ts b/src/libs/actions/Delegate.ts index 98567349e039..bf1f9469703d 100644 --- a/src/libs/actions/Delegate.ts +++ b/src/libs/actions/Delegate.ts @@ -70,7 +70,7 @@ const KEYS_TO_PRESERVE_DELEGATE_ACCESS = [ ONYXKEYS.HAS_LOADED_APP, ONYXKEYS.STASHED_CREDENTIALS, - // We need to preserve the sidebar loaded state since we never unrender the sidebar when connecting as a delegate + // We need to preserve the sidebar loaded state since we never unmount the sidebar when connecting as a delegate // This allows the report screen to load correctly when the delegate token expires and the delegate is returned to their original account. ONYXKEYS.IS_SIDEBAR_LOADED, ]; diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 92f6f05c2e62..c94c8032bb84 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -2970,7 +2970,7 @@ function getSendInvoiceInformation( let filename; if (receipt?.source) { receiptObject.source = receipt.source; - receiptObject.state = receipt.state ?? CONST.IOU.RECEIPT_STATE.SCANREADY; + receiptObject.state = receipt.state ?? CONST.IOU.RECEIPT_STATE.SCAN_READY; filename = receipt.name; } const optimisticTransaction = buildOptimisticTransaction({ @@ -3103,7 +3103,7 @@ function getMoneyRequestInformation(moneyRequestInformation: MoneyRequestInforma chatReport = getChatByParticipants([payerAccountID, payeeAccountID]) ?? null; } - // If we still don't have a report, it likely doens't exist and we need to build an optimistic one + // If we still don't have a report, it likely doesn't exist and we need to build an optimistic one if (!chatReport) { isNewChatReport = true; chatReport = buildOptimisticChatReport({ @@ -3354,7 +3354,7 @@ function getPerDiemExpenseInformation(perDiemExpenseInformation: PerDiemExpenseI chatReport = getChatByParticipants([payerAccountID, payeeAccountID]) ?? null; } - // If we still don't have a report, it likely doens't exist and we need to build an optimistic one + // If we still don't have a report, it likely doesn't exist and we need to build an optimistic one if (!chatReport) { isNewChatReport = true; chatReport = buildOptimisticChatReport({ @@ -3611,7 +3611,7 @@ function getTrackExpenseInformation(params: GetTrackExpenseInformationParams): T let filename; if (receipt?.source) { receiptObject.source = receipt.source; - receiptObject.state = receipt.state ?? CONST.IOU.RECEIPT_STATE.SCANREADY; + receiptObject.state = receipt.state ?? CONST.IOU.RECEIPT_STATE.SCAN_READY; filename = receipt.name; } const existingTransaction = allTransactionDrafts[`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${existingTransactionID ?? CONST.IOU.OPTIMISTIC_TRANSACTION_ID}`]; @@ -3894,7 +3894,7 @@ function getUpdateMoneyRequestParams( // Step 4: Compute the IOU total and update the report preview message (and report header) so LHN amount owed is correct. const calculatedDiffAmount = calculateDiffAmount(iouReport, updatedTransaction, transaction); // If calculatedDiffAmount is null it means we cannot calculate the new iou report total from front-end due to currency differences. - const isTotalIndeterministic = calculatedDiffAmount === null; + const isTotalIndeterminate = calculatedDiffAmount === null; const diff = calculatedDiffAmount ?? 0; let updatedMoneyRequestReport: OnyxTypes.OnyxInputOrEntry; @@ -3933,7 +3933,7 @@ function getUpdateMoneyRequestParams( { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`, - value: {...updatedMoneyRequestReport, ...(isTotalIndeterministic && {pendingFields: {total: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}})}, + value: {...updatedMoneyRequestReport, ...(isTotalIndeterminate && {pendingFields: {total: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}})}, }, { onyxMethod: Onyx.METHOD.MERGE, @@ -3953,7 +3953,7 @@ function getUpdateMoneyRequestParams( successData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`, - value: {pendingAction: null, ...(isTotalIndeterministic && {pendingFields: {total: null}})}, + value: {pendingAction: null, ...(isTotalIndeterminate && {pendingFields: {total: null}})}, }); // Optimistically modify the transaction and the transaction thread @@ -4044,7 +4044,7 @@ function getUpdateMoneyRequestParams( } const overLimitViolation = violations?.find((violation) => violation.name === 'overLimit'); - // Update violation limit, if we modify attendees. The given limit value is for a single attendee, if we have multiple attendees we should multpiply limit by attende count + // Update violation limit, if we modify attendees. The given limit value is for a single attendee, if we have multiple attendees we should multiply limit by attendee count if ('attendees' in transactionChanges && !!overLimitViolation) { const limitForSingleAttendee = ViolationsUtils.getViolationAmountLimit(overLimitViolation); if (limitForSingleAttendee * (transactionChanges?.attendees?.length ?? 1) > Math.abs(getAmount(transaction))) { @@ -4089,7 +4089,7 @@ function getUpdateMoneyRequestParams( failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`, - value: {...iouReport, ...(isTotalIndeterministic && {pendingFields: {total: null}})}, + value: {...iouReport, ...(isTotalIndeterminate && {pendingFields: {total: null}})}, }); } @@ -5668,7 +5668,7 @@ function createSplitsAndOnyxData({ transactionParams: { amount, currency, - reportID: CONST.REPORT.SPLIT_REPORTID, + reportID: CONST.REPORT.SPLIT_REPORT_ID, comment, created, merchant: merchant || Localize.translateLocal('iou.expense'), @@ -6279,7 +6279,7 @@ function startSplitBill({ const isOwnPolicyExpenseChat = !!splitChatReport.isOwnPolicyExpenseChat; const parsedComment = getParsedComment(comment); - const {name: filename, source, state = CONST.IOU.RECEIPT_STATE.SCANREADY} = receipt; + const {name: filename, source, state = CONST.IOU.RECEIPT_STATE.SCAN_READY} = receipt; const receiptObject: Receipt = {state, source}; // ReportID is -2 (aka "deleted") on the group transaction @@ -6287,7 +6287,7 @@ function startSplitBill({ transactionParams: { amount: 0, currency, - reportID: CONST.REPORT.SPLIT_REPORTID, + reportID: CONST.REPORT.SPLIT_REPORT_ID, comment: parsedComment, merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, receipt: receiptObject, @@ -9954,7 +9954,7 @@ function setSplitShares(transaction: OnyxEntry, amount: n const splitShares: SplitShares = accountIDs.reduce((acc: SplitShares, accountID): SplitShares => { // We want to replace the contents of splitShares to contain only `newAccountIDs` entries // In the case of going back to the participants page and removing a participant - // a simple merge will have the previous participant still present in the splitshares object + // a simple merge will have the previous participant still present in the splitShares object // So we manually set their entry to null if (!newAccountIDs.includes(accountID) && accountID !== userAccountID) { acc[accountID] = null; @@ -10281,7 +10281,7 @@ function unholdRequest(transactionID: string, reportID: string, searchHash?: num }, ]; - // If we are unholding from the search page, we optimistically update the snapshot data that search uses so that it is kept in sync + // If we are un-holding from the search page, we optimistically update the snapshot data that search uses so that it is kept in sync if (searchHash) { optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, diff --git a/src/libs/actions/Modal.ts b/src/libs/actions/Modal.ts index 34233f16b6e7..4c766e11f638 100644 --- a/src/libs/actions/Modal.ts +++ b/src/libs/actions/Modal.ts @@ -75,7 +75,7 @@ function setModalVisibility(isVisible: boolean, type: ModalType | null = null) { } /** - * Allows other parts of the app to set whether modals should be dismissable using the Escape key + * Allows other parts of the app to set whether modals should be dismissible using the Escape key */ function setDisableDismissOnEscape(disableDismissOnEscape: boolean) { Onyx.merge(ONYXKEYS.MODAL, {disableDismissOnEscape}); diff --git a/src/libs/actions/OnyxDerived/configs/conciergeChatReportID.ts b/src/libs/actions/OnyxDerived/configs/conciergeChatReportID.ts index 151d35be5db0..d95cd0904464 100644 --- a/src/libs/actions/OnyxDerived/configs/conciergeChatReportID.ts +++ b/src/libs/actions/OnyxDerived/configs/conciergeChatReportID.ts @@ -20,7 +20,7 @@ export default createOnyxDerivedValueConfig({ const reportNameValuePairs = (allReportNameValuePair[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`] ?? {}) as OnyxInputOrEntry; - // Merged accounts can have multiple conceirge chats, exclude archived chats. + // Merged accounts can have multiple Concierge chats, exclude archived chats. if (!report?.participants || isThread(report) || isArchivedReport(reportNameValuePairs)) { return false; } diff --git a/src/libs/actions/OnyxDerived/configs/reportAttributes.ts b/src/libs/actions/OnyxDerived/configs/reportAttributes.ts index 06ff411fb7ac..9e970fbe7ec8 100644 --- a/src/libs/actions/OnyxDerived/configs/reportAttributes.ts +++ b/src/libs/actions/OnyxDerived/configs/reportAttributes.ts @@ -47,7 +47,7 @@ export default createOnyxDerivedValueConfig({ }; } // if any of those keys changed, reset the isFullyComputed flag to recompute all reports - // we need to recompute all report attributes on locale change becuase the report names are locale dependent + // we need to recompute all report attributes on locale change because the report names are locale dependent if (hasKeyTriggeredCompute(ONYXKEYS.NVP_PREFERRED_LOCALE, sourceValues)) { isFullyComputed = false; } @@ -112,7 +112,7 @@ export default createOnyxDerivedValueConfig({ return acc; }, currentValue?.reports ?? {}); - // mark the report attributes as fully computed after first iteration to avoid unnecessary recomputations on all objects + // mark the report attributes as fully computed after first iteration to avoid unnecessary recomputation on all objects if (!Object.keys(reportUpdates).length && Object.keys(reports ?? {}).length > 0 && !isFullyComputed) { isFullyComputed = true; } diff --git a/src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts b/src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts index a9edf1bdf82e..ca2e7a85fc1b 100644 --- a/src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts +++ b/src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts @@ -26,7 +26,7 @@ function setMissingOnyxUpdatesQueryPromise(promise: Promise, tagListIndex: number) { +function renamePolicyTagList(policyID: string, policyTagListName: {oldName: string; newName: string}, policyTags: OnyxEntry, tagListIndex: number) { const newName = policyTagListName.newName; const oldName = policyTagListName.oldName; const oldPolicyTags = policyTags?.[oldName] ?? {}; @@ -731,7 +731,7 @@ function renamePolicyTaglist(policyID: string, policyTagListName: {oldName: stri }, ], }; - const parameters: RenamePolicyTaglistParams = { + const parameters: RenamePolicyTagListParams = { policyID, oldName, newName, @@ -1051,7 +1051,7 @@ export { enablePolicyTags, openPolicyTagsPage, renamePolicyTag, - renamePolicyTaglist, + renamePolicyTagList, setWorkspaceTagEnabled, setPolicyTagGLCode, setPolicyTagApprover, diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 0551b2c755f5..c04b02812fcf 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -12,7 +12,7 @@ import * as ActiveClientManager from '@libs/ActiveClientManager'; import addEncryptedAuthTokenToURL from '@libs/addEncryptedAuthTokenToURL'; import * as API from '@libs/API'; import type { - AddCommentOrAttachementParams, + AddCommentOrAttachmentParams, AddEmojiReactionParams, AddWorkspaceRoomParams, CompleteGuidedSetupParams, @@ -212,7 +212,7 @@ type Video = { height: number; }; -type TaskMessage = Required>; +type TaskMessage = Required>; type TaskForParameters = | { @@ -232,12 +232,12 @@ type TaskForParameters = } & TaskMessage); type GuidedSetupData = Array< - | ({type: 'message'} & AddCommentOrAttachementParams) + | ({type: 'message'} & AddCommentOrAttachmentParams) | TaskForParameters | ({ type: 'video'; } & Video & - AddCommentOrAttachementParams) + AddCommentOrAttachmentParams) >; type ReportError = { @@ -686,7 +686,7 @@ function addActions(reportID: string, text = '', file?: FileObject) { optimisticReportActions[attachmentAction.reportActionID] = attachmentAction; } - const parameters: AddCommentOrAttachementParams = { + const parameters: AddCommentOrAttachmentParams = { reportID, reportActionID: file ? attachmentAction?.reportActionID : reportCommentAction?.reportActionID, commentReportActionID: file && reportCommentAction ? reportCommentAction.reportActionID : null, @@ -1816,13 +1816,13 @@ function deleteReportComment(reportID: string | undefined, reportAction: ReportA const didCommentMentionCurrentUser = ReportActionsUtils.didMessageMentionCurrentUser(reportAction); if (didCommentMentionCurrentUser && reportAction.created === report?.lastMentionedTime) { const reportActionsForReport = allReportActions?.[reportID]; - const latestMentioneReportAction = Object.values(reportActionsForReport ?? {}).find( + const latestMentionedReportAction = Object.values(reportActionsForReport ?? {}).find( (action) => action.reportActionID !== reportAction.reportActionID && ReportActionsUtils.didMessageMentionCurrentUser(action) && ReportActionsUtils.shouldReportActionBeVisible(action, action.reportActionID), ); - optimisticReport.lastMentionedTime = latestMentioneReportAction?.created ?? null; + optimisticReport.lastMentionedTime = latestMentionedReportAction?.created ?? null; } // If the API call fails we must show the original message again, so we revert the message content back to how it was // and and remove the pendingAction so the strike-through clears @@ -2171,7 +2171,7 @@ function updateRoomVisibility(reportID: string, previousValue: RoomVisibility | } /** - * This will subscribe to an existing thread, or create a new one and then subsribe to it if necessary + * This will subscribe to an existing thread, or create a new one and then subscribe to it if necessary * * @param childReportID The reportID we are trying to open * @param parentReportAction the parent comment of a thread @@ -3293,7 +3293,7 @@ function openReportFromDeepLink(url: string) { const handleDeeplinkNavigation = () => { // We want to disconnect the connection so it won't trigger the deeplink again - // every time the data is changed, for example, when relogin. + // every time the data is changed, for example, when re-login. Onyx.disconnect(connection); const state = navigationRef.getRootState(); @@ -5118,7 +5118,7 @@ function changeReportPolicy(reportID: string, policyID: string) { }); } - // 3. Optimistically create a new REPORTPREVIEW reportAction with the newReportPreviewActionID + // 3. Optimistically create a new REPORT_PREVIEW reportAction with the newReportPreviewActionID // and set it as a parent of the moved report const policyExpenseChat = getPolicyExpenseChat(currentUserAccountID, policyID); const optimisticReportPreviewAction = buildOptimisticReportPreview(policyExpenseChat, reportToMove); @@ -5170,7 +5170,7 @@ function changeReportPolicy(reportID: string, policyID: string) { }); } - // 4. Optimistically create a CHANGEPOLICY reportAction on the report using the reportActionID + // 4. Optimistically create a CHANGE_POLICY reportAction on the report using the reportActionID const optimisticMovedReportAction = buildOptimisticChangePolicyReportAction(reportToMove.policyID, policyID); optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, diff --git a/src/libs/actions/RoomMembersUserSearchPhrase.ts b/src/libs/actions/RoomMembersUserSearchPhrase.ts index 1395b1ecec7f..e057fd1487c1 100644 --- a/src/libs/actions/RoomMembersUserSearchPhrase.ts +++ b/src/libs/actions/RoomMembersUserSearchPhrase.ts @@ -6,7 +6,7 @@ function clearUserSearchPhrase() { } /** - * Persists user search phrase from the serch input across the screens. + * Persists user search phrase from the search input across the screens. */ function updateUserSearchPhrase(value: string) { Onyx.merge(ONYXKEYS.ROOM_MEMBERS_USER_SEARCH_PHRASE, value); diff --git a/src/libs/actions/Session/AttachmentImageReauthenticator.ts b/src/libs/actions/Session/AttachmentImageReauthenticator.ts index 5d23c09c5f29..67d86f2138cb 100644 --- a/src/libs/actions/Session/AttachmentImageReauthenticator.ts +++ b/src/libs/actions/Session/AttachmentImageReauthenticator.ts @@ -47,7 +47,7 @@ function deactivate() { /** * The reauthenticator is currently only used by attachment images and only when the current session is expired. - * It will only request reauthentification only once between two receptions of different sessions from Onyx + * It will only request reauthentication only once between two receptions of different sessions from Onyx * @param session the current session * @returns */ diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index e9f9823940ed..f1ca0c54f61a 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -141,7 +141,7 @@ function setSupportAuthToken(supportAuthToken: string, email: string, accountID: accountID, creationDate: new Date().getTime(), }).then(() => { - Log.info('[Supportal] Authtoken set'); + Log.info('[Supportal] Auth token set'); }); Onyx.set(ONYXKEYS.LAST_VISITED_PATH, ''); } @@ -291,7 +291,7 @@ function signOutAndRedirectToSignIn(shouldResetToHome?: boolean, shouldStashSess } // If this is a supportal token, and we've received the parameters to stashSession as true, and - // we already have a stashedSession, that means we are supportaled, currently supportaling + // we already have a stashedSession, that means we are supportal-ed, currently supportal-ing // into another account and we want to keep the stashed data from the original account. if (isSupportal && shouldStashSession && hasStashedSession()) { onyxSetParams = { diff --git a/src/libs/actions/Subscription.ts b/src/libs/actions/Subscription.ts index 0b431d5f36ed..6d65f7b35501 100644 --- a/src/libs/actions/Subscription.ts +++ b/src/libs/actions/Subscription.ts @@ -49,7 +49,7 @@ function updateSubscriptionType(type: SubscriptionType) { onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION, value: { - type: type === CONST.SUBSCRIPTION.TYPE.ANNUAL ? CONST.SUBSCRIPTION.TYPE.PAYPERUSE : CONST.SUBSCRIPTION.TYPE.ANNUAL, + type: type === CONST.SUBSCRIPTION.TYPE.ANNUAL ? CONST.SUBSCRIPTION.TYPE.PAY_PER_USE : CONST.SUBSCRIPTION.TYPE.ANNUAL, pendingFields: { type: null, }, diff --git a/src/libs/actions/Transaction.ts b/src/libs/actions/Transaction.ts index d4738e293ad3..86b806efb409 100644 --- a/src/libs/actions/Transaction.ts +++ b/src/libs/actions/Transaction.ts @@ -358,11 +358,11 @@ function updateWaypoints(transactionID: string, waypoints: WaypointCollection, i * Dismisses the duplicate transaction violation for the provided transactionIDs * and updates the transaction to include the dismissed violation in the comment. */ -function dismissDuplicateTransactionViolation(transactionIDs: string[], dissmissedPersonalDetails: PersonalDetails) { +function dismissDuplicateTransactionViolation(transactionIDs: string[], dismissedPersonalDetails: PersonalDetails) { const currentTransactionViolations = transactionIDs.map((id) => ({transactionID: id, violations: allTransactionViolation?.[id] ?? []})); const currentTransactions = transactionIDs.map((id) => allTransactions?.[id]); const transactionsReportActions = currentTransactions.map((transaction) => getIOUActionForReportID(transaction.reportID, transaction.transactionID)); - const optimisticDissmidedViolationReportActions = transactionsReportActions.map(() => { + const optimisticDismissedViolationReportActions = transactionsReportActions.map(() => { return buildOptimisticDismissedViolationReportAction({reason: 'manual', violationName: CONST.VIOLATIONS.DUPLICATED_TRANSACTION}); }); @@ -370,13 +370,13 @@ function dismissDuplicateTransactionViolation(transactionIDs: string[], dissmiss const failureData: OnyxUpdate[] = []; const optimisticReportActions: OnyxUpdate[] = transactionsReportActions.map((action, index) => { - const optimisticDissmidedViolationReportAction = optimisticDissmidedViolationReportActions.at(index); + const optimisticDismissedViolationReportAction = optimisticDismissedViolationReportActions.at(index); return { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${action?.childReportID}`, - value: optimisticDissmidedViolationReportAction + value: optimisticDismissedViolationReportAction ? { - [optimisticDissmidedViolationReportAction.reportActionID]: optimisticDissmidedViolationReportAction as ReportAction, + [optimisticDismissedViolationReportAction.reportActionID]: optimisticDismissedViolationReportAction as ReportAction, } : undefined, }; @@ -399,7 +399,7 @@ function dismissDuplicateTransactionViolation(transactionIDs: string[], dissmiss ...transaction.comment, dismissedViolations: { duplicatedTransaction: { - [dissmissedPersonalDetails.login ?? '']: getUnixTime(new Date()), + [dismissedPersonalDetails.login ?? '']: getUnixTime(new Date()), }, }, }, @@ -423,13 +423,13 @@ function dismissDuplicateTransactionViolation(transactionIDs: string[], dissmiss })); const failureReportActions: OnyxUpdate[] = transactionsReportActions.map((action, index) => { - const optimisticDissmidedViolationReportAction = optimisticDissmidedViolationReportActions.at(index); + const optimisticDismissedViolationReportAction = optimisticDismissedViolationReportActions.at(index); return { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${action?.childReportID}`, - value: optimisticDissmidedViolationReportAction + value: optimisticDismissedViolationReportAction ? { - [optimisticDissmidedViolationReportAction.reportActionID]: null, + [optimisticDismissedViolationReportAction.reportActionID]: null, } : undefined, }; @@ -440,13 +440,13 @@ function dismissDuplicateTransactionViolation(transactionIDs: string[], dissmiss failureData.push(...failureReportActions); const successData: OnyxUpdate[] = transactionsReportActions.map((action, index) => { - const optimisticDissmidedViolationReportAction = optimisticDissmidedViolationReportActions.at(index); + const optimisticDismissedViolationReportAction = optimisticDismissedViolationReportActions.at(index); return { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${action?.childReportID}`, - value: optimisticDissmidedViolationReportAction + value: optimisticDismissedViolationReportAction ? { - [optimisticDissmidedViolationReportAction.reportActionID]: null, + [optimisticDismissedViolationReportAction.reportActionID]: null, } : undefined, }; @@ -458,7 +458,7 @@ function dismissDuplicateTransactionViolation(transactionIDs: string[], dissmiss const params: DismissViolationParams = { name: CONST.VIOLATIONS.DUPLICATED_TRANSACTION, transactionIDList: transactionIDs.join(','), - reportActionIDList: optimisticDissmidedViolationReportActions.map(() => NumberUtils.rand64()).join(','), + reportActionIDList: optimisticDismissedViolationReportActions.map(() => NumberUtils.rand64()).join(','), }; API.write(WRITE_COMMANDS.DISMISS_VIOLATION, params, { @@ -778,7 +778,7 @@ function changeTransactionsReport(transactionIDs: string[], reportID: string) { ); } - // 6. Add MOVEDTRANSACTION or UNREPORTEDTRANSACTION report actions + // 6. Add MOVED_TRANSACTION or UNREPORTED_TRANSACTION report actions const movedAction = reportID === CONST.REPORT.UNREPORTED_REPORT_ID ? buildOptimisticUnreportedTransactionAction(transactionThreadReportID, transaction.reportID) diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index a79567a10b17..8aa1904599eb 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -88,7 +88,7 @@ Onyx.connect({ }); /** - * Attempt to close the user's accountt + * Attempt to close the user's account */ function closeAccount(reason: string) { // Note: successData does not need to set isLoading to false because if the CloseAccount @@ -118,7 +118,7 @@ function closeAccount(reason: string) { } /** - * Resends a validation link to a given login + * Resend a validation link to a given login */ function resendValidateCode(login: string) { sessionResendValidateCode(login); @@ -280,7 +280,7 @@ function clearContactMethod(contactMethod: string) { } /** - * Clears error for a sepcific field on validate action code. + * Clears error for a specific field on validate action code. */ function clearValidateCodeActionError(fieldName: string) { Onyx.merge(ONYXKEYS.VALIDATE_ACTION_CODE, { @@ -701,7 +701,7 @@ function playSoundForMessageType(pushJSON: OnyxServerUpdate[]) { for (const data of flatten) { // Someone completes a task - if (data.actionName === 'TASKCOMPLETED') { + if (data.actionName === CONST.REPORT.ACTIONS.TYPE.TASK_COMPLETED) { return playSound(SOUNDS.SUCCESS); } } @@ -779,7 +779,7 @@ function subscribeToPusherPong() { Timing.end(CONST.TIMING.PUSHER_PING_PONG); - // When any PONG event comes in, reset this flag so that checkforLatePongReplies will resume looking for missed PONGs + // When any PONG event comes in, reset this flag so that checkForLatePongReplies will resume looking for missed PONGs pongHasBeenMissed = false; }); } @@ -817,9 +817,9 @@ function pingPusher() { Timing.start(CONST.TIMING.PUSHER_PING_PONG); } -function checkforLatePongReplies() { +function checkForLatePongReplies() { if (isOffline()) { - Log.info('[Pusher PINGPONG] Skipping checkforLatePongReplies because the client is offline'); + Log.info('[Pusher PINGPONG] Skipping checkForLatePongReplies because the client is offline'); return; } @@ -844,7 +844,7 @@ function checkforLatePongReplies() { } let pingPusherIntervalID: ReturnType; -let checkforLatePongRepliesIntervalID: ReturnType; +let checkForLatePongRepliesIntervalID: ReturnType; function initializePusherPingPong() { // Only run the ping pong from the leader client if (!ActiveClientManager.isClientTheLeader()) { @@ -870,11 +870,11 @@ function initializePusherPingPong() { // events to be sent and received setTimeout(() => { // If things are initializing again (which is fine because it will reinitialize each time Pusher authenticates), clear the old intervals - if (checkforLatePongRepliesIntervalID) { - clearInterval(checkforLatePongRepliesIntervalID); + if (checkForLatePongRepliesIntervalID) { + clearInterval(checkForLatePongRepliesIntervalID); } // Check for any missing pong events on a regular interval - checkforLatePongRepliesIntervalID = setInterval(checkforLatePongReplies, CHECK_LATE_PONG_INTERVAL_LENGTH_IN_SECONDS * 1000); + checkForLatePongRepliesIntervalID = setInterval(checkForLatePongReplies, CHECK_LATE_PONG_INTERVAL_LENGTH_IN_SECONDS * 1000); }, PING_INTERVAL_LENGTH_IN_SECONDS * 2); } @@ -908,7 +908,7 @@ function subscribeToUserEvents() { applyOnyxUpdatesReliably(updates); }); - // Debounce the playSoundForMessageType function to avoid playing sounds too often, for example when a user comeback after offline and alot of messages come in + // Debounce the playSoundForMessageType function to avoid playing sounds too often, for example when a user comeback after offline and a lot of messages come in // See https://github.com/Expensify/App/issues/57961 for more details const debouncedPlaySoundForMessageType = debounce( (pushJSONMessage: OnyxServerUpdate[]) => { diff --git a/src/libs/actions/connections/index.ts b/src/libs/actions/connections/index.ts index a2cd42b258bd..212bdc4d9e92 100644 --- a/src/libs/actions/connections/index.ts +++ b/src/libs/actions/connections/index.ts @@ -79,7 +79,7 @@ function removePolicyConnection(policyID: string, connectionName: PolicyConnecti } /** - * This method returns read command and stage in progres for a given accounting integration. + * This method returns read command and stage in progress for a given accounting integration. * * @param policyID - ID of the policy for which the sync is needed * @param connectionName - Name of the connection, QBO/Xero diff --git a/src/libs/asyncOpenURL/index.ts b/src/libs/asyncOpenURL/index.ts index 5aff101933af..b52f7fbe99b7 100644 --- a/src/libs/asyncOpenURL/index.ts +++ b/src/libs/asyncOpenURL/index.ts @@ -12,7 +12,7 @@ const asyncOpenURL: AsyncOpenURL = (promise, url) => { Linking.openURL(typeof url === 'string' ? url : url(params)); }) .catch(() => { - Log.warn('[asyncOpenURL] error occured while opening URL', {url}); + Log.warn('[asyncOpenURL] error occurred while opening URL', {url}); }); }; diff --git a/src/libs/asyncOpenURL/index.website.ts b/src/libs/asyncOpenURL/index.website.ts index ba7da73616c2..ac3c4488e4b2 100644 --- a/src/libs/asyncOpenURL/index.website.ts +++ b/src/libs/asyncOpenURL/index.website.ts @@ -23,7 +23,7 @@ const asyncOpenURL: AsyncOpenURL = (promise, url, shouldSkipCustomSafariLogic, s (Linking.openURL as LinkingWeb['openURL'])(typeof url === 'string' ? url : url(params), shouldOpenInSameTab && canOpenURLInSameTab ? '_self' : undefined); }) .catch(() => { - Log.warn('[asyncOpenURL] error occured while opening URL', {url}); + Log.warn('[asyncOpenURL] error occurred while opening URL', {url}); }); } else { const windowRef = window.open(); @@ -36,7 +36,7 @@ const asyncOpenURL: AsyncOpenURL = (promise, url, shouldSkipCustomSafariLogic, s }) .catch(() => { windowRef?.close(); - Log.warn('[asyncOpenURL] error occured while opening URL', {url}); + Log.warn('[asyncOpenURL] error occurred while opening URL', {url}); }); } }; diff --git a/src/libs/convertToLTRForComposer/index.ts b/src/libs/convertToLTRForComposer/index.ts index 804f5a4cd7e5..82e616655221 100644 --- a/src/libs/convertToLTRForComposer/index.ts +++ b/src/libs/convertToLTRForComposer/index.ts @@ -9,7 +9,7 @@ function hasRTLCharacters(text: string): boolean { // Converts a given text to ensure it starts with the LTR (Left-to-Right) marker. const convertToLTRForComposer: ConvertToLTRForComposer = (text) => { - // Ensure that the text starts with RTL characters if not we return the same text to avoid concatination with special + // Ensure that the text starts with RTL characters if not we return the same text to avoid concatenation with special // character at the start which leads to unexpected behaviour for Emoji/Mention suggestions. if (!hasRTLCharacters(text)) { // If text is empty string return empty string to avoid an empty draft due to special character. diff --git a/src/libs/fileDownload/index.ios.ts b/src/libs/fileDownload/index.ios.ts index 7558bad70ec0..c98839670070 100644 --- a/src/libs/fileDownload/index.ios.ts +++ b/src/libs/fileDownload/index.ios.ts @@ -139,7 +139,7 @@ const fileDownload: FileDownload = (fileUrl, fileName, successMessage, _, formDa .catch((err: Error) => { // iOS shows permission popup only once. Subsequent request will only throw an error. // We catch the error and show a redirection link to the settings screen - if (err.message === CONST.IOS_CAMERAROLL_ACCESS_ERROR) { + if (err.message === CONST.IOS_CAMERA_ROLL_ACCESS_ERROR) { showPermissionErrorAlert(); } else { showGeneralErrorAlert(); diff --git a/src/libs/getPlatform/index.ts b/src/libs/getPlatform/index.ts index aedb4610673e..fc6b41c1f460 100644 --- a/src/libs/getPlatform/index.ts +++ b/src/libs/getPlatform/index.ts @@ -4,7 +4,7 @@ import type Platform from './types'; export default function getPlatform(shouldMobileWebBeDistinctFromWeb = false): Platform { if (shouldMobileWebBeDistinctFromWeb && Browser.isMobile()) { - return CONST.PLATFORM.MOBILEWEB; + return CONST.PLATFORM.MOBILE_WEB; } return CONST.PLATFORM.WEB; } diff --git a/src/pages/ReimbursementAccount/NonUSD/SignerInfo/index.tsx b/src/pages/ReimbursementAccount/NonUSD/SignerInfo/index.tsx index da9660a89ee8..af4b84012a65 100644 --- a/src/pages/ReimbursementAccount/NonUSD/SignerInfo/index.tsx +++ b/src/pages/ReimbursementAccount/NonUSD/SignerInfo/index.tsx @@ -8,7 +8,7 @@ import useSubStep from '@hooks/useSubStep'; import type {SubStepProps} from '@hooks/useSubStep/types'; import Navigation from '@navigation/Navigation'; import getSignerDetailsAndSignerFilesForSignerInfo from '@pages/ReimbursementAccount/NonUSD/utils/getSignerDetailsAndSignerFilesForSignerInfo'; -import {clearReimbursementAccoungSaveCorplayOnboardingDirectorInformation, saveCorpayOnboardingDirectorInformation} from '@userActions/BankAccounts'; +import {clearReimbursementAccountSaveCorpayOnboardingDirectorInformation, saveCorpayOnboardingDirectorInformation} from '@userActions/BankAccounts'; import {clearErrors} from '@userActions/FormActions'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -73,15 +73,15 @@ function SignerInfo({onBackButtonPress, onSubmit}: SignerInfoProps) { if (reimbursementAccount?.isSuccess) { if (currency === CONST.CURRENCY.AUD) { setCurrentSubStep(SUBSTEP.ENTER_EMAIL); - clearReimbursementAccoungSaveCorplayOnboardingDirectorInformation(); + clearReimbursementAccountSaveCorpayOnboardingDirectorInformation(); return; } onSubmit(); - clearReimbursementAccoungSaveCorplayOnboardingDirectorInformation(); + clearReimbursementAccountSaveCorpayOnboardingDirectorInformation(); } return () => { - clearReimbursementAccoungSaveCorplayOnboardingDirectorInformation(); + clearReimbursementAccountSaveCorpayOnboardingDirectorInformation(); }; }, [reimbursementAccount, onSubmit, currency]); diff --git a/src/pages/ScheduleCall/ScheduleCallPage.tsx b/src/pages/ScheduleCall/ScheduleCallPage.tsx index cd5355bd7819..3ddbc5617315 100644 --- a/src/pages/ScheduleCall/ScheduleCallPage.tsx +++ b/src/pages/ScheduleCall/ScheduleCallPage.tsx @@ -198,7 +198,7 @@ function ScheduleCallPage() { }, reportID, }); - Navigation.navigate(ROUTES.SCHEDULE_CALL_CONFIRMATON.getRoute(reportID)); + Navigation.navigate(ROUTES.SCHEDULE_CALL_CONFIRMATION.getRoute(reportID)); }} shouldEnableHapticFeedback style={styles.twoColumnLayoutCol} diff --git a/src/pages/Share/SubmitDetailsPage.tsx b/src/pages/Share/SubmitDetailsPage.tsx index 295ecf9b832a..4e38e8bf49ab 100644 --- a/src/pages/Share/SubmitDetailsPage.tsx +++ b/src/pages/Share/SubmitDetailsPage.tsx @@ -137,7 +137,7 @@ function SubmitDetailsPage({ } const receipt: Receipt = file; - receipt.state = file && CONST.IOU.RECEIPT_STATE.SCANREADY; + receipt.state = file && CONST.IOU.RECEIPT_STATE.SCAN_READY; if (locationPermissionGranted) { getCurrentPosition( (successData) => { diff --git a/src/pages/TransactionReceiptPage.tsx b/src/pages/TransactionReceiptPage.tsx index e3d70a93eba1..0c08e31509c9 100644 --- a/src/pages/TransactionReceiptPage.tsx +++ b/src/pages/TransactionReceiptPage.tsx @@ -91,7 +91,7 @@ function TransactionReceipt({route}: TransactionReceiptProps) { // eslint-disable-next-line rulesdir/no-negated-variables const shouldShowNotFoundPage = - isTrackExpenseReport || isDraftTransaction || transaction?.reportID === CONST.REPORT.SPLIT_REPORTID || isFromReviewDuplicates + isTrackExpenseReport || isDraftTransaction || transaction?.reportID === CONST.REPORT.SPLIT_REPORT_ID || isFromReviewDuplicates ? !transaction : moneyRequestReportID !== transaction?.reportID; diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index 36aa086be5e7..5a91793d8d2d 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -35,7 +35,7 @@ import { getPolicyChangeLogDefaultTitleEnforcedMessage, getPolicyChangeLogDeleteMemberMessage, getPolicyChangeLogMaxExpenseAmountMessage, - getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage, + getPolicyChangeLogMaxExpenseAmountNoReceiptMessage, getRemovedConnectionMessage, getRenamedAction, getReportActionMessageText, @@ -537,7 +537,7 @@ const ContextMenuActions: ContextMenuAction[] = [ } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_FIELD) { setClipboardMessage(getWorkspaceUpdateFieldMessage(reportAction)); } else if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT) { - Clipboard.setString(getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage(reportAction)); + Clipboard.setString(getPolicyChangeLogMaxExpenseAmountNoReceiptMessage(reportAction)); } else if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT) { Clipboard.setString(getPolicyChangeLogMaxExpenseAmountMessage(reportAction)); } else if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DEFAULT_BILLABLE) { diff --git a/src/pages/home/report/PureReportActionItem.tsx b/src/pages/home/report/PureReportActionItem.tsx index b9df0269d1d1..f9dc7e90314c 100644 --- a/src/pages/home/report/PureReportActionItem.tsx +++ b/src/pages/home/report/PureReportActionItem.tsx @@ -68,7 +68,7 @@ import { getPolicyChangeLogDefaultTitleEnforcedMessage, getPolicyChangeLogDeleteMemberMessage, getPolicyChangeLogMaxExpenseAmountMessage, - getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage, + getPolicyChangeLogMaxExpenseAmountNoReceiptMessage, getRemovedConnectionMessage, getRemovedFromApprovalChainMessage, getRenamedAction, @@ -1064,7 +1064,7 @@ function PureReportActionItem({ } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_FIELD)) { children = ; } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT)) { - children = ; + children = ; } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT)) { children = ; } else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DEFAULT_BILLABLE)) { diff --git a/src/pages/home/report/ReportFooter.tsx b/src/pages/home/report/ReportFooter.tsx index 2b61bbf000cc..f8503c339658 100644 --- a/src/pages/home/report/ReportFooter.tsx +++ b/src/pages/home/report/ReportFooter.tsx @@ -96,7 +96,7 @@ function ReportFooter({ return new Date(dateString) >= new Date(); } catch (error) { // If the NVP is malformed, we'll assume the user is not blocked from chat. This is not expected, so if it happens we'll log an alert. - Log.alert(`[${CONST.ERROR.ENSURE_BUGBOT}] Found malformed ${ONYXKEYS.NVP_BLOCKED_FROM_CHAT} nvp`, dateString); + Log.alert(`[${CONST.ERROR.ENSURE_BUG_BOT}] Found malformed ${ONYXKEYS.NVP_BLOCKED_FROM_CHAT} nvp`, dateString); return false; } }, diff --git a/src/pages/iou/SplitBillDetailsPage.tsx b/src/pages/iou/SplitBillDetailsPage.tsx index 83c20beeab99..b7861aa276a9 100644 --- a/src/pages/iou/SplitBillDetailsPage.tsx +++ b/src/pages/iou/SplitBillDetailsPage.tsx @@ -64,7 +64,7 @@ function SplitBillDetailsPage({route, report, reportAction}: SplitBillDetailsPag const participantsExcludingPayee = participants.filter((participant) => participant.accountID !== reportAction?.actorAccountID); const isScanning = hasReceipt(transaction) && isReceiptBeingScanned(transaction); - const hasSmartScanFailed = hasReceipt(transaction) && transaction?.receipt?.state === CONST.IOU.RECEIPT_STATE.SCANFAILED; + const hasSmartScanFailed = hasReceipt(transaction) && transaction?.receipt?.state === CONST.IOU.RECEIPT_STATE.SCAN_FAILED; const isEditingSplitBill = session?.accountID === actorAccountID && areRequiredFieldsEmpty(transaction); const isDistanceRequest = isDistanceRequestUtil(transaction); const [isConfirmed, setIsConfirmed] = useState(false); diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index 99d7d5d895cb..f0e5f82ca186 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -368,9 +368,9 @@ function IOURequestStepConfirmation({ const receipt: Receipt = file; if (transaction?.receipt?.isTestReceipt) { receipt.isTestReceipt = true; - receipt.state = CONST.IOU.RECEIPT_STATE.SCANCOMPLETE; + receipt.state = CONST.IOU.RECEIPT_STATE.SCAN_COMPLETE; } else { - receipt.state = file && requestType === CONST.IOU.REQUEST_TYPE.MANUAL ? CONST.IOU.RECEIPT_STATE.OPEN : CONST.IOU.RECEIPT_STATE.SCANREADY; + receipt.state = file && requestType === CONST.IOU.REQUEST_TYPE.MANUAL ? CONST.IOU.RECEIPT_STATE.OPEN : CONST.IOU.RECEIPT_STATE.SCAN_READY; } setReceiptFile(receipt); diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx index 0afa82d90787..953968289981 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx @@ -354,7 +354,7 @@ function IOURequestStepScan({ if (shouldSkipConfirmation) { const receipt: Receipt = file; receipt.source = source; - receipt.state = CONST.IOU.RECEIPT_STATE.SCANREADY; + receipt.state = CONST.IOU.RECEIPT_STATE.SCAN_READY; if (iouType === CONST.IOU.TYPE.SPLIT) { playSound(SOUNDS.DONE); startSplitBill({ diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.tsx index dd6f72a7b088..ba266d1bffda 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.tsx @@ -378,7 +378,7 @@ function IOURequestStepScan({ if (shouldSkipConfirmation) { const receipt: Receipt = file; receipt.source = source; - receipt.state = CONST.IOU.RECEIPT_STATE.SCANREADY; + receipt.state = CONST.IOU.RECEIPT_STATE.SCAN_READY; if (iouType === CONST.IOU.TYPE.SPLIT) { playSound(SOUNDS.DONE); startSplitBill({ @@ -882,7 +882,7 @@ function IOURequestStepScan({ ); const elementTopOffset = useMemo(() => { - if (platform === CONST.PLATFORM.MOBILEWEB) { + if (platform === CONST.PLATFORM.MOBILE_WEB) { return SMALL_SCREEN_TOOLTIP_OFFSET; } diff --git a/src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCard.tsx b/src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCard.tsx index bf6934f8f84b..751a8f40f45b 100644 --- a/src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCard.tsx +++ b/src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCard.tsx @@ -17,11 +17,11 @@ import type CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import SubscriptionPlanCardActionButton from './SubscriptionPlanCardActionButton'; -type PersonalPolicyTypeExludedProps = Exclude, 'personal'>; +type PersonalPolicyTypeExcludedProps = Exclude, 'personal'>; type SubscriptionPlanCardProps = { /** Subscription plan to display */ - subscriptionPlan: PersonalPolicyTypeExludedProps | null; + subscriptionPlan: PersonalPolicyTypeExcludedProps | null; /** Whether the plan card was rendered inside the comparison modal */ isFromComparisonModal?: boolean; @@ -106,4 +106,4 @@ function SubscriptionPlanCard({subscriptionPlan, isFromComparisonModal = false, SubscriptionPlanCard.displayName = 'SubscriptionPlanCard'; export default SubscriptionPlanCard; -export type {PersonalPolicyTypeExludedProps}; +export type {PersonalPolicyTypeExcludedProps}; diff --git a/src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCardActionButton.tsx b/src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCardActionButton.tsx index f8e4c9a8170b..11ab50b9f297 100644 --- a/src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCardActionButton.tsx +++ b/src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCardActionButton.tsx @@ -15,11 +15,11 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import AddMembersButton from './AddMembersButton'; -import type {PersonalPolicyTypeExludedProps} from './SubscriptionPlanCard'; +import type {PersonalPolicyTypeExcludedProps} from './SubscriptionPlanCard'; type SubscriptionPlanCardActionButtonProps = { /** Subscription plan to display */ - subscriptionPlan: PersonalPolicyTypeExludedProps | null; + subscriptionPlan: PersonalPolicyTypeExcludedProps | null; /** Whether the plan card was rendered inside the comparison modal */ isFromComparisonModal: boolean; @@ -44,7 +44,7 @@ function SubscriptionPlanCardActionButton({subscriptionPlan, isFromComparisonMod const isAnnual = privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL; const ownerPolicies = useMemo(() => getOwnedPaidPolicies(policies, currentUserAccountID), [policies, currentUserAccountID]); - const handlePlanPress = (planType: PersonalPolicyTypeExludedProps) => { + const handlePlanPress = (planType: PersonalPolicyTypeExcludedProps) => { closeComparisonModal?.(); // If user has no policies, return. diff --git a/src/pages/settings/Subscription/SubscriptionSettings/index.native.tsx b/src/pages/settings/Subscription/SubscriptionSettings/index.native.tsx index 42cee9e508e6..0462e48a0799 100644 --- a/src/pages/settings/Subscription/SubscriptionSettings/index.native.tsx +++ b/src/pages/settings/Subscription/SubscriptionSettings/index.native.tsx @@ -94,7 +94,7 @@ function SubscriptionSettings() { ) : ( <> - {privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.PAYPERUSE ? ( + {privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.PAY_PER_USE ? ( > = [ icon: Illustrations.SubscriptionAnnual, }, { - key: CONST.SUBSCRIPTION.TYPE.PAYPERUSE, + key: CONST.SUBSCRIPTION.TYPE.PAY_PER_USE, title: 'subscription.details.payPerUse', icon: Illustrations.SubscriptionPPU, }, @@ -82,7 +82,7 @@ function SubscriptionSettings() { setIsNoDelegateAccessMenuVisible(true); return; } - if (privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL && option === CONST.SUBSCRIPTION.TYPE.PAYPERUSE && !account?.canDowngrade) { + if (privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL && option === CONST.SUBSCRIPTION.TYPE.PAY_PER_USE && !account?.canDowngrade) { Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_SIZE.getRoute(0)); return; } diff --git a/src/pages/workspace/WorkspaceOverviewPlanTypePage.tsx b/src/pages/workspace/WorkspaceOverviewPlanTypePage.tsx index 7cf17594ea9c..7add4a33fa75 100644 --- a/src/pages/workspace/WorkspaceOverviewPlanTypePage.tsx +++ b/src/pages/workspace/WorkspaceOverviewPlanTypePage.tsx @@ -19,7 +19,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import OpenWorkspacePlanPage from '@libs/actions/Policy/Plan'; import Navigation from '@navigation/Navigation'; import CardSectionUtils from '@pages/settings/Subscription/CardSection/utils'; -import type {PersonalPolicyTypeExludedProps} from '@pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCard'; +import type {PersonalPolicyTypeExcludedProps} from '@pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCard'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -57,8 +57,8 @@ function WorkspaceOverviewPlanTypePage({policy}: WithPolicyProps) { .filter((type) => type !== CONST.POLICY.TYPE.PERSONAL) .map((policyType) => ({ value: policyType, - text: translate(`workspace.planTypePage.planTypes.${policyType as PersonalPolicyTypeExludedProps}.label`), - alternateText: translate(`workspace.planTypePage.planTypes.${policyType as PersonalPolicyTypeExludedProps}.description`), + text: translate(`workspace.planTypePage.planTypes.${policyType as PersonalPolicyTypeExcludedProps}.label`), + alternateText: translate(`workspace.planTypePage.planTypes.${policyType as PersonalPolicyTypeExcludedProps}.description`), keyForList: policyType, isSelected: policyType === currentPlan, })) diff --git a/src/pages/workspace/tags/WorkspaceEditTagsPage.tsx b/src/pages/workspace/tags/WorkspaceEditTagsPage.tsx index 23ea7cd041b5..368e70a56868 100644 --- a/src/pages/workspace/tags/WorkspaceEditTagsPage.tsx +++ b/src/pages/workspace/tags/WorkspaceEditTagsPage.tsx @@ -15,7 +15,7 @@ import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavig import {getCleanedTagName, getTagListName} from '@libs/PolicyUtils'; import type {SettingsNavigatorParamList} from '@navigation/types'; import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper'; -import {renamePolicyTaglist} from '@userActions/Policy/Tag'; +import {renamePolicyTagList} from '@userActions/Policy/Tag'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -58,7 +58,7 @@ function WorkspaceEditTagsPage({route}: WorkspaceEditTagsPageProps) { const updateTaglistName = useCallback( (values: FormOnyxValues) => { if (values[INPUT_IDS.POLICY_TAGS_NAME] !== taglistName) { - renamePolicyTaglist(route.params.policyID, {oldName: taglistName, newName: values[INPUT_IDS.POLICY_TAGS_NAME]}, policyTags, route.params.orderWeight); + renamePolicyTagList(route.params.policyID, {oldName: taglistName, newName: values[INPUT_IDS.POLICY_TAGS_NAME]}, policyTags, route.params.orderWeight); } goBackToTagsSettings(); }, diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index 762ac3979b84..bc2f2fff8c09 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -2019,7 +2019,7 @@ describe('actions/IOU', () => { vitTransaction = Object.values(allTransactions ?? {}).find( (transaction) => vitIOUAction && transaction?.transactionID === getOriginalMessage(vitIOUAction)?.IOUTransactionID, ); - groupTransaction = Object.values(allTransactions ?? {}).find((transaction) => transaction?.reportID === CONST.REPORT.SPLIT_REPORTID); + groupTransaction = Object.values(allTransactions ?? {}).find((transaction) => transaction?.reportID === CONST.REPORT.SPLIT_REPORT_ID); expect(carlosTransaction?.reportID).toBe(carlosIOUReport?.reportID); expect(julesTransaction?.reportID).toBe(julesIOUReport?.reportID); @@ -3773,9 +3773,9 @@ describe('actions/IOU', () => { expect(iouReport).toHaveProperty('chatReportID'); expect(iouReport?.total).toBe(30000); - const ioupreview = chatReport?.reportID && iouReport?.reportID ? getReportPreviewAction(chatReport.reportID, iouReport.reportID) : undefined; - expect(ioupreview).toBeTruthy(); - expect(getReportActionText(ioupreview)).toBe('rory@expensifail.com owes $300.00'); + const iouPreview = chatReport?.reportID && iouReport?.reportID ? getReportPreviewAction(chatReport.reportID, iouReport.reportID) : undefined; + expect(iouPreview).toBeTruthy(); + expect(getReportActionText(iouPreview)).toBe('rory@expensifail.com owes $300.00'); // When we delete the first expense mockFetch?.pause?.(); @@ -5185,7 +5185,7 @@ describe('actions/IOU', () => { modifiedAmount: 0, receipt: { source: 'test', - state: CONST.IOU.RECEIPT_STATE.SCANFAILED, + state: CONST.IOU.RECEIPT_STATE.SCAN_FAILED, }, merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, modifiedMerchant: undefined, @@ -5197,7 +5197,7 @@ describe('actions/IOU', () => { modifiedAmount: 0, receipt: { source: 'test', - state: CONST.IOU.RECEIPT_STATE.SCANFAILED, + state: CONST.IOU.RECEIPT_STATE.SCAN_FAILED, }, merchant: 'test merchant', modifiedMerchant: undefined, @@ -5246,7 +5246,7 @@ describe('actions/IOU', () => { modifiedAmount: 0, receipt: { source: 'test', - state: CONST.IOU.RECEIPT_STATE.SCANFAILED, + state: CONST.IOU.RECEIPT_STATE.SCAN_FAILED, }, merchant: 'test merchant', modifiedMerchant: undefined, @@ -5291,7 +5291,7 @@ describe('actions/IOU', () => { amount: 0, receipt: { source: 'test', - state: CONST.IOU.RECEIPT_STATE.SCANFAILED, + state: CONST.IOU.RECEIPT_STATE.SCAN_FAILED, }, merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, modifiedMerchant: undefined, @@ -5756,7 +5756,7 @@ describe('actions/IOU', () => { await getOnyxData({ key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport?.reportID}`, callback: (allReportActions) => { - const action = Object.values(allReportActions ?? {}).find((a) => a?.actionName === 'REIMBURSEMENTDEQUEUED'); + const action = Object.values(allReportActions ?? {}).find((a) => a?.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DEQUEUED); expect(action?.pendingAction).toBe(CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD); }, }); diff --git a/tests/actions/PolicyTagTest.ts b/tests/actions/PolicyTagTest.ts index 36a6126ad208..7c01a05df5ac 100644 --- a/tests/actions/PolicyTagTest.ts +++ b/tests/actions/PolicyTagTest.ts @@ -154,7 +154,7 @@ describe('actions/Policy', () => { }); }); - describe('RenamePolicyTaglist', () => { + describe('renamePolicyTagList', () => { it('rename policy tag list', () => { const fakePolicy = createRandomPolicy(0); fakePolicy.areTagsEnabled = true; @@ -170,7 +170,7 @@ describe('actions/Policy', () => { Onyx.set(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${fakePolicy.id}`, fakePolicyTags); }) .then(() => { - Tag.renamePolicyTaglist( + Tag.renamePolicyTagList( fakePolicy.id, { oldName: oldTagListName, @@ -238,7 +238,7 @@ describe('actions/Policy', () => { .then(() => { mockFetch?.fail?.(); - Tag.renamePolicyTaglist( + Tag.renamePolicyTagList( fakePolicy.id, { oldName: oldTagListName, diff --git a/tests/actions/ReportPreviewActionUtilsTest.ts b/tests/actions/ReportPreviewActionUtilsTest.ts index f60ed2464120..8dac3392d11b 100644 --- a/tests/actions/ReportPreviewActionUtilsTest.ts +++ b/tests/actions/ReportPreviewActionUtilsTest.ts @@ -41,7 +41,7 @@ jest.mock('@libs/ReportUtils', () => ({ })); jest.mock('@libs/PolicyUtils', () => ({ ...jest.requireActual('@libs/PolicyUtils'), - isPrefferedExporter: jest.fn().mockReturnValue(true), + isPreferredExporter: jest.fn().mockReturnValue(true), hasAccountingConnections: jest.fn().mockReturnValue(true), })); diff --git a/tests/unit/TransactionUtilsTest.ts b/tests/unit/TransactionUtilsTest.ts index 73556a8b8757..8b7a0dbcc400 100644 --- a/tests/unit/TransactionUtilsTest.ts +++ b/tests/unit/TransactionUtilsTest.ts @@ -300,7 +300,7 @@ describe('TransactionUtils', () => { it('should return true if transaction is receipt being scanned', () => { const transaction = generateTransaction({ receipt: { - state: CONST.IOU.RECEIPT_STATE.SCANREADY, + state: CONST.IOU.RECEIPT_STATE.SCAN_READY, }, }); expect(TransactionUtils.shouldShowRTERViolationMessage([transaction])).toBe(true); From 3d2b44f04cf5f1f66c82e7ee3e9ecae5dd9d541a Mon Sep 17 00:00:00 2001 From: dominictb Date: Tue, 13 May 2025 18:15:41 +0700 Subject: [PATCH 2/3] feedbacks --- src/CONST.ts | 2 +- src/libs/API/types.ts | 3 ++- src/libs/SearchQueryUtils.ts | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 2d9ef55cb03b..83101b40d109 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1705,7 +1705,7 @@ const CONST = { UNKNOWN_ERROR: 'Unknown error', REQUEST_CANCELLED: 'AbortError', FAILED_TO_FETCH: 'Failed to fetch', - ENSURE_BUG_BOT: 'ENSURE_BUG_BOT', + ENSURE_BUG_BOT: 'ENSURE_BUGBOT', PUSHER_ERROR: 'PusherError', WEB_SOCKET_ERROR: 'WebSocketError', NETWORK_REQUEST_FAILED: 'Network request failed', diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index ddbb4c25812b..fe698da2cb13 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -169,7 +169,8 @@ const WRITE_COMMANDS = { DELETE_POLICY_REPORT_FIELD: 'DeletePolicyReportField', SET_POLICY_TAGS_REQUIRED: 'SetPolicyTagsRequired', SET_POLICY_REQUIRES_TAG: 'SetPolicyRequiresTag', - RENAME_POLICY_TAG_LIST: 'renamePolicyTagList', + // cspell:disable-next-line + RENAME_POLICY_TAG_LIST: 'RenamePolicyTaglist', DELETE_POLICY_TAGS: 'DeletePolicyTags', UPDATE_POLICY_TAG_GL_CODE: 'UpdatePolicyTagGLCode', CREATE_TASK: 'CreateTask', diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts index ee885d1e742e..a622d46a2eef 100644 --- a/src/libs/SearchQueryUtils.ts +++ b/src/libs/SearchQueryUtils.ts @@ -43,7 +43,6 @@ const operatorToCharMap = { /** * A mapping object that maps filter names from the internal codebase format to user-friendly names. */ -// cspell:disable const UserFriendlyKeyMap: Record = { type: 'type', status: 'status', @@ -63,6 +62,7 @@ const UserFriendlyKeyMap: Record Date: Wed, 14 May 2025 22:05:31 +0700 Subject: [PATCH 3/3] fix more words --- src/libs/actions/Wallet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Wallet.ts b/src/libs/actions/Wallet.ts index ceee796a100e..e9f42788fe16 100644 --- a/src/libs/actions/Wallet.ts +++ b/src/libs/actions/Wallet.ts @@ -276,7 +276,7 @@ function issuerEncryptPayloadCallback(nonce: string, nonceSignature: string, cer /** * Add card to digital wallet * - * @param walletAcountID ID of the wallet on user's phone + * @param walletAccountID ID of the wallet on user's phone * @param deviceID ID of user's phone */ function createDigitalGoogleWallet({walletAccountID, deviceID, cardHolderName}: {deviceID: string; walletAccountID: string; cardHolderName: string}): Promise {