diff --git a/.env.production b/.env.production index cca9adf26f52..dbfd3a20ea7b 100644 --- a/.env.production +++ b/.env.production @@ -8,6 +8,7 @@ USE_WEB_PROXY=false ENVIRONMENT=production SEND_CRASH_REPORTS=true +# cspell:disable-next-line FB_API_KEY=AIzaSyBrLKgCuo6Vem6Xi5RPokdumssW8HaWBow FB_APP_ID=1:1008697809946:web:08de4ecb7656b7235445a3 FB_PROJECT_ID=expensify-mobile-app diff --git a/.github/workflows/cspell.yml b/.github/workflows/cspell.yml new file mode 100644 index 000000000000..27c02733cc5b --- /dev/null +++ b/.github/workflows/cspell.yml @@ -0,0 +1,25 @@ +name: 🧙 Check spell + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + spellcheck: + runs-on: ubuntu-latest + name: 🔍 spellcheck + steps: + - uses: actions/checkout@v4 + - uses: streetsidesoftware/cspell-action@v6 + with: + files: "**/*" + root: "." + config: "./cspell.json" + inline: error + strict: true + use_cspell_files: false + incremental_files_only: true diff --git a/.imgbotconfig b/.imgbotconfig index 45cdf03ec36e..da6942061dd1 100644 --- a/.imgbotconfig +++ b/.imgbotconfig @@ -1,6 +1,6 @@ { "ignoredFiles": [ - "assets/images/themeDependent/empty-state_background-fade-dark.png", // Caused an issue with colour gradients, https://github.com/Expensify/App/issues/30499 + "assets/images/themeDependent/empty-state_background-fade-dark.png", // Caused an issue with color gradients, https://github.com/Expensify/App/issues/30499 "assets/images/themeDependent/empty-state_background-fade-light.png" ], "aggressiveCompression": "false" diff --git a/README.md b/README.md index abd25c99ef48..cb6cfde0ab95 100644 --- a/README.md +++ b/README.md @@ -560,7 +560,7 @@ If you'd like to add HybridApp-specific patches, use the `--patch-dir` flag: ### Additional information and troubleshooting -If you seek some addtional information you can always refer to the [extended version](contributingGuides/HYBRID_APP.md) of the docs for HybridApp. You can find there extended explanation of some of the concepts, pro tips, and most common errors. +If you seek some additional information you can always refer to the [extended version](contributingGuides/HYBRID_APP.md) of the docs for HybridApp. You can find there extended explanation of some of the concepts, pro tips, and most common errors. ---- diff --git a/__mocks__/@react-navigation/native/index.ts b/__mocks__/@react-navigation/native/index.ts index 9cd0e497d75e..4e07a6480302 100644 --- a/__mocks__/@react-navigation/native/index.ts +++ b/__mocks__/@react-navigation/native/index.ts @@ -48,7 +48,7 @@ const useFocusEffect = isJestEnv ? realReactNavigation.useFocusEffect : (callbac const UNSTABLE_usePreventRemove = isJestEnv ? jest.fn() : () => {}; export { - // Overriden modules + // Overridden modules useIsFocused, useTheme, useNavigation, diff --git a/__mocks__/Illustrations.ts b/__mocks__/Illustrations.ts index 8b2b033a8ff8..76688c3e9b0b 100644 --- a/__mocks__/Illustrations.ts +++ b/__mocks__/Illustrations.ts @@ -46,7 +46,7 @@ const PinkBill = 'PinkBill'; const CreditCardsNew = 'CreditCardsNew'; const CreditCardsNewGreen = 'CreditCardsNewGreen'; const InvoiceBlue = 'InvoiceBlue'; -const LaptopwithSecondScreenandHourglass = 'LaptopwithSecondScreenandHourglass'; +const LaptopWithSecondScreenAndHourglass = 'LaptopWithSecondScreenAndHourglass'; const LockOpen = 'LockOpen'; const Luggage = 'Luggage'; const MoneyIntoWallet = 'MoneyIntoWallet'; @@ -200,7 +200,7 @@ export { CreditCardsNew, CreditCardsNewGreen, InvoiceBlue, - LaptopwithSecondScreenandHourglass, + LaptopWithSecondScreenAndHourglass, LockOpen, Luggage, MoneyIntoWallet, diff --git a/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java b/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java index fc2ba9db3624..70923e5ef637 100644 --- a/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java +++ b/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java @@ -105,7 +105,7 @@ protected NotificationCompat.Builder onExtendBuilder(@NonNull Context context, @ PushMessage message = arguments.getMessage(); Log.d(TAG, "buildNotification: " + message.toString()); - // Improve notification delivery by categorising as a time-critical message + // Improve notification delivery by categorizing as a time-critical message builder.setCategory(CATEGORY_MESSAGE); builder.setVisibility(NotificationCompat.VISIBILITY_PRIVATE); diff --git a/assets/images/LaptopwithSecondScreenandHourglass.svg b/assets/images/LaptopWithSecondScreenAndHourglass.svg similarity index 100% rename from assets/images/LaptopwithSecondScreenandHourglass.svg rename to assets/images/LaptopWithSecondScreenAndHourglass.svg diff --git a/assets/images/bankicons/american-express.svg b/assets/images/bank-icons/american-express.svg similarity index 100% rename from assets/images/bankicons/american-express.svg rename to assets/images/bank-icons/american-express.svg diff --git a/assets/images/bankicons/bank-of-america.svg b/assets/images/bank-icons/bank-of-america.svg similarity index 100% rename from assets/images/bankicons/bank-of-america.svg rename to assets/images/bank-icons/bank-of-america.svg diff --git a/assets/images/bankicons/bb-t.svg b/assets/images/bank-icons/bb-t.svg similarity index 100% rename from assets/images/bankicons/bb-t.svg rename to assets/images/bank-icons/bb-t.svg diff --git a/assets/images/bankicons/capital-one.svg b/assets/images/bank-icons/capital-one.svg similarity index 100% rename from assets/images/bankicons/capital-one.svg rename to assets/images/bank-icons/capital-one.svg diff --git a/assets/images/bankicons/charles-schwab.svg b/assets/images/bank-icons/charles-schwab.svg similarity index 100% rename from assets/images/bankicons/charles-schwab.svg rename to assets/images/bank-icons/charles-schwab.svg diff --git a/assets/images/bankicons/chase.svg b/assets/images/bank-icons/chase.svg similarity index 100% rename from assets/images/bankicons/chase.svg rename to assets/images/bank-icons/chase.svg diff --git a/assets/images/bankicons/citibank.svg b/assets/images/bank-icons/citibank.svg similarity index 100% rename from assets/images/bankicons/citibank.svg rename to assets/images/bank-icons/citibank.svg diff --git a/assets/images/bankicons/citizens-bank.svg b/assets/images/bank-icons/citizens-bank.svg similarity index 100% rename from assets/images/bankicons/citizens-bank.svg rename to assets/images/bank-icons/citizens-bank.svg diff --git a/assets/images/bankicons/discover.svg b/assets/images/bank-icons/discover.svg similarity index 100% rename from assets/images/bankicons/discover.svg rename to assets/images/bank-icons/discover.svg diff --git a/assets/images/bankicons/expensify-background.png b/assets/images/bank-icons/expensify-background.png similarity index 100% rename from assets/images/bankicons/expensify-background.png rename to assets/images/bank-icons/expensify-background.png diff --git a/assets/images/bankicons/expensify.svg b/assets/images/bank-icons/expensify.svg similarity index 100% rename from assets/images/bankicons/expensify.svg rename to assets/images/bank-icons/expensify.svg diff --git a/assets/images/bankicons/fidelity.svg b/assets/images/bank-icons/fidelity.svg similarity index 100% rename from assets/images/bankicons/fidelity.svg rename to assets/images/bank-icons/fidelity.svg diff --git a/assets/images/bankicons/generic-bank-account.svg b/assets/images/bank-icons/generic-bank-account.svg similarity index 100% rename from assets/images/bankicons/generic-bank-account.svg rename to assets/images/bank-icons/generic-bank-account.svg diff --git a/assets/images/bankicons/huntington-bank.svg b/assets/images/bank-icons/huntington-bank.svg similarity index 100% rename from assets/images/bankicons/huntington-bank.svg rename to assets/images/bank-icons/huntington-bank.svg diff --git a/assets/images/bankicons/navy-federal-credit-union.svg b/assets/images/bank-icons/navy-federal-credit-union.svg similarity index 100% rename from assets/images/bankicons/navy-federal-credit-union.svg rename to assets/images/bank-icons/navy-federal-credit-union.svg diff --git a/assets/images/bankicons/pnc.svg b/assets/images/bank-icons/pnc.svg similarity index 100% rename from assets/images/bankicons/pnc.svg rename to assets/images/bank-icons/pnc.svg diff --git a/assets/images/bankicons/regions-bank.svg b/assets/images/bank-icons/regions-bank.svg similarity index 100% rename from assets/images/bankicons/regions-bank.svg rename to assets/images/bank-icons/regions-bank.svg diff --git a/assets/images/bankicons/suntrust.svg b/assets/images/bank-icons/suntrust.svg similarity index 100% rename from assets/images/bankicons/suntrust.svg rename to assets/images/bank-icons/suntrust.svg diff --git a/assets/images/bankicons/td-bank.svg b/assets/images/bank-icons/td-bank.svg similarity index 100% rename from assets/images/bankicons/td-bank.svg rename to assets/images/bank-icons/td-bank.svg diff --git a/assets/images/bankicons/us-bank.svg b/assets/images/bank-icons/us-bank.svg similarity index 100% rename from assets/images/bankicons/us-bank.svg rename to assets/images/bank-icons/us-bank.svg diff --git a/assets/images/bankicons/usaa.svg b/assets/images/bank-icons/usaa.svg similarity index 100% rename from assets/images/bankicons/usaa.svg rename to assets/images/bank-icons/usaa.svg diff --git a/assets/images/cardicons/american-express.svg b/assets/images/card-icons/american-express.svg similarity index 100% rename from assets/images/cardicons/american-express.svg rename to assets/images/card-icons/american-express.svg diff --git a/assets/images/cardicons/bank-of-america.svg b/assets/images/card-icons/bank-of-america.svg similarity index 100% rename from assets/images/cardicons/bank-of-america.svg rename to assets/images/card-icons/bank-of-america.svg diff --git a/assets/images/cardicons/bb-t.svg b/assets/images/card-icons/bb-t.svg similarity index 100% rename from assets/images/cardicons/bb-t.svg rename to assets/images/card-icons/bb-t.svg diff --git a/assets/images/cardicons/capital-one.svg b/assets/images/card-icons/capital-one.svg similarity index 100% rename from assets/images/cardicons/capital-one.svg rename to assets/images/card-icons/capital-one.svg diff --git a/assets/images/cardicons/charles-schwab.svg b/assets/images/card-icons/charles-schwab.svg similarity index 100% rename from assets/images/cardicons/charles-schwab.svg rename to assets/images/card-icons/charles-schwab.svg diff --git a/assets/images/cardicons/chase.svg b/assets/images/card-icons/chase.svg similarity index 100% rename from assets/images/cardicons/chase.svg rename to assets/images/card-icons/chase.svg diff --git a/assets/images/cardicons/citibank.svg b/assets/images/card-icons/citibank.svg similarity index 100% rename from assets/images/cardicons/citibank.svg rename to assets/images/card-icons/citibank.svg diff --git a/assets/images/cardicons/citizens.svg b/assets/images/card-icons/citizens.svg similarity index 100% rename from assets/images/cardicons/citizens.svg rename to assets/images/card-icons/citizens.svg diff --git a/assets/images/cardicons/discover.svg b/assets/images/card-icons/discover.svg similarity index 100% rename from assets/images/cardicons/discover.svg rename to assets/images/card-icons/discover.svg diff --git a/assets/images/cardicons/expensify-card-dark.svg b/assets/images/card-icons/expensify-card-dark.svg similarity index 100% rename from assets/images/cardicons/expensify-card-dark.svg rename to assets/images/card-icons/expensify-card-dark.svg diff --git a/assets/images/cardicons/fidelity.svg b/assets/images/card-icons/fidelity.svg similarity index 100% rename from assets/images/cardicons/fidelity.svg rename to assets/images/card-icons/fidelity.svg diff --git a/assets/images/cardicons/generic-bank-card.svg b/assets/images/card-icons/generic-bank-card.svg similarity index 100% rename from assets/images/cardicons/generic-bank-card.svg rename to assets/images/card-icons/generic-bank-card.svg diff --git a/assets/images/cardicons/huntington-bank.svg b/assets/images/card-icons/huntington-bank.svg similarity index 100% rename from assets/images/cardicons/huntington-bank.svg rename to assets/images/card-icons/huntington-bank.svg diff --git a/assets/images/cardicons/navy-federal-credit-union.svg b/assets/images/card-icons/navy-federal-credit-union.svg similarity index 100% rename from assets/images/cardicons/navy-federal-credit-union.svg rename to assets/images/card-icons/navy-federal-credit-union.svg diff --git a/assets/images/cardicons/pnc.svg b/assets/images/card-icons/pnc.svg similarity index 100% rename from assets/images/cardicons/pnc.svg rename to assets/images/card-icons/pnc.svg diff --git a/assets/images/cardicons/regions-bank.svg b/assets/images/card-icons/regions-bank.svg similarity index 100% rename from assets/images/cardicons/regions-bank.svg rename to assets/images/card-icons/regions-bank.svg diff --git a/assets/images/cardicons/suntrust.svg b/assets/images/card-icons/suntrust.svg similarity index 100% rename from assets/images/cardicons/suntrust.svg rename to assets/images/card-icons/suntrust.svg diff --git a/assets/images/cardicons/td-bank.svg b/assets/images/card-icons/td-bank.svg similarity index 100% rename from assets/images/cardicons/td-bank.svg rename to assets/images/card-icons/td-bank.svg diff --git a/assets/images/cardicons/us-bank.svg b/assets/images/card-icons/us-bank.svg similarity index 100% rename from assets/images/cardicons/us-bank.svg rename to assets/images/card-icons/us-bank.svg diff --git a/assets/images/cardicons/usaa.svg b/assets/images/card-icons/usaa.svg similarity index 100% rename from assets/images/cardicons/usaa.svg rename to assets/images/card-icons/usaa.svg diff --git a/assets/images/integrationicons/netsuite-icon-square.svg b/assets/images/integration-icons/netsuite-icon-square.svg similarity index 100% rename from assets/images/integrationicons/netsuite-icon-square.svg rename to assets/images/integration-icons/netsuite-icon-square.svg diff --git a/assets/images/integrationicons/qbd-icon-square.svg b/assets/images/integration-icons/qbd-icon-square.svg similarity index 100% rename from assets/images/integrationicons/qbd-icon-square.svg rename to assets/images/integration-icons/qbd-icon-square.svg diff --git a/assets/images/integrationicons/qbo-icon-circle.svg b/assets/images/integration-icons/qbo-icon-circle.svg similarity index 100% rename from assets/images/integrationicons/qbo-icon-circle.svg rename to assets/images/integration-icons/qbo-icon-circle.svg diff --git a/assets/images/integrationicons/qbo-icon-square.svg b/assets/images/integration-icons/qbo-icon-square.svg similarity index 100% rename from assets/images/integrationicons/qbo-icon-square.svg rename to assets/images/integration-icons/qbo-icon-square.svg diff --git a/assets/images/integrationicons/sage-intacct-icon-square.svg b/assets/images/integration-icons/sage-intacct-icon-square.svg similarity index 100% rename from assets/images/integrationicons/sage-intacct-icon-square.svg rename to assets/images/integration-icons/sage-intacct-icon-square.svg diff --git a/assets/images/integrationicons/xero-icon-circle.svg b/assets/images/integration-icons/xero-icon-circle.svg similarity index 100% rename from assets/images/integrationicons/xero-icon-circle.svg rename to assets/images/integration-icons/xero-icon-circle.svg diff --git a/assets/images/integrationicons/xero-icon-square.svg b/assets/images/integration-icons/xero-icon-square.svg similarity index 100% rename from assets/images/integrationicons/xero-icon-square.svg rename to assets/images/integration-icons/xero-icon-square.svg diff --git a/config/webpack/webpack.common.ts b/config/webpack/webpack.common.ts index 591bdd1f699d..557152bcec43 100644 --- a/config/webpack/webpack.common.ts +++ b/config/webpack/webpack.common.ts @@ -294,7 +294,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment): optimization: { minimizer: [ - // default settings accordint to https://webpack.js.org/configuration/optimization/#optimizationminimizer + // default settings according to https://webpack.js.org/configuration/optimization/#optimizationminimizer // with addition of preserving the class name for ImageManipulator (expo module) new TerserPlugin({ terserOptions: { diff --git a/contributingGuides/ACCESSIBILITY.md b/contributingGuides/ACCESSIBILITY.md index ff73eaf2942e..db695af6f2fa 100644 --- a/contributingGuides/ACCESSIBILITY.md +++ b/contributingGuides/ACCESSIBILITY.md @@ -4,11 +4,11 @@ - **GenericPressable**: A basic pressable component with generic functionality. It should generally only be used to creating a new, custom pressable components. Avoid using it directly. -- **PressableWithFeedback**: A pressable component that provides standarised visual and haptic feedback upon pressing. +- **PressableWithFeedback**: A pressable component that provides standardized visual and haptic feedback upon pressing. - **PressableWithoutFeedback**: A pressable component without any visual or haptic feedback. -- **PressableWithoutFocus**: A pressable component without visible efect of focus. +- **PressableWithoutFocus**: A pressable component without visible effect of focus. - **PressableWithDelayToggle**: A pressable component that briefly disables then re-enables after a short delay upon pressing. @@ -21,7 +21,7 @@ When implementing pressable components, it's essential to create accessible flow - size of any pressable component should be at least 44x44dp. This is the minimum size recommended by Apple and Google for touch targets. If the pressable component is smaller than `44x44dp`, it will be difficult for users with motor disabilities to interact with it. Pressable components have a `autoHitSlop` prop that can be used to automatically increase the size of the pressable component to `44x44dp`. This prop accepts a boolean value. If set to true, the pressable component will automatically increase its touchable size to `44x44dp`. If set to false, the pressable component will not increase its size. By default, this prop is set to false. -- ensure that the pressable component has a label and hint. This is especially important for users with visual disabilities who rely on screen readers to navigate the app. All Pressable components have a `accessibilitylabel` prop that can be used to set the label of the pressable component. This prop accepts a string value. All Pressable components also have a `accessibilityHint` prop that can be used to set the hint of the pressable component. This prop accepts a string value. The `accessibilityHint` prop is optional. If not set, the pressable component will fallback to the `accessibilityLabel` prop. For example, if you have a button that opens a modal, you can set the `accessibilityLabel` to "Open modal" and the `accessibilityHint` to "Opens a modal with more information". This way, when the user focuses on the button, the screen reader will read "Open modal. Opens a modal with more information". This will help the user understand what the button does and what to expect after pressing it. +- ensure that the pressable component has a label and hint. This is especially important for users with visual disabilities who rely on screen readers to navigate the app. All Pressable components have a `accessibilityLabel` prop that can be used to set the label of the pressable component. This prop accepts a string value. All Pressable components also have a `accessibilityHint` prop that can be used to set the hint of the pressable component. This prop accepts a string value. The `accessibilityHint` prop is optional. If not set, the pressable component will fallback to the `accessibilityLabel` prop. For example, if you have a button that opens a modal, you can set the `accessibilityLabel` to "Open modal" and the `accessibilityHint` to "Opens a modal with more information". This way, when the user focuses on the button, the screen reader will read "Open modal. Opens a modal with more information". This will help the user understand what the button does and what to expect after pressing it. - the `enableInScreenReaderStates` prop proves invaluable when aiming to enhance the accessibility of clickable elements, particularly when desiring to enlarge the clickable area of a component, such as an entire row. This can be especially useful, for instance, when dealing with tables where only a small portion of a row, like a checkbox, might traditionally trigger an action. By employing this prop, developers can ensure that the entirety of a designated component, in this case a row, is made accessible to users employing screen readers. This creates a more inclusive user experience, allowing individuals relying on screen readers to interact with the component effortlessly. For instance, in a table, using this prop on a row component enables users to click anywhere within the row to trigger an action, significantly improving accessibility and user-friendliness. diff --git a/contributingGuides/HYBRID_APP.md b/contributingGuides/HYBRID_APP.md index 48d2bbbc5b92..e18641abca71 100644 --- a/contributingGuides/HYBRID_APP.md +++ b/contributingGuides/HYBRID_APP.md @@ -3,7 +3,7 @@ Every React Native mobile application needs native codebase with an entry point, It means that whenever we create a React Native application from scratch we instantiate it on a (very basic, bare) native codebase. However, we can always use a different, already existing codebase to run React Native. This is how we've built HybridApp - we've created a new `ReactRootView`, and taken all JavaScript code to run it within the existing mobile application (OldDot). -It means that HybridApp is a **regular native application**, which has an additional screen that runs React Native. HybridApp let us combine New Expensify and our classic app into a single mobile app for a seemless migration +It means that HybridApp is a **regular native application**, which has an additional screen that runs React Native. HybridApp let us combine New Expensify and our classic app into a single mobile app for a seamless migration # How is HybridApp built? If you have access to the closed-source `Mobile-Expensify` repository, you are eligible to build HybridApp. The main difference between NewDot and HybridApp is that the native code is located in a different place. The native code is located under `./Mobile-Expensify/Android` and `./Mobile-Expensify/iOS`. @@ -116,14 +116,14 @@ In this case you can do the following: 1. `rm -rf node_modules` 2. `npm i-standalone` 3. `npm run pod-install-standalone` (required only if you build iOS) -4. `npm run ios-standalone` or `npm run android-stanalone` +4. `npm run ios-standalone` or `npm run android-standalone` Alternatively, you may notice in `package.json` that all these scripts are based on `STANDALONE_NEW_DOT` environment variable. If you feel confident you can do `export STANDALONE_NEW_DOT=true` to change the default behaviour in the current process of the terminal, and use regular commands (`npm i`, `npm run android`, `npm run ios` etc.) to build NewDot. ### Do I need to clean cache and rebuild the app? It's a valid question, especially because clean builds may take some time. On the way I've noticed that many developers tend to rebuild the app from scratch, even though in some cases it is unnecessary. In this case, when should you rebuild the app? 1. Whenever any code located in `./Mobile-Expensify` has changed - this means that we need to recompile OldDot/native code -2. Whenever you've pulled the newest main - not always necessary, but usually we don't analise what code has just been merged by `git pull` +2. Whenever you've pulled the newest main - not always necessary, but usually we don't analyze what code has just been merged by `git pull` 3. Whenever `package-lock.json` has changed - this may indicate that some packages with native code were bumped (however it's not always necessary, see [[#Should I rebuild HybridApp after bumping a `node_module`?]]) 4. Whenever you've updated `.env` files This means that if you changed only React Native code, and didn't pull any changes, the rebuilt is probably not necessary. If something doesn't work, you can always restart the Metro bundler using the following command `npm run start --reset-cache` @@ -199,7 +199,7 @@ This one is pretty enigmatic, and usually appears after subsequent android, and 2. rerun the iOS build ### Error: `CDN: trunk URL couldn't be downloaded` -This error may appear after execution of `npm run pod-install`. In this case you shaould do the following: +This error may appear after execution of `npm run pod-install`. In this case you should do the following: 1. cd to `Mobile-Expensify/ios` 2. run `pod repo remove trunk` diff --git a/contributingGuides/LEFT_HAND_NAVIGATION.md b/contributingGuides/LEFT_HAND_NAVIGATION.md index 344b0c4f8ecf..4e5da7fc45d6 100644 --- a/contributingGuides/LEFT_HAND_NAVIGATION.md +++ b/contributingGuides/LEFT_HAND_NAVIGATION.md @@ -39,6 +39,6 @@ Certain reports are excluded from the LHN to avoid clutter and to focus on relev 4. Non-Archived reports: - In default mode, these are sorted by the lastVisibleActionCreated date, so the most recently updated reports appear first. - In focus mode, these reports are sorted alphabetically by name for quicker navigation. -5. Archived eports: +5. Archived reports: - In default mode, these are sorted by lastVisibleActionCreated, with recent reports displayed first. - In focus mode, archived reports are sorted alphabetically by name. diff --git a/contributingGuides/NAVIGATION_TESTS.md b/contributingGuides/NAVIGATION_TESTS.md index adb98e79712e..3fb5c0d13a9e 100644 --- a/contributingGuides/NAVIGATION_TESTS.md +++ b/contributingGuides/NAVIGATION_TESTS.md @@ -139,7 +139,7 @@ Linked issue: https://github.com/Expensify/App/pull/49539#issuecomment-243240081 1. Launch the app. 2. Open FAB > Submit expense > Manual. -3. Submit a manual expense to any user (as long as the user is not the currrently opened report and the receiver is not workspace chat). +3. Submit a manual expense to any user (as long as the user is not the currently opened report and the receiver is not workspace chat). 4. Verify if the destination report is opened after submitting expense. #### QBO - Preferred exporter/Export date tab do not auto-close after value selected @@ -177,7 +177,7 @@ Linked issue: https://github.com/Expensify/App/pull/49539#issuecomment-243338180 4. Click on the group chat header. 5. Click Group name field. 6. Click Save. -7. Verify if the app returs to group details RHP after saving group name. +7. Verify if the app returns to group details RHP after saving group name. #### Going up to a screen with any params diff --git a/contributingGuides/OFFLINE_UX.md b/contributingGuides/OFFLINE_UX.md index 48d52af6f796..5ec9a430811f 100644 --- a/contributingGuides/OFFLINE_UX.md +++ b/contributingGuides/OFFLINE_UX.md @@ -89,7 +89,7 @@ When the user is offline: - The behavior for when something fails is: - If you were adding new data, the failed to add data is displayed greyed out and with the button to dismiss the error - If you were deleting data, the failed data is displayed regularly with the button to dismiss the error - - If you are updating data, the original data is displayed regulary with the button to dismiss the error + - If you are updating data, the original data is displayed regularly with the button to dismiss the error - When dismissing the error, the `onClose` prop will be called, there we need to call an action that either: - If the pendingAction was `add`, it removes the data altogether - Otherwise, it would clear the errors and `pendingAction` properties from the data diff --git a/contributingGuides/PERFORMANCE.md b/contributingGuides/PERFORMANCE.md index 1942c97af913..d4f36a79339f 100644 --- a/contributingGuides/PERFORMANCE.md +++ b/contributingGuides/PERFORMANCE.md @@ -4,7 +4,7 @@ - Use [`PureComponent`](https://reactjs.org/docs/react-api.html#reactpurecomponent), [`React.memo()`](https://reactjs.org/docs/react-api.html#reactmemo), and [`shouldComponentUpdate()`](https://reactjs.org/docs/react-component.html#shouldcomponentupdate) to prevent re-rendering expensive components. - Using a combination of [React DevTools Profiler](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) and [Chrome Dev Tools Performance Timing](https://calibreapp.com/blog/react-performance-profiling-optimization) can help identify unnecessary re-renders. Both tools can be used to time an interaction like the app starting up or navigating to a new screen. - Watch out for [very large lists](https://reactnative.dev/docs/optimizing-flatlist-configuration) and things like `Image` components re-fetching images on render when a remote uri did not change. -- Avoid the temptation to over-optimize. There is added cost in both code complexity and performance when adding checks like `shouldComponentUpdate()`. Be selective about when you use this and make sure there is a measureable difference before proposing the change. As a very general rule, it should be measurably faster to run logic to avoid the re-render (e.g. do a deep comparison) than it would be to let React take care of it without any extra intervention from us. +- Avoid the temptation to over-optimize. There is added cost in both code complexity and performance when adding checks like `shouldComponentUpdate()`. Be selective about when you use this and make sure there is a measurable difference before proposing the change. As a very general rule, it should be measurably faster to run logic to avoid the re-render (e.g. do a deep comparison) than it would be to let React take care of it without any extra intervention from us. - Use caution when adding subscriptions that might re-render very large trees of components e.g. subscribing to state that changes often (current report, current route, etc) in the app root. - Avoid using arrow function callbacks in components that are expensive to re-render. React will re-render this component since each time the parent renders it creates a new instance of that function. **Alternative:** Bind the method in the constructor instead. diff --git a/contributingGuides/REASSURE_PERFORMANCE_TEST.md b/contributingGuides/REASSURE_PERFORMANCE_TEST.md index a41d49517303..be1f6bbcc2c6 100644 --- a/contributingGuides/REASSURE_PERFORMANCE_TEST.md +++ b/contributingGuides/REASSURE_PERFORMANCE_TEST.md @@ -65,7 +65,7 @@ We use Reassure for monitoring performance regression. It helps us check if our - Investigate the code changes that might be causing this and address them to maintain a stable render count. More info [here](https://github.com/Expensify/App/blob/fe9e9e3e31bae27c2398678aa632e808af2690b5/tests/perf-test/README.md?plain=1#L32). - It is important to run Reassure tests locally and see if our changes caused a regression. - - One of the potential factors that may influence variation in the number of renders is adding unnecesary providers to the component we want to test using `````` . Ensure that all providers are necessary for running the test. + - One of the potential factors that may influence variation in the number of renders is adding unnecessary providers to the component we want to test using `````` . Ensure that all providers are necessary for running the test. ## What can be tested (scenarios) diff --git a/contributingGuides/STORYBOOK.md b/contributingGuides/STORYBOOK.md index 93815bab3da9..99819ecc4150 100644 --- a/contributingGuides/STORYBOOK.md +++ b/contributingGuides/STORYBOOK.md @@ -2,7 +2,7 @@ >Storybook is an open source tool for building UI components and pages in isolation. It streamlines UI development, testing, and documentation. -At Expensify, we primarily use [Storybook](https://storybook.js.org/) to provide interactive documentation of our design system. This helps bridge the gap between design and engineering to encourage code reusibility and improve communication. +At Expensify, we primarily use [Storybook](https://storybook.js.org/) to provide interactive documentation of our design system. This helps bridge the gap between design and engineering to encourage code reusability and improve communication. ### Building and Deploying Storybook diff --git a/contributingGuides/STRICT_MODE.md b/contributingGuides/STRICT_MODE.md index dfe94ea2c3ba..58501ae12c7a 100644 --- a/contributingGuides/STRICT_MODE.md +++ b/contributingGuides/STRICT_MODE.md @@ -2,7 +2,7 @@ ## Concurrent react This App is rendered using react concurrent mode, which is the direction that React seems to be moving. -Concurrent mode enables a lot of new behaviours in react, most importantly renders can be interrupted by React, re-run or run more than once. This is supposed to make react more performant and webapps more responsive to user actions. +Concurrent mode enables a lot of new behaviors in react, most importantly renders can be interrupted by React, re-run or run more than once. This is supposed to make react more performant and webapps more responsive to user actions. Further reading: - [What is Concurrent React](https://react.dev/blog/2022/03/29/react-v18#what-is-concurrent-react) diff --git a/contributingGuides/STYLE.md b/contributingGuides/STYLE.md index fcfb6881262b..34466a6d84eb 100644 --- a/contributingGuides/STYLE.md +++ b/contributingGuides/STYLE.md @@ -1096,7 +1096,7 @@ type ComponentProps = { #### Important Note: -In React Native, one **must not** attempt to falsey-check a string for an inline ternary. Even if it's in curly braces, React Native will try to render it as a `` node and most likely throw an error about trying to render text outside of a `` component. Use `!!` instead. +In React Native, one **must not** attempt to falsy-check a string for an inline ternary. Even if it's in curly braces, React Native will try to render it as a `` node and most likely throw an error about trying to render text outside of a `` component. Use `!!` instead. ```tsx // Bad! This will cause a breaking an error on native platforms diff --git a/contributingGuides/STYLING.md b/contributingGuides/STYLING.md index 1c8e96bf0c08..3d11de3cfddd 100644 --- a/contributingGuides/STYLING.md +++ b/contributingGuides/STYLING.md @@ -41,12 +41,12 @@ On the other hand, if we are copying and pasting some chunks of JSX from one pla ## Use the "Rule of Three" -In order to resist the urge to preoptimize and have many single-use components, we've adopted a main principle: +In order to resist the urge to pre-optimize and have many single-use components, we've adopted a main principle: Any array of styles associated with a single type of React element that has at least 3 identical usages should be refactored into: -- A new resusable style that can be used in many places e.g. `styles.button` -- If that style has modifiers or style variations, then those styles should follow a naming convention of `styles.elementModifer` e.g. `styles.buttonSuccess` +- A new reusable style that can be used in many places e.g. `styles.button` +- If that style has modifiers or style variations, then those styles should follow a naming convention of `styles.elementModifier` e.g. `styles.buttonSuccess` - If a reusable style has 3 or more modifiers, it should be refactored into a component with props to modify the styles e.g. ```jsx diff --git a/cspell.json b/cspell.json new file mode 100644 index 000000000000..ee24118ef2f9 --- /dev/null +++ b/cspell.json @@ -0,0 +1,668 @@ +{ + "language": "en", + "words": [ + "Accelo", + "achreimburse", + "adbd", + "ADDCOMMENT", + "Addendums", + "ADFS", + "águero", + "Aircall", + "airshipconfig", + "Amal", + "Amal’s", + "americanexpressfdx", + "Amina", + "androiddebugkey", + "androidx", + "APCA", + "apksigner", + "apktool", + "APPL", + "applauseleads", + "appleauth", + "appleid", + "applesignin", + "applinks", + "approvalstatus", + "--longpress", + "appversion", + "ARGB", + "armeabi", + "armv7", + "ARROWDOWN", + "ARROWLEFT", + "ARROWRIGHT", + "ARROWUP", + "artículo", + "artículos", + "as_siteseach", + "asar", + "assetlinks", + "attributes.accountid", + "attributes.reportid", + "Authy", + "autocompletions", + "autodocs", + "autofilled", + "automations", + "autoplay", + "autoreleasepool", + "AUTOREPORTING", + "autoresizesSubviews", + "autoresizing", + "autosync", + "avds", + "AVURL", + "Bartek", + "Batchinator", + "behaviour", + "BILLCOM", + "billpay", + "Billpay", + "blahblahblah", + "blakeembrey", + "blankrows", + "BNDL", + "bofa", + "bolditalic", + "bootsplash", + "Borderless", + "Botify", + "brex", + "bridgeless", + "Broadwoven", + "Bronn", + "BROWSABLE", + "buildscript", + "Buildscript", + "Bushwick", + "capitalone", + "CAROOT", + "Carta", + "ccache", + "ccupload", + "cdfbmo", + "Certinia", + "Certinia's", + "CFPB", + "chargeback", + "Checkmark", + "checkmarked", + "Chronos", + "citi", + "clawback", + "cleartext", + "CLIENTID", + "clippath", + "cmaps", + "cocoapods", + "Codat", + "codegen", + "Codice", + "Combustors", + "contenteditable", + "copiloted", + "copiloting", + "Corpay", + "Countertop", + "CPPFLAGS", + "cpuprofile", + "creditamount", + "CREDS", + "crios", + "customairshipextender", + "customfield", + "customise", + "dateexported", + "debitamount", + "deburr", + "Deel", + "deeplink", + "deeplinked", + "deeplinking", + "deeplinks", + "delegators", + "delish", + "devportal", + "DFOLLY", + "dimen", + "directfeeds", + "Dishoom", + "DocuSign", + "domhandler", + "domparser", + "dont", + "dotlottie", + "Drycleaners", + "Drycleaning", + "DSYM", + "dsyms", + "durationMillis", + "e2edelta", + "ecash", + "Egencia", + "Electromedical", + "electronmon", + "Electrotherapeutic", + "ellipsize", + "Emphemeral", + "endcapture", + "enddate", + "endfor", + "entityid", + "Entra", + "ENVFILE", + "ERECEIPT", + "ERECEIPTS", + "ethnicities", + "evenodd", + "eventmachine", + "exchangerate", + "exchrate", + "exfy", + "exitstatus", + "expensescount", + "Expensi", + "Expensicon", + "Expensicons", + "expensicorp", + "Expensifier", + "expensifyhelp", + "expensifylite", + "expensifymono", + "expensifyneue", + "expensifynewkansas", + "EXPENSIFYPDBUSINESS", + "EXPENSIFYPDTEAM", + "expensifyreactnative", + "Expensiworks", + "Fábio", + "fabs", + "falso", + "favicons", + "Ferroalloy", + "firstname", + "Fiscale", + "flac", + "flatlist", + "flexsearch", + "FLJZ", + "fname", + "fnames", + "focusvisible", + "fontawesome", + "foreignamount", + "formatjs", + "Frederico", + "frontpart", + "fullstory", + "FXHF", + "Gaber", + "gcsc", + "gcse", + "genkey", + "GEOLOCATION", + "getprop", + "glcode", + "googleusercontent", + "gorhom", + "gpgsign", + "gradlew", + "Grantmaking", + "gscb", + "gsib", + "gsst", + "Gsuite", + "Handtool", + "hanno_gödecke", + "headshot", + "healthcheck", + "helpsite", + "Highfive", + "Highlightable", + "Hoverable", + "HRMS", + "hybridapp", + "Hydronics", + "IDEIN", + "idfa", + "Idology", + "ifdef", + "imagebutton", + "Inactives", + "inbetweenCompo", + "Inclusivity", + "initialises", + "instancetype", + "Intacct", + "intenthandler", + "ionatan", + "IPHONEOS", + "iphonesimulator", + "isemojisonly", + "islarge", + "ismedium", + "isnonreimbursable", + "ITSM", + "Jakub", + "janky", + "jarsigner", + "johndoe", + "jsbundle", + "jsSrcsDir", + "Kearny", + "keyalg", + "keyevent", + "keypass", + "keysize", + "keytool", + "keyval", + "keyvaluepairs", + "KHTML", + "killall", + "Krasoń", + "laggy", + "lastname", + "LDFLAGS", + "LIBCPP", + "licence", + "LIGHTBOXES", + "Limpich", + "linecap", + "linejoin", + "listformat", + "LLDB", + "locationbias", + "logcat", + "logomark", + "Luhn", + "Maat", + "maildrop", + "manualreimburse", + "Mapbox", + "mapboxgl", + "marcaaron", + "Marqeta", + "mateusz", + "McAfee", + "mchmod", + "MCTEST", + "mechler", + "mediumitalic", + "memberof", + "metainfo", + "microtime", + "Microtransaction", + "microtransactions", + "mimecast", + "Miniwarehouses", + "miterlimit", + "mkcert", + "MMYY", + "Mobasher", + "mobiexpensifyg", + "mobileprovision", + "mswin", + "msword", + "mtrl", + "multidex", + "MVCP", + "MYOB", + "mysubdomain", + "Nacha", + "NAICS", + "Namecheap", + "Nanobiotechnology", + "Navan", + "navattic", + "navigations", + "ndkversion", + "negsign", + "netinfo", + "netrc", + "NETSUITE", + "Neue", + "newarch", + "NEWDOT", + "newdotreport", + "newhelp", + "ngneat", + "NGROK", + "nmanager", + "NMLS", + "nocreeps", + "nodownload", + "Nonchocolate", + "Noncitrus", + "Nondepository", + "Nonfinancial", + "Nonmortgage", + "Nonnull", + "nonreimbursable", + "Nonstore", + "Nonupholstered", + "noopener", + "noreferer", + "noreferrer", + "nosymbol", + "Noto", + "NSQS", + "NSQSOAuth", + "NSURL", + "NSUTF8", + "ntag", + "ntdiary", + "Nuevo", + "nullptr", + "numberformat", + "objc", + "oblador", + "octocat", + "officedocument", + "oldarch", + "OLDDOT", + "onclosetag", + "oneteam", + "oneui", + "onfido", + "onloaderror", + "onopentag", + "onplayerror", + "onxy", + "ONYXKEY", + "ONYXKEYS", + "openxmlformats", + "ordinality", + "organisation", + "originalamount", + "originalcurrency", + "osdk", + "otpauth", + "parasharrajat", + "Parcelable", + "passwordless", + "Passwordless", + "payrollcode", + "pbxproj", + "pdfreport", + "Perfetto", + "persistable", + "Pettinella", + "phonenumber", + "Picklist", + "picklists", + "PINGPONG", + "Pluginfile", + "pluralrules", + "Podfile", + "podspec", + "podspecs", + "popen3", + "positionMillis", + "Postharvest", + "Postproduction", + "precheck", + "Precheck", + "prescribers", + "presentationml", + "Pressable", + "Pressables", + "proguard", + "Protip", + "purchaseamount", + "purchasecurrency", + "QAPR", + "qrcode", + "QUICKBOOKS", + "RAAS", + "rach", + "Rankable", + "RCTI18nUtil", + "RCTIs", + "RCTURL", + "reactnative", + "reactnativebackgroundtask", + "reactnativehybridapp", + "reactnativekeycommand", + "reauthentication", + "Reauthenticator", + "recategorize", + "recents", + "REDIRECTURI", + "regexpu", + "reimagination", + "Reimb", + "reimbursability", + "Reimbursability", + "Reimbursables", + "reimbursementid", + "REIMBURSER", + "reimbursible", + "Reimbursments", + "remotedesktop", + "remotesync", + "requestee", + "Resawing", + "resizeable", + "resultsbox", + "retryable", + "Reupholstery", + "rideshare", + "rnef", + "RNFS", + "rnmapbox", + "RNTL", + "RNVP", + "Rosiclair", + "rpartition", + "RTER", + "s3uqn2oe4m85tufi6mqflbfbuajrm2i3", + "SAASPASS", + "safesearch", + "Salagatan", + "samltool", + "Saqbd", + "SBFJ", + "Scaleway", + "Scaleway’s", + "Schiffli", + "SCIM", + "scriptname", + "seamless", + "Segoe", + "seguiemj", + "Sepa", + "serveo", + "Sharees", + "Sharons", + "shellcheck", + "shellenv", + "shipit", + "signingkey", + "signup", + "Signup", + "simctl", + "skip_codesigning", + "SMARTREPORT", + "Smartscan", + "soloader", + "SONIFICATION", + "Spotnana", + "spreadsheetml", + "SSAE", + "startdate", + "stdev", + "stdlib", + "storepass", + "strikethrough", + "Strikethrough", + "subcomponents", + "sublicensees", + "sublocality", + "subpremise", + "subrates", + "substep", + "substeps", + "subview", + "Subviews", + "superapp", + "Supercenters", + "superpowered", + "supportal", + "SVFG", + "SVGID", + "svgs", + "Svmy", + "Swipeable", + "symbolicate", + "Symbolicates", + "systempreferences", + "tabindex", + "Talkspace", + "teachersunite", + "Tele", + "Teleproduction", + "testflight", + "tnode", + "tobe", + "togglefullscreen", + "TOTP", + "touchables", + "TQBQW", + "Trainline", + "tranid", + "Transpiles", + "trivago", + "Typeform", + "UBOI", + "UBOS", + "UDID", + "UIBG", + "uimanager", + "ukkonen", + "unapprove", + "unassigning", + "Unassigning", + "unassigns", + "uncategorized", + "Undelete", + "unheld", + "unhold", + "Unlaminated", + "Unmigrated", + "unredacted", + "unscrollable", + "unsubmitted", + "UNSWIPEABLE", + "Unvalidated", + "UPWORK", + "urbanairship", + "urlset", + "USAA", + "USDVBBA", + "useAutolayout", + "usernotifications", + "utilise", + "Valuska", + "VBBA", + "Venmo", + "viewability", + "viewport", + "viewports", + "voidings", + "vorbis", + "vvcf", + "vypj", + "waitlist", + "WDYR", + "webapps", + "webcredentials", + "webrtc", + "welldone", + "Woohoo", + "Wordmark", + "wordprocessingml", + "worklet", + "workletization", + "worklets", + "workshopping", + "writeitdown", + "xcconfig", + "xcodeproj", + "xcpretty", + "xcprivacy", + "xcrun", + "xctrace", + "xcworkspace", + "xdescribe", + "xero", + "Xfermode", + "xlink", + "xmlgateway", + "Xours", + "Xtheirs", + "Yapl", + "YAPL", + "Yema", + "yourcompany", + "yourname", + "YYMM", + "Zenefit", + "Zenefits", + "zipalign", + "Zipaligning", + "zoneinfo", + "zxcv", + "zxldvw", + "مثال" + ], + "ignorePaths": [ + ".github", + "node_modules", + "src/languages/es.ts", + "android/app/BUCK", + "android/app/build_defs.bzl", + "android/app/build.gradle", + "android/app/google-services-DEV.json", + "android/app/google-services.json", + "android/app/proguard-rules.pro", + "android/app/src/development/assets/airshipconfig.properties", + "android/build.gradle", + "android/gradle.properties", + "android/gradle/wrapper/gradle-wrapper.properties", + "android/gradlew", + "android/gradlew.bat", + "assets/emojis/common.ts", + "assets/emojis/en.ts", + "assets/emojis/es.ts", + "patches/**", + "docs/assets/Files/**", + "ios/NewExpensify.xcodeproj/**", + "ios/GoogleService-Info.plist", + "ios/GoogleService-Info-DEV.plist", + "ios/AirshipConfig.plist", + "Mobile-Expensify", + "src/TIMEZONES.ts", + "tests/unit/EmojiTest.ts", + "tests/unit/FastSearchTest.ts", + "tests/unit/LocaleCompareTest.ts", + "tests/unit/removeInvisibleCharacters.ts", + "tests/unit/Search/searchCountryOptionsTest.ts", + "tests/unit/splitLongWordTest.ts", + "tests/unit/currencyList.json", + "tests/unit/ValidationUtilsTest.ts", + "src/CONST.ts", + "src/libs/SearchParser/*", + ".gitignore" + ], + "ignoreRegExpList": ["@assets/.*"], + "useGitignore": true, + "overrides": [ + { + "filename": "src/languages/es.ts", + "language": "es" + } + ] +} diff --git a/docs/README.md b/docs/README.md index 235334c95732..b5814199541e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -153,7 +153,7 @@ You can now begin adding articles inside the subcategory `hr-integrations/`. ## Add content -Copy the [template](https://github.com/Expensify/App/blob/main/docs/TEMPLATE.md) file into the correct subdirectory of `docs/articles`. For example, if the article belongs in the `Bank Accounts` hub for the platform `Expensify Classic`, then copy the template into `docs/articles/expensiyfy-classic/bank-accounts` directory. +Copy the [template](https://github.com/Expensify/App/blob/main/docs/TEMPLATE.md) file into the correct subdirectory of `docs/articles`. For example, if the article belongs in the `Bank Accounts` hub for the platform `Expensify Classic`, then copy the template into `docs/articles/expensify-classic/bank-accounts` directory. Next, rename the copy with the name of the article title, i.e. `Connect-ANZ.md`. It is **important** that the article has `.md` extension (you can use dashes for spaces in the file name if it's needed). The dashes will be removed in the generated site page. diff --git a/docs/TEMPLATE.md b/docs/TEMPLATE.md index db83a037021c..3bd209b07117 100644 --- a/docs/TEMPLATE.md +++ b/docs/TEMPLATE.md @@ -27,7 +27,7 @@ This section will be the final nice-to-know section which covers additional Best - Is the feature multi-layered (contains features within features) and needs further explanation in this section? Example: Managing Domains. - Does the feature have several different variables that can cause different outcomes for different customers? Example: Billing. -- Does the feature have optional enhancements that can be used in different ways depending on the use case? Example: Category-specifc rules. +- Does the feature have optional enhancements that can be used in different ways depending on the use case? Example: Category-specific rules. --> @@ -38,7 +38,7 @@ This section covers the useful but not as vital information, it should capture c - What's idiosyncratic or potentially confusing about this feature? - Is there anything unique about how this feature relates to billing/activity? - If this feature is released, are there any common confusions that can't be solved by improvements to the product itself? -- Similarly, if this feature hasn't been released, can you predict and pre-empt any potential confusion? +- Similarly, if this feature hasn't been released, can you predict and preempt any potential confusion? - Is there any general troubleshooting for this feature? - Note: troubleshooting should generally go in the FAQ, but if there is extensive troubleshooting, such as with integrations, that will be housed in a separate page, stored with and linked from the main page for that feature. --> diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index c7b55b28cfd5..4d9e7794c642 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -107,7 +107,7 @@

Get Started

- + diff --git a/docs/articles/expensify-classic/bank-accounts-and-payments/payments/Receive-Payments.md b/docs/articles/expensify-classic/bank-accounts-and-payments/payments/Receive-Payments.md index 34d6523af454..40c64811d171 100644 --- a/docs/articles/expensify-classic/bank-accounts-and-payments/payments/Receive-Payments.md +++ b/docs/articles/expensify-classic/bank-accounts-and-payments/payments/Receive-Payments.md @@ -14,7 +14,7 @@ To receive a reimbursement after submitting an expense report, you must first [c - Payments initiated **after 3 p.m. PST** or on **weekends/bank holidays** may be delayed. - If your payment qualifies for **Rapid Reimbursement**, you may receive it sooner. -Your company or client also has the option to pay you via **check, a third-party payment processor, or outside of Expensify**. Check with your **Workspace Admin** or payor to confirm the payment method. +Your company or client also has the option to pay you via **check, a third-party payment processor, or outside of Expensify**. Check with your **Workspace Admin** or payer to confirm the payment method. --- diff --git a/docs/articles/expensify-classic/bank-accounts-and-payments/payments/Send-and-Pay-Invoices.md b/docs/articles/expensify-classic/bank-accounts-and-payments/payments/Send-and-Pay-Invoices.md index f360172c4328..606d4beed7c6 100644 --- a/docs/articles/expensify-classic/bank-accounts-and-payments/payments/Send-and-Pay-Invoices.md +++ b/docs/articles/expensify-classic/bank-accounts-and-payments/payments/Send-and-Pay-Invoices.md @@ -129,7 +129,7 @@ No, invoices are included in the [Control Plan](https://help.expensify.com/artic ## Can invoices be revised after sending? Yes, click **Undo Send** to revoke an invoice. To add details, use [Report Comments](https://help.expensify.com/articles/expensify-classic/reports/Add-comments-and-attachments-to-a-report). -## How do I communicate with the payor? +## How do I communicate with the payer? Use [Report Comments](https://help.expensify.com/articles/expensify-classic/reports/Add-comments-and-attachments-to-a-report) for direct communication. ## What’s the difference between an invoice and an expense report? diff --git a/docs/articles/expensify-classic/connections/Expensify-API.md b/docs/articles/expensify-classic/connections/Expensify-API.md index e2fbdbfd7703..4c9035de48af 100644 --- a/docs/articles/expensify-classic/connections/Expensify-API.md +++ b/docs/articles/expensify-classic/connections/Expensify-API.md @@ -148,7 +148,7 @@ The template variable determines what information is saved in your CSV file. If **Step 3: Save your generated file name** -Expensify currently supports only the "onReceive":{"immediateResponse":["returnRandomFileName"]} option in step 2, so you should receive a random filename back from the API like "exportc111111d-a1a1-a1a1-a1a1-d1111111f.csv". You will need to document this filename if you plan on running the download command after this one. +Expensify currently supports only the "onReceive":{"immediateResponse":["returnRandomFileName"]} option in step 2, so you should receive a random filename back from the API like "export111111d-a1a1-a1a1-a1a1-d1111111f.csv". You will need to document this filename if you plan on running the download command after this one. **Step 4: Download your exported report** @@ -161,7 +161,7 @@ Set up another API call in almost the same way you did before. You don't need th "partnerUserID": "my_user_id", "partnerUserSecret": "my_user_secret" }, - "fileName": "exportc111111d-a1a1-a1a1-a1a1-d1111111f.csv", + "fileName": "export111111d-a1a1-a1a1-a1a1-d1111111f.csv", "fileSystem": "integrationServer" } ``` diff --git a/docs/articles/expensify-classic/connections/netsuite/Configure-Netsuite.md b/docs/articles/expensify-classic/connections/netsuite/Configure-Netsuite.md index 55f6e3292c89..06eb63286a4c 100644 --- a/docs/articles/expensify-classic/connections/netsuite/Configure-Netsuite.md +++ b/docs/articles/expensify-classic/connections/netsuite/Configure-Netsuite.md @@ -60,7 +60,7 @@ This dictates when reimbursable expenses will export, according to your preferre ## Export Settings for Reimbursable Expenses -**Expense Reports:** Expensify transactions will export reimbursable expenses as expense reports by default, which will be posted to the payables account designated in NetSuite. +**Expense Reports:** Expensify transactions will export reimbursable expenses as expense reports by default, which will be posted to the payable account designated in NetSuite. **Vendor Bills:** Expensify transactions export as vendor bills in NetSuite and are mapped to the subsidiary associated with the corresponding workspace. Each report is posted as payable to the vendor associated with the employee who submitted it. You can also set an approval level in NetSuite for vendor bills. @@ -496,7 +496,7 @@ If you have confirmed that your categories are set as Expense Categories in NetS ## What's the difference between a Custom Segment, Custom Record, and Custom List? - **Custom Record**: This is an entirely customizable record type used to store detailed, structured information not covered by standard NetSuite records (e.g., customers, vendors, and transactions). Unlike Segments, Custom Records are designed to manage standalone data, like tracking projects, assets, or other entities. -- **Custom Segment**: A custom classification field similar to standard NetSuite segments like Department, Class, or Location. Typically used when you need to categorize transactions, records, or GL entries for reporting purposes or to separate financials. (NetSuite automatically creates a Custom Record behind the scenes to power the segment.) +- **Custom Segment**: A custom classification field similar to standard NetSuite segments like Department, Class, or Location. Typically used when you need to categorize transactions, records, or GL entries for reporting purposes or to separate financial. (NetSuite automatically creates a Custom Record behind the scenes to power the segment.) - **Custom List**: A static dropdown of predefined values used for simple selections, like **Preferred Contact Method.** Custom Lists are lightweight and don't support complex relationships or GL impacts. diff --git a/docs/articles/expensify-classic/expenses/Add-an-expense.md b/docs/articles/expensify-classic/expenses/Add-an-expense.md index 6ee4a99b55b0..beba50349334 100644 --- a/docs/articles/expensify-classic/expenses/Add-an-expense.md +++ b/docs/articles/expensify-classic/expenses/Add-an-expense.md @@ -1,11 +1,11 @@ --- title: add-an-expense.md -description: Learn how to add, edit, and manage expenses in Expensify, including SmartScans, per diems, mileage, and group expenses. +description: Learn how to add, edit, and manage expenses in Expensify, including SmartScans, per diem, mileage, and group expenses. keywords: [Expensify Classic, add expense, add expense to a report, SmartScan, per diem, mileage, group expense, receipts, upload receipts, distance tracking, bulk expense upload] ---
-Add, track, and manage all types of expenses in Expensify—from SmartScanned receipts to mileage, per diems, and group costs. This guide walks through all your options. +Add, track, and manage all types of expenses in Expensify—from SmartScanned receipts to mileage, per diem, and group costs. This guide walks through all your options. --- diff --git a/docs/articles/expensify-classic/getting-started/Create-a-Company-Workspace.md b/docs/articles/expensify-classic/getting-started/Create-a-Company-Workspace.md index 853f221fe9a8..de8e2d8d02ae 100644 --- a/docs/articles/expensify-classic/getting-started/Create-a-Company-Workspace.md +++ b/docs/articles/expensify-classic/getting-started/Create-a-Company-Workspace.md @@ -168,6 +168,6 @@ As an admin, it’s important to ensure employees are submitting expenses and re - From the dropdown menu, they must select the correct workspace from the list at the bottom. - If an employee frequently switches between workspaces, remind them to always verify the workspace selection before submitting an expense or report. -By reinforcing this process, you help prevent expense reports from being miscategorized and ensure accurate financial tracking. +By reinforcing this process, you help prevent expense reports from being mis-categorized and ensure accurate financial tracking.
diff --git a/docs/articles/expensify-classic/getting-started/playbooks/Expensify-Playbook-For-US-Based-Bootstrapped-Startups.md b/docs/articles/expensify-classic/getting-started/playbooks/Expensify-Playbook-For-US-Based-Bootstrapped-Startups.md index f452b2365dec..a6451466c8a6 100644 --- a/docs/articles/expensify-classic/getting-started/playbooks/Expensify-Playbook-For-US-Based-Bootstrapped-Startups.md +++ b/docs/articles/expensify-classic/getting-started/playbooks/Expensify-Playbook-For-US-Based-Bootstrapped-Startups.md @@ -69,7 +69,7 @@ After linking your business bank account, you’re eligible for the Expensify Ca To enable the Expensify Card: -1. Click your **avata*r*. +1. Click your **avatar*. 2. Select **Workspaces**. 3. Click your workspace. 4. Select **Cards**. diff --git a/docs/articles/expensify-classic/travel/Configure-travel-policy-and-preferences.md b/docs/articles/expensify-classic/travel/Configure-travel-policy-and-preferences.md index a8395395663e..81b6243569d4 100644 --- a/docs/articles/expensify-classic/travel/Configure-travel-policy-and-preferences.md +++ b/docs/articles/expensify-classic/travel/Configure-travel-policy-and-preferences.md @@ -59,7 +59,7 @@ Flight preferences include multiple sections with different settings: - **Booking window:** Add a time limit to prevent employees from booking less than a certain number of days in advance to prohibit bookings too close to the flight time. - **Cancellation policy:** Allow your employees to book fully or partially refundable rooms. To allow all options, you can leave this as the default option. - **Experience:** Set hotel ratings that are in and out of policy. -- **Nightly median rate:** Determine which hotels to consider when calculating the median price. You can set a radius around the search location and include/disclude hotels above or below a certain rating. +- **Nightly median rate:** Determine which hotels to consider when calculating the median price. You can set a radius around the search location and include/exclude hotels above or below a certain rating. - **Out of policy reason codes:** If enabled, travelers will be asked to enter a reason code for an out-of-policy hotel booking. This gives them a way to provide context for why the booking is still being placed. You can also modify the reason codes by clicking Manage reason codes below the toggle. # Car diff --git a/docs/articles/expensify-classic/workspaces/Configure-Reimbursement-Settings.md b/docs/articles/expensify-classic/workspaces/Configure-Reimbursement-Settings.md index a2041ea37ee2..0fdc3fc08d57 100644 --- a/docs/articles/expensify-classic/workspaces/Configure-Reimbursement-Settings.md +++ b/docs/articles/expensify-classic/workspaces/Configure-Reimbursement-Settings.md @@ -9,7 +9,7 @@ Expensify offers flexible reimbursement options to help businesses quickly and e There are a few ways to reimburse employees in Expensify. The option that's best suited for you and your business will depend on a few different factors: - **Direct Reimbursement**: For companies with a business bank account in the US that reimburse employees within the US. -- **Indirect Reimbursement**: This option is available to all members, and connecting a bank account to Expensify is not required. Indirect reimbursReimbursementes that all reports are reimbursed outside of Expensify. +- **Indirect Reimbursement**: This option is available to all members, and connecting a bank account to Expensify is not required. Indirect Reimbursements that all reports are reimbursed outside of Expensify. - **Global Reimbursement**: If your company bank account is in the US, Canada, the UK, Europe, or Australia, you can reimburse employees directly in nearly any country worldwide. --- diff --git a/docs/articles/expensify-classic/workspaces/Create-tags.md b/docs/articles/expensify-classic/workspaces/Create-tags.md index 14c92b1b5a0e..1c4e49498d23 100644 --- a/docs/articles/expensify-classic/workspaces/Create-tags.md +++ b/docs/articles/expensify-classic/workspaces/Create-tags.md @@ -55,7 +55,7 @@ Once the tags are updated in your accounting integration, the changes will autom # Multi-Level Tags -You can add mutli-level tags by importing them in a .csv, .txt, .xls, or .xlsx spreadsheet. +You can add multi-level tags by importing them in a .csv, .txt, .xls, or .xlsx spreadsheet. First, determine whether you will use independent (a separate tag for department and project) or dependent tags (the project tags populate different options based on the department selected) and whether you will capture general ledger (GL) codes. diff --git a/docs/articles/new-expensify/expenses-and-payments/Create-an-expense.md b/docs/articles/new-expensify/expenses-and-payments/Create-an-expense.md index 12fe541d3012..c516c8fdfffb 100644 --- a/docs/articles/new-expensify/expenses-and-payments/Create-an-expense.md +++ b/docs/articles/new-expensify/expenses-and-payments/Create-an-expense.md @@ -15,7 +15,7 @@ If you use Expensify for personal use, submitting to an individual is likely bes Once the expense is created, you will see the option to send it to an email or phone number. Alternatively, add an expense to a chat, which will go straight to the person you are chatting with. -When an expense is submitted to an individual’s email or phone number, the payor will receive an email or text notification with the amount that needs to be paid. They can click on the amount in the email or text to pay the expense. +When an expense is submitted to an individual’s email or phone number, the payer will receive an email or text notification with the amount that needs to be paid. They can click on the amount in the email or text to pay the expense. # Submit an expense to a workspace or employer diff --git a/docs/articles/new-expensify/getting-started/Create-a-company-workspace.md b/docs/articles/new-expensify/getting-started/Create-a-company-workspace.md index 12b4cf413dc7..76afeafb75e2 100644 --- a/docs/articles/new-expensify/getting-started/Create-a-company-workspace.md +++ b/docs/articles/new-expensify/getting-started/Create-a-company-workspace.md @@ -22,7 +22,7 @@ Workspaces help manage company expenses, enforce policies, and integrate with ac ![Click your profile photo or icon]({{site.url}}/assets/images/ExpensifyHelp_CreateWorkspace_1.png){:width="100%"} -![Click Workspaces in the left menu and New Worksapce]({{site.url}}/assets/images/ExpensifyHelp_CreateWorkspace_2.png){:width="100%"} +![Click Workspaces in the left menu and New Workspace]({{site.url}}/assets/images/ExpensifyHelp_CreateWorkspace_2.png){:width="100%"} ![Options to make changes like a custom workspace name]({{site.url}}/assets/images/ExpensifyHelp_CreateWorkspace_3.png){:width="100%"} @@ -164,6 +164,6 @@ Track your Free Trial start date and remaining days on the Subscription page. - You’ll receive notifications when your trial starts and ends. - To continue using Expensify, add a billing card before your trial ends. -![Hightlight the free trial start and end date]({{site.url}}/assets/images/ExpensifyHelp-FreeTrial-1.png){:width="100%"} +![Highlight the free trial start and end date]({{site.url}}/assets/images/ExpensifyHelp-FreeTrial-1.png){:width="100%"} diff --git a/docs/articles/new-expensify/getting-started/Track-Expenses-on-Personal-Workspace.md b/docs/articles/new-expensify/getting-started/Track-Expenses-on-Personal-Workspace.md index 29756eddbd93..768c6f05ca54 100644 --- a/docs/articles/new-expensify/getting-started/Track-Expenses-on-Personal-Workspace.md +++ b/docs/articles/new-expensify/getting-started/Track-Expenses-on-Personal-Workspace.md @@ -37,7 +37,7 @@ Each workspace has its own set of rules, settings, and integrations. Even if you ![Click your profile photo or icon]({{site.url}}/assets/images/ExpensifyHelp_CreateWorkspace_1.png){:width="100%"} -![Click Workspaces in the left menu and New Worksapce]({{site.url}}/assets/images/ExpensifyHelp_CreateWorkspace_2.png){:width="100%"} +![Click Workspaces in the left menu and New Workspace]({{site.url}}/assets/images/ExpensifyHelp_CreateWorkspace_2.png){:width="100%"} ![Options to make changes like a custom workspace name]({{site.url}}/assets/images/ExpensifyHelp_CreateWorkspace_3.png){:width="100%"} diff --git a/docs/articles/new-expensify/settings/General-product-troubleshooting.md b/docs/articles/new-expensify/settings/General-product-troubleshooting.md index 57126628e04f..c2d86faa7e59 100644 --- a/docs/articles/new-expensify/settings/General-product-troubleshooting.md +++ b/docs/articles/new-expensify/settings/General-product-troubleshooting.md @@ -5,7 +5,7 @@ description: How to troubleshoot a website issue # Issues with a specific feature -If you're having issues with a specific feature, please reffer to the corresponding section of the help docs for detailed explinations of common errors and troubleshooting steps. If you cannot find an answer to your question, please reach out to Concierge via in-product chat or by emailing us at concierge@expensify.com. +If you're having issues with a specific feature, please refer to the corresponding section of the help docs for detailed explanations of common errors and troubleshooting steps. If you cannot find an answer to your question, please reach out to Concierge via in-product chat or by emailing us at concierge@expensify.com. # Troubleshooting local issues Is your webpage not loading? Try these steps: diff --git a/docs/articles/new-expensify/travel/Configure-travel-policy-and-preferences.md b/docs/articles/new-expensify/travel/Configure-travel-policy-and-preferences.md index d7d9c656a612..950465ad4e05 100644 --- a/docs/articles/new-expensify/travel/Configure-travel-policy-and-preferences.md +++ b/docs/articles/new-expensify/travel/Configure-travel-policy-and-preferences.md @@ -60,7 +60,7 @@ Flight preferences include multiple sections with different settings: - **Booking window:** Add a time limit to prevent employees from booking less than a certain number of days in advance to prohibit bookings too close to the flight time. - **Cancellation policy:** Allow your employees to book fully or partially refundable rooms. To allow all options, you can leave this as the default option. - **Experience:** Set hotel ratings that are in and out of policy. -- **Nightly median rate:** Determine which hotels to consider when calculating the median price. You can set a radius around the search location and include/disclude hotels above or below a certain rating. +- **Nightly median rate:** Determine which hotels to consider when calculating the median price. You can set a radius around the search location and include/exclude hotels above or below a certain rating. - **Out of policy reason codes:** If enabled, travelers will be asked to enter a reason code for an out-of-policy hotel booking. This gives them a way to provide context for why the booking is still being placed. You can also modify the reason codes by clicking Manage reason codes below the toggle. # Car @@ -145,7 +145,7 @@ Flight preferences include multiple sections with different settings: - **Booking window:** Add a time limit to prevent employees from booking less than a certain number of days in advance to prohibit bookings too close to the flight time. - **Cancellation policy:** Allow your employees to book fully or partially refundable rooms. To allow all options, you can leave this as the default option. - **Experience:** Set hotel ratings that are in and out of policy. -- **Nightly median rate:** Determine which hotels to consider when calculating the median price. You can set a radius around the search location and include/disclude hotels above or below a certain rating. +- **Nightly median rate:** Determine which hotels to consider when calculating the median price. You can set a radius around the search location and include/exclude hotels above or below a certain rating. - **Out of policy reason codes:** If enabled, travelers will be asked to enter a reason code for an out-of-policy hotel booking. This gives them a way to provide context for why the booking is still being placed. You can also modify the reason codes by clicking Manage reason codes below the toggle. # Car diff --git a/docs/articles/new-expensify/workspaces/Add-approvals.md b/docs/articles/new-expensify/workspaces/Add-approvals.md index 5d8c1f733287..c6755938bf1c 100644 --- a/docs/articles/new-expensify/workspaces/Add-approvals.md +++ b/docs/articles/new-expensify/workspaces/Add-approvals.md @@ -44,7 +44,7 @@ Note: When Add approvals is enabled, the workspace must have a default approval 3. Select the workspace where you want to add approvals 4. Click **Workflows** in the left menu 5. Under **Add approvals**, click on **Add approval workflow** -6. Choose the workspace member whose expenses should go through the custom approval workfow +6. Choose the workspace member whose expenses should go through the custom approval workflow 7. Click **Next** 8. Choose the workspace member who should be the first approver on submitted expenses in the approval workflow 9. Click **Next** @@ -62,7 +62,7 @@ Note: When Add approvals is enabled, the workspace must have a default approval **To delete an approval workflow:** -1. On the **Workflows** page, click the approval workflow that shoudld be deleted +1. On the **Workflows** page, click the approval workflow that should be deleted 2. Click **Delete** 3. In the window that appears,click **Delete** again diff --git a/docs/articles/new-expensify/workspaces/Enable-Report-Fields.md b/docs/articles/new-expensify/workspaces/Enable-Report-Fields.md index 3ae1af36482b..b59c12757959 100644 --- a/docs/articles/new-expensify/workspaces/Enable-Report-Fields.md +++ b/docs/articles/new-expensify/workspaces/Enable-Report-Fields.md @@ -27,7 +27,7 @@ To create new Report Fields: 1. Click Settings in the bottom left menu 2. Click Workspaces from the left-hand menu 3. Select the Workspace you want to create Report Fields on -4. Click Report Fields on the lefthand menu (if you do not see this option, enable Report Fields by following the Enable Report Fields process above this) +4. Click Report Fields on the left hand menu (if you do not see this option, enable Report Fields by following the Enable Report Fields process above this) 5. Click “Add Field” in the top right corner 6. Click “Name” and add a name your your Report Field 7. Click “Type” to select the Report Field type; you will have the following options: @@ -43,7 +43,7 @@ To edit or delete existing report fields Report Fields: 1. Click Settings in the bottom left menu 2. Click Workspaces from the left-hand menu 3. Select the Workspace you want to edit Report Fields on -4. Click Report Fields on the lefthand menu +4. Click Report Fields on the left hand menu 5. Click the Report Field you wish to edit or delete 6. Make the required edits in the right-hand panel, or select “Delete” diff --git a/docs/articles/new-expensify/workspaces/Set-distance-rates.md b/docs/articles/new-expensify/workspaces/Set-distance-rates.md index c434f34d2cef..e9f3aadcf81a 100644 --- a/docs/articles/new-expensify/workspaces/Set-distance-rates.md +++ b/docs/articles/new-expensify/workspaces/Set-distance-rates.md @@ -4,7 +4,7 @@ description: Set distance rates on your Expensify workspace ---
-# Set Distance eates +# Set Distance rates Each Expensify workspace can be configured with one or more distance rates. Once distance rates are enabled on your workspace, employees will be able to choose between the available rates to create distance expenses. diff --git a/docs/articles/new-expensify/workspaces/Set-up-workflows.md b/docs/articles/new-expensify/workspaces/Set-up-workflows.md index 7d5e6413fcae..ff7756de1627 100644 --- a/docs/articles/new-expensify/workspaces/Set-up-workflows.md +++ b/docs/articles/new-expensify/workspaces/Set-up-workflows.md @@ -43,7 +43,7 @@ The payments section is where you’ll set up your business bank account for pay 2. Enable the Payments toggle. 3. Click **Connect Bank Account**. 4. Follow the prompts to [connect your company bank account](https://help.expensify.com/articles/new-expensify/expenses-and-payments/Connect-a-Business-Bank-Account). -5. Once enabled, choose an authorized expense payer. The authorized payer is a workspace admin who has access to the business bank account. They will be the default reimburser/payor for expenses submitted to the workspace. +5. Once enabled, choose an authorized expense payer. The authorized payer is a workspace admin who has access to the business bank account. They will be the default reimburser/payer for expenses submitted to the workspace. {% include faq-begin.md %} diff --git a/docs/assets/js/main.js b/docs/assets/js/main.js index af5473602847..2bf4df22fc0f 100644 --- a/docs/assets/js/main.js +++ b/docs/assets/js/main.js @@ -2,21 +2,21 @@ function toggleHeaderMenu() { const lhn = document.getElementById('lhn'); const lhnContent = document.getElementById('lhn-content'); - const anguleUpIcon = document.getElementById('angle-up-icon'); + const angleUpIcon = document.getElementById('angle-up-icon'); const barsIcon = document.getElementById('bars-icon'); if (lhnContent.className === 'expanded') { // Collapse the LHN in mobile lhn.className = ''; lhnContent.className = ''; barsIcon.classList.remove('hide'); - anguleUpIcon.classList.add('hide'); + angleUpIcon.classList.add('hide'); document.body.classList.remove('disable-scrollbar'); } else { // Expand the LHN in mobile lhn.className = 'expanded'; lhnContent.className = 'expanded'; barsIcon.classList.add('hide'); - anguleUpIcon.classList.remove('hide'); + angleUpIcon.classList.remove('hide'); document.body.classList.add('disable-scrollbar'); } } @@ -70,8 +70,8 @@ function navigateBack() { setTimeout(toggleHeaderMenu, 250); } -function injectFooterCopywrite() { - const footer = document.getElementById('footer-copywrite-date'); +function injectFooterCopyright() { + const footer = document.getElementById('footer-copyright-date'); footer.innerHTML = `©2008-${new Date().getFullYear()} Expensify, Inc.`; } @@ -265,7 +265,7 @@ function selectExpensifyClassic(newExpensifyTab, newExpensifyContent, expensifyC } window.addEventListener('DOMContentLoaded', () => { - injectFooterCopywrite(); + injectFooterCopyright(); // Handle open & close the sidebar const buttonOpenSidebar = document.getElementById('toggle-search-open'); diff --git a/ios/NotificationServiceExtension/NotificationService.swift b/ios/NotificationServiceExtension/NotificationService.swift index db999e0ec631..3fc7e7157671 100644 --- a/ios/NotificationServiceExtension/NotificationService.swift +++ b/ios/NotificationServiceExtension/NotificationService.swift @@ -203,7 +203,7 @@ class NotificationService: UANotificationServiceExtension { speakableGroupName = INSpeakableString(spokenPhrase: notificationData.roomName ?? "") // To add the group name subtitle there must be multiple recipients set. However, we do not have - // data on the participatns in the room/group chat so we just add a placeholder here. This shouldn't + // data on the participants in the room/group chat so we just add a placeholder here. This shouldn't // appear anywhere in the UI let placeholderPerson = INPerson(personHandle: INPersonHandle(value: "placeholder", type: .unknown), nameComponents: nil, diff --git a/jest/setup.ts b/jest/setup.ts index 90821bba5b8c..1adc7bc86979 100644 --- a/jest/setup.ts +++ b/jest/setup.ts @@ -112,7 +112,7 @@ jest.mock('../modules/hybrid-app/src/NativeReactNativeHybridApp', () => ({ jest.mock( '@react-native/virtualized-lists/Interaction/Batchinator', () => - class SyncBachinator { + class SyncBatchinator { #callback: () => void; constructor(callback: () => void) { diff --git a/jest/setupMockImages.ts b/jest/setupMockImages.ts index c48797b3c07b..7f9d50dab797 100644 --- a/jest/setupMockImages.ts +++ b/jest/setupMockImages.ts @@ -19,6 +19,6 @@ function mockImages(imagePath: string) { export default () => { mockImages('images'); mockImages('images/avatars'); - mockImages('images/bankicons'); + mockImages('images/bank-icons'); mockImages('images/product-illustrations'); }; diff --git a/package-lock.json b/package-lock.json index 92be46948d8c..64b5ae7ea305 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40300,9 +40300,14 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "2.3.2", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "dev": true, "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" } diff --git a/scripts/postInstall.sh b/scripts/postInstall.sh index c2adcadc4f43..0d538aebc47a 100755 --- a/scripts/postInstall.sh +++ b/scripts/postInstall.sh @@ -24,8 +24,8 @@ fi # Apply packages using patch-package scripts/applyPatches.sh -# Install node_modules in subpackages, unless we're in a CI/CD environment, -# where the node_modules for subpackages are cached separately. +# Install node_modules in subpackage, unless we're in a CI/CD environment, +# where the node_modules for subpackage are cached separately. # See `.github/actions/composite/setupNode/action.yml` for more context. if [[ -z ${CI+x} ]]; then cd desktop || exit 1 diff --git a/src/CONFIG.ts b/src/CONFIG.ts index b8e45601cf37..aa6e3a325d49 100644 --- a/src/CONFIG.ts +++ b/src/CONFIG.ts @@ -93,6 +93,7 @@ export default { REDIRECT_URI: `${newExpensifyURL}appleauth`, }, GOOGLE_SIGN_IN: { + // cspell:disable-next-line WEB_CLIENT_ID: '921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com', IOS_CLIENT_ID: '921154746561-s3uqn2oe4m85tufi6mqflbfbuajrm2i3.apps.googleusercontent.com', }, diff --git a/src/CONST.ts b/src/CONST.ts index 8ac06a52a8a5..29c58b6e7eae 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -388,9 +388,9 @@ const CONST = { // Multiplier for gyroscope animation in order to make it a bit more subtle ANIMATION_GYROSCOPE_VALUE: 0.4, ANIMATION_PAID_DURATION: 200, - ANIMATION_PAID_CHECKMARK_DELAY: 300, - ANIMATION_THUMBSUP_DURATION: 250, - ANIMATION_THUMBSUP_DELAY: 200, + ANIMATION_PAID_CHECK_MARK_DELAY: 300, + ANIMATION_THUMBS_UP_DURATION: 250, + ANIMATION_THUMBS_UP_DELAY: 200, ANIMATION_PAID_BUTTON_HIDE_DELAY: 300, BACKGROUND_IMAGE_TRANSITION_DURATION: 1000, SCREEN_TRANSITION_END_TIMEOUT: 1000, @@ -813,7 +813,7 @@ const CONST = { ANDROID: 'android', WEB: 'web', DESKTOP: 'desktop', - MOBILEWEB: 'mobileweb', + MOBILE_WEB: 'mobileweb', }, PLATFORM_SPECIFIC_KEYS: { CTRL: { @@ -1023,7 +1023,7 @@ const CONST = { SAVE_WITH_EXPENSIFY_URL: `${USE_EXPENSIFY_URL}/savings-calculator`, CFPB_PREPAID_URL: 'https://cfpb.gov/prepaid', STAGING_NEW_EXPENSIFY_URL: 'https://staging.new.expensify.com', - NEWHELP_URL: 'https://help.expensify.com', + NEW_HELP_URL: 'https://help.expensify.com', INTERNAL_DEV_EXPENSIFY_URL: 'https://www.expensify.com.dev', STAGING_EXPENSIFY_URL: 'https://staging.expensify.com', DENIED_CAMERA_ACCESS_INSTRUCTIONS_URL: @@ -1049,8 +1049,8 @@ const CONST = { vcf: 'https://help.expensify.com/articles/new-expensify/connect-credit-cards/company-cards/Commercial-feeds#steps-to-add-a-visa-commercial-feed', gl1025: 'https://help.expensify.com/articles/new-expensify/connect-credit-cards/company-cards/Commercial-feeds#steps-to-add-an-american-express-corporate-feed', }, - COMPANY_CARDS_VISA_COMMERICAL_CARD_HELP: 'https://help.expensify.com/articles/new-expensify/connect-credit-cards/company-cards/Commercial-feeds#how-to-set-up-a-visa-commercial-feed', - COMPANY_CARDS_AMEX_COMMERICAL_CARD_HELP: + COMPANY_CARDS_VISA_COMMERCIAL_CARD_HELP: 'https://help.expensify.com/articles/new-expensify/connect-credit-cards/company-cards/Commercial-feeds#how-to-set-up-a-visa-commercial-feed', + COMPANY_CARDS_AMEX_COMMERCIAL_CARD_HELP: 'https://help.expensify.com/articles/new-expensify/connect-credit-cards/company-cards/Commercial-feeds#how-to-set-up-an-american-express-corporate-feed', COMPANY_CARDS_STRIPE_HELP: 'https://dashboard.stripe.com/login?redirect=%2Fexpenses%2Fsettings', COMPANY_CARDS_CONNECT_CREDIT_CARDS_HELP_URL: 'https://help.expensify.com/new-expensify/hubs/connect-credit-cards/', @@ -1138,8 +1138,8 @@ const CONST = { }, MAX_COUNT_BEFORE_FOCUS_UPDATE: 30, MIN_INITIAL_REPORT_ACTION_COUNT: 15, - UNREPORTED_REPORTID: '0', - SPLIT_REPORTID: '-2', + UNREPORTED_REPORT_ID: '0', + SPLIT_REPORT_ID: '-2', SECONDARY_ACTIONS: { SUBMIT: 'submit', APPROVE: 'approve', @@ -1227,10 +1227,10 @@ const CONST = { SUBMITTED_AND_CLOSED: 'SUBMITTEDCLOSED', TAKE_CONTROL: 'TAKECONTROL', // OldDot Action TASK_CANCELLED: 'TASKCANCELLED', - TASK_COMPLETED: 'TASKCOMPLETED', + TASK_COMPLETED: 'TASK_COMPLETED', TASK_EDITED: 'TASKEDITED', TASK_REOPENED: 'TASKREOPENED', - TRIPPREVIEW: 'TRIPPREVIEW', + TRIP_PREVIEW: 'TRIP_PREVIEW', UNAPPROVED: 'UNAPPROVED', UNHOLD: 'UNHOLD', UNSHARE: 'UNSHARE', // OldDot Action @@ -1462,7 +1462,7 @@ const CONST = { MODAL_TYPE: { CONFIRM: 'confirm', CENTERED: 'centered', - CENTERED_SWIPABLE_TO_RIGHT: 'centered_swipable_to_right', + CENTERED_SWIPEABLE_TO_RIGHT: 'centered_swipable_to_right', CENTERED_UNSWIPEABLE: 'centered_unswipeable', CENTERED_SMALL: 'centered_small', BOTTOM_DOCKED: 'bottom_docked', @@ -1626,7 +1626,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', @@ -1709,7 +1709,7 @@ const CONST = { // More info https://github.com/Expensify/App/issues/8007 EMAIL_SEARCH_REGEX: /\.(?=[^\s@]*@)/g, - VALIDATE_FOR_LEADINGSPACES_HTML_TAG_REGEX: /<([\s]+.+[\s]*)>/g, + VALIDATE_FOR_LEADING_SPACES_HTML_TAG_REGEX: /<([\s]+.+[\s]*)>/g, WHITELISTED_TAGS: [/<>/, /< >/, /<->/, /<-->/, /
/, //], @@ -1905,7 +1905,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: { @@ -2671,11 +2671,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', @@ -2814,7 +2814,7 @@ const CONST = { OPTIONAL: 'submitAndClose', BASIC: 'submitAndApprove', ADVANCED: 'advanced', - DYNAMICEXTERNAL: 'dynamictExternal', + DYNAMICEXTERNAL: 'dynamicExternal', SMARTREPORT: 'smartReport', BILLCOM: 'billcom', }, @@ -3068,7 +3068,7 @@ const CONST = { }, AVATAR_SIZE: { - XLARGE: 'xlarge', + X_LARGE: 'xlarge', LARGE: 'large', MEDIUM: 'medium', DEFAULT: 'default', @@ -3309,7 +3309,7 @@ const CONST = { SUBSCRIPTION: { TYPE: { ANNUAL: 'yearly2018', - PAYPERUSE: 'monthly2018', + PAY_PER_USE: 'monthly2018', }, }, get SUBSCRIPTION_PRICES() { @@ -3317,41 +3317,41 @@ 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.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.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.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, }, }, }; @@ -3457,7 +3457,7 @@ const CONST = { * Group 2: Optional email group between \s+....\s* start rule with @+valid email or short mention * Group 3: Title is remaining characters */ - TASK_TITLE_WITH_OPTONAL_SHORT_MENTION: `^\\[\\]\\s+(?:@(?:${EMAIL_WITH_OPTIONAL_DOMAIN.source}))?\\s*([\\s\\S]*)`, + TASK_TITLE_WITH_OPTIONAL_SHORT_MENTION: `^\\[\\]\\s+(?:@(?:${EMAIL_WITH_OPTIONAL_DOMAIN.source}))?\\s*([\\s\\S]*)`, }, PRONOUNS: { @@ -3618,7 +3618,7 @@ const CONST = { SPEND_MANAGEMENT_URL: `${USE_EXPENSIFY_URL}/spend-management`, EXPENSE_REPORTS_URL: `${USE_EXPENSIFY_URL}/expense-reports`, COMPANY_CARD_URL: `${USE_EXPENSIFY_URL}/company-credit-card`, - RECIEPT_SCANNING_URL: `${USE_EXPENSIFY_URL}/receipt-scanning-app`, + RECEIPT_SCANNING_URL: `${USE_EXPENSIFY_URL}/receipt-scanning-app`, BILL_PAY_URL: `${USE_EXPENSIFY_URL}/bills`, INVOICES_URL: `${USE_EXPENSIFY_URL}/invoices`, PAYROLL_URL: `${USE_EXPENSIFY_URL}/payroll`, @@ -5006,7 +5006,7 @@ const CONST = { SUBMITTER: 'submitter', }, }, - DELEGATE_ROLE_HELPDOT_ARTICLE_LINK: 'https://help.expensify.com/expensify-classic/hubs/copilots-and-delegates/', + DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK: 'https://help.expensify.com/expensify-classic/hubs/copilots-and-delegates/', STRIPE_GBP_AUTH_STATUSES: { SUCCEEDED: 'succeeded', CARD_AUTHENTICATION_REQUIRED: 'authentication_required', @@ -6732,7 +6732,7 @@ const CONST = { CUSTOM_FIELD_1: 'customField1', CUSTOM_FIELD_2: 'customField2', ROLE: 'role', - REPORT_THRESHHOLD: 'reportThreshold', + REPORT_THRESHOLD: 'reportThreshold', APPROVE_TO_ALTERNATE: 'approveToAlternate', SUBRATE: 'subRate', AMOUNT: 'amount', @@ -6875,7 +6875,7 @@ const CONST = { PRODUCT_TRAINING_TOOLTIP_NAMES: { // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 - CONCEIRGE_LHN_GBR: 'conciergeLHNGBR', + CONCIERGE_LHN_GBR: 'conciergeLHNGbr', RENAME_SAVED_SEARCH: 'renameSavedSearch', BOTTOM_NAV_INBOX_TOOLTIP: 'bottomNavInboxTooltip', LHN_WORKSPACE_CHAT_TOOLTIP: 'workspaceChatLHNTooltip', diff --git a/src/NAVIGATORS.ts b/src/NAVIGATORS.ts index 853e2591b499..90cf571235e2 100644 --- a/src/NAVIGATORS.ts +++ b/src/NAVIGATORS.ts @@ -7,7 +7,7 @@ export default { LEFT_MODAL_NAVIGATOR: 'LeftModalNavigator', RIGHT_MODAL_NAVIGATOR: 'RightModalNavigator', ONBOARDING_MODAL_NAVIGATOR: 'OnboardingModalNavigator', - FEATURE_TRANING_MODAL_NAVIGATOR: 'FeatureTrainingModalNavigator', + FEATURE_TRAINING_MODAL_NAVIGATOR: 'FeatureTrainingModalNavigator', WELCOME_VIDEO_MODAL_NAVIGATOR: 'WelcomeVideoModalNavigator', EXPLANATION_MODAL_NAVIGATOR: 'ExplanationModalNavigator', MIGRATED_USER_MODAL_NAVIGATOR: 'MigratedUserModalNavigator', diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 15c90547aa10..6093e27de883 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -130,7 +130,7 @@ const ONYXKEYS = { NVP_ONBOARDING: 'nvp_onboarding', /** This NVP contains data associated with HybridApp */ - NVP_TRYNEWDOT: 'nvp_tryNewDot', + NVP_TRY_NEW_DOT: 'nvp_tryNewDot', /** Contains the platforms for which the user muted the sounds */ NVP_MUTED_PLATFORMS: 'nvp_mutedPlatforms', @@ -195,7 +195,7 @@ const ONYXKEYS = { /** Store the billing status */ NVP_PRIVATE_BILLING_STATUS: 'nvp_private_billingStatus', - /** Store preferred skintone for emoji */ + /** Store preferred skin tone for emoji */ PREFERRED_EMOJI_SKIN_TONE: 'nvp_expensify_preferredEmojiSkinTone', /** Store frequently used emojis for this user */ @@ -207,7 +207,7 @@ const ONYXKEYS = { /** The NVP with the last action taken (for the Quick Action Button) */ NVP_QUICK_ACTION_GLOBAL_CREATE: 'nvp_quickActionGlobalCreate', - /** The NVP containing all information necessary to connect with Spontana */ + /** The NVP containing all information necessary to connect with Spotnana */ NVP_TRAVEL_SETTINGS: 'nvp_travelSettings', /** The start date (yyyy-MM-dd HH:mm:ss) of the workspace owner’s free trial period. */ @@ -386,7 +386,7 @@ const ONYXKEYS = { /** Indicates whether an forced upgrade is required */ UPDATE_REQUIRED: 'updateRequired', - /** Indicates whether an forced reset is required. Used in emergency situations where we must completely erase the Onyx data in the client because it is in a bad state. This will clear Oynx data without signing the user out. */ + /** Indicates whether an forced reset is required. Used in emergency situations where we must completely erase the Onyx data in the client because it is in a bad state. This will clear Onyx data without signing the user out. */ RESET_REQUIRED: 'resetRequired', /** Stores the logs of the app for debugging purposes */ @@ -410,7 +410,7 @@ const ONYXKEYS = { /** Holds the checks used while transferring the ownership of the workspace */ POLICY_OWNERSHIP_CHANGE_CHECKS: 'policyOwnershipChangeChecks', - // These statuses below are in separate keys on purpose - it allows us to have different behaviours of the banner based on the status + // These statuses below are in separate keys on purpose - it allows us to have different behaviors of the banner based on the status /** Indicates whether ClearOutstandingBalance failed */ SUBSCRIPTION_RETRY_BILLING_STATUS_FAILED: 'subscriptionRetryBillingStatusFailed', @@ -427,7 +427,7 @@ const ONYXKEYS = { /** Stores the last export method for policy */ LAST_EXPORT_METHOD: 'lastExportMethod', - /** Stores the information about the state of addint a new company card */ + /** Stores the information about the state of adding a new company card */ ADD_NEW_COMPANY_CARD: 'addNewCompanyCard', /** Stores the information about the state of assigning a company card */ @@ -441,7 +441,7 @@ const ONYXKEYS = { /** Stores the information about currently edited advanced approval workflow */ APPROVAL_WORKFLOW: 'approvalWorkflow', - /** Stores the user search value for persistance across the screens */ + /** Stores the user search value for persistence across the screens */ ROOM_MEMBERS_USER_SEARCH_PHRASE: 'roomMembersUserSearchPhrase', /** Stores information about recently uploaded spreadsheet file */ IMPORTED_SPREADSHEET: 'importedSpreadsheet', @@ -587,7 +587,7 @@ const ONYXKEYS = { /** Whether the bank account chosen for Expensify Card in on verification waitlist */ NVP_EXPENSIFY_ON_CARD_WAITLIST: 'nvp_expensify_onCardWaitlist_', - NVP_EXPENSIFY_REPORT_PDFFILENAME: 'nvp_expensify_report_PDFFilename_', + NVP_EXPENSIFY_REPORT_PDF_FILENAME: 'nvp_expensify_report_PDFFilename_', /** Stores the information about the state of issuing a new card */ ISSUE_NEW_EXPENSIFY_CARD: 'issueNewExpensifyCard_', @@ -926,7 +926,7 @@ type OnyxCollectionValuesMapping = { [ONYXKEYS.COLLECTION.OLD_POLICY_RECENTLY_USED_TAGS]: OnyxTypes.RecentlyUsedTags; [ONYXKEYS.COLLECTION.SELECTED_TAB]: OnyxTypes.SelectedTabRequest; [ONYXKEYS.COLLECTION.PRIVATE_NOTES_DRAFT]: string; - [ONYXKEYS.COLLECTION.NVP_EXPENSIFY_REPORT_PDFFILENAME]: string; + [ONYXKEYS.COLLECTION.NVP_EXPENSIFY_REPORT_PDF_FILENAME]: string; [ONYXKEYS.COLLECTION.NEXT_STEP]: OnyxTypes.ReportNextStep; [ONYXKEYS.COLLECTION.POLICY_JOIN_MEMBER]: OnyxTypes.PolicyJoinMember; [ONYXKEYS.COLLECTION.POLICY_CONNECTION_SYNC_PROGRESS]: OnyxTypes.PolicyConnectionSyncProgress; @@ -950,8 +950,8 @@ type OnyxValuesMapping = { [ONYXKEYS.NVP_ONBOARDING]: Onboarding; - // ONYXKEYS.NVP_TRYNEWDOT is HybridApp onboarding data - [ONYXKEYS.NVP_TRYNEWDOT]: OnyxTypes.TryNewDot; + // ONYXKEYS.NVP_TRY_NEW_DOT is HybridApp onboarding data + [ONYXKEYS.NVP_TRY_NEW_DOT]: OnyxTypes.TryNewDot; [ONYXKEYS.RECENT_SEARCHES]: Record; [ONYXKEYS.SAVED_SEARCHES]: OnyxTypes.SaveSearch; [ONYXKEYS.RECENTLY_USED_CURRENCIES]: string[]; diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 6b55f97b40e8..1acc2706ccab 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -233,11 +233,11 @@ const ROUTES = { getRoute: (backTo?: string, forwardTo?: string) => getUrlWithBackToParam(forwardTo ? `settings/wallet/verify?forwardTo=${encodeURIComponent(forwardTo)}` : 'settings/wallet/verify', backTo), }, - SETTINGS_WALLET_DOMAINCARD: { + SETTINGS_WALLET_DOMAIN_CARD: { route: 'settings/wallet/card/:cardID?', getRoute: (cardID: string) => `settings/wallet/card/${cardID}` as const, }, - SETTINGS_DOMAINCARD_DETAIL: { + SETTINGS_DOMAIN_CARD_DETAIL: { route: 'settings/card/:cardID?', getRoute: (cardID: string) => `settings/card/${cardID}` as const, }, @@ -249,7 +249,7 @@ const ROUTES = { route: 'settings/wallet/card/:cardID/report-virtual-fraud-confirm', getRoute: (cardID: string) => `settings/wallet/card/${cardID}/report-virtual-fraud-confirm` as const, }, - SETTINGS_DOMAINCARD_REPORT_FRAUD: { + SETTINGS_DOMAIN_CARD_REPORT_FRAUD: { route: 'settings/card/:cardID/report-virtual-fraud', getRoute: (cardID: string) => `settings/card/${cardID}/report-virtual-fraud` as const, }, @@ -339,7 +339,7 @@ const ROUTES = { route: 'settings/exit-survey/reason', getRoute: (backTo?: string) => getUrlWithBackToParam('settings/exit-survey/reason', backTo), }, - SETTINGS_EXIT_SURVERY_BOOK_CALL: { + SETTINGS_EXIT_SURVEY_BOOK_CALL: { route: 'settings/exit-survey/book-call', getRoute: (backTo?: string) => getUrlWithBackToParam('settings/exit-survey/book-call', backTo), }, @@ -448,7 +448,12 @@ const ROUTES = { }, REPORT_PARTICIPANTS: { route: 'r/:reportID/participants', - getRoute: (reportID: string, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/participants` as const, backTo), + getRoute: (reportID: string | undefined, backTo?: string) => { + if (!reportID) { + Log.warn('Invalid reportID is used to build the REPORT_PARTICIPANTS route'); + } + return getUrlWithBackToParam(`r/${reportID}/participants` as const, backTo); + }, }, REPORT_PARTICIPANTS_INVITE: { route: 'r/:reportID/participants/invite', @@ -545,7 +550,12 @@ const ROUTES = { }, ROOM_MEMBERS: { route: 'r/:reportID/members', - getRoute: (reportID: string, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/members` as const, backTo), + getRoute: (reportID: string | undefined, backTo?: string) => { + if (!reportID) { + Log.warn('Invalid reportID is used to build the ROOM_MEMBERS route'); + } + return getUrlWithBackToParam(`r/${reportID}/members` as const, backTo); + }, }, ROOM_MEMBER_DETAILS: { route: 'r/:reportID/members/:accountID', @@ -1063,15 +1073,30 @@ const ROUTES = { }, POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT: { route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/export/out-of-pocket-expense/account-select', - getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-desktop/export/out-of-pocket-expense/account-select` as const, + getRoute: (policyID: string | undefined) => { + if (!policyID) { + Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT route'); + } + return `settings/workspaces/${policyID}/accounting/quickbooks-desktop/export/out-of-pocket-expense/account-select` as const; + }, }, POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_SELECT: { route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/export/out-of-pocket-expense/entity-select', - getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-desktop/export/out-of-pocket-expense/entity-select` as const, + getRoute: (policyID: string | undefined) => { + if (!policyID) { + Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_SELECT route'); + } + return `settings/workspaces/${policyID}/accounting/quickbooks-desktop/export/out-of-pocket-expense/entity-select` as const; + }, }, POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT: { route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/export', - getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-desktop/export` as const, + getRoute: (policyID: string | undefined) => { + if (!policyID) { + Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT route'); + } + return `settings/workspaces/${policyID}/accounting/quickbooks-desktop/export` as const; + }, }, POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_SETUP_MODAL: { route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/setup-modal', @@ -1172,13 +1197,23 @@ const ROUTES = { route: 'settings/workspaces/:policyID/workflows/payer', getRoute: (policyId: string) => `settings/workspaces/${policyId}/workflows/payer` as const, }, - WORKSPACE_WORKFLOWS_AUTOREPORTING_FREQUENCY: { + WORKSPACE_WORKFLOWS_AUTO_REPORTING_FREQUENCY: { route: 'settings/workspaces/:policyID/workflows/auto-reporting-frequency', - getRoute: (policyID: string) => `settings/workspaces/${policyID}/workflows/auto-reporting-frequency` as const, + getRoute: (policyID: string | undefined) => { + if (!policyID) { + Log.warn('Invalid policyID is used to build the WORKSPACE_WORKFLOWS_AUTO_REPORTING_FREQUENCY route'); + } + return `settings/workspaces/${policyID}/workflows/auto-reporting-frequency` as const; + }, }, - WORKSPACE_WORKFLOWS_AUTOREPORTING_MONTHLY_OFFSET: { + WORKSPACE_WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET: { route: 'settings/workspaces/:policyID/workflows/auto-reporting-frequency/monthly-offset', - getRoute: (policyID: string) => `settings/workspaces/${policyID}/workflows/auto-reporting-frequency/monthly-offset` as const, + getRoute: (policyID: string | undefined) => { + if (!policyID) { + Log.warn('Invalid policyID is used to build the WORKSPACE_WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET route'); + } + return `settings/workspaces/${policyID}/workflows/auto-reporting-frequency/monthly-offset` as const; + }, }, WORKSPACE_INVOICES: { route: 'settings/workspaces/:policyID/invoices', @@ -1319,23 +1354,23 @@ const ROUTES = { route: 'settings/workspaces/:policyID/category/:categoryName/gl-code', getRoute: (policyID: string, categoryName: string) => `settings/workspaces/${policyID}/category/${encodeURIComponent(categoryName)}/gl-code` as const, }, - WORSKPACE_CATEGORY_DEFAULT_TAX_RATE: { + WORKSPACE_CATEGORY_DEFAULT_TAX_RATE: { route: 'settings/workspaces/:policyID/category/:categoryName/tax-rate', getRoute: (policyID: string, categoryName: string) => `settings/workspaces/${policyID}/category/${encodeURIComponent(categoryName)}/tax-rate` as const, }, - WORSKPACE_CATEGORY_FLAG_AMOUNTS_OVER: { + WORKSPACE_CATEGORY_FLAG_AMOUNTS_OVER: { route: 'settings/workspaces/:policyID/category/:categoryName/flag-amounts', getRoute: (policyID: string, categoryName: string) => `settings/workspaces/${policyID}/category/${encodeURIComponent(categoryName)}/flag-amounts` as const, }, - WORSKPACE_CATEGORY_DESCRIPTION_HINT: { + WORKSPACE_CATEGORY_DESCRIPTION_HINT: { route: 'settings/workspaces/:policyID/category/:categoryName/description-hint', getRoute: (policyID: string, categoryName: string) => `settings/workspaces/${policyID}/category/${encodeURIComponent(categoryName)}/description-hint` as const, }, - WORSKPACE_CATEGORY_REQUIRE_RECEIPTS_OVER: { + WORKSPACE_CATEGORY_REQUIRE_RECEIPTS_OVER: { route: 'settings/workspaces/:policyID/category/:categoryName/require-receipts-over', getRoute: (policyID: string, categoryName: string) => `settings/workspaces/${policyID}/category/${encodeURIComponent(categoryName)}/require-receipts-over` as const, }, - WORSKPACE_CATEGORY_APPROVER: { + WORKSPACE_CATEGORY_APPROVER: { route: 'settings/workspaces/:policyID/category/:categoryName/approver', getRoute: (policyID: string, categoryName: string) => `settings/workspaces/${policyID}/category/${encodeURIComponent(categoryName)}/approver` as const, }, @@ -2035,8 +2070,12 @@ const ROUTES = { }, POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_FIELD_MAPPING: { route: 'settings/workspaces/:policyID/accounting/netsuite/import/custom/:importCustomField', - getRoute: (policyID: string, importCustomField: ValueOf) => - `settings/workspaces/${policyID}/accounting/netsuite/import/custom/${importCustomField as string}` as const, + getRoute: (policyID: string | undefined, importCustomField: ValueOf) => { + if (!policyID) { + Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_FIELD_MAPPING route'); + } + return `settings/workspaces/${policyID}/accounting/netsuite/import/custom/${importCustomField as string}` as const; + }, }, POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_FIELD_VIEW: { route: 'settings/workspaces/:policyID/accounting/netsuite/import/custom/:importCustomField/view/:valueIndex', @@ -2213,7 +2252,12 @@ const ROUTES = { }, POLICY_ACCOUNTING_SAGE_INTACCT_TOGGLE_MAPPINGS: { route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/toggle-mapping/:mapping', - getRoute: (policyID: string, mapping: SageIntacctMappingName) => `settings/workspaces/${policyID}/accounting/sage-intacct/import/toggle-mapping/${mapping as string}` as const, + getRoute: (policyID: string | undefined, mapping: SageIntacctMappingName) => { + if (!policyID) { + Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_SAGE_INTACCT_TOGGLE_MAPPINGS route'); + } + return `settings/workspaces/${policyID}/accounting/sage-intacct/import/toggle-mapping/${mapping as string}` as const; + }, }, POLICY_ACCOUNTING_SAGE_INTACCT_MAPPINGS_TYPE: { route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/mapping-type/:mapping', @@ -2221,7 +2265,12 @@ const ROUTES = { }, POLICY_ACCOUNTING_SAGE_INTACCT_USER_DIMENSIONS: { route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/user-dimensions', - getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/sage-intacct/import/user-dimensions` as const, + getRoute: (policyID: string | undefined) => { + if (!policyID) { + Log.warn('Invalid policyID is used to build the POLICY_ACCOUNTING_SAGE_INTACCT_USER_DIMENSIONS route'); + } + return `settings/workspaces/${policyID}/accounting/sage-intacct/import/user-dimensions` as const; + }, }, POLICY_ACCOUNTING_SAGE_INTACCT_ADD_USER_DIMENSION: { route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/add-user-dimension', diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 562b047efe97..db8ef85607ee 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -266,7 +266,7 @@ const SCREENS = { TAG: 'Transaction_Duplicate_Tag', DESCRIPTION: 'Transaction_Duplicate_Description', TAX_CODE: 'Transaction_Duplicate_Tax_Code', - REIMBURSABLE: 'Transaction_Duplicate_Reimburable', + REIMBURSABLE: 'Transaction_Duplicate_Reimbursable', BILLABLE: 'Transaction_Duplicate_Billable', CONFIRMATION: 'Transaction_Duplicate_Confirmation', }, @@ -393,20 +393,20 @@ const SCREENS = { QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_SELECT: 'Workspace_Accounting_Quickbooks_Desktop_Export_Out_Of_Pocket_Expenses_Select', QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT: 'Workspace_Accounting_Quickbooks_Desktop_Export_Out_Of_Pocket_Expenses_Account_Select', QUICKBOOKS_DESKTOP_EXPORT: 'Workspace_Accounting_Quickbooks_Desktop_Export', - QUICKBOOKS_DESKTOP_SETUP_MODAL: 'Policy_Accouting_Quickbooks_Desktop_Setup_Modal', - QUICKBOOKS_DESKTOP_SETUP_REQUIRED_DEVICE_MODAL: 'Policy_Accouting_Quickbooks_Desktop_Setup_Required_Device_Modal', - QUICKBOOKS_DESKTOP_TRIGGER_FIRST_SYNC: 'Policy_Accouting_Quickbooks_Desktop_Trigger_First_Sync', + QUICKBOOKS_DESKTOP_SETUP_MODAL: 'Policy_Accounting_Quickbooks_Desktop_Setup_Modal', + QUICKBOOKS_DESKTOP_SETUP_REQUIRED_DEVICE_MODAL: 'Policy_Accounting_Quickbooks_Desktop_Setup_Required_Device_Modal', + QUICKBOOKS_DESKTOP_TRIGGER_FIRST_SYNC: 'Policy_Accounting_Quickbooks_Desktop_Trigger_First_Sync', QUICKBOOKS_DESKTOP_IMPORT: 'Policy_Accounting_Quickbooks_Desktop_Import', QUICKBOOKS_DESKTOP_CHART_OF_ACCOUNTS: 'Policy_Accounting_Quickbooks_Desktop_Import_Chart_Of_Accounts', QUICKBOOKS_DESKTOP_CLASSES: 'Policy_Accounting_Quickbooks_Desktop_Import_Classes', - QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS: 'Policy_Accounting_Quickbooks_Desktop_Import_Classes_Dipslayed_As', + QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS: 'Policy_Accounting_Quickbooks_Desktop_Import_Classes_Displayed_As', QUICKBOOKS_DESKTOP_CUSTOMERS: 'Policy_Accounting_Quickbooks_Desktop_Import_Customers', - QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS: 'Policy_Accounting_Quickbooks_Desktop_Import_Customers_Dipslayed_As', + QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS: 'Policy_Accounting_Quickbooks_Desktop_Import_Customers_Displayed_As', QUICKBOOKS_DESKTOP_ITEMS: 'Policy_Accounting_Quickbooks_Desktop_Import_Items', XERO_IMPORT: 'Policy_Accounting_Xero_Import', XERO_ORGANIZATION: 'Policy_Accounting_Xero_Customers', XERO_CHART_OF_ACCOUNTS: 'Policy_Accounting_Xero_Import_Chart_Of_Accounts', - XERO_CUSTOMER: 'Policy_Acounting_Xero_Import_Customer', + XERO_CUSTOMER: 'Policy_Accounting_Xero_Import_Customer', XERO_TAXES: 'Policy_Accounting_Xero_Taxes', XERO_TRACKING_CATEGORIES: 'Policy_Accounting_Xero_Tracking_Categories', XERO_MAP_TRACKING_CATEGORY: 'Policy_Accounting_Xero_Map_Tracking_Category', diff --git a/src/components/AddressSearch/index.tsx b/src/components/AddressSearch/index.tsx index f6e8482f5058..1df709b51dfa 100644 --- a/src/components/AddressSearch/index.tsx +++ b/src/components/AddressSearch/index.tsx @@ -186,7 +186,7 @@ function AddressSearch( // When locality is not returned, many countries return the city as postalTown (e.g. 5 New Street // Square, London), otherwise as sublocality (e.g. 384 Court Street Brooklyn). If postalTown is // returned, the sublocality will be a city subdivision so shouldn't take precedence (e.g. - // Salagatan, Upssala, Sweden). + // Salagatan, Uppsala, Sweden). city: locality || postalTown || sublocality || cityAutocompleteFallback, zipCode, diff --git a/src/components/AmountForm.tsx b/src/components/AmountForm.tsx index 60a1e2af442d..83404a0e968c 100644 --- a/src/components/AmountForm.tsx +++ b/src/components/AmountForm.tsx @@ -227,7 +227,7 @@ function AmountForm( const textInputKeyPress = (event: NativeSyntheticEvent) => { const key = event.nativeEvent.key.toLowerCase(); if (isMobileSafari() && key === CONST.PLATFORM_SPECIFIC_KEYS.CTRL.DEFAULT) { - // Optimistically anticipate forward-delete on iOS Safari (in cases where the Mac Accessiblity keyboard is being + // Optimistically anticipate forward-delete on iOS Safari (in cases where the Mac Accessibility keyboard is being // used for input). If the Control-D shortcut doesn't get sent, the ref will still be reset on the next key press. forwardDeletePressedRef.current = true; return; diff --git a/src/components/AttachmentModal.tsx b/src/components/AttachmentModal.tsx index abb2679d478e..ba39a8bfa1e3 100644 --- a/src/components/AttachmentModal.tsx +++ b/src/components/AttachmentModal.tsx @@ -240,7 +240,7 @@ function AttachmentModal({ ); /** - * If our attachment is a PDF, return the unswipeablge Modal type. + * If our attachment is a PDF, return the unswipeable Modal type. */ const getModalType = useCallback( (sourceURL: string, fileObject: FileObject) => diff --git a/src/components/AttachmentOfflineIndicator.tsx b/src/components/AttachmentOfflineIndicator.tsx index 0451cbd87ae3..4af97c0dd12c 100644 --- a/src/components/AttachmentOfflineIndicator.tsx +++ b/src/components/AttachmentOfflineIndicator.tsx @@ -45,7 +45,7 @@ function AttachmentOfflineIndicator({isPreview = false}: AttachmentOfflineIndica {!isPreview && ( {translate('common.youAppearToBeOffline')} - {translate('common.attachementWillBeAvailableOnceBackOnline')} + {translate('common.attachmentWillBeAvailableOnceBackOnline')} )} diff --git a/src/components/AttachmentPicker/index.native.tsx b/src/components/AttachmentPicker/index.native.tsx index bd0102d1fde7..bf1f5bca4f0c 100644 --- a/src/components/AttachmentPicker/index.native.tsx +++ b/src/components/AttachmentPicker/index.native.tsx @@ -188,8 +188,8 @@ function AttachmentPicker({ image.release(); return result; }) - .then((manipResult) => { - const uri = manipResult.uri; + .then((manipulateResult) => { + const uri = manipulateResult.uri; const convertedAsset = { uri, name: uri @@ -197,8 +197,8 @@ function AttachmentPicker({ .split('?') .at(0), type: 'image/jpeg', - width: manipResult.width, - height: manipResult.height, + width: manipulateResult.width, + height: manipulateResult.height, }; return resolve([convertedAsset]); }) diff --git a/src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx b/src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx index e452cddb4128..04fd1163af44 100644 --- a/src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx +++ b/src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx @@ -25,10 +25,10 @@ type CarouselButtonsProps = { /** Callback to go one page forward */ onForward: () => void; - /** Callback for autohiding carousel button arrows */ + /** Callback for auto hiding carousel button arrows */ autoHideArrow?: () => void; - /** Callback for cancelling autohiding of carousel button arrows */ + /** Callback for cancelling auto hiding of carousel button arrows */ cancelAutoHideArrow?: () => void; }; diff --git a/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.tsx b/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.tsx index c756345664cc..c304187b8876 100644 --- a/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.tsx +++ b/src/components/Attachments/AttachmentView/AttachmentViewPdf/index.android.tsx @@ -7,7 +7,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import BaseAttachmentViewPdf from './BaseAttachmentViewPdf'; import type AttachmentViewPdfProps from './types'; -// If the user pans less than this threshold, we'll not enable/disable the pager scroll, since the thouch will most probably be a tap. +// If the user pans less than this threshold, we'll not enable/disable the pager scroll, since the touch will most probably be a tap. // If the user moves their finger more than this threshold in the X direction, we'll enable the pager scroll. Otherwise if in the Y direction, we'll disable it. const SCROLL_THRESHOLD = 10; diff --git a/src/components/Attachments/AttachmentView/index.tsx b/src/components/Attachments/AttachmentView/index.tsx index 3a76c3f5b663..17f0b7c6e083 100644 --- a/src/components/Attachments/AttachmentView/index.tsx +++ b/src/components/Attachments/AttachmentView/index.tsx @@ -211,7 +211,7 @@ function AttachmentView({ // We need the following View component on android native // So that the event will propagate properly and - // the Password protected preview will be shown for pdf attachement we are about to send. + // the Password protected preview will be shown for pdf attachment we are about to send. return ( { + ImageSize.getSize(imageUri).then(({width, height, rotation: originalRotation}) => { // On Android devices ImageSize library returns also rotation parameter. - if (orginalRotation === 90 || orginalRotation === 270) { + if (originalRotation === 90 || originalRotation === 270) { originalImageHeight.set(width); originalImageWidth.set(height); } else { diff --git a/src/components/AvatarWithImagePicker.tsx b/src/components/AvatarWithImagePicker.tsx index ee88c7c403dc..f07afb9c4513 100644 --- a/src/components/AvatarWithImagePicker.tsx +++ b/src/components/AvatarWithImagePicker.tsx @@ -75,7 +75,7 @@ type AvatarWithImagePickerProps = { isUsingDefaultAvatar?: boolean; /** Size of Indicator */ - size?: typeof CONST.AVATAR_SIZE.XLARGE | typeof CONST.AVATAR_SIZE.LARGE | typeof CONST.AVATAR_SIZE.DEFAULT; + size?: typeof CONST.AVATAR_SIZE.X_LARGE | typeof CONST.AVATAR_SIZE.LARGE | typeof CONST.AVATAR_SIZE.DEFAULT; /** A fallback avatar icon to display when there is an error on loading avatar from remote URL. */ fallbackIcon?: AvatarSource; diff --git a/src/components/BigNumberPad.tsx b/src/components/BigNumberPad.tsx index 30d5c0f45d1d..6785387e274f 100644 --- a/src/components/BigNumberPad.tsx +++ b/src/components/BigNumberPad.tsx @@ -70,7 +70,7 @@ function BigNumberPad({numberPressed, longPressHandlerStateChanged = () => {}, i > {row.map((column, columnIndex) => { // Adding margin between buttons except first column to - // avoid unccessary space before the first column. + // avoid unnecessary space before the first column. const marginLeft = columnIndex > 0 ? styles.ml3 : {}; return ( diff --git a/src/components/BookTravelButton.tsx b/src/components/BookTravelButton.tsx index 7ea2bcca1364..4301cc7495f0 100644 --- a/src/components/BookTravelButton.tsx +++ b/src/components/BookTravelButton.tsx @@ -36,7 +36,7 @@ type BookTravelButtonProps = { }; const navigateToAcceptTerms = (domain: string, isUserValidated?: boolean) => { - // Remove the previous provision session infromation if any is cached. + // Remove the previous provision session information if any is cached. cleanupTravelProvisioningSession(); if (isUserValidated) { Navigation.navigate(ROUTES.TRAVEL_TCS.getRoute(domain)); diff --git a/src/components/Breadcrumbs.tsx b/src/components/Breadcrumbs.tsx index 3f1d78eae06b..874184ddabed 100644 --- a/src/components/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs.tsx @@ -39,7 +39,7 @@ function Breadcrumbs({breadcrumbs, style}: BreadcrumbsProps) { const isRootBreadcrumb = primaryBreadcrumb.type === CONST.BREADCRUMB_TYPE.ROOT; const fontScale = PixelRatio.getFontScale() > CONST.LOGO_MAX_SCALE ? CONST.LOGO_MAX_SCALE : PixelRatio.getFontScale(); return ( - + {isRootBreadcrumb ? (
& { /** Function to check whether composer is covered up or not */ checkComposerVisibility?: () => boolean; - /** Whether the sull composer is open */ + /** Whether the full composer is open */ isComposerFullSize?: boolean; /** Should make the input only scroll inside the element avoid scroll out to parent */ diff --git a/src/components/ConfirmContent.tsx b/src/components/ConfirmContent.tsx index 22e7ec76c5b5..4ccd207a8a9e 100644 --- a/src/components/ConfirmContent.tsx +++ b/src/components/ConfirmContent.tsx @@ -97,7 +97,7 @@ type ConfirmContentProps = { /** Styles for the image */ imageStyles?: StyleProp; - /** Whether the modal is visibile */ + /** Whether the modal is visible */ isVisible: boolean; /** Whether the confirm button is loading */ diff --git a/src/components/ConfirmedRoute.tsx b/src/components/ConfirmedRoute.tsx index e1580dcae7d0..c943144e27b8 100644 --- a/src/components/ConfirmedRoute.tsx +++ b/src/components/ConfirmedRoute.tsx @@ -1,16 +1,16 @@ import React, {useCallback, useEffect} from 'react'; import type {ReactNode} from 'react'; -import {withOnyx} from 'react-native-onyx'; +import {useOnyx} from 'react-native-onyx'; import type {OnyxEntry} from 'react-native-onyx'; import useNetwork from '@hooks/useNetwork'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as TransactionUtils from '@libs/TransactionUtils'; -import * as MapboxToken from '@userActions/MapboxToken'; +import {getWaypointIndex} from '@libs/TransactionUtils'; +import {init, stop} from '@userActions/MapboxToken'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import type {MapboxAccessToken, Transaction} from '@src/types/onyx'; +import type {Transaction} from '@src/types/onyx'; import type {WaypointCollection} from '@src/types/onyx/Transaction'; import type IconAsset from '@src/types/utils/IconAsset'; import DistanceMapView from './DistanceMapView'; @@ -19,12 +19,7 @@ import ImageSVG from './ImageSVG'; import type {WayPoint} from './MapView/MapViewTypes'; import PendingMapView from './MapView/PendingMapView'; -type ConfirmedRoutePropsOnyxProps = { - /** Data about Mapbox token for calling Mapbox API */ - mapboxAccessToken: OnyxEntry; -}; - -type ConfirmedRouteProps = ConfirmedRoutePropsOnyxProps & { +type ConfirmedRouteProps = { /** Transaction that stores the distance expense data */ transaction: OnyxEntry; @@ -38,12 +33,13 @@ type ConfirmedRouteProps = ConfirmedRoutePropsOnyxProps & { * it will display pending map icon */ requireRouteToDisplayMap?: boolean; - /** Whether the map is interactable or not */ + /** Whether the map is interactive or not */ interactive?: boolean; }; -function ConfirmedRoute({mapboxAccessToken, transaction, isSmallerIcon, shouldHaveBorderRadius = true, requireRouteToDisplayMap = false, interactive}: ConfirmedRouteProps) { +function ConfirmedRoute({transaction, isSmallerIcon, shouldHaveBorderRadius = true, requireRouteToDisplayMap = false, interactive}: ConfirmedRouteProps) { const {isOffline} = useNetwork(); + const [mapboxAccessToken] = useOnyx(ONYXKEYS.MAPBOX_ACCESS_TOKEN); const {route0: route} = transaction?.routes ?? {}; const waypoints = transaction?.comment?.waypoints ?? {}; const coordinates = route?.geometry?.coordinates ?? []; @@ -74,7 +70,7 @@ function ConfirmedRoute({mapboxAccessToken, transaction, isSmallerIcon, shouldHa return; } - const index = TransactionUtils.getWaypointIndex(key); + const index = getWaypointIndex(key); let MarkerComponent: IconAsset; if (index === 0) { MarkerComponent = Expensicons.DotIndicatorUnfilled; @@ -98,8 +94,8 @@ function ConfirmedRoute({mapboxAccessToken, transaction, isSmallerIcon, shouldHa const waypointMarkers = getWaypointMarkers(waypoints); useEffect(() => { - MapboxToken.init(); - return MapboxToken.stop; + init(); + return stop; }, []); const shouldDisplayMap = !requireRouteToDisplayMap || !!coordinates.length; @@ -128,10 +124,6 @@ function ConfirmedRoute({mapboxAccessToken, transaction, isSmallerIcon, shouldHa ); } -export default withOnyx({ - mapboxAccessToken: { - key: ONYXKEYS.MAPBOX_ACCESS_TOKEN, - }, -})(ConfirmedRoute); +export default ConfirmedRoute; ConfirmedRoute.displayName = 'ConfirmedRoute'; diff --git a/src/components/ConnectionLayout.tsx b/src/components/ConnectionLayout.tsx index de61f368a911..aff27d11fbfe 100644 --- a/src/components/ConnectionLayout.tsx +++ b/src/components/ConnectionLayout.tsx @@ -41,7 +41,7 @@ type ConnectionLayoutProps = { /** The current feature name that the user tries to get access to */ featureName?: PolicyFeatureName; - /** The content container style of Scrollview */ + /** The content container style of ScrollView */ contentContainerStyle?: StyleProp | undefined; /** Style of the title text */ diff --git a/src/components/ContextMenuItem.tsx b/src/components/ContextMenuItem.tsx index c57c10e2c2b9..f16b11bc6581 100644 --- a/src/components/ContextMenuItem.tsx +++ b/src/components/ContextMenuItem.tsx @@ -42,7 +42,7 @@ type ContextMenuItemProps = { /** Whether the width should be limited */ shouldLimitWidth?: boolean; - /** Styles to apply to ManuItem wrapper */ + /** Styles to apply to MenuItem wrapper */ wrapperStyle?: StyleProp; shouldPreventDefaultFocusOnPress?: boolean; diff --git a/src/components/CountrySelector.tsx b/src/components/CountrySelector.tsx index cff06e5768b6..094f529c66b2 100644 --- a/src/components/CountrySelector.tsx +++ b/src/components/CountrySelector.tsx @@ -37,12 +37,12 @@ function CountrySelector({errorText = '', value: countryCode, onInputChange = () const title = countryCode ? translate(`allCountries.${countryCode}`) : ''; const countryTitleDescStyle = title.length === 0 ? styles.textNormal : null; - const didOpenContrySelector = useRef(false); + const didOpenCountrySelector = useRef(false); const isFocused = useIsFocused(); useEffect(() => { // Check if the country selector was opened and no value was selected, triggering onBlur to display an error - if (isFocused && didOpenContrySelector.current) { - didOpenContrySelector.current = false; + if (isFocused && didOpenCountrySelector.current) { + didOpenCountrySelector.current = false; if (!countryFromUrl) { onBlur?.(); } @@ -76,7 +76,7 @@ function CountrySelector({errorText = '', value: countryCode, onInputChange = () errorText={errorText} onPress={() => { const activeRoute = Navigation.getActiveRoute(); - didOpenContrySelector.current = true; + didOpenCountrySelector.current = true; Navigation.navigate(ROUTES.SETTINGS_ADDRESS_COUNTRY.getRoute(countryCode ?? '', activeRoute)); }} /> diff --git a/src/components/CustomStatusBarAndBackground/index.tsx b/src/components/CustomStatusBarAndBackground/index.tsx index ac1fc77dff96..87b7b5208c41 100644 --- a/src/components/CustomStatusBarAndBackground/index.tsx +++ b/src/components/CustomStatusBarAndBackground/index.tsx @@ -38,7 +38,7 @@ function CustomStatusBarAndBackground({isNested = false}: CustomStatusBarAndBack const didForceUpdateStatusBarRef = useRef(false); const prevIsRootStatusBarEnabled = usePrevious(isRootStatusBarEnabled); - // The prev and current status bar background color refs are initialized with the splash screen background color so the status bar color is changed from the splash screen color to the expected color atleast once on first render - https://github.com/Expensify/App/issues/34154 + // The prev and current status bar background color refs are initialized with the splash screen background color so the status bar color is changed from the splash screen color to the expected color at least once on first render - https://github.com/Expensify/App/issues/34154 const prevStatusBarBackgroundColor = useSharedValue(theme.splashBG); const statusBarBackgroundColor = useSharedValue(theme.splashBG); const statusBarAnimation = useSharedValue(0); @@ -59,7 +59,7 @@ function CustomStatusBarAndBackground({isNested = false}: CustomStatusBarAndBack const listenerCount = useRef(0); // Updates the status bar style and background color depending on the current route and theme - // This callback is triggered everytime the route changes or the theme changes + // This callback is triggered every time the route changes or the theme changes const updateStatusBarStyle = useCallback( (listenerID?: number) => { // Check if this function is either called through the current navigation listener @@ -69,8 +69,8 @@ function CustomStatusBarAndBackground({isNested = false}: CustomStatusBarAndBack return; } - // Set the status bar colour depending on the current route. - // If we don't have any colour defined for a route, fall back to + // Set the status bar color depending on the current route. + // If we don't have any color defined for a route, fall back to // appBG color. let currentRoute: ReturnType | undefined; if (navigationRef.isReady()) { @@ -106,7 +106,7 @@ function CustomStatusBarAndBackground({isNested = false}: CustomStatusBarAndBack }; // Don't update the status bar style if it's the same as the current one, to prevent flashing. - // Force update if the root status bar is back on active or it won't overwirte the nested status bar style + // Force update if the root status bar is back on active or it won't overwrite the nested status bar style if (!didForceUpdateStatusBarRef.current && !prevIsRootStatusBarEnabled && isRootStatusBarEnabled) { callUpdateStatusBarAppearance(); callUpdateStatusBarBackgroundColor(); @@ -159,7 +159,7 @@ function CustomStatusBarAndBackground({isNested = false}: CustomStatusBarAndBack return () => navigationRef.removeListener('state', listener); }, [isDisabled, updateStatusBarStyle]); - // Update the global background and status bar style (on web) everytime the theme changes. + // Update the global background and status bar style (on web) every time the theme changes. // The background of the html element needs to be updated, otherwise you will see a big contrast when resizing the window or when the keyboard is open on iOS web. // The status bar style needs to be updated when the user changes the theme, otherwise, the status bar will not change its color (mWeb iOS). useEffect(() => { diff --git a/src/components/DelegateNoAccessModal.tsx b/src/components/DelegateNoAccessModal.tsx index 088e94041e49..ae5a98293407 100644 --- a/src/components/DelegateNoAccessModal.tsx +++ b/src/components/DelegateNoAccessModal.tsx @@ -20,7 +20,7 @@ export default function DelegateNoAccessModal({isNoDelegateAccessMenuVisible = f const delegateNoAccessPrompt = ( {noDelegateAccessPromptStart} - {noDelegateAccessHyperLinked} + {noDelegateAccessHyperLinked} {noDelegateAccessPromptEnd} ); diff --git a/src/components/DotIndicatorMessage.tsx b/src/components/DotIndicatorMessage.tsx index a357bd96a665..0db118508b23 100644 --- a/src/components/DotIndicatorMessage.tsx +++ b/src/components/DotIndicatorMessage.tsx @@ -20,7 +20,7 @@ import TextLink from './TextLink'; type DotIndicatorMessageProps = { /** - * In most cases this should just be errors from onxyData + * In most cases this should just be errors from onyxData * if you are not passing that data then this needs to be in a similar shape like * { * timestamp: 'message', diff --git a/src/components/EmojiPicker/CategoryShortcutBar.tsx b/src/components/EmojiPicker/CategoryShortcutBar.tsx index 25c1ff85f6a3..b2071a656df4 100644 --- a/src/components/EmojiPicker/CategoryShortcutBar.tsx +++ b/src/components/EmojiPicker/CategoryShortcutBar.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; -import type {HeaderIndice} from '@libs/EmojiUtils'; +import type {HeaderIndices} from '@libs/EmojiUtils'; import CategoryShortcutButton from './CategoryShortcutButton'; type CategoryShortcutBarProps = { @@ -9,7 +9,7 @@ type CategoryShortcutBarProps = { onPress: (index: number) => void; /** The emojis consisting emoji code and indices that the icons should link to */ - headerEmojis: HeaderIndice[]; + headerEmojis: HeaderIndices[]; }; function CategoryShortcutBar({onPress, headerEmojis}: CategoryShortcutBarProps) { diff --git a/src/components/EmojiPicker/EmojiPicker.tsx b/src/components/EmojiPicker/EmojiPicker.tsx index 51ae120d80bf..74aba0b944cd 100644 --- a/src/components/EmojiPicker/EmojiPicker.tsx +++ b/src/components/EmojiPicker/EmojiPicker.tsx @@ -213,7 +213,7 @@ function EmojiPicker({viewportOffsetTop}: EmojiPickerProps, ref: ForwardedRef void; diff --git a/src/components/EnvironmentBadge.tsx b/src/components/EnvironmentBadge.tsx index 272aad734eec..ef3451847daa 100644 --- a/src/components/EnvironmentBadge.tsx +++ b/src/components/EnvironmentBadge.tsx @@ -2,7 +2,7 @@ import React from 'react'; import useEnvironment from '@hooks/useEnvironment'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as Environment from '@libs/Environment/Environment'; +import {isInternalTestBuild} from '@libs/Environment/Environment'; import CONST from '@src/CONST'; import pkg from '../../package.json'; import Badge from './Badge'; @@ -23,21 +23,21 @@ function EnvironmentBadge() { const success = environment === CONST.ENVIRONMENT.STAGING; const error = environment !== CONST.ENVIRONMENT.STAGING && environment !== CONST.ENVIRONMENT.ADHOC; - const badgeEnviromentStyle = StyleUtils.getEnvironmentBadgeStyle(success, error, adhoc); + const badgeEnvironmentStyle = StyleUtils.getEnvironmentBadgeStyle(success, error, adhoc); // If we are on production, don't show any badge if (isProduction) { return null; } - const text = Environment.isInternalTestBuild() ? `v${pkg.version} PR:${CONST.PULL_REQUEST_NUMBER}` : ENVIRONMENT_SHORT_FORM[environment]; + const text = isInternalTestBuild() ? `v${pkg.version} PR:${CONST.PULL_REQUEST_NUMBER}` : ENVIRONMENT_SHORT_FORM[environment]; return ( diff --git a/src/components/HeaderPageLayout.tsx b/src/components/HeaderPageLayout.tsx index 1d3a290ccbff..7d109bb340db 100644 --- a/src/components/HeaderPageLayout.tsx +++ b/src/components/HeaderPageLayout.tsx @@ -8,7 +8,7 @@ import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; -import * as Browser from '@libs/Browser'; +import {isSafari} from '@libs/Browser'; import type ChildrenProps from '@src/types/utils/ChildrenProps'; import FixedFooter from './FixedFooter'; import HeaderWithBackButton from './HeaderWithBackButton'; @@ -94,8 +94,8 @@ function HeaderPageLayout({ iconFill={iconFill} /> - {/** Safari on ios/mac has a bug where overscrolling the page scrollview shows green background color. This is a workaround to fix that. https://github.com/Expensify/App/issues/23422 */} - {Browser.isSafari() && ( + {/** Safari on ios/mac has a bug where over scrolling the page scroll view shows green background color. This is a workaround to fix that. https://github.com/Expensify/App/issues/23422 */} + {isSafari() && ( @@ -105,7 +105,7 @@ function HeaderPageLayout({ contentContainerStyle={[safeAreaPaddingBottomStyle, style, scrollViewContainerStyles]} keyboardShouldPersistTaps={keyboardShouldPersistTaps} > - {!Browser.isSafari() && } + {!isSafari() && } {headerContent} diff --git a/src/components/HeaderWithBackButton/index.tsx b/src/components/HeaderWithBackButton/index.tsx index 3a6b6361b209..afd41439af86 100755 --- a/src/components/HeaderWithBackButton/index.tsx +++ b/src/components/HeaderWithBackButton/index.tsx @@ -146,7 +146,7 @@ function HeaderWithBackButton({ shouldUseHeadlineHeader && styles.headerBarDesktopHeight, shouldShowBorderBottom && styles.borderBottom, // progressBarPercentage can be 0 which would - // be falsey, hence using !== undefined explicitly + // be falsy, hence using !== undefined explicitly progressBarPercentage !== undefined && styles.pl0, shouldShowBackButton && [styles.pl2], shouldOverlay && StyleSheet.absoluteFillObject, diff --git a/src/components/HeaderWithBackButton/types.ts b/src/components/HeaderWithBackButton/types.ts index fe25015cd305..7589391f6c3c 100644 --- a/src/components/HeaderWithBackButton/types.ts +++ b/src/components/HeaderWithBackButton/types.ts @@ -72,10 +72,10 @@ type HeaderWithBackButtonProps = Partial & { /** Whether we should show a pin button */ shouldShowPinButton?: boolean; - /** Whether we should show a more options (threedots) button */ + /** Whether we should show a more options (three-dots) button */ shouldShowThreeDotsButton?: boolean; - /** Whether we should disable threedots button */ + /** Whether we should disable three-dots button */ shouldDisableThreeDotsButton?: boolean; /** Whether we should set modal visibility when three dot menu opens */ diff --git a/src/components/Icon/BankIcons/index.native.ts b/src/components/Icon/BankIcons/index.native.ts index af6cd0679fda..62689e1d63c5 100644 --- a/src/components/Icon/BankIcons/index.native.ts +++ b/src/components/Icon/BankIcons/index.native.ts @@ -1,5 +1,5 @@ -import GenericBank from '@assets/images/bankicons/generic-bank-account.svg'; -import GenericBankCard from '@assets/images/cardicons/generic-bank-card.svg'; +import GenericBank from '@assets/images/bank-icons/generic-bank-account.svg'; +import GenericBankCard from '@assets/images/card-icons/generic-bank-card.svg'; import type {BankIconParams} from '@components/Icon/BankIconsUtils'; import {getBankIconAsset, getBankNameKey} from '@components/Icon/BankIconsUtils'; import variables from '@styles/variables'; diff --git a/src/components/Icon/BankIcons/index.ts b/src/components/Icon/BankIcons/index.ts index cf233da702fa..71f851e61c9f 100644 --- a/src/components/Icon/BankIcons/index.ts +++ b/src/components/Icon/BankIcons/index.ts @@ -1,5 +1,5 @@ -import GenericBank from '@assets/images/bankicons/generic-bank-account.svg'; -import GenericBankCard from '@assets/images/cardicons/generic-bank-card.svg'; +import GenericBank from '@assets/images/bank-icons/generic-bank-account.svg'; +import GenericBankCard from '@assets/images/card-icons/generic-bank-card.svg'; import type {BankIconParams} from '@components/Icon/BankIconsUtils'; import {getBankIconAsset, getBankNameKey} from '@components/Icon/BankIconsUtils'; import variables from '@styles/variables'; diff --git a/src/components/Icon/BankIconsUtils.ts b/src/components/Icon/BankIconsUtils.ts index c91ec030c9ba..9b94e5b8378c 100644 --- a/src/components/Icon/BankIconsUtils.ts +++ b/src/components/Icon/BankIconsUtils.ts @@ -19,47 +19,49 @@ function getBankIconAsset(bankNameKey: BankNameKey, isCard: boolean): IconAsset // The purpose is to avoid importing these at the app startup stage. // Depending on whether 'isCard' is true, it selects either a card icon or a bank icon. const iconMappings = { - [CONST.BANK_NAMES.EXPENSIFY]: isCard ? (require('@assets/images/cardicons/expensify-card-dark.svg') as IconAsset) : (require('@assets/images/bankicons/expensify.svg') as IconAsset), + [CONST.BANK_NAMES.EXPENSIFY]: isCard + ? (require('@assets/images/card-icons/expensify-card-dark.svg') as IconAsset) + : (require('@assets/images/bank-icons/expensify.svg') as IconAsset), [CONST.BANK_NAMES.AMERICAN_EXPRESS]: isCard - ? (require('@assets/images/cardicons/american-express.svg') as IconAsset) - : (require('@assets/images/bankicons/american-express.svg') as IconAsset), + ? (require('@assets/images/card-icons/american-express.svg') as IconAsset) + : (require('@assets/images/bank-icons/american-express.svg') as IconAsset), [CONST.BANK_NAMES.BANK_OF_AMERICA]: isCard - ? (require('@assets/images/cardicons/bank-of-america.svg') as IconAsset) - : (require('@assets/images/bankicons/bank-of-america.svg') as IconAsset), - [CONST.BANK_NAMES.BB_T]: isCard ? (require('@assets/images/cardicons/bb-t.svg') as IconAsset) : (require('@assets/images/bankicons/bb-t.svg') as IconAsset), - [CONST.BANK_NAMES.CAPITAL_ONE]: isCard ? (require('@assets/images/cardicons/capital-one.svg') as IconAsset) : (require('@assets/images/bankicons/capital-one.svg') as IconAsset), - [CONST.BANK_NAMES.CHASE]: isCard ? (require('@assets/images/cardicons/chase.svg') as IconAsset) : (require('@assets/images/bankicons/chase.svg') as IconAsset), + ? (require('@assets/images/card-icons/bank-of-america.svg') as IconAsset) + : (require('@assets/images/bank-icons/bank-of-america.svg') as IconAsset), + [CONST.BANK_NAMES.BB_T]: isCard ? (require('@assets/images/card-icons/bb-t.svg') as IconAsset) : (require('@assets/images/bank-icons/bb-t.svg') as IconAsset), + [CONST.BANK_NAMES.CAPITAL_ONE]: isCard ? (require('@assets/images/card-icons/capital-one.svg') as IconAsset) : (require('@assets/images/bank-icons/capital-one.svg') as IconAsset), + [CONST.BANK_NAMES.CHASE]: isCard ? (require('@assets/images/card-icons/chase.svg') as IconAsset) : (require('@assets/images/bank-icons/chase.svg') as IconAsset), [CONST.BANK_NAMES.CHARLES_SCHWAB]: isCard - ? (require('@assets/images/cardicons/charles-schwab.svg') as IconAsset) - : (require('@assets/images/bankicons/charles-schwab.svg') as IconAsset), - [CONST.BANK_NAMES.CITIBANK]: isCard ? (require('@assets/images/cardicons/citibank.svg') as IconAsset) : (require('@assets/images/bankicons/citibank.svg') as IconAsset), - [CONST.BANK_NAMES.CITIZENS_BANK]: isCard ? (require('@assets/images/cardicons/citizens.svg') as IconAsset) : (require('@assets/images/bankicons/citizens-bank.svg') as IconAsset), - [CONST.BANK_NAMES.DISCOVER]: isCard ? (require('@assets/images/cardicons/discover.svg') as IconAsset) : (require('@assets/images/bankicons/discover.svg') as IconAsset), - [CONST.BANK_NAMES.FIDELITY]: isCard ? (require('@assets/images/cardicons/fidelity.svg') as IconAsset) : (require('@assets/images/bankicons/fidelity.svg') as IconAsset), + ? (require('@assets/images/card-icons/charles-schwab.svg') as IconAsset) + : (require('@assets/images/bank-icons/charles-schwab.svg') as IconAsset), + [CONST.BANK_NAMES.CITIBANK]: isCard ? (require('@assets/images/card-icons/citibank.svg') as IconAsset) : (require('@assets/images/bank-icons/citibank.svg') as IconAsset), + [CONST.BANK_NAMES.CITIZENS_BANK]: isCard ? (require('@assets/images/card-icons/citizens.svg') as IconAsset) : (require('@assets/images/bank-icons/citizens-bank.svg') as IconAsset), + [CONST.BANK_NAMES.DISCOVER]: isCard ? (require('@assets/images/card-icons/discover.svg') as IconAsset) : (require('@assets/images/bank-icons/discover.svg') as IconAsset), + [CONST.BANK_NAMES.FIDELITY]: isCard ? (require('@assets/images/card-icons/fidelity.svg') as IconAsset) : (require('@assets/images/bank-icons/fidelity.svg') as IconAsset), [CONST.BANK_NAMES.GENERIC_BANK]: isCard - ? (require('@assets/images/cardicons/generic-bank-card.svg') as IconAsset) - : (require('@assets/images/bankicons/generic-bank-account.svg') as IconAsset), + ? (require('@assets/images/card-icons/generic-bank-card.svg') as IconAsset) + : (require('@assets/images/bank-icons/generic-bank-account.svg') as IconAsset), [CONST.BANK_NAMES.HUNTINGTON_BANK]: isCard - ? (require('@assets/images/cardicons/huntington-bank.svg') as IconAsset) - : (require('@assets/images/bankicons/huntington-bank.svg') as IconAsset), + ? (require('@assets/images/card-icons/huntington-bank.svg') as IconAsset) + : (require('@assets/images/bank-icons/huntington-bank.svg') as IconAsset), [CONST.BANK_NAMES.HUNTINGTON_NATIONAL]: isCard - ? (require('@assets/images/cardicons/huntington-bank.svg') as IconAsset) - : (require('@assets/images/bankicons/huntington-bank.svg') as IconAsset), + ? (require('@assets/images/card-icons/huntington-bank.svg') as IconAsset) + : (require('@assets/images/bank-icons/huntington-bank.svg') as IconAsset), [CONST.BANK_NAMES.NAVY_FEDERAL_CREDIT_UNION]: isCard - ? (require('@assets/images/cardicons/navy-federal-credit-union.svg') as IconAsset) - : (require('@assets/images/bankicons/navy-federal-credit-union.svg') as IconAsset), - [CONST.BANK_NAMES.PNC]: isCard ? (require('@assets/images/cardicons/pnc.svg') as IconAsset) : (require('@assets/images/bankicons/pnc.svg') as IconAsset), - [CONST.BANK_NAMES.REGIONS_BANK]: isCard ? (require('@assets/images/cardicons/regions-bank.svg') as IconAsset) : (require('@assets/images/bankicons/regions-bank.svg') as IconAsset), - [CONST.BANK_NAMES.SUNTRUST]: isCard ? (require('@assets/images/cardicons/suntrust.svg') as IconAsset) : (require('@assets/images/bankicons/suntrust.svg') as IconAsset), - [CONST.BANK_NAMES.TD_BANK]: isCard ? (require('@assets/images/cardicons/td-bank.svg') as IconAsset) : (require('@assets/images/bankicons/td-bank.svg') as IconAsset), - [CONST.BANK_NAMES.US_BANK]: isCard ? (require('@assets/images/cardicons/us-bank.svg') as IconAsset) : (require('@assets/images/bankicons/us-bank.svg') as IconAsset), - [CONST.BANK_NAMES.USAA]: isCard ? (require('@assets/images/cardicons/usaa.svg') as IconAsset) : (require('@assets/images/bankicons/usaa.svg') as IconAsset), + ? (require('@assets/images/card-icons/navy-federal-credit-union.svg') as IconAsset) + : (require('@assets/images/bank-icons/navy-federal-credit-union.svg') as IconAsset), + [CONST.BANK_NAMES.PNC]: isCard ? (require('@assets/images/card-icons/pnc.svg') as IconAsset) : (require('@assets/images/bank-icons/pnc.svg') as IconAsset), + [CONST.BANK_NAMES.REGIONS_BANK]: isCard ? (require('@assets/images/card-icons/regions-bank.svg') as IconAsset) : (require('@assets/images/bank-icons/regions-bank.svg') as IconAsset), + [CONST.BANK_NAMES.SUNTRUST]: isCard ? (require('@assets/images/card-icons/suntrust.svg') as IconAsset) : (require('@assets/images/bank-icons/suntrust.svg') as IconAsset), + [CONST.BANK_NAMES.TD_BANK]: isCard ? (require('@assets/images/card-icons/td-bank.svg') as IconAsset) : (require('@assets/images/bank-icons/td-bank.svg') as IconAsset), + [CONST.BANK_NAMES.US_BANK]: isCard ? (require('@assets/images/card-icons/us-bank.svg') as IconAsset) : (require('@assets/images/bank-icons/us-bank.svg') as IconAsset), + [CONST.BANK_NAMES.USAA]: isCard ? (require('@assets/images/card-icons/usaa.svg') as IconAsset) : (require('@assets/images/bank-icons/usaa.svg') as IconAsset), } as const; // Fallback to generic bank/card icon const iconModule = iconMappings[bankValue] || - (isCard ? (require('@assets/images/cardicons/generic-bank-card.svg') as IconAsset) : (require('@assets/images/bankicons/generic-bank-account.svg') as IconAsset)); + (isCard ? (require('@assets/images/card-icons/generic-bank-card.svg') as IconAsset) : (require('@assets/images/bank-icons/generic-bank-account.svg') as IconAsset)); return iconModule; } diff --git a/src/components/Icon/Expensicons.ts b/src/components/Icon/Expensicons.ts index 6c176519a0bb..c4498a1208bc 100644 --- a/src/components/Icon/Expensicons.ts +++ b/src/components/Icon/Expensicons.ts @@ -118,13 +118,13 @@ import ImageCropCircleMask from '@assets/images/image-crop-circle-mask.svg'; import ImageCropSquareMask from '@assets/images/image-crop-square-mask.svg'; import Inbox from '@assets/images/inbox.svg'; import Info from '@assets/images/info.svg'; -import NetSuiteSquare from '@assets/images/integrationicons/netsuite-icon-square.svg'; -import QBDSquare from '@assets/images/integrationicons/qbd-icon-square.svg'; -import QBOCircle from '@assets/images/integrationicons/qbo-icon-circle.svg'; -import QBOSquare from '@assets/images/integrationicons/qbo-icon-square.svg'; -import SageIntacctSquare from '@assets/images/integrationicons/sage-intacct-icon-square.svg'; -import XeroCircle from '@assets/images/integrationicons/xero-icon-circle.svg'; -import XeroSquare from '@assets/images/integrationicons/xero-icon-square.svg'; +import NetSuiteSquare from '@assets/images/integration-icons/netsuite-icon-square.svg'; +import QBDSquare from '@assets/images/integration-icons/qbd-icon-square.svg'; +import QBOCircle from '@assets/images/integration-icons/qbo-icon-circle.svg'; +import QBOSquare from '@assets/images/integration-icons/qbo-icon-square.svg'; +import SageIntacctSquare from '@assets/images/integration-icons/sage-intacct-icon-square.svg'; +import XeroCircle from '@assets/images/integration-icons/xero-icon-circle.svg'; +import XeroSquare from '@assets/images/integration-icons/xero-icon-square.svg'; import InvoiceGeneric from '@assets/images/invoice-generic.svg'; import Invoice from '@assets/images/invoice.svg'; import Key from '@assets/images/key.svg'; diff --git a/src/components/Icon/Illustrations.ts b/src/components/Icon/Illustrations.ts index c840d3e1cae2..7c9906bbc0ae 100644 --- a/src/components/Icon/Illustrations.ts +++ b/src/components/Icon/Illustrations.ts @@ -26,7 +26,7 @@ import CompanyCardsPendingState from '@assets/images/companyCards/pendingstate_l import VisaCompanyCards from '@assets/images/companyCards/visa.svg'; import EmptyCardState from '@assets/images/emptystate__expensifycard.svg'; import ExpensifyCardIllustration from '@assets/images/expensifyCard/cardIllustration.svg'; -import LaptopwithSecondScreenandHourglass from '@assets/images/LaptopwithSecondScreenandHourglass.svg'; +import LaptopWithSecondScreenAndHourglass from '@assets/images/LaptopWithSecondScreenAndHourglass.svg'; import Abracadabra from '@assets/images/product-illustrations/abracadabra.svg'; import BankArrowPink from '@assets/images/product-illustrations/bank-arrow--pink.svg'; import BankMouseGreen from '@assets/images/product-illustrations/bank-mouse--green.svg'; @@ -206,7 +206,7 @@ export { CreditCardsNew, CreditCardsNewGreen, InvoiceBlue, - LaptopwithSecondScreenandHourglass, + LaptopWithSecondScreenAndHourglass, LockOpen, Luggage, MoneyIntoWallet, diff --git a/src/components/ImportColumn.tsx b/src/components/ImportColumn.tsx index 0e1ae935a2b7..d54c7197c11b 100644 --- a/src/components/ImportColumn.tsx +++ b/src/components/ImportColumn.tsx @@ -11,6 +11,7 @@ import ButtonWithDropdownMenu from './ButtonWithDropdownMenu'; import type {DropdownOption} from './ButtonWithDropdownMenu/types'; import Text from './Text'; +// cspell:disable function findColumnName(header: string): string { let attribute = ''; const formattedHeader = Str.removeSpaces(String(header).toLowerCase().trim()); @@ -75,7 +76,7 @@ function findColumnName(header: string): string { case 'reporttotal': case 'reporttotalthreshold': case 'approvallimit': - attribute = CONST.CSV_IMPORT_COLUMNS.REPORT_THRESHHOLD; + attribute = CONST.CSV_IMPORT_COLUMNS.REPORT_THRESHOLD; break; case 'alternate': @@ -117,6 +118,7 @@ function findColumnName(header: string): string { return attribute; } +// cspell:enable type ColumnRole = { /** Translated text to be displayed */ diff --git a/src/components/ImportSpreadsheet.tsx b/src/components/ImportSpreadsheet.tsx index a6a27e2d5bcb..e7b1d107fe3d 100644 --- a/src/components/ImportSpreadsheet.tsx +++ b/src/components/ImportSpreadsheet.tsx @@ -7,8 +7,8 @@ import useLocalize from '@hooks/useLocalize'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useThemeStyles from '@hooks/useThemeStyles'; import {setSpreadsheetData} from '@libs/actions/ImportSpreadsheet'; -import * as DeviceCapabilities from '@libs/DeviceCapabilities'; -import * as FileUtils from '@libs/fileDownload/FileUtils'; +import {canUseTouchScreen as canUseTouchScreenUtils} from '@libs/DeviceCapabilities'; +import {splitExtensionFromFileName} from '@libs/fileDownload/FileUtils'; import Navigation from '@libs/Navigation/Navigation'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; @@ -25,7 +25,7 @@ import ImageSVG from './ImageSVG'; import ScreenWrapper from './ScreenWrapper'; import Text from './Text'; -type ImportSpreedsheetProps = { +type ImportSpreadsheetProps = { // The route to navigate to when the back button is pressed. backTo?: Routes; @@ -33,7 +33,7 @@ type ImportSpreedsheetProps = { goTo: Routes; }; -function ImportSpreadsheet({backTo, goTo}: ImportSpreedsheetProps) { +function ImportSpreadsheet({backTo, goTo}: ImportSpreadsheetProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); const [isReadingFile, setIsReadingFIle] = useState(false); @@ -60,7 +60,7 @@ function ImportSpreadsheet({backTo, goTo}: ImportSpreedsheetProps) { }; const validateFile = (file: FileObject) => { - const {fileExtension} = FileUtils.splitExtensionFromFileName(file?.name ?? ''); + const {fileExtension} = splitExtensionFromFileName(file?.name ?? ''); if (!CONST.ALLOWED_SPREADSHEET_EXTENSIONS.includes(fileExtension.toLowerCase() as TupleToUnion)) { setUploadFileError(true, 'attachmentPicker.wrongFileType', 'attachmentPicker.notAllowedExtension'); return false; @@ -163,7 +163,7 @@ function ImportSpreadsheet({backTo, goTo}: ImportSpreedsheetProps) { includeSafeAreaPaddingBottom={false} shouldEnableKeyboardAvoidingView={false} testID={ImportSpreadsheet.displayName} - shouldEnableMaxHeight={DeviceCapabilities.canUseTouchScreen()} + shouldEnableMaxHeight={canUseTouchScreenUtils()} headerGapStyles={isDraggingOver ? [styles.isDraggingOver] : []} > {({safeAreaPaddingBottomStyle}) => ( diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index ebadc9401ccf..c04b1896b938 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -259,7 +259,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio const onScroll = useCallback['onScroll']>>( (e) => { - // If the layout measurement is 0, it means the flashlist is not displayed but the onScroll may be triggered with offset value 0. + // If the layout measurement is 0, it means the FlashList is not displayed but the onScroll may be triggered with offset value 0. // We should ignore this case. if (e.nativeEvent.layoutMeasurement.height === 0) { return; diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index 48d0c72f0cf2..fc069a7d1029 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -62,7 +62,7 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [isFullscreenVisible] = useOnyx(ONYXKEYS.FULLSCREEN_VISIBILITY); const session = useSession(); - const shouldShowWokspaceChatTooltip = isPolicyExpenseChat(report) && !isThread(report) && activePolicyID === report?.policyID && session?.accountID === report?.ownerAccountID; + const shouldShowWorkspaceChatTooltip = isPolicyExpenseChat(report) && !isThread(report) && activePolicyID === report?.policyID && session?.accountID === report?.ownerAccountID; const isOnboardingGuideAssigned = introSelected?.choice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !session?.email?.includes('+'); const isChatUsedForOnboarding = isChatUsedForOnboardingReportUtils(report, introSelected?.choice); const shouldShowGetStartedTooltip = isOnboardingGuideAssigned ? isAdminRoom(report) && isChatUsedForOnboarding : isConciergeChatReport(report); @@ -70,15 +70,15 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti const isReportsSplitNavigatorLast = useRootNavigationState((state) => state?.routes?.at(-1)?.name === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR); const {tooltipToRender, shouldShowTooltip} = useMemo(() => { - // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room + // TODO: CONCIERGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 - const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; - const shouldShowTooltips = shouldShowWokspaceChatTooltip || shouldShowGetStartedTooltip; + const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCIERGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; + const shouldShowTooltips = shouldShowWorkspaceChatTooltip || shouldShowGetStartedTooltip; const shouldTooltipBeVisible = shouldUseNarrowLayout ? isScreenFocused && isReportsSplitNavigatorLast : isReportsSplitNavigatorLast && !isFullscreenVisible; // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing return {tooltipToRender: tooltip, shouldShowTooltip: shouldShowTooltips && shouldTooltipBeVisible}; - }, [shouldShowGetStartedTooltip, shouldShowWokspaceChatTooltip, isScreenFocused, shouldUseNarrowLayout, isReportsSplitNavigatorLast, isFullscreenVisible]); + }, [shouldShowGetStartedTooltip, shouldShowWorkspaceChatTooltip, isScreenFocused, shouldUseNarrowLayout, isReportsSplitNavigatorLast, isFullscreenVisible]); const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(tooltipToRender, shouldShowTooltip); @@ -103,8 +103,8 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti if (!optionItem && !isFocused) { // rendering null as a render item causes the FlashList to render all - // its children and consume signficant memory on the first render. We can avoid this by - // rendering a placeholder view instead. This behaviour is only observed when we + // its children and consume significant memory on the first render. We can avoid this by + // rendering a placeholder view instead. This behavior is only observed when we // first sign in to the App. // We can fix this by checking if the optionItem is null and the component is not focused. // Which means that the currentReportID is not the same as the reportID. The currentReportID @@ -195,11 +195,11 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti shouldRender={shouldShowProductTrainingTooltip} renderTooltipContent={renderProductTrainingTooltip} anchorAlignment={{ - horizontal: shouldShowWokspaceChatTooltip ? CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT : CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, + horizontal: shouldShowWorkspaceChatTooltip ? CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT : CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, }} - shiftHorizontal={shouldShowWokspaceChatTooltip ? variables.workspaceLHNTooltipShiftHorizontal : variables.gbrTooltipShiftHorizontal} - shiftVertical={shouldShowWokspaceChatTooltip ? 0 : variables.gbrTooltipShiftVertical} + shiftHorizontal={shouldShowWorkspaceChatTooltip ? variables.workspaceLHNTooltipShiftHorizontal : variables.gbrTooltipShiftHorizontal} + shiftVertical={shouldShowWorkspaceChatTooltip ? 0 : variables.gbrTooltipShiftVertical} wrapperStyle={styles.productTrainingTooltipWrapper} onTooltipPress={onOptionPress} shouldHideOnScroll diff --git a/src/components/Lightbox/numberOfConcurrentLightboxes/types.ts b/src/components/Lightbox/numberOfConcurrentLightboxes/types.ts index 57aaa53cca8c..32738c1f2285 100644 --- a/src/components/Lightbox/numberOfConcurrentLightboxes/types.ts +++ b/src/components/Lightbox/numberOfConcurrentLightboxes/types.ts @@ -1,5 +1,5 @@ // Increase/decrease this number to change the number of concurrent lightboxes -// The more concurrent lighboxes, the worse performance gets (especially on low-end devices) +// The more concurrent lightboxes, the worse performance gets (especially on low-end devices) type LightboxConcurrencyLimit = number | 'UNLIMITED'; export default LightboxConcurrencyLimit; diff --git a/src/components/LocationErrorMessage/index.tsx b/src/components/LocationErrorMessage/index.tsx index 193d38069d65..c78945fb72bc 100644 --- a/src/components/LocationErrorMessage/index.tsx +++ b/src/components/LocationErrorMessage/index.tsx @@ -6,7 +6,7 @@ import type LocationErrorMessageProps from './types'; /** Opens expensify help site in a new browser tab */ const navigateToExpensifyHelpSite = () => { - Linking.openURL(CONST.NEWHELP_URL); + Linking.openURL(CONST.NEW_HELP_URL); }; function LocationErrorMessage(props: LocationErrorMessageProps) { diff --git a/src/components/MapView/MapView.tsx b/src/components/MapView/MapView.tsx index 3e1a66524274..80d973d4d041 100644 --- a/src/components/MapView/MapView.tsx +++ b/src/components/MapView/MapView.tsx @@ -227,7 +227,7 @@ const MapView = forwardRef( const initCenterCoordinate = useMemo(() => (interactive ? centerCoordinate : undefined), [interactive, centerCoordinate]); const initBounds = useMemo(() => (interactive ? undefined : waypointsBounds), [interactive, waypointsBounds]); - const distanceSymbolCoorinate = useMemo(() => { + const distanceSymbolCoordinate = useMemo(() => { if (!directionCoordinates?.length || !waypoints?.length) { return; } @@ -310,9 +310,9 @@ const MapView = forwardRef( })} {!!directionCoordinates && } - {!!distanceSymbolCoorinate && !!distanceInMeters && !!distanceUnit && ( + {!!distanceSymbolCoordinate && !!distanceInMeters && !!distanceUnit && ( diff --git a/src/components/MapView/MapViewImpl.website.tsx b/src/components/MapView/MapViewImpl.website.tsx index 891732f9d13c..894310c4c81d 100644 --- a/src/components/MapView/MapViewImpl.website.tsx +++ b/src/components/MapView/MapViewImpl.website.tsx @@ -250,7 +250,7 @@ const MapViewImpl = forwardRef( }; }, [waypoints, directionCoordinates, interactive, currentPosition, initialState.zoom]); - const distanceSymbolCoorinate = useMemo(() => { + const distanceSymbolCoordinate = useMemo(() => { if (!directionCoordinates?.length || !waypoints?.length) { return; } @@ -288,11 +288,11 @@ const MapViewImpl = forwardRef( )} - {!!distanceSymbolCoorinate && !!distanceInMeters && !!distanceUnit && ( + {!!distanceSymbolCoordinate && !!distanceInMeters && !!distanceUnit && ( void; - // Whether the map is interactable or not + // Whether the map is interactive or not interactive?: boolean; // Distance displayed on the map in meters. diff --git a/src/components/MapView/utils.ts b/src/components/MapView/utils.ts index bd663af6f978..8a1a98298cb2 100644 --- a/src/components/MapView/utils.ts +++ b/src/components/MapView/utils.ts @@ -2,16 +2,16 @@ import type {LngLat} from 'react-map-gl'; import type {Coordinate} from './MapViewTypes'; function getBounds(waypoints: Coordinate[], directionCoordinates: undefined | Coordinate[]): {southWest: Coordinate; northEast: Coordinate} { - const lngs = waypoints.map((waypoint) => waypoint[0]); - const lats = waypoints.map((waypoint) => waypoint[1]); + const longitudes = waypoints.map((waypoint) => waypoint[0]); + const latitudes = waypoints.map((waypoint) => waypoint[1]); if (directionCoordinates) { - lngs.push(...directionCoordinates.map((coordinate) => coordinate[0])); - lats.push(...directionCoordinates.map((coordinate) => coordinate[1])); + longitudes.push(...directionCoordinates.map((coordinate) => coordinate[0])); + latitudes.push(...directionCoordinates.map((coordinate) => coordinate[1])); } return { - southWest: [Math.min(...lngs), Math.min(...lats)], - northEast: [Math.max(...lngs), Math.max(...lats)], + southWest: [Math.min(...longitudes), Math.min(...latitudes)], + northEast: [Math.max(...longitudes), Math.max(...latitudes)], }; } diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index 905fb7bda0d7..93506ab19cd7 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -373,7 +373,7 @@ type MenuItemBaseProps = { type MenuItemProps = (IconProps | AvatarProps | NoIcon) & MenuItemBaseProps; -const getSubscriptpAvatarBackgroundColor = (isHovered: boolean, isPressed: boolean, hoveredBackgroundColor: string, pressedBackgroundColor: string) => { +const getSubscriptAvatarBackgroundColor = (isHovered: boolean, isPressed: boolean, hoveredBackgroundColor: string, pressedBackgroundColor: string) => { if (isPressed) { return pressedBackgroundColor; } @@ -698,7 +698,7 @@ function MenuItem( )} {shouldShowAvatar && shouldShowSubscriptAvatar && ( { - if (isLoadingOnyxValue(tryNewDotdMetadata, dismissedProductTrainingMetadata)) { + if (isLoadingOnyxValue(tryNewDotMetadata, dismissedProductTrainingMetadata)) { return; } const {hasBeenAddedToNudgeMigration} = tryNewDot ?? {}; @@ -62,7 +62,7 @@ function OnboardingWelcomeVideo() { setIsModalDisabled(false); const defaultCannedQuery = buildCannedSearchQuery(); Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: defaultCannedQuery})); - }, [dismissedProductTraining?.migratedUserWelcomeModal, setIsModalDisabled, tryNewDotdMetadata, dismissedProductTrainingMetadata, tryNewDot]); + }, [dismissedProductTraining?.migratedUserWelcomeModal, setIsModalDisabled, tryNewDotMetadata, dismissedProductTrainingMetadata, tryNewDot]); /** * Extracts values from the non-scraped attribute WEB_PROP_ATTR at build time diff --git a/src/components/Modal/BaseModal.tsx b/src/components/Modal/BaseModal.tsx index d93bd11004f6..0408426a9314 100644 --- a/src/components/Modal/BaseModal.tsx +++ b/src/components/Modal/BaseModal.tsx @@ -248,7 +248,7 @@ function BaseModal( {}, type, onModalShow = ( type === CONST.MODAL.MODAL_TYPE.CENTERED || type === CONST.MODAL.MODAL_TYPE.CENTERED_UNSWIPEABLE || type === CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED || - type === CONST.MODAL.MODAL_TYPE.CENTERED_SWIPABLE_TO_RIGHT; + type === CONST.MODAL.MODAL_TYPE.CENTERED_SWIPEABLE_TO_RIGHT; if (statusBarColor) { setPreviousStatusBarColor(statusBarColor); diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index f61c56681851..41cd4ba00904 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -327,7 +327,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea const shouldShowStatusBar = hasAllPendingRTERViolations || shouldShowBrokenConnectionViolation || hasOnlyHeldExpenses || hasScanningReceipt || isPayAtEndExpense || hasOnlyPendingTransactions || hasDuplicates; - // When prevent self-approval is enabled & the current user is submitter AND they're submitting to theirself, we need to show the optimistic next step + // When prevent self-approval is enabled & the current user is submitter AND they're submitting to themselves, we need to show the optimistic next step // We should always show this optimistic message for policies with preventSelfApproval // to avoid any flicker during transitions between online/offline states const nextApproverAccountID = getNextApproverAccountID(moneyRequestReport); @@ -472,7 +472,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea (isDuplicate || shouldShowSettlementButton || !!shouldShowExportIntegrationButton || shouldShowSubmitButton || shouldShowMarkAsCashButton) && (!!statusBarProps || shouldShowNextStep); - // The submit button should be success green colour only if the user is the submitter and the policy does not have Scheduled Submit turned on + // The submit button should be success green color only if the user is the submitter and the policy does not have Scheduled Submit turned on const isWaitingForSubmissionFromCurrentUser = useMemo(() => isWaitingForSubmissionFromCurrentUserReportUtils(chatReport, policy), [chatReport, policy]); const shouldDuplicateButtonBeSuccess = useMemo( diff --git a/src/components/MoneyRequestAmountInput.tsx b/src/components/MoneyRequestAmountInput.tsx index 5cfe51f05c56..5761e8098f94 100644 --- a/src/components/MoneyRequestAmountInput.tsx +++ b/src/components/MoneyRequestAmountInput.tsx @@ -86,7 +86,7 @@ type MoneyRequestAmountInputProps = { shouldKeepUserInput?: boolean; /** - * Autogrow input container length based on the entered text. + * Auto-grow input container length based on the entered text. */ autoGrow?: boolean; @@ -252,7 +252,7 @@ function MoneyRequestAmountInput( const textInputKeyPress = ({nativeEvent}: NativeSyntheticEvent) => { const key = nativeEvent?.key.toLowerCase(); if (isMobileSafari() && key === CONST.PLATFORM_SPECIFIC_KEYS.CTRL.DEFAULT) { - // Optimistically anticipate forward-delete on iOS Safari (in cases where the Mac Accessiblity keyboard is being + // Optimistically anticipate forward-delete on iOS Safari (in cases where the Mac Accessibility keyboard is being // used for input). If the Control-D shortcut doesn't get sent, the ref will still be reset on the next key press. forwardDeletePressedRef.current = true; return; diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index de53f5cae4c1..0bea31287f8f 100755 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -302,7 +302,7 @@ function MoneyRequestConfirmationList({ const previousTransactionModifiedCurrency = usePrevious(transaction?.modifiedCurrency); const previousCustomUnitRateID = usePrevious(customUnitRateID); useEffect(() => { - // previousTransaction is in the condition because if it is falsey, it means this is the first time the useEffect is triggered after we load it, so we should calculate the default + // previousTransaction is in the condition because if it is falsy, it means this is the first time the useEffect is triggered after we load it, so we should calculate the default // tax even if the other parameters are the same against their previous values. if ( !shouldShowTax || @@ -790,7 +790,7 @@ function MoneyRequestConfirmationList({ return; } setMoneyRequestCategory(transactionID, enabledCategories.at(0)?.name ?? '', policy?.id); - // Keep 'transaction' out to ensure that we autoselect the option only once + // Keep 'transaction' out to ensure that we auto select the option only once // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [shouldShowCategories, policyCategories, isCategoryRequired, policy?.id]); @@ -815,7 +815,7 @@ function MoneyRequestConfirmationList({ if (updatedTagsString !== getTag(transaction) && updatedTagsString) { setMoneyRequestTag(transactionID, updatedTagsString); } - // Keep 'transaction' out to ensure that we autoselect the option only once + // Keep 'transaction' out to ensure that we auto select the option only once // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [transactionID, policyTagLists, policyTags]); diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx index 7c5825f598d6..d2caaabff36d 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx @@ -267,8 +267,8 @@ function MoneyRequestReportActionsList({report, reportActions = [], hasNewerActi return !isNewMessage || scrollingVerticalOffset.current >= CONST.REPORT.ACTIONS.ACTION_VISIBLE_THRESHOLD; }; - // If there are message that were recevied while offline, - // we can skip checking all messages later than the earliest recevied offline message. + // If there are message that were received while offline, + // we can skip checking all messages later than the earliest received offline message. const startIndex = earliestReceivedOfflineMessageIndex ?? 0; // Scan through each visible report action until we find the appropriate action to show the unread marker diff --git a/src/components/MultiGestureCanvas/index.tsx b/src/components/MultiGestureCanvas/index.tsx index 7e5c5d2365d8..3e9644202faf 100644 --- a/src/components/MultiGestureCanvas/index.tsx +++ b/src/components/MultiGestureCanvas/index.tsx @@ -19,7 +19,7 @@ import * as MultiGestureCanvasUtils from './utils'; type MultiGestureCanvasProps = ChildrenProps & { /** - * Wheter the canvas is currently active (in the screen) or not. + * Whether the canvas is currently active (in the screen) or not. * Disables certain gestures and functionality */ isActive?: boolean; diff --git a/src/components/MultiGestureCanvas/usePanGesture.ts b/src/components/MultiGestureCanvas/usePanGesture.ts index f2f33aa87e7e..a6d5040fe1f8 100644 --- a/src/components/MultiGestureCanvas/usePanGesture.ts +++ b/src/components/MultiGestureCanvas/usePanGesture.ts @@ -4,7 +4,7 @@ import {Dimensions} from 'react-native'; import type {PanGesture} from 'react-native-gesture-handler'; import {Gesture} from 'react-native-gesture-handler'; import {runOnJS, useDerivedValue, useSharedValue, withDecay, withSpring} from 'react-native-reanimated'; -import * as Browser from '@libs/Browser'; +import {isMobile} from '@libs/Browser'; import {SPRING_CONFIG} from './constants'; import type {MultiGestureCanvasVariables} from './types'; import * as MultiGestureCanvasUtils from './utils'; @@ -12,7 +12,7 @@ import * as MultiGestureCanvasUtils from './utils'; // This value determines how fast the pan animation should phase out // We're using a "withDecay" animation to smoothly phase out the pan animation // https://docs.swmansion.com/react-native-reanimated/docs/animations/withDecay/ -const PAN_DECAY_DECELARATION = 0.9915; +const PAN_DECAY_DECELERATION = 0.9915; const SCREEN_HEIGHT = Dimensions.get('screen').height; const SNAP_POINT = SCREEN_HEIGHT / 4; const SNAP_POINT_HIDDEN = SCREEN_HEIGHT / 1.2; @@ -59,7 +59,7 @@ const usePanGesture = ({ const panVelocityX = useSharedValue(0); const panVelocityY = useSharedValue(0); - const isMobileBrowser = Browser.isMobile(); + const isMobileBrowser = isMobile(); // Disable "swipe down to close" gesture when content is bigger than the canvas const enableSwipeDownToClose = useDerivedValue(() => canvasSize.height < zoomedContentHeight.get(), [canvasSize.height]); @@ -126,7 +126,7 @@ const usePanGesture = ({ withDecay({ velocity: panVelocityX.get(), clamp: [horizontalBoundaries.min, horizontalBoundaries.max], - deceleration: PAN_DECAY_DECELARATION, + deceleration: PAN_DECAY_DECELERATION, rubberBandEffect: false, }), ); @@ -144,7 +144,7 @@ const usePanGesture = ({ withDecay({ velocity: panVelocityY.get(), clamp: [verticalBoundaries.min, verticalBoundaries.max], - deceleration: PAN_DECAY_DECELARATION, + deceleration: PAN_DECAY_DECELERATION, }), ); } diff --git a/src/components/MultiGestureCanvas/usePinchGesture.ts b/src/components/MultiGestureCanvas/usePinchGesture.ts index 755f4dfc8603..384c274d490b 100644 --- a/src/components/MultiGestureCanvas/usePinchGesture.ts +++ b/src/components/MultiGestureCanvas/usePinchGesture.ts @@ -49,7 +49,7 @@ const usePinchGesture = ({ const pinchTranslateX = useSharedValue(0); const pinchTranslateY = useSharedValue(0); - // In order to keep track of the "bounce" effect when "overzooming"/"underzooming", + // In order to keep track of the "bounce" effect when "over-zooming"/"under-zooming", // we need to have extra "bounce" translation variables const pinchBounceTranslateX = useSharedValue(0); const pinchBounceTranslateY = useSharedValue(0); @@ -149,7 +149,7 @@ const usePinchGesture = ({ const newPinchTranslateY = adjustedFocal.y + currentPinchScale.get() * pinchOrigin.y.get() * -1; // If the zoom scale is within the zoom range, we perform the regular pinch translation - // Otherwise it means that we are "overzoomed" or "underzoomed", so we need to bounce back + // Otherwise it means that we are "over-zoomed" or "under-zoomed", so we need to bounce back if (zoomScale.get() >= zoomRange.min && zoomScale.get() <= zoomRange.max) { pinchTranslateX.set(newPinchTranslateX); pinchTranslateY.set(newPinchTranslateY); @@ -168,7 +168,7 @@ const usePinchGesture = ({ pinchTranslateY.set(0); currentPinchScale.set(1); - // If the content was "overzoomed" or "underzoomed", we need to bounce back with an animation + // If the content was "over-zoomed" or "under-zoomed", we need to bounce back with an animation if (pinchBounceTranslateX.get() !== 0 || pinchBounceTranslateY.get() !== 0) { pinchBounceTranslateX.set(withSpring(0, SPRING_CONFIG)); pinchBounceTranslateY.set(withSpring(0, SPRING_CONFIG)); diff --git a/src/components/MultipleAvatars.tsx b/src/components/MultipleAvatars.tsx index 158970d1e9f3..10e399e5c09e 100644 --- a/src/components/MultipleAvatars.tsx +++ b/src/components/MultipleAvatars.tsx @@ -37,7 +37,7 @@ type MultipleAvatarsProps = { /** Whether the avatars are hovered */ isHovered?: boolean; - /** Whether the avatars are actived */ + /** Whether the avatars are active */ isActive?: boolean; /** Whether the avatars are in an element being pressed */ diff --git a/src/components/OfflineWithFeedback.tsx b/src/components/OfflineWithFeedback.tsx index b536b5b43c6c..04a0c12cd9c1 100644 --- a/src/components/OfflineWithFeedback.tsx +++ b/src/components/OfflineWithFeedback.tsx @@ -107,7 +107,7 @@ function OfflineWithFeedback({ */ const applyStrikeThrough = useCallback( (childrenProp: React.ReactNode): React.ReactNode => { - const strikedThroughChildren = mapChildrenFlat(childrenProp, (child) => { + const strikeThroughChildren = mapChildrenFlat(childrenProp, (child) => { if (!React.isValidElement(child)) { return child; } @@ -125,7 +125,7 @@ function OfflineWithFeedback({ return React.cloneElement(child, props); }); - return strikedThroughChildren; + return strikeThroughChildren; }, [StyleUtils, styles], ); diff --git a/src/components/Onfido/index.css b/src/components/Onfido/index.css index 66fe571af9cc..b013311e1509 100644 --- a/src/components/Onfido/index.css +++ b/src/components/Onfido/index.css @@ -27,7 +27,7 @@ box-shadow: inset 0px 0px 0px 1px #5AB0FF !important; } -/* This is needed to dsiable the blue outline that shows up once the payment page is opened through keyboard */ +/* This is needed to disable the blue outline that shows up once the payment page is opened through keyboard */ #onfido-mount [tabindex="-1"]:focus-visible, #onfido-mount [tabindex="-1"]:focus[data-focusvisible-polyfill] { box-shadow: none !important; @@ -35,6 +35,7 @@ .onfido-sdk-ui-NavigationBar-iconBack { /* Onfido's back icon with our theme colors. */ + /* cspell:disable-next-line */ --back-icon-svg: url("data:image/svg+xml,%3Csvg width='32' height='32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle fill='none' cx='16' cy='16' r='16'/%3E%3Cpath d='M16.668 11.811L11.738 16l4.93 4.189a1.014 1.014 0 0 1 0 1.5 1.191 1.191 0 0 1-1.604 0l-5.736-4.873A1.01 1.01 0 0 1 9.003 16a1.01 1.01 0 0 1 .325-.816l5.736-4.873a1.191 1.191 0 0 1 1.604 0 1.014 1.014 0 0 1 0 1.5z' fill='%238B9C8F' fill-rule='nonzero'/%3E%3Crect fill='%238B9C8F' fill-rule='nonzero' x='9' y='15' width='16' height='2' rx='1'/%3E%3C/g%3E%3C/svg%3E"); background-image: var(--back-icon-svg) !important; } diff --git a/src/components/OptionRow.tsx b/src/components/OptionRow.tsx index 1b6519f4fd44..bb8018bd973f 100644 --- a/src/components/OptionRow.tsx +++ b/src/components/OptionRow.tsx @@ -6,8 +6,8 @@ import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as OptionsListUtils from '@libs/OptionsListUtils'; -import * as ReportUtils from '@libs/ReportUtils'; +import {shouldOptionShowTooltip} from '@libs/OptionsListUtils'; +import {getDisplayNamesWithTooltips} from '@libs/ReportUtils'; import type {OptionData} from '@libs/ReportUtils'; import CONST from '@src/CONST'; import Button from './Button'; @@ -39,13 +39,13 @@ type OptionRowProps = { /** Whether we should show the selected state */ showSelectedState?: boolean; - /** Whether to show a button pill instead of a tickbox */ + /** Whether to show a button pill instead of a check box */ shouldShowSelectedStateAsButton?: boolean; /** Text for button pill */ selectedStateButtonText?: string; - /** Callback to fire when the multiple selector (tickbox or button) is clicked */ + /** Callback to fire when the multiple selector (check box or button) is clicked */ onSelectedStatePressed?: (option: OptionData) => void; /** Whether we highlight selected option */ @@ -149,7 +149,7 @@ function OptionRow({ const firstIcon = option?.icons?.at(0); // We only create tooltips for the first 10 users or so since some reports have hundreds of users, causing performance to degrade. - const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips((option.participantsList ?? (option.accountID ? [option] : [])).slice(0, 10), shouldUseShortFormInTooltip); + const displayNamesWithTooltips = getDisplayNamesWithTooltips((option.participantsList ?? (option.accountID ? [option] : [])).slice(0, 10), shouldUseShortFormInTooltip); let subscriptColor = theme.appBG; if (optionIsFocused) { subscriptColor = focusedBackgroundColor; @@ -221,7 +221,7 @@ function OptionRow({ icons={option.icons} size={CONST.AVATAR_SIZE.DEFAULT} secondAvatarStyle={[StyleUtils.getBackgroundAndBorderStyle(hovered && !optionIsFocused ? hoveredBackgroundColor : subscriptColor)]} - shouldShowTooltip={showTitleTooltip && OptionsListUtils.shouldOptionShowTooltip(option)} + shouldShowTooltip={showTitleTooltip && shouldOptionShowTooltip(option)} /> ))} diff --git a/src/components/OptionsList/types.ts b/src/components/OptionsList/types.ts index c575a82332b6..cff7384db38c 100644 --- a/src/components/OptionsList/types.ts +++ b/src/components/OptionsList/types.ts @@ -1,4 +1,4 @@ -import type {RefObject} from 'react'; +import type {JSX, RefObject} from 'react'; import type {SectionList, SectionListData, StyleProp, View, ViewStyle} from 'react-native'; import type {OptionData} from '@libs/ReportUtils'; @@ -119,13 +119,13 @@ type OptionsListProps = { /** Custom content to display in the floating footer */ renderFooterContent?: JSX.Element; - /** Whether to show a button pill instead of a standard tickbox */ + /** Whether to show a button pill instead of a standard check box */ shouldShowMultipleOptionSelectorAsButton?: boolean; /** Text for button pill */ multipleOptionSelectorButtonText?: string; - /** Callback to fire when the multiple selector (tickbox or button) is clicked */ + /** Callback to fire when the multiple selector (check box or button) is clicked */ onAddToSelection?: () => void; /** Safe area style */ diff --git a/src/components/ParentNavigationSubtitle.tsx b/src/components/ParentNavigationSubtitle.tsx index 85f22912297f..0c5e3b2f27fc 100644 --- a/src/components/ParentNavigationSubtitle.tsx +++ b/src/components/ParentNavigationSubtitle.tsx @@ -22,7 +22,7 @@ type ParentNavigationSubtitleProps = { /** parent Report Action ID */ parentReportActionID?: string; - /** PressableWithoutFeedack additional styles */ + /** PressableWithoutFeedback additional styles */ pressableStyles?: StyleProp; }; diff --git a/src/components/PopoverWithMeasuredContent.tsx b/src/components/PopoverWithMeasuredContent.tsx index f7fdeab2d681..9f2a708f3d40 100644 --- a/src/components/PopoverWithMeasuredContent.tsx +++ b/src/components/PopoverWithMeasuredContent.tsx @@ -21,7 +21,7 @@ type PopoverWithMeasuredContentProps = Omit & { anchorDimensions?: AnchorDimensions; /** Whether we should change the vertical position if the popover's position is overflow */ - shoudSwitchPositionIfOverflow?: boolean; + shouldSwitchPositionIfOverflow?: boolean; /** Whether handle navigation back when modal show. */ shouldHandleNavigationBack?: boolean; @@ -58,7 +58,7 @@ function PopoverWithMeasuredContent({ height: 0, width: 0, }, - shoudSwitchPositionIfOverflow = false, + shouldSwitchPositionIfOverflow = false, shouldHandleNavigationBack = false, shouldEnableNewFocusManagement, shouldUseNewModal = false, @@ -133,7 +133,7 @@ function PopoverWithMeasuredContent({ popoverHeight, windowHeight, anchorDimensions.height, - shoudSwitchPositionIfOverflow, + shouldSwitchPositionIfOverflow, ); const shiftedAnchorPosition: PopoverAnchorPosition = { left: adjustedAnchorPosition.left + horizontalShift, diff --git a/src/components/PopoverWithoutOverlay/index.tsx b/src/components/PopoverWithoutOverlay/index.tsx index b4c65e221c38..d6b2808fc2d1 100644 --- a/src/components/PopoverWithoutOverlay/index.tsx +++ b/src/components/PopoverWithoutOverlay/index.tsx @@ -91,7 +91,7 @@ function PopoverWithoutOverlay( return ( e.stopPropagation()} diff --git a/src/components/Pressable/PressableWithFeedback.tsx b/src/components/Pressable/PressableWithFeedback.tsx index 9eeb0980d027..43996d845026 100644 --- a/src/components/Pressable/PressableWithFeedback.tsx +++ b/src/components/Pressable/PressableWithFeedback.tsx @@ -13,14 +13,14 @@ type PressableWithFeedbackProps = PressableProps & { wrapperStyle?: StyleProp>; /** - * Determines what opacity value should be applied to the underlaying view when Pressable is pressed. + * Determines what opacity value should be applied to the underlying view when Pressable is pressed. * To disable dimming, pass 1 as pressDimmingValue * @default variables.pressDimValue */ pressDimmingValue?: number; /** - * Determines what opacity value should be applied to the underlaying view when pressable is hovered. + * Determines what opacity value should be applied to the underlying view when pressable is hovered. * To disable dimming, pass 1 as hoverDimmingValue * @default variables.hoverDimValue */ diff --git a/src/components/ProductTrainingContext/TOOLTIPS.ts b/src/components/ProductTrainingContext/TOOLTIPS.ts index b0bed79b96e3..980191c5cd30 100644 --- a/src/components/ProductTrainingContext/TOOLTIPS.ts +++ b/src/components/ProductTrainingContext/TOOLTIPS.ts @@ -4,7 +4,7 @@ import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; const { - CONCEIRGE_LHN_GBR, + CONCIERGE_LHN_GBR, RENAME_SAVED_SEARCH, BOTTOM_NAV_INBOX_TOOLTIP, LHN_WORKSPACE_CHAT_TOOLTIP, @@ -30,15 +30,15 @@ type TooltipData = { }; const TOOLTIPS: Record = { - [CONCEIRGE_LHN_GBR]: { + [CONCIERGE_LHN_GBR]: { content: [ - {text: 'productTrainingTooltip.conciergeLHNGBR.part1', isBold: false}, - {text: 'productTrainingTooltip.conciergeLHNGBR.part2', isBold: true}, + {text: 'productTrainingTooltip.conciergeLHNGbr.part1', isBold: false}, + {text: 'productTrainingTooltip.conciergeLHNGbr.part2', isBold: true}, ], - onHideTooltip: () => dismissProductTraining(CONCEIRGE_LHN_GBR), - name: CONCEIRGE_LHN_GBR, + onHideTooltip: () => dismissProductTraining(CONCIERGE_LHN_GBR), + name: CONCIERGE_LHN_GBR, priority: 1300, - // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room + // TODO: CONCIERGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 shouldShow: () => false, }, diff --git a/src/components/ProductTrainingContext/index.tsx b/src/components/ProductTrainingContext/index.tsx index c877e1d45fbc..545f5c353897 100644 --- a/src/components/ProductTrainingContext/index.tsx +++ b/src/components/ProductTrainingContext/index.tsx @@ -45,7 +45,7 @@ const ProductTrainingContext = createContext({ function ProductTrainingContextProvider({children}: ChildrenProps) { const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {initialValue: true}); - const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRYNEWDOT); + const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT); const hasBeenAddedToNudgeMigration = !!tryNewDot?.nudgeMigration?.timestamp; const [isOnboardingCompleted = true, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { selector: hasCompletedGuidedSetupFlowSelector, diff --git a/src/components/ReportActionItem/ActionableItemButtons.tsx b/src/components/ReportActionItem/ActionableItemButtons.tsx index 6c79dc5206e1..e7db4dd67f0b 100644 --- a/src/components/ReportActionItem/ActionableItemButtons.tsx +++ b/src/components/ReportActionItem/ActionableItemButtons.tsx @@ -40,7 +40,7 @@ function ActionableItemButtons(props: ActionableItemButtonsProps) { ); } -ActionableItemButtons.displayName = 'ActionableItemButtton'; +ActionableItemButtons.displayName = 'ActionableItemButton'; export default ActionableItemButtons; export type {ActionableItem}; diff --git a/src/components/ReportActionItem/ExportWithDropdownMenu.tsx b/src/components/ReportActionItem/ExportWithDropdownMenu.tsx index b676c581da98..a7187b8cdcc2 100644 --- a/src/components/ReportActionItem/ExportWithDropdownMenu.tsx +++ b/src/components/ReportActionItem/ExportWithDropdownMenu.tsx @@ -83,7 +83,7 @@ function ExportWithDropdownMenu({ options.sort((method) => (method.value === exportMethod ? -1 : 0)); } return options; - // We do not include exportMethods not to re-render the component when the preffered export method changes + // We do not include exportMethods not to re-render the component when the preferred export method changes // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [canBeExported, iconToDisplay, connectionName, report?.policyID, translate]); diff --git a/src/components/ReportActionItem/MoneyReportView.tsx b/src/components/ReportActionItem/MoneyReportView.tsx index f4e3302eacf4..2e6ef0541713 100644 --- a/src/components/ReportActionItem/MoneyReportView.tsx +++ b/src/components/ReportActionItem/MoneyReportView.tsx @@ -80,7 +80,7 @@ function MoneyReportView({report, policy, isCombinedReport = false, shouldShowTo const subAmountTextStyles: StyleProp = [ styles.taskTitleMenuItem, styles.alignSelfCenter, - StyleUtils.getFontSizeStyle(variables.fontSizeh1), + StyleUtils.getFontSizeStyle(variables.fontSizeH1), StyleUtils.getColorStyle(theme.textSupporting), ]; diff --git a/src/components/ReportActionItem/MoneyRequestAction.tsx b/src/components/ReportActionItem/MoneyRequestAction.tsx index e6cdba15948c..675ce1a65cf3 100644 --- a/src/components/ReportActionItem/MoneyRequestAction.tsx +++ b/src/components/ReportActionItem/MoneyRequestAction.tsx @@ -39,7 +39,7 @@ type MoneyRequestActionProps = { /** The ID of the current report */ reportID: string | undefined; - /** Is this IOUACTION the most recent? */ + /** Is this IOU action the most recent? */ isMostRecentIOUReportAction: boolean; /** Popover context menu anchor, used for showing context menu */ diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx index e4af0aa1e82e..004defa86c54 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx @@ -198,7 +198,7 @@ function MoneyRequestReportPreviewContent({ const shouldShowSubmitButton = canSubmitReport(iouReport, policy, filteredTransactions, violations); const shouldDisableSubmitButton = shouldShowSubmitButton && !isAllowedToSubmitDraftExpenseReport(iouReport); - // The submit button should be success green colour only if the user is submitter and the policy does not have Scheduled Submit turned on + // The submit button should be success green color only if the user is submitter and the policy does not have Scheduled Submit turned on const isWaitingForSubmissionFromCurrentUser = useMemo(() => isWaitingForSubmissionFromCurrentUserReportUtils(chatReport, policy), [chatReport, policy]); const [isNoDelegateAccessMenuVisible, setIsNoDelegateAccessMenuVisible] = useState(false); @@ -355,7 +355,7 @@ function MoneyRequestReportPreviewContent({ return; } - checkMarkScale.set(isPaidAnimationRunning ? withDelay(CONST.ANIMATION_PAID_CHECKMARK_DELAY, withSpring(1, {duration: CONST.ANIMATION_PAID_DURATION})) : 1); + checkMarkScale.set(isPaidAnimationRunning ? withDelay(CONST.ANIMATION_PAID_CHECK_MARK_DELAY, withSpring(1, {duration: CONST.ANIMATION_PAID_DURATION})) : 1); }, [isPaidAnimationRunning, iouSettled, checkMarkScale]); useEffect(() => { @@ -363,7 +363,7 @@ function MoneyRequestReportPreviewContent({ return; } - thumbsUpScale.set(isApprovedAnimationRunning ? withDelay(CONST.ANIMATION_THUMBSUP_DELAY, withSpring(1, {duration: CONST.ANIMATION_THUMBSUP_DURATION})) : 1); + thumbsUpScale.set(isApprovedAnimationRunning ? withDelay(CONST.ANIMATION_THUMBS_UP_DELAY, withSpring(1, {duration: CONST.ANIMATION_THUMBS_UP_DURATION})) : 1); }, [isApproved, isApprovedAnimationRunning, thumbsUpScale]); const [currentIndex, setCurrentIndex] = useState(0); @@ -415,7 +415,7 @@ function MoneyRequestReportPreviewContent({ // The button should expand up to transaction width const buttonMaxWidth = !shouldUseNarrowLayout ? {maxWidth: reportPreviewStyles.transactionPreviewStyle.width} : {}; - const approvedOrSettledicon = (iouSettled || isApproved) && ( + const approvedOrSettledIcon = (iouSettled || isApproved) && ( {action.childReportName} - {!doesReportNameOverflow && <> {approvedOrSettledicon}} + {!doesReportNameOverflow && <> {approvedOrSettledIcon}} {doesReportNameOverflow && ( - {approvedOrSettledicon} + {approvedOrSettledIcon} )} diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 047f8f3717f9..5112e02dfd21 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -254,7 +254,7 @@ function ReportPreview({ const shouldShowSubmitButton = canSubmitReport(iouReport, policy, filteredTransactions, violations); const shouldDisableSubmitButton = shouldShowSubmitButton && !isAllowedToSubmitDraftExpenseReport(iouReport); - // The submit button should be success green colour only if the user is submitter and the policy does not have Scheduled Submit turned on + // The submit button should be success green color only if the user is submitter and the policy does not have Scheduled Submit turned on const isWaitingForSubmissionFromCurrentUser = useMemo(() => isWaitingForSubmissionFromCurrentUserReportUtils(chatReport, policy), [chatReport, policy]); const {isDelegateAccessRestricted} = useDelegateUserDetails(); @@ -490,7 +490,7 @@ function ReportPreview({ return; } - checkMarkScale.set(isPaidAnimationRunning ? withDelay(CONST.ANIMATION_PAID_CHECKMARK_DELAY, withSpring(1, {duration: CONST.ANIMATION_PAID_DURATION})) : 1); + checkMarkScale.set(isPaidAnimationRunning ? withDelay(CONST.ANIMATION_PAID_CHECK_MARK_DELAY, withSpring(1, {duration: CONST.ANIMATION_PAID_DURATION})) : 1); }, [isPaidAnimationRunning, iouSettled, checkMarkScale]); useEffect(() => { @@ -498,7 +498,7 @@ function ReportPreview({ return; } - thumbsUpScale.set(isApprovedAnimationRunning ? withDelay(CONST.ANIMATION_THUMBSUP_DELAY, withSpring(1, {duration: CONST.ANIMATION_THUMBSUP_DURATION})) : 1); + thumbsUpScale.set(isApprovedAnimationRunning ? withDelay(CONST.ANIMATION_THUMBS_UP_DELAY, withSpring(1, {duration: CONST.ANIMATION_THUMBS_UP_DURATION})) : 1); }, [isApproved, isApprovedAnimationRunning, thumbsUpScale]); const openReportFromPreview = useCallback(() => { diff --git a/src/components/RoomHeaderAvatars.tsx b/src/components/RoomHeaderAvatars.tsx index aaff5fc2e84b..3397894557b1 100644 --- a/src/components/RoomHeaderAvatars.tsx +++ b/src/components/RoomHeaderAvatars.tsx @@ -53,7 +53,7 @@ function RoomHeaderAvatars({icons, reportID}: RoomHeaderAvatarsProps) { , scrollOffset: number) => void; /** Get scroll offset value for given screen */ getScrollOffset: (route: PlatformStackRouteProp) => number | undefined; - /** Save scroll index of flashlist on given screen */ + /** Save scroll index of flash list on given screen */ saveScrollIndex: (route: PlatformStackRouteProp, scrollIndex: number) => void; /** Get scroll index value for given screen */ @@ -79,9 +79,9 @@ function ScrollOffsetContextProvider({children}: ScrollOffsetContextProviderProp const cleanStaleScrollOffsets: ScrollOffsetContextValue['cleanStaleScrollOffsets'] = useCallback((state) => { const sidebarRoutes = state.routes.filter((route) => isSidebarScreenName(route.name)); - const scrollOffsetkeysOfExistingScreens = sidebarRoutes.map((route) => getKey(route)); + const scrollOffsetKeysOfExistingScreens = sidebarRoutes.map((route) => getKey(route)); for (const key of Object.keys(scrollOffsetsRef.current)) { - if (!scrollOffsetkeysOfExistingScreens.includes(key)) { + if (!scrollOffsetKeysOfExistingScreens.includes(key)) { delete scrollOffsetsRef.current[key]; } } diff --git a/src/components/ScrollView.tsx b/src/components/ScrollView.tsx index e4b2c6703c30..660f43114ca6 100644 --- a/src/components/ScrollView.tsx +++ b/src/components/ScrollView.tsx @@ -34,7 +34,7 @@ function ScrollView( { - return OptionsListUtils.filterAndOrderOptions(defaultOptions, cleanSearchTerm, { + return filterAndOrderOptions(defaultOptions, cleanSearchTerm, { selectedOptions, excludeLogins: CONST.EXPENSIFY_EMAILS_OBJECT, maxRecentReportsToShow: CONST.IOU.MAX_RECENT_REPORTS_TO_SHOW, @@ -75,24 +75,17 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: }, [defaultOptions, cleanSearchTerm, selectedOptions]); const {sections, headerMessage} = useMemo(() => { - const newSections: OptionsListUtils.Section[] = []; + const newSections: Section[] = []; if (!areOptionsInitialized) { return {sections: [], headerMessage: undefined}; } - const formattedResults = OptionsListUtils.formatSectionsFromSearchTerm( - cleanSearchTerm, - selectedOptions, - chatOptions.recentReports, - chatOptions.personalDetails, - personalDetails, - true, - ); + const formattedResults = formatSectionsFromSearchTerm(cleanSearchTerm, selectedOptions, chatOptions.recentReports, chatOptions.personalDetails, personalDetails, true); const selectedCurrentUser = formattedResults.section.data.find((option) => option.accountID === chatOptions.currentUserOption?.accountID); if (chatOptions.currentUserOption) { - const formattedName = ReportUtils.getDisplayNameForParticipant({ + const formattedName = getDisplayNameForParticipant({ accountID: chatOptions.currentUserOption.accountID, shouldAddCurrentUserPostfix: true, personalDetailsData: personalDetails, @@ -152,7 +145,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: }, [initialAccountIDs, personalDetails]); useEffect(() => { - Report.searchInServer(debouncedSearchTerm.trim()); + searchInServer(debouncedSearchTerm.trim()); }, [debouncedSearchTerm]); const handleParticipantSelection = useCallback( @@ -207,7 +200,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: textInputValue={searchTerm} footerContent={footerContent} showScrollIndicator - shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()} + shouldPreventDefaultFocusOnSelectRow={!canUseTouchScreenUtil()} onChangeText={(value) => { setSearchTerm(value); }} diff --git a/src/components/Search/SearchList.tsx b/src/components/Search/SearchList.tsx index 3808c13253f7..ba59a022206a 100644 --- a/src/components/Search/SearchList.tsx +++ b/src/components/Search/SearchList.tsx @@ -60,7 +60,7 @@ type SearchListProps = Pick, 'onScroll' /** Styles to apply to SelectionList container */ containerStyle?: StyleProp; - /** Whether to prevent default focusing of options and focus the textinput when selecting an option */ + /** Whether to prevent default focusing of options and focus the text input when selecting an option */ shouldPreventDefaultFocusOnSelectRow?: boolean; /** Whether to prevent long press of options */ diff --git a/src/components/Search/SearchRouter/SearchRouterModal.tsx b/src/components/Search/SearchRouter/SearchRouterModal.tsx index 29b0da9155bb..b0792664c965 100644 --- a/src/components/Search/SearchRouter/SearchRouterModal.tsx +++ b/src/components/Search/SearchRouter/SearchRouterModal.tsx @@ -25,7 +25,7 @@ function SearchRouterModal() { // On mWeb Safari, the input caret stuck for a moment while the modal is animating. So, we hide the caret until the animation is done. const [shouldHideInputCaret, setShouldHideInputCaret] = useState(isMobileWebSafari); - const modalType = shouldUseNarrowLayout ? CONST.MODAL.MODAL_TYPE.CENTERED_SWIPABLE_TO_RIGHT : CONST.MODAL.MODAL_TYPE.POPOVER; + const modalType = shouldUseNarrowLayout ? CONST.MODAL.MODAL_TYPE.CENTERED_SWIPEABLE_TO_RIGHT : CONST.MODAL.MODAL_TYPE.POPOVER; return ( { - const isFromSelfDM = item.reportID === CONST.REPORT.UNREPORTED_REPORTID; + const isFromSelfDM = item.reportID === CONST.REPORT.UNREPORTED_REPORT_ID; const isTransactionItem = isTransactionListItemType(item); let reportID = isTransactionItem && (!item.isFromOneTransactionReport || isFromSelfDM) ? item.transactionThreadReportID : item.reportID; @@ -397,7 +397,7 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts index 5c8f089c330d..75c1a7faa680 100644 --- a/src/components/Search/types.ts +++ b/src/components/Search/types.ts @@ -33,7 +33,7 @@ type SelectedTransactionInfo = { amount: number; }; -/** Model of selected transactons */ +/** Model of selected transactions */ type SelectedTransactions = Record; /** Model of selected reports */ diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 6d0f224b5e80..542aad69c96a 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -180,7 +180,7 @@ function BaseSelectionList( * Iterates through the sections and items inside each section, and builds 4 arrays along the way: * - `allOptions`: Contains all the items in the list, flattened, regardless of section * - `disabledOptionsIndexes`: Contains the indexes of all the unselectable and disabled items in the list - * - `disabledArrowKeyOptionsIndexes`: Contains the indexes of item that is not navigatable by the arrow key. The list is separated from disabledOptionsIndexes because unselectable item is still navigatable by the arrow key. + * - `disabledArrowKeyOptionsIndexes`: Contains the indexes of item that is not navigable by the arrow key. The list is separated from disabledOptionsIndexes because unselectable item is still navigable by the arrow key. * - `itemLayouts`: Contains the layout information for each item, header and footer in the list, * so we can calculate the position of any given item when scrolling programmatically */ @@ -281,7 +281,7 @@ function BaseSelectionList( ) : null; return [processedSections, showMoreButton]; // we don't need to add styles here as they change - // we don't need to add flattendedSections here as they will change along with sections + // we don't need to add flattenedSections here as they will change along with sections // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [sections, currentPage]); @@ -732,7 +732,7 @@ function BaseSelectionList( ? -1 : 0; - // reseting the currrent page to 1 when the user types something + // resetting the current page to 1 when the user types something setCurrentPage(1); updateAndScrollToFocusedIndex(newSelectedIndex); @@ -793,7 +793,7 @@ function BaseSelectionList( ); /** - * Handles isTextInputFocusedRef value when using external TextInput, so external TextInput is not defocused when typing in it. + * Handles isTextInputFocusedRef value when using external TextInput, so external TextInput is not unfocused when typing in it. * * @param isTextInputFocused - Is external TextInput focused. */ diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts index 7e80c5ebebe5..9e0592ba18da 100644 --- a/src/components/SelectionList/types.ts +++ b/src/components/SelectionList/types.ts @@ -311,7 +311,7 @@ type ListItemProps = CommonListItemProps & { /** Styles applied for the title */ titleStyles?: StyleProp; - /** Styles applid for the title container of the list item */ + /** Styles applied for the title container of the list item */ titleContainerStyles?: StyleProp; }; @@ -525,7 +525,7 @@ type SelectionListProps = Partial & { /** Whether to call preventDefault() on pressing enter key or not */ shouldPreventDefault?: boolean; - /** Whether to prevent default focusing of options and focus the textinput when selecting an option */ + /** Whether to prevent default focusing of options and focus the TextInput when selecting an option */ shouldPreventDefaultFocusOnSelectRow?: boolean; /** Whether to subscribe to KeyboardShortcut arrow keys events */ @@ -597,10 +597,10 @@ type SelectionListProps = Partial & { /** Styles for the section title */ sectionTitleStyles?: StyleProp; - /** Styles applid for the title of the list item */ + /** Styles applied for the title of the list item */ listItemTitleStyles?: StyleProp; - /** Styles applid for the title container of the list item */ + /** Styles applied for the title container of the list item */ listItemTitleContainerStyles?: StyleProp; /** This may improve scroll performance for large lists */ diff --git a/src/components/SettlementButton/AnimatedSettlementButton.tsx b/src/components/SettlementButton/AnimatedSettlementButton.tsx index 388297075082..e8649587ed92 100644 --- a/src/components/SettlementButton/AnimatedSettlementButton.tsx +++ b/src/components/SettlementButton/AnimatedSettlementButton.tsx @@ -31,7 +31,7 @@ function AnimatedSettlementButton({ const {translate} = useLocalize(); const isAnimationRunning = isPaidAnimationRunning || isApprovedAnimationRunning; - const buttonDuration = isPaidAnimationRunning ? CONST.ANIMATION_PAID_DURATION : CONST.ANIMATION_THUMBSUP_DURATION; + const buttonDuration = isPaidAnimationRunning ? CONST.ANIMATION_PAID_DURATION : CONST.ANIMATION_THUMBS_UP_DURATION; const buttonDelay = CONST.ANIMATION_PAID_BUTTON_HIDE_DELAY; const gap = styles.expenseAndReportPreviewTextButtonContainer.gap; const buttonMarginTop = useSharedValue(gap); diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx index 1b8a70164a6c..88d8b20e0e9e 100644 --- a/src/components/SettlementButton/index.tsx +++ b/src/components/SettlementButton/index.tsx @@ -103,7 +103,7 @@ function SettlementButton({ }, [isLoadingLastPaymentMethod]); const isInvoiceReport = (!isEmptyObject(iouReport) && isInvoiceReportUtil(iouReport)) || false; - const shouldShowPaywithExpensifyOption = !shouldHidePaymentOptions; + const shouldShowPayWithExpensifyOption = !shouldHidePaymentOptions; const shouldShowPayElsewhereOption = !shouldHidePaymentOptions && !isInvoiceReport; const paymentButtonOptions = useMemo(() => { const buttonOptions = []; @@ -146,7 +146,7 @@ function SettlementButton({ if (canUseWallet) { buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.EXPENSIFY]); } - if (isExpenseReport && shouldShowPaywithExpensifyOption) { + if (isExpenseReport && shouldShowPayWithExpensifyOption) { buttonOptions.push(paymentMethods[CONST.IOU.PAYMENT_TYPE.VBBA]); } if (shouldShowPayElsewhereOption) { @@ -231,7 +231,7 @@ function SettlementButton({ currency, shouldHidePaymentOptions, shouldShowApproveButton, - shouldShowPaywithExpensifyOption, + shouldShowPayWithExpensifyOption, shouldShowPayElsewhereOption, chatReport, onPress, diff --git a/src/components/TestToolMenu.tsx b/src/components/TestToolMenu.tsx index 8d8c3bc4dc89..9d690e774608 100644 --- a/src/components/TestToolMenu.tsx +++ b/src/components/TestToolMenu.tsx @@ -119,7 +119,7 @@ function TestToolMenu() { {/* When toggled all network requests will fail. */} - + 0) { hasValueRef.current = true; - // When the componment is uncontrolled, we need to manually activate the label: + // When the component is uncontrolled, we need to manually activate the label: if (value === undefined) { activateLabel(); } @@ -283,7 +283,7 @@ function BaseTextInput( tabIndex={-1} accessibilityLabel={label} // When autoGrowHeight is true we calculate the width for the textInput, so it will break lines properly - // or if multiline is not supplied we calculate the textinput height, using onLayout. + // or if multiline is not supplied we calculate the textInput height, using onLayout. onLayout={onLayout} style={[ autoGrowHeight && diff --git a/src/components/TextInput/BaseTextInput/types.ts b/src/components/TextInput/BaseTextInput/types.ts index 75b12c4593be..237bdf4a0a24 100644 --- a/src/components/TextInput/BaseTextInput/types.ts +++ b/src/components/TextInput/BaseTextInput/types.ts @@ -52,7 +52,7 @@ type CustomBaseTextInputProps = { disableKeyboard?: boolean; /** - * Autogrow input container length based on the entered text. + * Auto-grow input container length based on the entered text. */ autoGrow?: boolean; @@ -60,7 +60,7 @@ type CustomBaseTextInputProps = { autoGrowExtraSpace?: number; /** - * Autogrow input container height based on the entered text + * Auto-grow input container height based on the entered text */ autoGrowHeight?: boolean; diff --git a/src/components/TimePicker/TimePicker.tsx b/src/components/TimePicker/TimePicker.tsx index bbca14bc176b..0e330d2cfc33 100644 --- a/src/components/TimePicker/TimePicker.tsx +++ b/src/components/TimePicker/TimePicker.tsx @@ -20,7 +20,7 @@ import {canUseTouchScreen as canUseTouchScreenDeviceCapabilities} from '@libs/De import CONST from '@src/CONST'; import setCursorPosition from './setCursorPosition'; -type TimePickerRefName = 'hourRef' | 'minuteRef' | 'secondRef' | 'milisecondRef'; +type TimePickerRefName = 'hourRef' | 'minuteRef' | 'secondRef' | 'millisecondRef'; type TimePickerRef = Record; @@ -137,7 +137,7 @@ function TimePicker( const [selectionHour, setSelectionHour] = useState({start: 0, end: 0}); const [selectionMinute, setSelectionMinute] = useState(showFullFormat ? {start: 0, end: 0} : {start: 2, end: 2}); // we focus it by default so need to have selection on the end const [selectionSecond, setSelectionSecond] = useState({start: 0, end: 0}); - const [selectionMilisecond, setSelectionMilisecond] = useState(showFullFormat ? {start: 6, end: 6} : {start: 0, end: 0}); + const [selectionMillisecond, setSelectionMillisecond] = useState(showFullFormat ? {start: 6, end: 6} : {start: 0, end: 0}); const [hours, setHours] = useState(() => DateUtils.get12HourTimeObjectFromDate(value, showFullFormat).hour); const [minutes, setMinutes] = useState(() => DateUtils.get12HourTimeObjectFromDate(value, showFullFormat).minute); const [seconds, setSeconds] = useState(() => DateUtils.get12HourTimeObjectFromDate(value, showFullFormat).seconds); @@ -148,11 +148,11 @@ function TimePicker( const hourInputRef = useRef(null); const minuteInputRef = useRef(null); const secondInputRef = useRef(null); - const milisecondInputRef = useRef(null); + const millisecondInputRef = useRef(null); const {inputCallbackRef} = useAutoFocusInput(); - const focusMilisecondInputOnFirstCharacter = useCallback(() => setCursorPosition(0, milisecondInputRef, setSelectionMilisecond), []); + const focusMillisecondInputOnFirstCharacter = useCallback(() => setCursorPosition(0, millisecondInputRef, setSelectionMillisecond), []); const focusSecondInputOnLastCharacter = useCallback(() => setCursorPosition(2, secondInputRef, setSelectionSecond), []); const focusSecondInputOnFirstCharacter = useCallback(() => setCursorPosition(0, secondInputRef, setSelectionSecond), []); const focusMinuteInputOnLastCharacter = useCallback(() => setCursorPosition(2, minuteInputRef, setSelectionMinute), []); @@ -200,7 +200,7 @@ function TimePicker( const resetMilliseconds = () => { setMinutes('000'); - setSelectionMilisecond({start: 0, end: 0}); + setSelectionMillisecond({start: 0, end: 0}); }; // This function receive value from hour input and validate it @@ -444,7 +444,7 @@ function TimePicker( setSeconds(newSecond); setSelectionSecond({start: newSelection, end: newSelection}); if (newSelection === 2) { - focusMilisecondInputOnFirstCharacter(); + focusMillisecondInputOnFirstCharacter(); } }; @@ -465,69 +465,69 @@ function TimePicker( return; } - let newMilisecond; + let newMillisecond; let newSelection; - if (selectionMilisecond.start === 0 && selectionMilisecond.end === 0) { + if (selectionMillisecond.start === 0 && selectionMillisecond.end === 0) { // The cursor is at the start of milliseconds const firstDigit = trimmedText[0]; const secondDigit = trimmedText[2] || '0'; const thirdDigit = trimmedText[3] || '0'; - newMilisecond = `${firstDigit}${secondDigit}${thirdDigit}`; + newMillisecond = `${firstDigit}${secondDigit}${thirdDigit}`; newSelection = 1; - } else if (selectionMilisecond.start === 1 && selectionMilisecond.end === 1) { + } else if (selectionMillisecond.start === 1 && selectionMillisecond.end === 1) { // The cursor is in-between the digits if (lastPressedKey.current === 'Backspace') { // We have removed the first digit. Replace it with 0 and move the cursor to the start. const secondDigit = trimmedText[0]; const thirdDigit = trimmedText[1] || '0'; - newMilisecond = `0${secondDigit}${thirdDigit}`; + newMillisecond = `0${secondDigit}${thirdDigit}`; newSelection = 0; } else { const firstDigit = trimmedText[0]; const secondDigit = trimmedText[1] || '0'; const thirdDigit = trimmedText[3] || '0'; - newMilisecond = `${firstDigit}${secondDigit}${thirdDigit}`; + newMillisecond = `${firstDigit}${secondDigit}${thirdDigit}`; newSelection = 2; } - } else if (selectionMilisecond.start === 2 && selectionMilisecond.end === 2) { + } else if (selectionMillisecond.start === 2 && selectionMillisecond.end === 2) { // The cursor is in-between the digits if (lastPressedKey.current === 'Backspace') { // We have removed the second digit. Replace it with 0 and move the cursor back. const firstDigit = trimmedText[0]; const thirdDigit = trimmedText[1] || '0'; - newMilisecond = `${firstDigit}0${thirdDigit}`; + newMillisecond = `${firstDigit}0${thirdDigit}`; newSelection = 1; } else { const firstDigit = trimmedText[0]; const secondDigit = trimmedText[1] || '0'; const thirdDigit = trimmedText[2] || '0'; - newMilisecond = `${firstDigit}${secondDigit}${thirdDigit}`; + newMillisecond = `${firstDigit}${secondDigit}${thirdDigit}`; newSelection = 3; } - } else if (selectionMilisecond.start === 0 && selectionMilisecond.end === 1) { + } else if (selectionMillisecond.start === 0 && selectionMillisecond.end === 1) { // There is an active selection of the first digit - newMilisecond = trimmedText.substring(0, 3).padStart(3, '0'); + newMillisecond = trimmedText.substring(0, 3).padStart(3, '0'); newSelection = trimmedText.length === 1 ? 0 : 1; - } else if (selectionMilisecond.start === 1 && selectionMilisecond.end === 2) { + } else if (selectionMillisecond.start === 1 && selectionMillisecond.end === 2) { // There is an active selection of the second digit - newMilisecond = trimmedText.substring(0, 3).padStart(3, '0'); + newMillisecond = trimmedText.substring(0, 3).padStart(3, '0'); newSelection = trimmedText.length === 1 ? 1 : 2; - } else if (selectionMilisecond.start === 2 && selectionMilisecond.end === 3) { + } else if (selectionMillisecond.start === 2 && selectionMillisecond.end === 3) { // There is an active selection of the third digit - newMilisecond = trimmedText.substring(0, 3).padEnd(3, '0'); + newMillisecond = trimmedText.substring(0, 3).padEnd(3, '0'); newSelection = trimmedText.length === 2 ? 2 : 3; } else { - newMilisecond = trimmedText.substring(0, 3).padEnd(3, '0'); + newMillisecond = trimmedText.substring(0, 3).padEnd(3, '0'); newSelection = trimmedText.length; } - if (Number(newMilisecond) > 999) { - newMilisecond = milliseconds; + if (Number(newMillisecond) > 999) { + newMillisecond = milliseconds; } - setMilliseconds(newMilisecond); - setSelectionMilisecond({start: newSelection, end: newSelection}); + setMilliseconds(newMillisecond); + setSelectionMillisecond({start: newSelection, end: newSelection}); }; /** @@ -539,9 +539,9 @@ function TimePicker( const isHourFocused = hourInputRef.current?.isFocused(); const isMinuteFocused = minuteInputRef.current?.isFocused(); const isSecondFocused = secondInputRef.current?.isFocused(); - const isMilisecondFocused = milisecondInputRef.current?.isFocused(); - if (showFullFormat && !isHourFocused && !isMinuteFocused && !isSecondFocused && !isMilisecondFocused) { - milisecondInputRef.current?.focus(); + const isMillisecondFocused = millisecondInputRef.current?.isFocused(); + if (showFullFormat && !isHourFocused && !isMinuteFocused && !isSecondFocused && !isMillisecondFocused) { + millisecondInputRef.current?.focus(); } else if (!showFullFormat && !isHourFocused && !isMinuteFocused) { minuteInputRef.current?.focus(); } @@ -566,13 +566,13 @@ function TimePicker( } clearSelectedValue(seconds, selectionSecond, setSeconds, setSelectionSecond); - } else if (isMilisecondFocused) { - if (selectionMilisecond.start === 0 && selectionMilisecond.end === 0) { + } else if (isMillisecondFocused) { + if (selectionMillisecond.start === 0 && selectionMillisecond.end === 0) { focusSecondInputOnLastCharacter(); return; } - clearSelectedValue(milliseconds, selectionMilisecond, setMilliseconds, setSelectionMilisecond, 3); + clearSelectedValue(milliseconds, selectionMillisecond, setMilliseconds, setSelectionMillisecond, 3); } return; } @@ -584,12 +584,12 @@ function TimePicker( handleMinutesChange(insertAtPosition(minutes, trimmedKey, selectionMinute.start, selectionMinute.end)); } else if (isSecondFocused) { handleSecondsChange(insertAtPosition(seconds, trimmedKey, selectionSecond.start, selectionSecond.end)); - } else if (isMilisecondFocused) { - handleMillisecondsChange(insertAtPosition(milliseconds, trimmedKey, selectionMilisecond.start, selectionMilisecond.end)); + } else if (isMillisecondFocused) { + handleMillisecondsChange(insertAtPosition(milliseconds, trimmedKey, selectionMillisecond.start, selectionMillisecond.end)); } }, // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - [minutes, hours, seconds, milliseconds, selectionMinute, selectionHour, selectionSecond, selectionMilisecond], + [minutes, hours, seconds, milliseconds, selectionMinute, selectionHour, selectionSecond, selectionMillisecond], ); useEffect(() => { @@ -617,7 +617,7 @@ function TimePicker( e?.preventDefault(); focusMinuteInputOnLastCharacter(); } - if (milisecondInputRef.current?.isFocused() && selectionMilisecond.start === 0) { + if (millisecondInputRef.current?.isFocused() && selectionMillisecond.start === 0) { // Check e to be truthy to avoid crashing on Android (e is undefined there) e?.preventDefault(); focusSecondInputOnLastCharacter(); @@ -641,11 +641,11 @@ function TimePicker( if (secondInputRef.current?.isFocused() && selectionSecond.start === 2) { // Check e to be truthy to avoid crashing on Android (e is undefined there) e?.preventDefault(); - focusMilisecondInputOnFirstCharacter(); + focusMillisecondInputOnFirstCharacter(); } }, // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - [selectionHour, selectionMinute, selectionSecond, selectionMilisecond], + [selectionHour, selectionMinute, selectionSecond, selectionMillisecond], ); useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ARROW_LEFT, arrowLeftCallback, arrowConfig); @@ -664,7 +664,7 @@ function TimePicker( e.preventDefault(); focusMinuteInputOnLastCharacter(); } - if (milisecondInputRef.current?.isFocused() && selectionMilisecond.start === 0 && selectionMilisecond.end === 0) { + if (millisecondInputRef.current?.isFocused() && selectionMillisecond.start === 0 && selectionMillisecond.end === 0) { e.preventDefault(); focusSecondInputOnLastCharacter(); } @@ -675,8 +675,8 @@ function TimePicker( selectionMinute.end, selectionSecond.start, selectionSecond.end, - selectionMilisecond.start, - selectionMilisecond.end, + selectionMillisecond.start, + selectionMillisecond.end, focusHourInputOnLastCharacter, focusMinuteInputOnLastCharacter, focusSecondInputOnLastCharacter, @@ -717,7 +717,7 @@ function TimePicker( hourRef: hourInputRef.current, minuteRef: minuteInputRef.current, secondRef: secondInputRef.current, - milisecondRef: milisecondInputRef.current, + millisecondRef: millisecondInputRef.current, [refName]: updatedRef, }; if (typeof ref === 'function') { @@ -812,19 +812,19 @@ function TimePicker( }} onChangeAmount={handleMillisecondsChange} ref={(textInputRef) => { - updateRefs('milisecondRef', textInputRef); - milisecondInputRef.current = textInputRef as TextInput | null; + updateRefs('millisecondRef', textInputRef); + millisecondInputRef.current = textInputRef as TextInput | null; if (showFullFormat) { inputCallbackRef(textInputRef as TextInput | null); } }} onSelectionChange={(e) => { - setSelectionMilisecond(e.nativeEvent.selection); + setSelectionMillisecond(e.nativeEvent.selection); }} style={[styles.iouAmountTextInput, styles.timePickerInput, showFullFormat && [styles.textXXLarge, styles.mnw0]]} containerStyle={[styles.iouAmountTextInputContainer]} touchableInputWrapperStyle={!showFullFormat && styles.timePickerHeight100} - selection={selectionMilisecond} + selection={selectionMillisecond} /> )} diff --git a/src/components/Tooltip/TooltipSense.tsx b/src/components/Tooltip/TooltipSense.tsx index bc16df3f8c7e..7e1be896a1d7 100644 --- a/src/components/Tooltip/TooltipSense.tsx +++ b/src/components/Tooltip/TooltipSense.tsx @@ -4,7 +4,7 @@ import CONST from '@src/CONST'; let active = false; /** - * Debounced function to deactive the TooltipSense after a specific time + * Debounced function to deactivate the TooltipSense after a specific time */ const debouncedDeactivate = lodashDebounce(() => { active = false; diff --git a/src/components/Tooltip/types.ts b/src/components/Tooltip/types.ts index 69c49906d94b..ec08c815eb92 100644 --- a/src/components/Tooltip/types.ts +++ b/src/components/Tooltip/types.ts @@ -5,7 +5,7 @@ import type {TooltipAnchorAlignment} from '@src/types/utils/AnchorAlignment'; import type ChildrenProps from '@src/types/utils/ChildrenProps'; type SharedTooltipProps = { - /** The text to display in the tooltip. If text is ommitted, only children will be rendered. */ + /** The text to display in the tooltip. If text is omitted, only children will be rendered. */ text?: string; /** Maximum number of lines to show in tooltip */ @@ -67,7 +67,7 @@ type GenericTooltipProps = SharedTooltipProps & { /** Whether the actual Tooltip should be rendered. If false, it's just going to return the children */ shouldRender?: boolean; - /** Whether to ignore TooltipSense activity and always triger animation */ + /** Whether to ignore TooltipSense activity and always trigger animation */ shouldForceAnimate?: boolean; /** Whether it is education tooltip */ diff --git a/src/components/TransactionItemRow/TransactionItemRowRBR.tsx b/src/components/TransactionItemRow/TransactionItemRowRBR.tsx index e9c1629e87d4..da7506cc1bd6 100644 --- a/src/components/TransactionItemRow/TransactionItemRowRBR.tsx +++ b/src/components/TransactionItemRow/TransactionItemRowRBR.tsx @@ -18,7 +18,7 @@ function TransactionItemRowRBR({transaction, containerStyles}: {transaction: Tra const {translate} = useLocalize(); const theme = useTheme(); - const RBRmessages = transactionViolations + const rbrMessage = transactionViolations .map((violation, index) => { const translation = ViolationsUtils.getViolationTranslation(violation, translate); return index > 0 ? translation.charAt(0).toLowerCase() + translation.slice(1) : translation; @@ -38,7 +38,7 @@ function TransactionItemRowRBR({transaction, containerStyles}: {transaction: Tra numberOfLines={1} style={[styles.textMicroSupporting, styles.pre, styles.flexShrink1, {color: theme.danger}]} > - {RBRmessages} + {rbrMessage} ) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.tsx b/src/components/VideoPlayer/BaseVideoPlayer.tsx index 29d5f549672a..3eb9309b9aa1 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.tsx +++ b/src/components/VideoPlayer/BaseVideoPlayer.tsx @@ -78,7 +78,7 @@ function BaseVideoPlayer({ const [isEnded, setIsEnded] = useState(false); const [isBuffering, setIsBuffering] = useState(true); const [hasError, setHasError] = useState(false); - // we add "#t=0.001" at the end of the URL to skip first milisecond of the video and always be able to show proper video preview when video is paused at the beginning + // we add "#t=0.001" at the end of the URL to skip first millisecond of the video and always be able to show proper video preview when video is paused at the beginning const [sourceURL] = useState(() => VideoUtils.addSkipTimeTagToURL(url.includes('blob:') || url.includes('file:///') ? url : addEncryptedAuthTokenToURL(url), 0.001)); const [isPopoverVisible, setIsPopoverVisible] = useState(false); const [popoverAnchorPosition, setPopoverAnchorPosition] = useState({horizontal: 0, vertical: 0}); @@ -238,9 +238,9 @@ function BaseVideoPlayer({ const isVideoPlaying = status.isPlaying; // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const currentDuration = status.durationMillis || videoDuration * 1000; - const currentPositon = status.positionMillis || 0; + const currentPosition = status.positionMillis || 0; - if (shouldReplayVideo(status, isVideoPlaying, currentDuration, currentPositon) && !isEnded) { + if (shouldReplayVideo(status, isVideoPlaying, currentDuration, currentPosition) && !isEnded) { videoPlayerRef.current?.setStatusAsync({positionMillis: 0, shouldPlay: true}); } @@ -249,7 +249,7 @@ function BaseVideoPlayer({ setIsLoading(Number.isNaN(status.durationMillis)); // when video is ready to display duration is not NaN setIsBuffering(status.isBuffering); setDuration(currentDuration); - setPosition(currentPositon); + setPosition(currentPosition); videoStateRef.current = status; onPlaybackStatusUpdate?.(status); diff --git a/src/components/VideoPlayer/VideoErrorIndicator.tsx b/src/components/VideoPlayer/VideoErrorIndicator.tsx index 249006569374..3b021777f913 100644 --- a/src/components/VideoPlayer/VideoErrorIndicator.tsx +++ b/src/components/VideoPlayer/VideoErrorIndicator.tsx @@ -28,7 +28,7 @@ function VideoErrorIndicator({isPreview = false}: VideoErrorIndicatorProps) { /> {!isPreview && ( - {translate('common.errorOccuredWhileTryingToPlayVideo')} + {translate('common.errorOccurredWhileTryingToPlayVideo')} )} diff --git a/src/components/VideoPlayerContexts/PlaybackContext.tsx b/src/components/VideoPlayerContexts/PlaybackContext.tsx index 0c456940407b..7fa61b346d53 100644 --- a/src/components/VideoPlayerContexts/PlaybackContext.tsx +++ b/src/components/VideoPlayerContexts/PlaybackContext.tsx @@ -125,7 +125,7 @@ function PlaybackContextProvider({children}: ChildrenProps) { const attachmentReportID = Navigation.getActiveRouteWithoutParams() === `/${ROUTES.ATTACHMENTS.route}` ? prevCurrentReportID ?? reportIDFromUrlParams : undefined; const reportIDWithUrl = isChatThread(topMostReport) ? findUrlInReportOrAncestorAttachments(topMostReport, url) : undefined; - // - if it is a chat thread, use chat thread ID or any ascentor ID since the video could have originally been sent on report many levels up + // - if it is a chat thread, use chat thread ID or any ancestor ID since the video could have originally been sent on report many levels up // - report ID in which we are currently, if it is not a chat thread // - if it is an attachment route, then we take report ID from the URL params const currentPlayReportID = [attachmentReportID, reportIDWithUrl, currentReportID].find((id) => id !== undefined); diff --git a/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx b/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx index 310563114849..ff4a349f898e 100644 --- a/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx +++ b/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx @@ -73,11 +73,11 @@ function VideoPopoverMenuContextProvider({children}: ChildrenProps) { } function useVideoPopoverMenuContext() { - const videoPopooverMenuContext = useContext(Context); - if (!videoPopooverMenuContext) { + const videoPopoverMenuContext = useContext(Context); + if (!videoPopoverMenuContext) { throw new Error('useVideoPopoverMenuContext must be used within a VideoPopoverMenuContext'); } - return videoPopooverMenuContext; + return videoPopoverMenuContext; } VideoPopoverMenuContextProvider.displayName = 'VideoPopoverMenuContextProvider'; diff --git a/src/components/WorkspaceConfirmationForm.tsx b/src/components/WorkspaceConfirmationForm.tsx index b74cc279abee..6e01149aa76a 100644 --- a/src/components/WorkspaceConfirmationForm.tsx +++ b/src/components/WorkspaceConfirmationForm.tsx @@ -107,7 +107,7 @@ function WorkspaceConfirmationForm({onSubmit, policyOwnerEmail = '', onBackButto // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- nullish coalescing cannot be used if left side can be empty string source={workspaceAvatar?.avatarUri || getDefaultWorkspaceAvatar(workspaceNameFirstCharacter)} fallbackIcon={Expensicons.FallbackWorkspaceAvatar} - size={CONST.AVATAR_SIZE.XLARGE} + size={CONST.AVATAR_SIZE.X_LARGE} name={workspaceNameFirstCharacter} avatarID={policyID} type={CONST.ICON_TYPE_WORKSPACE} @@ -142,7 +142,7 @@ function WorkspaceConfirmationForm({onSubmit, policyOwnerEmail = '', onBackButto setAvatarFile(undefined); setWorkspaceAvatar({avatarUri: null, avatarFileName: null, avatarFileType: null}); }} - size={CONST.AVATAR_SIZE.XLARGE} + size={CONST.AVATAR_SIZE.X_LARGE} avatarStyle={[styles.avatarXLarge, styles.alignSelfCenter]} shouldDisableViewPhoto editIcon={Expensicons.Camera} diff --git a/src/components/WorkspaceMembersSelectionList.tsx b/src/components/WorkspaceMembersSelectionList.tsx index aff095f09839..3c9754c1aa4a 100644 --- a/src/components/WorkspaceMembersSelectionList.tsx +++ b/src/components/WorkspaceMembersSelectionList.tsx @@ -3,10 +3,10 @@ import type {SectionListData} from 'react-native'; import useDebouncedState from '@hooks/useDebouncedState'; import useLocalize from '@hooks/useLocalize'; import usePolicy from '@hooks/usePolicy'; -import useScreenWrapperTranstionStatus from '@hooks/useScreenWrapperTransitionStatus'; -import * as DeviceCapabilities from '@libs/DeviceCapabilities'; -import * as OptionsListUtils from '@libs/OptionsListUtils'; -import * as PolicyUtils from '@libs/PolicyUtils'; +import useScreenWrapperTransitionStatus from '@hooks/useScreenWrapperTransitionStatus'; +import {canUseTouchScreen as canUseTouchScreenUtil} from '@libs/DeviceCapabilities'; +import {getSearchValueForPhoneOrEmail, sortAlphabetically} from '@libs/OptionsListUtils'; +import {getMemberAccountIDsForWorkspace} from '@libs/PolicyUtils'; import CONST from '@src/CONST'; import type {Icon} from '@src/types/onyx/OnyxCommon'; import Badge from './Badge'; @@ -35,7 +35,7 @@ type WorkspaceMembersSelectionListProps = { function WorkspaceMembersSelectionList({policyID, selectedApprover, setApprover}: WorkspaceMembersSelectionListProps) { const {translate} = useLocalize(); - const {didScreenTransitionEnd} = useScreenWrapperTranstionStatus(); + const {didScreenTransitionEnd} = useScreenWrapperTransitionStatus(); const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState(''); const personalDetails = usePersonalDetails(); const policy = usePolicy(policyID); @@ -53,7 +53,7 @@ function WorkspaceMembersSelectionList({policyID, selectedApprover, setApprover} return null; } - const policyMemberEmailsToAccountIDs = PolicyUtils.getMemberAccountIDsForWorkspace(policy?.employeeList); + const policyMemberEmailsToAccountIDs = getMemberAccountIDsForWorkspace(policy?.employeeList); const accountID = Number(policyMemberEmailsToAccountIDs[email] ?? ''); const {avatar, displayName = email} = personalDetails?.[accountID] ?? {}; @@ -75,7 +75,7 @@ function WorkspaceMembersSelectionList({policyID, selectedApprover, setApprover} const filteredApprovers = debouncedSearchTerm !== '' ? approvers.filter((option) => { - const searchValue = OptionsListUtils.getSearchValueForPhoneOrEmail(debouncedSearchTerm); + const searchValue = getSearchValueForPhoneOrEmail(debouncedSearchTerm); const isPartOfSearchTerm = !!option.text?.toLowerCase().includes(searchValue) || !!option.login?.toLowerCase().includes(searchValue); return isPartOfSearchTerm; }) @@ -84,7 +84,7 @@ function WorkspaceMembersSelectionList({policyID, selectedApprover, setApprover} return [ { title: undefined, - data: OptionsListUtils.sortAlphabetically(filteredApprovers, 'text'), + data: sortAlphabetically(filteredApprovers, 'text'), shouldShow: true, }, ]; @@ -107,7 +107,7 @@ function WorkspaceMembersSelectionList({policyID, selectedApprover, setApprover} onSelectRow={handleOnSelectRow} showScrollIndicator showLoadingPlaceholder={!didScreenTransitionEnd} - shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()} + shouldPreventDefaultFocusOnSelectRow={!canUseTouchScreenUtil()} /> ); } diff --git a/src/hooks/useAnimatedHighlightStyle/index.ts b/src/hooks/useAnimatedHighlightStyle/index.ts index 4c9099c7f1ba..96ecd9c9f9db 100644 --- a/src/hooks/useAnimatedHighlightStyle/index.ts +++ b/src/hooks/useAnimatedHighlightStyle/index.ts @@ -1,7 +1,7 @@ import React, {useState} from 'react'; import {InteractionManager} from 'react-native'; import {Easing, interpolate, interpolateColor, runOnJS, useAnimatedStyle, useSharedValue, withDelay, withSequence, withTiming} from 'react-native-reanimated'; -import useScreenWrapperTranstionStatus from '@hooks/useScreenWrapperTransitionStatus'; +import useScreenWrapperTransitionStatus from '@hooks/useScreenWrapperTransitionStatus'; import useTheme from '@hooks/useTheme'; import CONST from '@src/CONST'; @@ -44,7 +44,7 @@ type Props = { }; /** - * Returns a highlight style that interpolates the colour, height and opacity giving a fading effect. + * Returns a highlight style that interpolates the color, height and opacity giving a fading effect. */ export default function useAnimatedHighlightStyle({ borderRadius, @@ -62,7 +62,7 @@ export default function useAnimatedHighlightStyle({ const [startHighlight, setStartHighlight] = useState(false); const repeatableProgress = useSharedValue(0); const nonRepeatableProgress = useSharedValue(shouldHighlight ? 0 : 1); - const {didScreenTransitionEnd} = useScreenWrapperTranstionStatus(); + const {didScreenTransitionEnd} = useScreenWrapperTransitionStatus(); const theme = useTheme(); const highlightBackgroundStyle = useAnimatedStyle(() => ({ diff --git a/src/hooks/useBasePopoverReactionList/index.ts b/src/hooks/useBasePopoverReactionList/index.ts index 82a9cb0dc5c1..cdb9f415830d 100644 --- a/src/hooks/useBasePopoverReactionList/index.ts +++ b/src/hooks/useBasePopoverReactionList/index.ts @@ -1,8 +1,8 @@ import {useEffect, useRef, useState} from 'react'; import type {SyntheticEvent} from 'react'; import {Dimensions} from 'react-native'; -import * as EmojiUtils from '@libs/EmojiUtils'; -import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; +import {getEmojiReactionDetails} from '@libs/EmojiUtils'; +import {getPersonalDetailsByIDs} from '@libs/PersonalDetailsUtils'; import type {BasePopoverReactionListHookProps, ReactionListAnchor, ShowReactionList} from './types'; export default function useBasePopoverReactionList({emojiName, emojiReactions, accountID, reportActionID, preferredLocale}: BasePopoverReactionListHookProps) { @@ -26,9 +26,9 @@ export default function useBasePopoverReactionList({emojiName, emojiReactions, a }; } - const {emojiCodes, reactionCount, hasUserReacted, userAccountIDs} = EmojiUtils.getEmojiReactionDetails(emojiName, selectedReaction, accountID); + const {emojiCodes, reactionCount, hasUserReacted, userAccountIDs} = getEmojiReactionDetails(emojiName, selectedReaction, accountID); - const users = PersonalDetailsUtils.getPersonalDetailsByIDs({accountIDs: userAccountIDs, currentUserAccountID: accountID, shouldChangeUserDisplayName: true}); + const users = getPersonalDetailsByIDs({accountIDs: userAccountIDs, currentUserAccountID: accountID, shouldChangeUserDisplayName: true}); return { emojiName, emojiCodes, @@ -41,7 +41,7 @@ export default function useBasePopoverReactionList({emojiName, emojiReactions, a /** * Get the BasePopoverReactionList anchor position - * We calculate the achor coordinates from measureInWindow async method + * We calculate the anchor coordinates from measureInWindow async method */ function getReactionListMeasuredLocation(): Promise<{x: number; y: number}> { return new Promise((resolve) => { diff --git a/src/hooks/useKeyboardShortcut.ts b/src/hooks/useKeyboardShortcut.ts index 90f43b4520d1..2a64a90cc8fa 100644 --- a/src/hooks/useKeyboardShortcut.ts +++ b/src/hooks/useKeyboardShortcut.ts @@ -18,7 +18,7 @@ type KeyboardShortcutConfig = { excludedNodes?: string[]; /* Is keyboard shortcut is already active */ isActive?: boolean; - /* Shuld stop propagation? */ + /* Should stop propagation? */ shouldStopPropagation?: boolean; }; diff --git a/src/hooks/useLocationBias.ts b/src/hooks/useLocationBias.ts index e18aba4a907c..80aaebe45892 100644 --- a/src/hooks/useLocationBias.ts +++ b/src/hooks/useLocationBias.ts @@ -16,17 +16,17 @@ export default function useLocationBias(allWaypoints: WaypointCollection, userLo } // Gather the longitudes and latitudes from filled waypoints. - const longitudes: number[] = Object.values(allWaypoints).reduce((accum: number[], waypoint) => { + const longitudes: number[] = Object.values(allWaypoints).reduce((accumulator: number[], waypoint) => { if (waypoint?.lng) { - accum.push(waypoint.lng); + accumulator.push(waypoint.lng); } - return accum; + return accumulator; }, []); - const latitudes: number[] = Object.values(allWaypoints).reduce((accum: number[], waypoint) => { + const latitudes: number[] = Object.values(allWaypoints).reduce((accumulator: number[], waypoint) => { if (waypoint?.lat) { - accum.push(waypoint.lat); + accumulator.push(waypoint.lat); } - return accum; + return accumulator; }, []); // When no filled waypoints are available but the current location of the user is available, diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index 0aaa8ddad9d0..7d691201e0bc 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -21,7 +21,7 @@ function useOnboardingFlowRouter() { const [isOnboardingCompleted, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { selector: hasCompletedGuidedSetupFlowSelector, }); - const [tryNewDot, tryNewDotdMetadata] = useOnyx(ONYXKEYS.NVP_TRYNEWDOT, { + const [tryNewDot, tryNewDotMetadata] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT, { selector: tryNewDotOnyxSelector, }); const {isHybridAppOnboardingCompleted, hasBeenAddedToNudgeMigration} = tryNewDot ?? {}; @@ -38,7 +38,7 @@ function useOnboardingFlowRouter() { return; } - if (isLoadingOnyxValue(isOnboardingCompletedMetadata, tryNewDotdMetadata, dismissedProductTrainingMetadata)) { + if (isLoadingOnyxValue(isOnboardingCompletedMetadata, tryNewDotMetadata, dismissedProductTrainingMetadata)) { return; } @@ -86,7 +86,7 @@ function useOnboardingFlowRouter() { isOnboardingCompleted, isHybridAppOnboardingCompleted, isOnboardingCompletedMetadata, - tryNewDotdMetadata, + tryNewDotMetadata, isSingleNewDotEntryMetadata, isSingleNewDotEntry, hasBeenAddedToNudgeMigration, diff --git a/src/hooks/useResponsiveLayout/index.ts b/src/hooks/useResponsiveLayout/index.ts index 76a57f6838cb..01b944210628 100644 --- a/src/hooks/useResponsiveLayout/index.ts +++ b/src/hooks/useResponsiveLayout/index.ts @@ -36,8 +36,8 @@ export default function useResponsiveLayout(): ResponsiveLayoutResult { const isExtraLargeScreenWidth = windowWidth > variables.sidePanelResponsiveWidthBreakpoint; const isExtraSmallScreenWidth = windowWidth <= variables.extraSmallMobileResponsiveWidthBreakpoint; - const lowerScreenDimmension = Math.min(windowWidth, windowHeight); - const isSmallScreen = lowerScreenDimmension <= variables.mobileResponsiveWidthBreakpoint; + const lowerScreenDimension = Math.min(windowWidth, windowHeight); + const isSmallScreen = lowerScreenDimension <= variables.mobileResponsiveWidthBreakpoint; // Note: activeModalType refers to our react-native-modal component wrapper, not react-navigation's modal stack navigators. // This means it will only be defined if the component calling this hook is a child of a modal component. See BaseModal for the provider. diff --git a/src/hooks/useScreenWrapperTransitionStatus.ts b/src/hooks/useScreenWrapperTransitionStatus.ts index b9e94abfc024..0d58bf3120c8 100644 --- a/src/hooks/useScreenWrapperTransitionStatus.ts +++ b/src/hooks/useScreenWrapperTransitionStatus.ts @@ -6,7 +6,7 @@ import {ScreenWrapperStatusContext} from '@components/ScreenWrapper'; * Use this hook if you can't get the transition status from the ScreenWrapper itself. Usually when ScreenWrapper is used inside TopTabNavigator. * @returns `didScreenTransitionEnd` flag to indicate if navigation transition ended. */ -export default function useScreenWrapperTranstionStatus() { +export default function useScreenWrapperTransitionStatus() { const value = useContext(ScreenWrapperStatusContext); if (value === undefined) { diff --git a/src/hooks/useSidePanel.ts b/src/hooks/useSidePanel.ts index fb69fedb6453..f7d8d69fd628 100644 --- a/src/hooks/useSidePanel.ts +++ b/src/hooks/useSidePanel.ts @@ -24,7 +24,7 @@ function useSidePanelDisplayStatus() { const [canUseHelpSidePanel = false] = useOnyx(ONYXKEYS.BETAS, {selector: Permissions.canUseHelpSidePanel}); const [isModalCenteredVisible = false] = useOnyx(ONYXKEYS.MODAL, { selector: (modal) => - modal?.type === CONST.MODAL.MODAL_TYPE.CENTERED_SWIPABLE_TO_RIGHT || + modal?.type === CONST.MODAL.MODAL_TYPE.CENTERED_SWIPEABLE_TO_RIGHT || modal?.type === CONST.MODAL.MODAL_TYPE.CENTERED_UNSWIPEABLE || modal?.type === CONST.MODAL.MODAL_TYPE.CENTERED_SMALL || modal?.type === CONST.MODAL.MODAL_TYPE.CENTERED, diff --git a/src/hooks/useTabNavigatorFocus/index.ts b/src/hooks/useTabNavigatorFocus/index.ts index ebf0137e05cb..4079a7b3901b 100644 --- a/src/hooks/useTabNavigatorFocus/index.ts +++ b/src/hooks/useTabNavigatorFocus/index.ts @@ -40,7 +40,7 @@ function useTabNavigatorFocus({tabIndex}: UseTabNavigatorFocusParams): boolean { try { // Retrieve the animation value from the tab navigator, which ranges from 0 to the total number of pages displayed. // Even a minimal scroll towards the camera page (e.g., a value of 0.001 at start) should activate the camera for immediate responsiveness. - // STOP!!!!!!! This is not a pattern to be followed! We are conditionally rendering this hook becase when used in the edit flow we'll never be inside a tab navigator. + // STOP!!!!!!! This is not a pattern to be followed! We are conditionally rendering this hook because when used in the edit flow we'll never be inside a tab navigator. // eslint-disable-next-line react-compiler/react-compiler, react-hooks/rules-of-hooks tabPositionAnimation = useTabAnimation(); } catch (error) { diff --git a/src/hooks/useViolations.ts b/src/hooks/useViolations.ts index 61d5a4a05e09..9167c9119a64 100644 --- a/src/hooks/useViolations.ts +++ b/src/hooks/useViolations.ts @@ -88,7 +88,7 @@ function useViolations(violations: TransactionViolation[], shouldShowOnlyViolati const currentViolations = violationsByField.get(field) ?? []; const firstViolation = currentViolations.at(0); - // someTagLevelsRequired has special logic becase data.errorIndexes is a bit unique in how it denotes the tag list that has the violation + // someTagLevelsRequired has special logic because data.errorIndexes is a bit unique in how it denotes the tag list that has the violation // tagListIndex can be 0 so we compare with undefined if (firstViolation?.name === CONST.VIOLATIONS.SOME_TAG_LEVELS_REQUIRED && data?.tagListIndex !== undefined && Array.isArray(firstViolation?.data?.errorIndexes)) { return currentViolations diff --git a/src/hooks/useWindowDimensions/index.ts b/src/hooks/useWindowDimensions/index.ts index 8666c3f666b0..28605c8d86d1 100644 --- a/src/hooks/useWindowDimensions/index.ts +++ b/src/hooks/useWindowDimensions/index.ts @@ -4,14 +4,14 @@ import {Dimensions, useWindowDimensions} from 'react-native'; import type {ResponsiveLayoutProperties} from '@components/VideoPlayerContexts/FullScreenContext'; import {FullScreenContext} from '@components/VideoPlayerContexts/FullScreenContext'; import useDebouncedState from '@hooks/useDebouncedState'; -import * as Browser from '@libs/Browser'; +import {isMobile as isMobileUtil, isMobileWebKit} from '@libs/Browser'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import type WindowDimensions from './types'; -const initalViewportHeight = window.visualViewport?.height ?? window.innerHeight; +const initialViewportHeight = window.visualViewport?.height ?? window.innerHeight; const tagNamesOpenKeyboard = ['INPUT', 'TEXTAREA']; -const isMobile = Browser.isMobile(); +const isMobile = isMobileUtil(); /** * A wrapper around React Native's useWindowDimensions hook. @@ -24,8 +24,8 @@ export default function (useCachedViewportHeight = false): WindowDimensions { unlockWindowDimensions: () => {}, }; - const isCachedViewportHeight = useCachedViewportHeight && Browser.isMobileWebKit(); - const cachedViewportHeightWithKeyboardRef = useRef(initalViewportHeight); + const isCachedViewportHeight = useCachedViewportHeight && isMobileWebKit(); + const cachedViewportHeightWithKeyboardRef = useRef(initialViewportHeight); const {width: windowWidth, height: windowHeight} = useWindowDimensions(); // These are the same as the ones in useResponsiveLayout, but we need to redefine them here to avoid cyclic dependency. @@ -36,8 +36,8 @@ export default function (useCachedViewportHeight = false): WindowDimensions { const isMediumScreenWidth = windowWidth > variables.mobileResponsiveWidthBreakpoint && windowWidth <= variables.tabletResponsiveWidthBreakpoint; const isLargeScreenWidth = windowWidth > variables.tabletResponsiveWidthBreakpoint; const isExtraSmallScreenWidth = windowWidth <= variables.extraSmallMobileResponsiveWidthBreakpoint; - const lowerScreenDimmension = Math.min(windowWidth, windowHeight); - const isSmallScreen = lowerScreenDimmension <= variables.mobileResponsiveWidthBreakpoint; + const lowerScreenDimension = Math.min(windowWidth, windowHeight); + const isSmallScreen = lowerScreenDimension <= variables.mobileResponsiveWidthBreakpoint; const responsiveLayoutResults = { isSmallScreenWidth, @@ -72,7 +72,7 @@ export default function (useCachedViewportHeight = false): WindowDimensions { const handleFocusOut = useRef((event: FocusEvent) => { const targetElement = event.target as HTMLElement; if (tagNamesOpenKeyboard.includes(targetElement.tagName)) { - setCachedViewportHeight(initalViewportHeight); + setCachedViewportHeight(initialViewportHeight); } }); @@ -97,7 +97,7 @@ export default function (useCachedViewportHeight = false): WindowDimensions { }, [windowHeight, isCachedViewportHeight]); useEffect(() => { - if (!isCachedViewportHeight || !window.matchMedia('(orientation: portrait)').matches || windowHeight >= initalViewportHeight) { + if (!isCachedViewportHeight || !window.matchMedia('(orientation: portrait)').matches || windowHeight >= initialViewportHeight) { return; } cachedViewportHeightWithKeyboardRef.current = windowHeight; @@ -123,7 +123,7 @@ export default function (useCachedViewportHeight = false): WindowDimensions { lockedWindowDimensionsRef.current.windowWidth !== windowWidth && lockedWindowDimensionsRef.current.windowHeight !== windowHeight; - // if video is in fullscreen mode, lock the window dimensions since they can change and casue whole app to re-render + // if video is in fullscreen mode, lock the window dimensions since they can change and cause whole app to re-render if (!lockedWindowDimensionsRef.current || didScreenChangeOrientation) { lockWindowDimensions(windowDimensions); return windowDimensions; diff --git a/src/languages/en.ts b/src/languages/en.ts index 63a7cf702ec4..b42ce40ed23c 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -86,9 +86,9 @@ import type { ImportedTagsMessageParams, ImportedTypesParams, ImportFieldParams, - ImportMembersSuccessfullDescriptionParams, - ImportPerDiemRatesSuccessfullDescriptionParams, - ImportTagsSuccessfullDescriptionParams, + ImportMembersSuccessfulDescriptionParams, + ImportPerDiemRatesSuccessfulDescriptionParams, + ImportTagsSuccessfulDescriptionParams, IncorrectZipFormatParams, InstantSummaryParams, IntacctMappingTitleParams, @@ -422,8 +422,8 @@ const translations = { conciergeHelp: 'Please reach out to Concierge for help.', youAppearToBeOffline: 'You appear to be offline.', thisFeatureRequiresInternet: 'This feature requires an active internet connection.', - attachementWillBeAvailableOnceBackOnline: 'Attachment will become available once back online.', - errorOccuredWhileTryingToPlayVideo: 'An error occurred while trying to play this video.', + attachmentWillBeAvailableOnceBackOnline: 'Attachment will become available once back online.', + errorOccurredWhileTryingToPlayVideo: 'An error occurred while trying to play this video.', areYouSure: 'Are you sure?', verify: 'Verify', yesContinue: 'Yes, continue', @@ -555,7 +555,7 @@ const translations = { }, attachmentPicker: { cameraPermissionRequired: 'Camera access', - expensifyDoesntHaveAccessToCamera: "Expensify can't take photos without access to your camera. Tap settings to update permissions.", + expensifyDoesNotHaveAccessToCamera: "Expensify can't take photos without access to your camera. Tap settings to update permissions.", attachmentError: 'Attachment error', errorWhileSelectingAttachment: 'An error occurred while selecting an attachment. Please try again.', errorWhileSelectingCorruptedAttachment: 'An error occurred while selecting a corrupted attachment. Please try another file.', @@ -825,9 +825,9 @@ const translations = { fieldNotMapped: ({fieldName}: SpreadFieldNameParams) => `Oops! A required field ("${fieldName}") hasn't been mapped. Please review and try again.`, singleFieldMultipleColumns: ({fieldName}: SpreadFieldNameParams) => `Oops! You've mapped a single field ("${fieldName}") to multiple columns. Please review and try again.`, emptyMappedField: ({fieldName}: SpreadFieldNameParams) => `Oops! The field ("${fieldName}") contains one or more empty values. Please review and try again.`, - importSuccessfullTitle: 'Import successful', - importCategoriesSuccessfullDescription: ({categories}: SpreadCategoriesParams) => (categories > 1 ? `${categories} categories have been added.` : '1 category has been added.'), - importMembersSuccessfullDescription: ({added, updated}: ImportMembersSuccessfullDescriptionParams) => { + importSuccessfulTitle: 'Import successful', + importCategoriesSuccessfulDescription: ({categories}: SpreadCategoriesParams) => (categories > 1 ? `${categories} categories have been added.` : '1 category has been added.'), + importMembersSuccessfulDescription: ({added, updated}: ImportMembersSuccessfulDescriptionParams) => { if (!added && !updated) { return 'No members have been added or updated.'; } @@ -842,8 +842,8 @@ const translations = { return added > 1 ? `${added} members have been added.` : '1 member has been added.'; }, - importTagsSuccessfullDescription: ({tags}: ImportTagsSuccessfullDescriptionParams) => (tags > 1 ? `${tags} tags have been added.` : '1 tag has been added.'), - importPerDiemRatesSuccessfullDescription: ({rates}: ImportPerDiemRatesSuccessfullDescriptionParams) => + importTagsSuccessfulDescription: ({tags}: ImportTagsSuccessfulDescriptionParams) => (tags > 1 ? `${tags} tags have been added.` : '1 tag has been added.'), + importPerDiemRatesSuccessfulDescription: ({rates}: ImportPerDiemRatesSuccessfulDescriptionParams) => rates > 1 ? `${rates} per diem rates have been added.` : '1 per diem rate has been added.', importFailedTitle: 'Import failed', importFailedDescription: 'Please ensure all fields are filled out correctly and try again. If the problem persists, please reach out to Concierge.', @@ -1266,7 +1266,7 @@ const translations = { deleteContactMethod: 'Failed to delete contact method. Please reach out to Concierge for help.', setDefaultContactMethod: 'Failed to set a new default contact method. Please reach out to Concierge for help.', addContactMethod: 'Failed to add this contact method. Please reach out to Concierge for help.', - enteredMethodIsAlreadySubmited: 'This contact method already exists.', + enteredMethodIsAlreadySubmitted: 'This contact method already exists.', passwordRequired: 'password required.', contactMethodRequired: 'Contact method is required.', invalidContactMethod: 'Invalid contact method', @@ -1274,6 +1274,7 @@ const translations = { newContactMethod: 'New contact method', goBackContactMethods: 'Go back to contact methods', }, + // cspell:disable pronouns: { coCos: 'Co / Cos', eEyEmEir: 'E / Ey / Em / Eir', @@ -1295,6 +1296,7 @@ const translations = { zeHirHirs: 'Ze / Hir', callMeByMyName: 'Call me by my name', }, + // cspell:enable displayNamePage: { headerTitle: 'Display name', isShownOnProfile: 'Your display name is shown on your profile.', @@ -1350,7 +1352,7 @@ const translations = { useStagingServer: 'Use Staging Server', forceOffline: 'Force offline', simulatePoorConnection: 'Simulate poor internet connection', - simulatFailingNetworkRequests: 'Simulate failing network requests', + simulateFailingNetworkRequests: 'Simulate failing network requests', authenticationStatus: 'Authentication status', deviceCredentials: 'Device credentials', invalidate: 'Invalidate', @@ -1788,7 +1790,7 @@ const translations = { pleaseEnterLastFour: 'Please enter the last four digits of your card.', activatePhysicalCard: 'Activate physical card', error: { - thatDidntMatch: "That didn't match the last 4 digits on your card. Please try again.", + thatDidNotMatch: "That didn't match the last 4 digits on your card. Please try again.", throttled: "You've incorrectly entered the last 4 digits of your Expensify Card too many times. If you're sure the numbers are correct, please reach out to Concierge to resolve. Otherwise, try again later.", }, @@ -2046,7 +2048,7 @@ const translations = { noLongerHaveAccess: ({primaryLogin}: NoLongerHaveAccessParams) => `If you no longer have access to ${primaryLogin}, please unlink your accounts.`, unlink: 'Unlink', linkSent: 'Link sent!', - succesfullyUnlinkedLogin: 'Secondary login successfully unlinked!', + successfullyUnlinkedLogin: 'Secondary login successfully unlinked!', }, emailDeliveryFailurePage: { ourEmailProvider: ({login}: OurEmailProviderParams) => @@ -2122,7 +2124,7 @@ const translations = { goBackHome: 'Go back to home page', }, errorPage: { - title: ({isBreakline}: {isBreakline: boolean}) => `Oops... ${isBreakline ? '\n' : ''}Something went wrong`, + title: ({shouldBreakLine}: {shouldBreakLine: boolean}) => `Oops... ${shouldBreakLine ? '\n' : ''}Something went wrong`, subtitle: 'Your request could not be completed. Please try again later.', }, setPasswordPage: { @@ -2446,14 +2448,14 @@ const translations = { businessInfo: 'Company info', enterTheNameOfYourBusiness: "What's the name of your company?", businessName: 'Legal company name', - enterYourCompanysTaxIdNumber: "What's your company’s Tax ID number?", + enterYourCompanyTaxIdNumber: "What's your company’s Tax ID number?", taxIDNumber: 'Tax ID number', taxIDNumberPlaceholder: '9 digits', - enterYourCompanysWebsite: "What's your company’s website?", + enterYourCompanyWebsite: "What's your company’s website?", companyWebsite: 'Company website', - enterYourCompanysPhoneNumber: "What's your company’s phone number?", - enterYourCompanysAddress: "What's your company’s address?", - selectYourCompanysType: 'What type of company is it?', + enterYourCompanyPhoneNumber: "What's your company’s phone number?", + enterYourCompanyAddress: "What's your company’s address?", + selectYourCompanyType: 'What type of company is it?', companyType: 'Company type', incorporationType: { LLC: 'LLC', @@ -2463,7 +2465,7 @@ const translations = { SOLE_PROPRIETORSHIP: 'Sole proprietorship', OTHER: 'Other', }, - selectYourCompanysIncorporationDate: "What's your company’s incorporation date?", + selectYourCompanyIncorporationDate: "What's your company’s incorporation date?", incorporationDate: 'Incorporation date', incorporationDatePlaceholder: 'Start date (yyyy-mm-dd)', incorporationState: 'Incorporation state', @@ -2726,7 +2728,7 @@ const translations = { header: 'Before we continue...', title: 'Terms & conditions', subtitle: 'Please agree to the Expensify Travel ', - termsconditions: 'terms & conditions', + termsConditions: 'terms & conditions', travelTermsAndConditions: 'terms & conditions', agree: 'I agree to the ', error: 'You must agree to the Expensify Travel terms & conditions to continue', @@ -2960,7 +2962,7 @@ const translations = { }, qbd: { exportOutOfPocketExpensesDescription: 'Set how out-of-pocket expenses export to QuickBooks Desktop.', - exportOutOfPocketExpensesCheckToogle: 'Mark checks as “print later”', + exportOutOfPocketExpensesCheckToggle: 'Mark checks as “print later”', exportDescription: 'Configure how Expensify data exports to QuickBooks Desktop.', date: 'Export date', exportInvoices: 'Export invoices to', @@ -3682,8 +3684,8 @@ const translations = { heading: 'We have a direct integration with your card issuer and can import your transaction data into Expensify quickly and accurately.\n\nTo get started, simply:', visa: 'We have global integrations with Visa, though eligibility varies by bank and card program.\n\nTo get started, simply:', mastercard: 'We have global integrations with Mastercard, though eligibility varies by bank and card program.\n\nTo get started, simply:', - vcf: `1. Visit [this help article](${CONST.COMPANY_CARDS_VISA_COMMERICAL_CARD_HELP}) for detailed instructions on how to set up your Visa Commercial Cards.\n\n2. [Contact your bank](${CONST.COMPANY_CARDS_VISA_COMMERICAL_CARD_HELP}) to verify they support a commercial feed for your program, and ask them to enable it.\n\n3. *Once the feed is enabled and you have its details, continue to the next screen.*`, - gl1025: `1. Visit [this help article](${CONST.COMPANY_CARDS_AMEX_COMMERICAL_CARD_HELP}) to find out if American Express can enable a commercial feed for your program.\n\n2. Once the feed is enabled, Amex will send you a production letter.\n\n3. *Once you have the feed information, continue to the next screen.*`, + vcf: `1. Visit [this help article](${CONST.COMPANY_CARDS_VISA_COMMERCIAL_CARD_HELP}) for detailed instructions on how to set up your Visa Commercial Cards.\n\n2. [Contact your bank](${CONST.COMPANY_CARDS_VISA_COMMERCIAL_CARD_HELP}) to verify they support a commercial feed for your program, and ask them to enable it.\n\n3. *Once the feed is enabled and you have its details, continue to the next screen.*`, + gl1025: `1. Visit [this help article](${CONST.COMPANY_CARDS_AMEX_COMMERCIAL_CARD_HELP}) to find out if American Express can enable a commercial feed for your program.\n\n2. Once the feed is enabled, Amex will send you a production letter.\n\n3. *Once you have the feed information, continue to the next screen.*`, cdf: `1. Visit [this help article](${CONST.COMPANY_CARDS_MASTERCARD_COMMERCIAL_CARDS}) for detailed instructions on how to set up your Mastercard Commercial Cards.\n\n 2. [Contact your bank](${CONST.COMPANY_CARDS_MASTERCARD_COMMERCIAL_CARDS}) to verify they support a commercial feed for your program, and ask them to enable it.\n\n3. *Once the feed is enabled and you have its details, continue to the next screen.*`, stripe: `1. Visit Stripe’s Dashboard, and go to [Settings](${CONST.COMPANY_CARDS_STRIPE_HELP}).\n\n2. Under Product Integrations, click Enable next to Expensify.\n\n3. Once the feed is enabled, click Submit below and we’ll work on adding it.`, }, @@ -4312,7 +4314,7 @@ const translations = { connectPrompt: ({connectionName}: ConnectionNameParams) => `Are you sure you want to connect ${ CONST.POLICY.CONNECTIONS.NAME_USER_FRIENDLY[connectionName] ?? 'this accounting integration' - }? This will remove any existing acounting connections.`, + }? This will remove any existing accounting connections.`, enterCredentials: 'Enter your credentials', connections: { syncStageName: ({stage}: SyncStageNameConnectionsParams) => { @@ -4354,7 +4356,7 @@ const translations = { case 'quickbooksDesktopImportTitle': return 'Importing title'; case 'quickbooksDesktopImportApproveCertificate': - return 'Importing approve ceritificate'; + return 'Importing approve certificate'; case 'quickbooksDesktopImportDimensions': return 'Importing dimensions'; case 'quickbooksDesktopImportSavePolicy': @@ -4565,7 +4567,7 @@ const translations = { }, bankAccount: { continueWithSetup: 'Continue setup', - youreAlmostDone: "You're almost done setting up your bank account, which will let you issue corporate cards, reimburse expenses, collect invoices, and pay bills.", + youAreAlmostDone: "You're almost done setting up your bank account, which will let you issue corporate cards, reimburse expenses, collect invoices, and pay bills.", streamlinePayments: 'Streamline payments', connectBankAccountNote: "Note: Personal bank accounts can't be used for payments on workspaces.", oneMoreThing: 'One more thing!', @@ -4956,7 +4958,7 @@ const translations = { submitAndClose: 'Submit and Close', submitAndApprove: 'Submit and Approve', advanced: 'ADVANCED', - dynamictExternal: 'DYNAMIC_EXTERNAL', + dynamicExternal: 'DYNAMIC_EXTERNAL', smartReport: 'SMARTREPORT', billcom: 'BILLCOM', }, @@ -5269,7 +5271,7 @@ const translations = { genericCreateReportFailureMessage: 'Unexpected error creating this chat. Please try again later.', genericAddCommentFailureMessage: 'Unexpected error posting the comment. Please try again later.', genericUpdateReportFieldFailureMessage: 'Unexpected error updating the field. Please try again later.', - genericUpdateReporNameEditFailureMessage: 'Unexpected error renaming the report. Please try again later.', + genericUpdateReportNameEditFailureMessage: 'Unexpected error renaming the report. Please try again later.', noActivityYet: 'No activity yet', actions: { type: { @@ -5360,7 +5362,7 @@ const translations = { workspaceName: 'Workspace name', chatUserDisplayNames: 'Chat member display names', scrollToNewestMessages: 'Scroll to newest messages', - prestyledText: 'Prestyled text', + preStyledText: 'Pre styled text', viewAttachment: 'View attachment', }, parentReportAction: { @@ -5427,7 +5429,7 @@ const translations = { iAmATeacher: 'I am a teacher', getInTouch: 'Excellent! Please share their information so we can get in touch with them.', introSchoolPrincipal: 'Intro to your school principal', - schoolPrincipalVerfiyExpense: + schoolPrincipalVerifyExpense: 'Expensify.org splits the cost of essential school supplies so that students from low-income households can have a better learning experience. Your principal will be asked to verify your expenses.', principalFirstName: 'Principal first name', principalLastName: 'Principal last name', @@ -6061,9 +6063,9 @@ const translations = { }, }, productTrainingTooltip: { - // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room + // TODO: CONCIERGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 - conciergeLHNGBR: { + conciergeLHNGbr: { part1: 'Get started', part2: ' here!', }, diff --git a/src/languages/es.ts b/src/languages/es.ts index be66f6ec6f01..3c84b365df4e 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -85,9 +85,9 @@ import type { ImportedTagsMessageParams, ImportedTypesParams, ImportFieldParams, - ImportMembersSuccessfullDescriptionParams, - ImportPerDiemRatesSuccessfullDescriptionParams, - ImportTagsSuccessfullDescriptionParams, + ImportMembersSuccessfulDescriptionParams, + ImportPerDiemRatesSuccessfulDescriptionParams, + ImportTagsSuccessfulDescriptionParams, IncorrectZipFormatParams, InstantSummaryParams, IntacctMappingTitleParams, @@ -415,8 +415,8 @@ const translations = { conciergeHelp: 'Por favor, contacta con Concierge para obtener ayuda.', youAppearToBeOffline: 'Parece que estás desconectado.', thisFeatureRequiresInternet: 'Esta función requiere una conexión a Internet activa.', - attachementWillBeAvailableOnceBackOnline: 'El archivo adjunto estará disponible cuando vuelvas a estar en línea.', - errorOccuredWhileTryingToPlayVideo: 'Se produjo un error al intentar reproducir este video.', + attachmentWillBeAvailableOnceBackOnline: 'El archivo adjunto estará disponible cuando vuelvas a estar en línea.', + errorOccurredWhileTryingToPlayVideo: 'Se produjo un error al intentar reproducir este video.', areYouSure: '¿Estás seguro?', verify: 'Verifique', yesContinue: 'Sí, continuar', @@ -550,7 +550,7 @@ const translations = { }, attachmentPicker: { cameraPermissionRequired: 'Permiso para acceder a la cámara', - expensifyDoesntHaveAccessToCamera: 'Expensify no puede tomar fotos sin acceso a la cámara. Haz click en configuración para actualizar los permisos.', + expensifyDoesNotHaveAccessToCamera: 'Expensify no puede tomar fotos sin acceso a la cámara. Haz click en configuración para actualizar los permisos.', attachmentError: 'Error al adjuntar archivo', errorWhileSelectingAttachment: 'Se ha producido un error al seleccionar un archivo adjunto. Por favor, inténtalo de nuevo.', errorWhileSelectingCorruptedAttachment: 'Se ha producido un error al seleccionar un archivo adjunto corrupto. Por favor, inténtalo con otro archivo.', @@ -821,8 +821,8 @@ const translations = { emptyMappedField: ({fieldName}: SpreadFieldNameParams) => `¡Vaya! El campo ("${fieldName}") contiene uno o más valores vacíos. Por favor, revísalo e inténtalo de nuevo.`, importFailedTitle: 'Fallo en la importación', importFailedDescription: 'Por favor, asegúrate de que todos los campos estén llenos correctamente e inténtalo de nuevo. Si el problema persiste, por favor contacta a Concierge.', - importCategoriesSuccessfullDescription: ({categories}: SpreadCategoriesParams) => (categories > 1 ? `Se han agregado ${categories} categorías.` : 'Se ha agregado 1 categoría.'), - importMembersSuccessfullDescription: ({added, updated}: ImportMembersSuccessfullDescriptionParams) => { + importCategoriesSuccessfulDescription: ({categories}: SpreadCategoriesParams) => (categories > 1 ? `Se han agregado ${categories} categorías.` : 'Se ha agregado 1 categoría.'), + importMembersSuccessfulDescription: ({added, updated}: ImportMembersSuccessfulDescriptionParams) => { if (!added && !updated) { return 'No se han añadido ni actualizado miembros.'; } @@ -838,10 +838,10 @@ const translations = { return added > 1 ? `Se han agregado ${added} miembros` : 'Se ha agregado 1 miembro.'; }, - importTagsSuccessfullDescription: ({tags}: ImportTagsSuccessfullDescriptionParams) => (tags > 1 ? `Se han agregado ${tags} etiquetas.` : 'Se ha agregado 1 etiqueta.'), - importPerDiemRatesSuccessfullDescription: ({rates}: ImportPerDiemRatesSuccessfullDescriptionParams) => + importTagsSuccessfulDescription: ({tags}: ImportTagsSuccessfulDescriptionParams) => (tags > 1 ? `Se han agregado ${tags} etiquetas.` : 'Se ha agregado 1 etiqueta.'), + importPerDiemRatesSuccessfulDescription: ({rates}: ImportPerDiemRatesSuccessfulDescriptionParams) => rates > 1 ? `Se han añadido ${rates} tasas de per diem.` : 'Se ha añadido 1 tasa de per diem.', - importSuccessfullTitle: 'Importar categorías', + importSuccessfulTitle: 'Importar categorías', importDescription: 'Elige qué campos mapear desde tu hoja de cálculo haciendo clic en el menú desplegable junto a cada columna importada a continuación.', sizeNotMet: 'El archivo adjunto debe ser más grande que 0 bytes.', invalidFileMessage: @@ -1265,7 +1265,7 @@ const translations = { deleteContactMethod: 'No se ha podido eliminar este método de contacto. Por favor, contacta con Concierge para obtener ayuda.', setDefaultContactMethod: 'No se pudo establecer un nuevo método de contacto predeterminado. Por favor contacta con Concierge para obtener ayuda.', addContactMethod: 'Se ha producido un error al añadir este método de contacto. Por favor, contacta con Concierge para obtener ayuda.', - enteredMethodIsAlreadySubmited: 'El método de contacto ingresado ya existe.', + enteredMethodIsAlreadySubmitted: 'El método de contacto ingresado ya existe.', passwordRequired: 'Se requiere contraseña', contactMethodRequired: 'Se requiere método de contacto.', invalidContactMethod: 'Método de contacto no válido', @@ -1349,7 +1349,7 @@ const translations = { useStagingServer: 'Usar servidor “staging”', forceOffline: 'Forzar desconexión', simulatePoorConnection: 'Simular una conexión a internet deficiente', - simulatFailingNetworkRequests: 'Simular fallos en solicitudes de red', + simulateFailingNetworkRequests: 'Simular fallos en solicitudes de red', authenticationStatus: 'Estado de autenticación', deviceCredentials: 'Credenciales del dispositivo', invalidate: 'Invalidar', @@ -1789,7 +1789,7 @@ const translations = { pleaseEnterLastFour: 'Introduce los cuatro últimos dígitos de la tarjeta.', activatePhysicalCard: 'Activar tarjeta física', error: { - thatDidntMatch: 'Los 4 últimos dígitos de tu tarjeta no coinciden. Por favor, inténtalo de nuevo.', + thatDidNotMatch: 'Los 4 últimos dígitos de tu tarjeta no coinciden. Por favor, inténtalo de nuevo.', throttled: 'Has introducido incorrectamente los 4 últimos dígitos de tu tarjeta Expensify demasiadas veces. Si estás seguro de que los números son correctos, ponte en contacto con Conserjería para solucionarlo. De lo contrario, inténtalo de nuevo más tarde.', }, @@ -2049,7 +2049,7 @@ const translations = { noLongerHaveAccess: ({primaryLogin}: NoLongerHaveAccessParams) => `Si ya no tienes acceso a ${primaryLogin} por favor, desvincula las cuentas.`, unlink: 'Desvincular', linkSent: '¡Enlace enviado!', - succesfullyUnlinkedLogin: '¡Nombre de usuario secundario desvinculado correctamente!', + successfullyUnlinkedLogin: '¡Nombre de usuario secundario desvinculado correctamente!', }, emailDeliveryFailurePage: { ourEmailProvider: ({login}: OurEmailProviderParams) => @@ -2126,7 +2126,7 @@ const translations = { goBackHome: 'Volver a la página principal', }, errorPage: { - title: ({isBreakline}: {isBreakline: boolean}) => `Ups... ${isBreakline ? '\n' : ''}Algo no ha ido bien`, + title: ({shouldBreakLine}: {shouldBreakLine: boolean}) => `Ups... ${shouldBreakLine ? '\n' : ''}Algo no ha ido bien`, subtitle: 'No se ha podido completar la acción. Por favor, inténtalo más tarde.', }, setPasswordPage: { @@ -2468,14 +2468,14 @@ const translations = { businessInfo: 'Información de la empresa', enterTheNameOfYourBusiness: '¿Cuál es el nombre de tu empresa?', businessName: 'Nombre de la empresa', - enterYourCompanysTaxIdNumber: '¿Cuál es el número de identificación fiscal?', + enterYourCompanyTaxIdNumber: '¿Cuál es el número de identificación fiscal?', taxIDNumber: 'Número de identificación fiscal', taxIDNumberPlaceholder: '9 dígitos', - enterYourCompanysWebsite: '¿Cuál es la página web de tu empresa?', + enterYourCompanyWebsite: '¿Cuál es la página web de tu empresa?', companyWebsite: 'Página web de la empresa', - enterYourCompanysPhoneNumber: '¿Cuál es el número de teléfono de tu empresa?', - enterYourCompanysAddress: '¿Cuál es la dirección de tu empresa?', - selectYourCompanysType: '¿Cuál es el tipo de empresa?', + enterYourCompanyPhoneNumber: '¿Cuál es el número de teléfono de tu empresa?', + enterYourCompanyAddress: '¿Cuál es la dirección de tu empresa?', + selectYourCompanyType: '¿Cuál es el tipo de empresa?', companyType: 'Tipo de empresa', incorporationType: { LLC: 'SRL', @@ -2485,7 +2485,7 @@ const translations = { SOLE_PROPRIETORSHIP: 'Empresa individual', OTHER: 'Otros', }, - selectYourCompanysIncorporationDate: '¿Cuál es la fecha de constitución de la empresa?', + selectYourCompanyIncorporationDate: '¿Cuál es la fecha de constitución de la empresa?', incorporationDate: 'Fecha de constitución', incorporationDatePlaceholder: 'Fecha de inicio (yyyy-mm-dd)', incorporationState: 'Estado en el que se constituyó', @@ -2749,7 +2749,7 @@ const translations = { header: 'Antes de continuar...', title: 'Términos y condiciones de Expensify Travel', subtitle: 'Por favor, acepta los ', - termsconditions: 'términos y condiciones', + termsConditions: 'términos y condiciones', travelTermsAndConditions: 'términos y condiciones', agree: 'Acepto los ', error: 'Debes aceptar los términos y condiciones de Expensify Travel para continuar', @@ -2983,7 +2983,7 @@ const translations = { }, qbd: { exportOutOfPocketExpensesDescription: 'Establezca cómo se exportan los gastos de bolsillo a QuickBooks Desktop.', - exportOutOfPocketExpensesCheckToogle: 'Marcar los cheques como “imprimir más tarde”', + exportOutOfPocketExpensesCheckToggle: 'Marcar los cheques como “imprimir más tarde”', exportDescription: 'Configura cómo se exportan los datos de Expensify a QuickBooks Desktop.', date: 'Fecha de exportación', exportInvoices: 'Exportar facturas a', @@ -3721,8 +3721,8 @@ const translations = { 'Tenemos una integración directa con el emisor de su tarjeta y podemos importar los datos de sus transacciones a Expensify de forma rápida y precisa.\n\nPara empezar, simplemente:', visa: 'Contamos con integraciones globales con Visa, aunque la elegibilidad varía según el banco y el programa de la tarjeta.\n\nTPara empezar, simplemente:', mastercard: 'Contamos con integraciones globales con Mastercard, aunque la elegibilidad varía según el banco y el programa de la tarjeta.\n\nPara empezar, simplemente:', - vcf: `1. Visite [este artículo de ayuda](${CONST.COMPANY_CARDS_VISA_COMMERICAL_CARD_HELP}) para obtener instrucciones detalladas sobre cómo configurar sus tarjetas comerciales Visa.\n\n2. [Póngase en contacto con su banco](${CONST.COMPANY_CARDS_VISA_COMMERICAL_CARD_HELP}) para comprobar que admiten un feed personalizado para su programa, y pídales que lo activen.\n\n3. *Una vez que el feed esté habilitado y tengas sus datos, pasa a la siguiente pantalla.*`, - gl1025: `1. Visite [este artículo de ayuda](${CONST.COMPANY_CARDS_AMEX_COMMERICAL_CARD_HELP}) para saber si American Express puede habilitar un feed personalizado para su programa.\n\n2. Una vez activada la alimentación, Amex le enviará una carta de producción.\n\n3. *Una vez que tenga la información de alimentación, continúe con la siguiente pantalla.*`, + vcf: `1. Visite [este artículo de ayuda](${CONST.COMPANY_CARDS_VISA_COMMERCIAL_CARD_HELP}) para obtener instrucciones detalladas sobre cómo configurar sus tarjetas comerciales Visa.\n\n2. [Póngase en contacto con su banco](${CONST.COMPANY_CARDS_VISA_COMMERCIAL_CARD_HELP}) para comprobar que admiten un feed personalizado para su programa, y pídales que lo activen.\n\n3. *Una vez que el feed esté habilitado y tengas sus datos, pasa a la siguiente pantalla.*`, + gl1025: `1. Visite [este artículo de ayuda](${CONST.COMPANY_CARDS_AMEX_COMMERCIAL_CARD_HELP}) para saber si American Express puede habilitar un feed personalizado para su programa.\n\n2. Una vez activada la alimentación, Amex le enviará una carta de producción.\n\n3. *Una vez que tenga la información de alimentación, continúe con la siguiente pantalla.*`, cdf: `1. Visite [este artículo de ayuda](${CONST.COMPANY_CARDS_MASTERCARD_COMMERCIAL_CARDS}) para obtener instrucciones detalladas sobre cómo configurar sus tarjetas comerciales Mastercard.\n\n 2. [Póngase en contacto con su banco](${CONST.COMPANY_CARDS_MASTERCARD_COMMERCIAL_CARDS}) para verificar que admiten un feed personalizado para su programa, y pídales que lo habiliten.\n\n3. *Una vez que el feed esté habilitado y tengas sus datos, pasa a la siguiente pantalla.*`, stripe: `1. Visita el Panel de Stripe y ve a [Configuraciones](${CONST.COMPANY_CARDS_STRIPE_HELP}).\n\n2. En Integraciones de Productos, haz clic en Habilitar junto a Expensify.\n\n3. Una vez que la fuente esté habilitada, haz clic en Enviar abajo y comenzaremos a añadirla.`, }, @@ -4611,7 +4611,7 @@ const translations = { }, bankAccount: { continueWithSetup: 'Continuar con la configuración', - youreAlmostDone: 'Casi has acabado de configurar tu cuenta bancaria, que te permitirá emitir tarjetas corporativas, reembolsar gastos y cobrar pagar facturas.', + youAreAlmostDone: 'Casi has acabado de configurar tu cuenta bancaria, que te permitirá emitir tarjetas corporativas, reembolsar gastos y cobrar pagar facturas.', streamlinePayments: 'Optimiza pagos', connectBankAccountNote: 'Nota: No se pueden usar cuentas bancarias personales para realizar pagos en los espacios de trabajo.', oneMoreThing: '¡Una cosa más!', @@ -5007,7 +5007,7 @@ const translations = { submitAndClose: 'Enviar y Cerrar', submitAndApprove: 'Enviar y Aprobar', advanced: 'AVANZADO', - dynamictExternal: 'DINÁMICO_EXTERNO', + dynamicExternal: 'DINÁMICO_EXTERNO', smartReport: 'INFORME_INTELIGENTE', billcom: 'BILLCOM', }, @@ -5323,7 +5323,7 @@ const translations = { genericCreateReportFailureMessage: 'Error inesperado al crear el chat. Por favor, inténtalo más tarde.', genericAddCommentFailureMessage: 'Error inesperado al añadir el comentario. Por favor, inténtalo más tarde.', genericUpdateReportFieldFailureMessage: 'Error inesperado al actualizar el campo. Por favor, inténtalo más tarde.', - genericUpdateReporNameEditFailureMessage: 'Error inesperado al cambiar el nombre del informe. Por favor, intentarlo más tarde.', + genericUpdateReportNameEditFailureMessage: 'Error inesperado al cambiar el nombre del informe. Por favor, intentarlo más tarde.', noActivityYet: 'Sin actividad todavía', actions: { type: { @@ -5874,7 +5874,7 @@ const translations = { workspaceName: 'Nombre del espacio de trabajo', chatUserDisplayNames: 'Nombres de los miembros del chat', scrollToNewestMessages: 'Desplázate a los mensajes más recientes', - prestyledText: 'texto preestilizado', + preStyledText: 'texto preestilizado', viewAttachment: 'Ver archivo adjunto', }, parentReportAction: { @@ -5940,7 +5940,7 @@ const translations = { iAmATeacher: 'Soy profesor', getInTouch: '¡Excelente! Por favor, comparte tu información para que podamos ponernos en contacto con ellos.', introSchoolPrincipal: 'Introducción al director del colegio', - schoolPrincipalVerfiyExpense: + schoolPrincipalVerifyExpense: 'Expensify.org divide el coste del material escolar esencial para que los estudiantes de familias con bajos ingresos puedan tener una mejor experiencia de aprendizaje. Se pedirá a tu director que verifique tus gastos.', principalFirstName: 'Nombre del director', principalLastName: 'Apellido del director', @@ -6584,7 +6584,7 @@ const translations = { productTrainingTooltip: { // TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room // https://github.com/Expensify/App/issues/57045#issuecomment-2701455668 - conciergeLHNGBR: { + conciergeLHNGbr: { part1: '¡Comienza', part2: ' aquí!', }, diff --git a/src/languages/params.ts b/src/languages/params.ts index a1ffa1053bef..31d1579914c4 100644 --- a/src/languages/params.ts +++ b/src/languages/params.ts @@ -577,7 +577,7 @@ type InvalidValueParams = { expectedValues: string; }; -type ImportTagsSuccessfullDescriptionParams = { +type ImportTagsSuccessfulDescriptionParams = { tags: number; }; @@ -585,12 +585,12 @@ type ImportedTagsMessageParams = { columnCounts: number; }; -type ImportMembersSuccessfullDescriptionParams = { +type ImportMembersSuccessfulDescriptionParams = { added: number; updated: number; }; -type ImportPerDiemRatesSuccessfullDescriptionParams = { +type ImportPerDiemRatesSuccessfulDescriptionParams = { rates: number; }; @@ -671,9 +671,9 @@ type ReviewParams = { export type { AuthenticationErrorParams, - ImportMembersSuccessfullDescriptionParams, + ImportMembersSuccessfulDescriptionParams, ImportedTagsMessageParams, - ImportTagsSuccessfullDescriptionParams, + ImportTagsSuccessfulDescriptionParams, MissingPropertyParams, InvalidPropertyParams, InvalidValueParams, @@ -880,7 +880,7 @@ export type { ImportedTypesParams, WorkspaceYouMayJoin, WorkspaceMemberList, - ImportPerDiemRatesSuccessfullDescriptionParams, + ImportPerDiemRatesSuccessfulDescriptionParams, CurrencyCodeParams, WorkspaceLockedPlanTypeParams, CompanyNameParams, diff --git a/src/libs/API/parameters/AcceptWalletTermsParams.ts b/src/libs/API/parameters/AcceptWalletTermsParams.ts index 897f002eb77a..e2a93792f9d4 100644 --- a/src/libs/API/parameters/AcceptWalletTermsParams.ts +++ b/src/libs/API/parameters/AcceptWalletTermsParams.ts @@ -1,6 +1,6 @@ type AcceptWalletTermsParams = { hasAcceptedTerms: boolean; - reportID: string; + reportID?: string; }; export default AcceptWalletTermsParams; 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/ImportPerDiemRatesParams.ts b/src/libs/API/parameters/ImportPerDiemRatesParams.ts index b67517150f2d..b3af43928560 100644 --- a/src/libs/API/parameters/ImportPerDiemRatesParams.ts +++ b/src/libs/API/parameters/ImportPerDiemRatesParams.ts @@ -12,7 +12,7 @@ type ImportPerDiemRatesParams = { * name: “Spain”; * currency: “EUR”; * enabled: true (since we are importing); - * rate: 0 (since we have subrates); + * rate: 0 (since we have sub-rates); * Attributes: []; * subRates: An array with each element in the following shape: * id: “66d5ae9a0379d”; 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 d46b4cb742fa..267ed6211708 100644 --- a/src/libs/API/parameters/index.ts +++ b/src/libs/API/parameters/index.ts @@ -94,7 +94,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'; @@ -184,7 +184,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 SwitchToOldDotOnCompanySizeParams} from './SwitchToOldDotOnCompanySizeParams'; export type {default as TrackExpenseParams} from './TrackExpenseParams'; diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index 4f771a8d118f..5321059fd358 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'; @@ -169,7 +169,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', @@ -239,7 +239,7 @@ const WRITE_COMMANDS = { UPDATE_CUSTOM_RULES: 'UpdateCustomRules', SET_POLICY_BILLABLE_MODE: ' SetPolicyBillableMode', DISABLE_POLICY_BILLABLE_MODE: 'DisablePolicyBillableExpenses', - SET_WORKSPACE_ERECEIPTS_ENABLED: 'SetWorkspaceEReceiptsEnabled', + SET_WORKSPACE_E_RECEIPTS_ENABLED: 'SetWorkspaceEReceiptsEnabled', SET_POLICY_CATEGORY_DESCRIPTION_REQUIRED: 'SetPolicyCategoryDescriptionRequired', SET_WORKSPACE_CATEGORY_DESCRIPTION_HINT: 'SetWorkspaceCategoryDescriptionHint', SET_POLICY_CATEGORY_RECEIPTS_REQUIRED: 'SetPolicyCategoryReceiptsRequired', @@ -545,10 +545,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; @@ -615,7 +615,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; @@ -736,7 +736,7 @@ type WriteCommandParameters = { [WRITE_COMMANDS.UPDATE_CUSTOM_RULES]: Parameters.UpdateCustomRules; [WRITE_COMMANDS.SET_POLICY_BILLABLE_MODE]: Parameters.SetPolicyBillableModeParams; [WRITE_COMMANDS.DISABLE_POLICY_BILLABLE_MODE]: Parameters.DisablePolicyBillableModeParams; - [WRITE_COMMANDS.SET_WORKSPACE_ERECEIPTS_ENABLED]: Parameters.SetWorkspaceEReceiptsEnabled; + [WRITE_COMMANDS.SET_WORKSPACE_E_RECEIPTS_ENABLED]: Parameters.SetWorkspaceEReceiptsEnabled; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_ONLINE_ENABLE_NEW_CATEGORIES]: Parameters.UpdateQuickbooksOnlineGenericTypeParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_ONLINE_AUTO_CREATE_VENDOR]: Parameters.UpdateQuickbooksOnlineAutoCreateVendorParams; [WRITE_COMMANDS.UPDATE_QUICKBOOKS_ONLINE_SYNC_TAX]: Parameters.UpdateQuickbooksOnlineGenericTypeParams; @@ -932,7 +932,7 @@ type WriteCommandParameters = { [WRITE_COMMANDS.UPDATE_INVOICE_COMPANY_WEBSITE]: Parameters.UpdateInvoiceCompanyWebsiteParams; [WRITE_COMMANDS.JOIN_ACCESSIBLE_POLICY]: Parameters.JoinAccessiblePolicyParams; - // Dismis Product Training + // Dismiss Product Training [WRITE_COMMANDS.DISMISS_PRODUCT_TRAINING]: Parameters.DismissProductTrainingParams; // Merge accounts API 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 608502530c5c..69049642fa05 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -323,7 +323,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..50d598a33a7f 100644 --- a/src/libs/DateUtils.ts +++ b/src/libs/DateUtils.ts @@ -340,7 +340,7 @@ const updateCurrentDate = throttle(() => { }, THREE_HOURS); /** - * Initialises the event listeners that trigger the current date update + * Initializes the event listeners that trigger the current date update */ function startCurrentDateUpdater() { const trackedEvents = ['mousemove', 'touchstart', 'keydown', 'scroll']; @@ -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 3c794d2558c6..562356467f42 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/DistanceRequestUtils.ts b/src/libs/DistanceRequestUtils.ts index 614e4471bb1a..c058f054423f 100644 --- a/src/libs/DistanceRequestUtils.ts +++ b/src/libs/DistanceRequestUtils.ts @@ -138,7 +138,7 @@ function getRoundedDistanceInUnits(distanceInMeters: number, unit: Unit): string /** * @param unit Unit that should be used to display the distance - * @param rate Expensable amount allowed per unit + * @param rate Expendable amount allowed per unit * @param currency The currency associated with the rate * @param translate Translate function * @param toLocaleDigit Function to convert to localized digit @@ -173,7 +173,7 @@ function getRateForDisplay( * @param hasRoute Whether the route exists for the distance expense * @param distanceInMeters Distance traveled * @param unit Unit that should be used to display the distance - * @param rate Expensable amount allowed per unit + * @param rate Expendable amount allowed per unit * @param translate Translate function * @param useShortFormUnit If true, the unit will be returned in short form (e.g., "mi", "km"). * @returns A string that describes the distance traveled @@ -211,7 +211,7 @@ function getDistanceForDisplayLabel(distanceInMeters: number, unit: Unit): strin * @param hasRoute Whether the route exists for the distance expense * @param distanceInMeters Distance traveled * @param unit Unit that should be used to display the distance - * @param rate Expensable amount allowed per unit + * @param rate Expendable amount allowed per unit * @param currency The currency associated with the rate * @param translate Translate function * @param toLocaleDigit Function to convert to localized digit diff --git a/src/libs/EmojiUtils.tsx b/src/libs/EmojiUtils.tsx index a8fb6f7a92b3..9eb5a35635a3 100644 --- a/src/libs/EmojiUtils.tsx +++ b/src/libs/EmojiUtils.tsx @@ -16,7 +16,7 @@ import type EmojiTrie from './EmojiTrie'; import type {SupportedLanguage} from './EmojiTrie'; import memoize from './memoize'; -type HeaderIndice = {code: string; index: number; icon: IconAsset}; +type HeaderIndices = {code: string; index: number; icon: IconAsset}; type EmojiSpacer = {code: string; spacer: boolean}; type EmojiPickerListItem = EmojiSpacer | Emoji | HeaderEmoji; type EmojiPickerList = EmojiPickerListItem[]; @@ -201,8 +201,8 @@ function containsOnlyEmojis(message: string): boolean { /** * Get the header emojis with their code, icon and index */ -function getHeaderEmojis(emojis: EmojiPickerList): HeaderIndice[] { - const headerIndices: HeaderIndice[] = []; +function getHeaderEmojis(emojis: EmojiPickerList): HeaderIndices[] { + const headerIndices: HeaderIndices[] = []; emojis.forEach((emoji, index) => { if (!('header' in emoji)) { return; @@ -674,7 +674,7 @@ function getProcessedText(processedTextArray: TextWithEmoji[], style: StyleProp< ); } -export type {HeaderIndice, EmojiPickerList, EmojiSpacer, EmojiPickerListItem}; +export type {HeaderIndices, EmojiPickerList, EmojiSpacer, EmojiPickerListItem}; export { findEmojiByName, 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 2c11d308cc19..1aa236782b72 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -461,11 +461,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); }; @@ -621,7 +621,7 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie component={MigratedUserWelcomeModalNavigator} /> 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/createRootStackNavigator/GetStateForActionHandlers.ts b/src/libs/Navigation/AppNavigator/createRootStackNavigator/GetStateForActionHandlers.ts index 658332d99294..91599705608b 100644 --- a/src/libs/Navigation/AppNavigator/createRootStackNavigator/GetStateForActionHandlers.ts +++ b/src/libs/Navigation/AppNavigator/createRootStackNavigator/GetStateForActionHandlers.ts @@ -17,7 +17,7 @@ const MODAL_ROUTES_TO_DISMISS: string[] = [ NAVIGATORS.LEFT_MODAL_NAVIGATOR, NAVIGATORS.RIGHT_MODAL_NAVIGATOR, NAVIGATORS.ONBOARDING_MODAL_NAVIGATOR, - NAVIGATORS.FEATURE_TRANING_MODAL_NAVIGATOR, + NAVIGATORS.FEATURE_TRAINING_MODAL_NAVIGATOR, NAVIGATORS.SHARE_MODAL_NAVIGATOR, SCREENS.NOT_FOUND, SCREENS.ATTACHMENTS, diff --git a/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts b/src/libs/Navigation/AppNavigator/createSplitNavigator/SplitRouter.ts index 6643bde53cb4..a83e96cc14a0 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 4fbfbff6ae33..2dbe68cb0b1b 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -235,7 +235,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 e65512895398..98d8e9821768 100644 --- a/src/libs/Navigation/PlatformStackNavigation/types/NavigationBuilder.ts +++ b/src/libs/Navigation/PlatformStackNavigation/types/NavigationBuilder.ts @@ -45,7 +45,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 36d3897afcfc..2e7af106ce0d 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -47,7 +47,7 @@ const config: LinkingOptions['config'] = { }, }, }, - [NAVIGATORS.FEATURE_TRANING_MODAL_NAVIGATOR]: { + [NAVIGATORS.FEATURE_TRAINING_MODAL_NAVIGATOR]: { screens: { [SCREENS.FEATURE_TRAINING_ROOT]: { path: ROUTES.TRACK_TRAINING_MODAL, @@ -175,7 +175,7 @@ const config: LinkingOptions['config'] = { exact: true, }, [SCREENS.SETTINGS.WALLET.DOMAIN_CARD]: { - path: ROUTES.SETTINGS_WALLET_DOMAINCARD.route, + path: ROUTES.SETTINGS_WALLET_DOMAIN_CARD.route, exact: true, }, [SCREENS.SETTINGS.WALLET.REPORT_VIRTUAL_CARD_FRAUD]: { @@ -555,10 +555,10 @@ const config: LinkingOptions['config'] = { path: ROUTES.WORKSPACE_OVERVIEW_DESCRIPTION.route, }, [SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_FREQUENCY]: { - path: ROUTES.WORKSPACE_WORKFLOWS_AUTOREPORTING_FREQUENCY.route, + path: ROUTES.WORKSPACE_WORKFLOWS_AUTO_REPORTING_FREQUENCY.route, }, [SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET]: { - path: ROUTES.WORKSPACE_WORKFLOWS_AUTOREPORTING_MONTHLY_OFFSET.route, + path: ROUTES.WORKSPACE_WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET.route, }, [SCREENS.WORKSPACE.SHARE]: { path: ROUTES.WORKSPACE_OVERVIEW_SHARE.route, @@ -717,31 +717,31 @@ const config: LinkingOptions['config'] = { }, }, [SCREENS.WORKSPACE.CATEGORY_DEFAULT_TAX_RATE]: { - path: ROUTES.WORSKPACE_CATEGORY_DEFAULT_TAX_RATE.route, + path: ROUTES.WORKSPACE_CATEGORY_DEFAULT_TAX_RATE.route, parse: { categoryName: (categoryName: string) => decodeURIComponent(categoryName), }, }, [SCREENS.WORKSPACE.CATEGORY_FLAG_AMOUNTS_OVER]: { - path: ROUTES.WORSKPACE_CATEGORY_FLAG_AMOUNTS_OVER.route, + path: ROUTES.WORKSPACE_CATEGORY_FLAG_AMOUNTS_OVER.route, parse: { categoryName: (categoryName: string) => decodeURIComponent(categoryName), }, }, [SCREENS.WORKSPACE.CATEGORY_DESCRIPTION_HINT]: { - path: ROUTES.WORSKPACE_CATEGORY_DESCRIPTION_HINT.route, + path: ROUTES.WORKSPACE_CATEGORY_DESCRIPTION_HINT.route, parse: { categoryName: (categoryName: string) => decodeURIComponent(categoryName), }, }, [SCREENS.WORKSPACE.CATEGORY_APPROVER]: { - path: ROUTES.WORSKPACE_CATEGORY_APPROVER.route, + path: ROUTES.WORKSPACE_CATEGORY_APPROVER.route, parse: { categoryName: (categoryName: string) => decodeURIComponent(categoryName), }, }, [SCREENS.WORKSPACE.CATEGORY_REQUIRE_RECEIPTS_OVER]: { - path: ROUTES.WORSKPACE_CATEGORY_REQUIRE_RECEIPTS_OVER.route, + path: ROUTES.WORKSPACE_CATEGORY_REQUIRE_RECEIPTS_OVER.route, parse: { categoryName: (categoryName: string) => decodeURIComponent(categoryName), }, @@ -879,7 +879,7 @@ const config: LinkingOptions['config'] = { path: ROUTES.SETTINGS_EXIT_SURVEY_REASON.route, }, [SCREENS.SETTINGS.EXIT_SURVEY.BOOK_CALL]: { - path: ROUTES.SETTINGS_EXIT_SURVERY_BOOK_CALL.route, + path: ROUTES.SETTINGS_EXIT_SURVEY_BOOK_CALL.route, }, [SCREENS.SETTINGS.EXIT_SURVEY.RESPONSE]: { path: ROUTES.SETTINGS_EXIT_SURVEY_RESPONSE.route, @@ -1151,10 +1151,10 @@ const config: LinkingOptions['config'] = { [SCREENS.RIGHT_MODAL.DOMAIN_CARD]: { screens: { [SCREENS.DOMAIN_CARD.DOMAIN_CARD_DETAIL]: { - path: ROUTES.SETTINGS_DOMAINCARD_DETAIL.route, + path: ROUTES.SETTINGS_DOMAIN_CARD_DETAIL.route, }, [SCREENS.DOMAIN_CARD.DOMAIN_CARD_REPORT_FRAUD]: { - path: ROUTES.SETTINGS_DOMAINCARD_REPORT_FRAUD.route, + path: ROUTES.SETTINGS_DOMAIN_CARD_REPORT_FRAUD.route, }, }, }, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 20313e1aef0c..6a173dc7d744 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -1834,7 +1834,7 @@ type AuthScreensParamList = SharedScreensParamList & { [NAVIGATORS.LEFT_MODAL_NAVIGATOR]: NavigatorScreenParams; [NAVIGATORS.RIGHT_MODAL_NAVIGATOR]: NavigatorScreenParams; [NAVIGATORS.ONBOARDING_MODAL_NAVIGATOR]: NavigatorScreenParams; - [NAVIGATORS.FEATURE_TRANING_MODAL_NAVIGATOR]: NavigatorScreenParams; + [NAVIGATORS.FEATURE_TRAINING_MODAL_NAVIGATOR]: NavigatorScreenParams; [NAVIGATORS.WELCOME_VIDEO_MODAL_NAVIGATOR]: NavigatorScreenParams; [NAVIGATORS.EXPLANATION_MODAL_NAVIGATOR]: NavigatorScreenParams; [NAVIGATORS.MIGRATED_USER_MODAL_NAVIGATOR]: NavigatorScreenParams; diff --git a/src/libs/Network/enhanceParameters.ts b/src/libs/Network/enhanceParameters.ts index 1806726fdabb..886a704bcd8e 100644 --- a/src/libs/Network/enhanceParameters.ts +++ b/src/libs/Network/enhanceParameters.ts @@ -1,10 +1,10 @@ import Onyx from 'react-native-onyx'; -import * as Environment from '@libs/Environment/Environment'; +import {isDevelopment} from '@libs/Environment/Environment'; import getPlatform from '@libs/getPlatform'; import CONFIG from '@src/CONFIG'; import ONYXKEYS from '@src/ONYXKEYS'; import pkg from '../../../package.json'; -import * as NetworkStore from './NetworkStore'; +import {getAuthToken, getCurrentUserEmail} from './NetworkStore'; // For all requests, we'll send the lastUpdateID that is applied to this client. This will // allow us to calculate previousUpdateID faster. @@ -43,12 +43,12 @@ export default function enhanceParameters(command: string, parameters: Record 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 2a3b711f352b..d0b60e18df3d 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -279,7 +279,7 @@ type OrderOptionsConfig = }; type OrderReportOptionsConfig = { - preferChatroomsOverThreads?: boolean; + preferChatRoomsOverThreads?: boolean; preferPolicyExpenseChat?: boolean; preferRecentExpenseReports?: boolean; }; @@ -769,7 +769,7 @@ function getLastMessageTextForReport(report: OnyxEntry, lastActorDetails lastMessageTextFromReport = getDowngradeWorkspaceMessage(); } else if (isActionableAddPaymentCard(lastReportAction) || isActionOfType(lastReportAction, CONST.REPORT.ACTIONS.TYPE.CHANGE_POLICY)) { lastMessageTextFromReport = getReportActionMessageText(lastReportAction); - } else if (lastReportAction?.actionName === 'EXPORTINTEGRATION') { + } else if (lastReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION) { lastMessageTextFromReport = getExportIntegrationLastMessageText(lastReportAction); } else if (lastReportAction?.actionName && isOldDotReportAction(lastReportAction)) { lastMessageTextFromReport = getMessageOfOldDotReportAction(lastReportAction, false); @@ -1172,7 +1172,7 @@ function orderReportOptions(options: OptionData[]) { function orderReportOptionsWithSearch( options: OptionData[], searchValue: string, - {preferChatroomsOverThreads = false, preferPolicyExpenseChat = false, preferRecentExpenseReports = false}: OrderReportOptionsConfig = {}, + {preferChatRoomsOverThreads = false, preferPolicyExpenseChat = false, preferRecentExpenseReports = false}: OrderReportOptionsConfig = {}, ) { const orderedByDate = orderReportOptions(options); @@ -1194,7 +1194,7 @@ function orderReportOptionsWithSearch( if (preferRecentExpenseReports && option.isPolicyExpenseChat) { return 1; } - if (preferChatroomsOverThreads && option.isThread) { + if (preferChatRoomsOverThreads && option.isThread) { return 4; } if (!!option.isChatRoom || option.private_isArchived) { @@ -1949,7 +1949,7 @@ function shouldOptionShowTooltip(option: OptionData): boolean { */ function formatSectionsFromSearchTerm( searchTerm: string, - selectedOptions: OptionData[], + selectedOptions: Option[], filteredRecentReports: OptionData[], filteredPersonalDetails: OptionData[], personalDetails: OnyxEntry = {}, diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index b57ae95aad81..beb9801ece2b 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -74,7 +74,7 @@ function getDisplayNameOrDefault(passedPersonalDetails?: Partial | SearchPolicy): string { } function getRuleApprovers(policy: OnyxEntry | SearchPolicy, expenseReport: OnyxEntry) { - const categoryAppovers: string[] = []; + const categoryApprovers: string[] = []; const tagApprovers: string[] = []; const allReportTransactions = getAllSortedTransactions(expenseReport?.reportID); @@ -599,10 +599,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) { @@ -610,7 +610,7 @@ function getRuleApprovers(policy: OnyxEntry | SearchPolicy, expenseRepor } } - return [...categoryAppovers, ...tagApprovers]; + return [...categoryApprovers, ...tagApprovers]; } function getManagerAccountID(policy: OnyxEntry | SearchPolicy, expenseReport: OnyxEntry) { @@ -1377,7 +1377,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, @@ -1540,7 +1540,7 @@ export { getDescriptionForPolicyDomainCard, isWorkspaceEligibleForReportChange, getManagerAccountID, - isPrefferedExporter, + isPreferredExporter, isAutoSyncEnabled, areAllGroupPoliciesExpenseChatDisabled, }; diff --git a/src/libs/PopoverWithMeasuredContentUtils.ts b/src/libs/PopoverWithMeasuredContentUtils.ts index 0bef469744dc..0fa209a501b6 100644 --- a/src/libs/PopoverWithMeasuredContentUtils.ts +++ b/src/libs/PopoverWithMeasuredContentUtils.ts @@ -33,22 +33,22 @@ function computeHorizontalShift(anchorLeftEdge: number, menuWidth: number, windo * @param menuHeight - The height of the menu itself. * @param windowHeight - The height of the Window. * @param anchorHeight - The height of anchor component - * @param shoudSwitchPositionIfOverflow - + * @param shouldSwitchPositionIfOverflow - */ -function computeVerticalShift(anchorTopEdge: number, menuHeight: number, windowHeight: number, anchorHeight: number, shoudSwitchPositionIfOverflow = false): number { +function computeVerticalShift(anchorTopEdge: number, menuHeight: number, windowHeight: number, anchorHeight: number, shouldSwitchPositionIfOverflow = false): number { const popoverBottomEdge = anchorTopEdge + menuHeight; let canSwitchPosition = false; if (anchorTopEdge < 0) { // Anchor is in top window Edge, shift bottom by a multiple of four. canSwitchPosition = popoverBottomEdge + menuHeight + anchorHeight <= windowHeight; - return roundToNearestMultipleOfFour(shoudSwitchPositionIfOverflow && canSwitchPosition ? menuHeight + anchorHeight : 0 - anchorTopEdge); + return roundToNearestMultipleOfFour(shouldSwitchPositionIfOverflow && canSwitchPosition ? menuHeight + anchorHeight : 0 - anchorTopEdge); } if (popoverBottomEdge > windowHeight) { // Anchor is in Bottom window Edge, shift top by a multiple of four. canSwitchPosition = anchorTopEdge - menuHeight - anchorHeight >= 0; - return roundToNearestMultipleOfFour(shoudSwitchPositionIfOverflow && canSwitchPosition ? -(menuHeight + anchorHeight) : windowHeight - popoverBottomEdge); + return roundToNearestMultipleOfFour(shouldSwitchPositionIfOverflow && canSwitchPosition ? -(menuHeight + anchorHeight) : windowHeight - popoverBottomEdge); } // Anchor is not in the gutter, so no need to shift it vertically 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 d6d1da3297df..500185b75fbc 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; @@ -98,5 +98,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 0bdf07d03435..be1b318e253e 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -240,8 +240,8 @@ function isCreatedTaskReportAction(reportAction: OnyxInputOrEntry) return isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT) && !!getOriginalMessage(reportAction)?.taskReportID; } -function isTripPreview(reportAction: OnyxInputOrEntry): reportAction is ReportAction { - return isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.TRIPPREVIEW); +function isTripPreview(reportAction: OnyxInputOrEntry): reportAction is ReportAction { + return isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.TRIP_PREVIEW); } function isActionOfType( @@ -1216,8 +1216,8 @@ function getOneTransactionThreadReportID( iouRequestTypes.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 @@ -1755,7 +1755,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}`); } @@ -2138,7 +2138,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) ?? {}; @@ -2281,7 +2281,7 @@ function getCardIssuedMessage({ const cardID = cardIssuedActionOriginalMessage?.cardID ?? CONST.DEFAULT_NUMBER_ID; const isPolicyAdmin = isPolicyAdminPolicyUtils(getPolicy(policyID)); const assignee = shouldRenderHTML ? `` : Parser.htmlToText(``); - const navigateRoute = isPolicyAdmin ? ROUTES.EXPENSIFY_CARD_DETAILS.getRoute(policyID, String(cardID)) : ROUTES.SETTINGS_DOMAINCARD_DETAIL.getRoute(String(cardID)); + const navigateRoute = isPolicyAdmin ? ROUTES.EXPENSIFY_CARD_DETAILS.getRoute(policyID, String(cardID)) : ROUTES.SETTINGS_DOMAIN_CARD_DETAIL.getRoute(String(cardID)); const expensifyCardLink = shouldRenderHTML && !!card ? `${translateLocal('cardPage.expensifyCard')}` : translateLocal('cardPage.expensifyCard'); const companyCardLink = shouldRenderHTML @@ -2471,7 +2471,7 @@ export { getWorkspaceUpdateFieldMessage, getWorkspaceCurrencyUpdateMessage, getWorkspaceFrequencyUpdateMessage, - getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage, + getPolicyChangeLogMaxExpenseAmountNoReceiptMessage, getPolicyChangeLogMaxExpenseAmountMessage, getPolicyChangeLogDefaultBillableMessage, getPolicyChangeLogDefaultTitleEnforcedMessage, diff --git a/src/libs/ReportPrimaryActionUtils.ts b/src/libs/ReportPrimaryActionUtils.ts index 16a755427a3e..5e7276d0f5a5 100644 --- a/src/libs/ReportPrimaryActionUtils.ts +++ b/src/libs/ReportPrimaryActionUtils.ts @@ -4,7 +4,7 @@ import CONST from '@src/CONST'; import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx'; import {isApprover as isApproverUtils} from './actions/Policy/Member'; import {getCurrentUserAccountID} from './actions/Report'; -import {arePaymentsEnabled as arePaymentsEnabledUtils, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPrefferedExporter} from './PolicyUtils'; +import {arePaymentsEnabled as arePaymentsEnabledUtils, getCorrectedAutoReportingFrequency, hasAccountingConnections, isAutoSyncEnabled, isPreferredExporter} from './PolicyUtils'; import { isClosedReport as isClosedReportUtils, isCurrentUserSubmitter, @@ -80,7 +80,7 @@ function isExportAction(report: Report, policy: Policy) { 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 80545b4404e6..77c41dbcec02 100644 --- a/src/libs/ReportSecondaryActionUtils.ts +++ b/src/libs/ReportSecondaryActionUtils.ts @@ -10,7 +10,7 @@ import { hasAccountingConnections, hasNoPolicyOtherThanPersonalType, isAutoSyncEnabled, - isPrefferedExporter, + isPreferredExporter, } from './PolicyUtils'; import {getIOUActionForReportID, getReportActions, isPayAction} from './ReportActionsUtils'; import { @@ -192,7 +192,7 @@ function isMarkAsExportedAction(report: Report, policy: Policy): boolean { return true; } - const isExporter = isPrefferedExporter(policy); + const isExporter = isPreferredExporter(policy); if (isExporter && isReportFinished && hasAccountingConnection && !syncEnabled) { return true; diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index cf038524e37e..b77d9e5287ff 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -68,7 +68,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'; @@ -137,7 +137,7 @@ import { getOriginalMessage, getPolicyChangeLogDefaultBillableMessage, getPolicyChangeLogDefaultTitleEnforcedMessage, - getPolicyChangeLogMaxExpesnseAmountNoReceiptMessage, + getPolicyChangeLogMaxExpenseAmountNoReceiptMessage, getReportAction, getReportActionHtml, getReportActionMessage as getReportActionMessageReportUtils, @@ -1168,7 +1168,7 @@ function getPolicy(policyID: string | undefined): OnyxEntry { /** * Get the policy type from a given report - * @param policies must have Onyxkey prefix (i.e 'policy_') for keys + * @param policies must have OnyxKey prefix (i.e 'policy_') for keys */ function getPolicyType(report: OnyxInputOrEntry, policies: OnyxCollection): string { return policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.type ?? ''; @@ -3798,7 +3798,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 edibility are defined in canEditMoneyRequest method * - It's not pending deletion */ function canEditReportAction(reportAction: OnyxInputOrEntry): boolean { @@ -4616,7 +4616,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)) { @@ -5774,8 +5774,8 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa originalMessage.IOUDetails = {amount, comment, currency}; 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. + // In case of pay someone action, we don't store the comment + // and there is no single transactionID to link the action to. delete originalMessage.IOUTransactionID; delete originalMessage.comment; originalMessage.paymentType = paymentType; @@ -5946,7 +5946,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 { @@ -6086,7 +6086,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(); @@ -9390,7 +9390,7 @@ function prepareOnboardingOnyxData( // Text message const textComment = buildOptimisticAddCommentReportAction(onboardingMessage.message, undefined, actorAccountID, 1); const textCommentAction: OptimisticAddCommentReportAction = textComment.reportAction; - const textMessage: AddCommentOrAttachementParams = { + const textMessage: AddCommentOrAttachmentParams = { reportID: targetChatReportID, reportActionID: textCommentAction.reportActionID, reportComment: textComment.commentText, @@ -9901,7 +9901,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 sign ups 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) @@ -10052,7 +10052,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; } @@ -10169,8 +10169,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/SearchParser/searchParser.peggy b/src/libs/SearchParser/searchParser.peggy index c95674338336..63d03ea92d49 100644 --- a/src/libs/SearchParser/searchParser.peggy +++ b/src/libs/SearchParser/searchParser.peggy @@ -13,7 +13,7 @@ // defaultKey: rule to match pre-defined search syntax fields that are used to update default values, e.g. type, status, etc // identifier: composite rule to match patterns defined by the quotedString and alphanumeric rules -// filter, logicalAnd, operator, alphanumeric, quotedStrig are defined in baseRules.peggy grammar +// filter, logicalAnd, operator, alphanumeric, quotedString are defined in baseRules.peggy grammar // global initializer (code executed only once) {{// CAUTION: DO NOT DIRECTLY ALTER OR MODIFY `searchParser.js` OR `autocompleteParser.js` diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts index 9ca5176bc877..3855066646b8 100644 --- a/src/libs/SearchQueryUtils.ts +++ b/src/libs/SearchQueryUtils.ts @@ -39,6 +39,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', @@ -68,7 +69,7 @@ const UserFriendlyKeyMap: Record taxRate.name); - return sortedtaxRates; + const sortedTaxRates = lodashSortBy(taxRates, (taxRate) => taxRate.name); + return sortedTaxRates; } /** @@ -68,7 +68,7 @@ function getTaxRatesSection({ }): TaxSection[] { const policyRatesSections = []; - const taxes = TransactionUtils.transformedTaxRates(policy, transaction); + const taxes = transformedTaxRates(policy, transaction); const sortedTaxRates = sortTaxRates(taxes); const selectedOptionNames = selectedOptions.map((selectedOption) => selectedOption.modifiedName); @@ -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 ef568db066a2..547ac8e8709d 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 re-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); @@ -902,8 +902,8 @@ function shouldShowBrokenConnectionViolationForMultipleTransactions( return shouldShowBrokenConnectionViolationInternal(brokenConnectionViolations, report, policy); } -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 3010072b8182..320cf62d66bc 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 put 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 739513e110c0..fc9bac2a3f6c 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -386,7 +386,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/Delegate.ts b/src/libs/actions/Delegate.ts index 2f376b4eca28..599aacd1b3bc 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 c80569fde982..7923303d66df 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -1023,14 +1023,14 @@ function updateSubrate(transaction: OnyxEntry, currentInd if (index === -1) { return; } - const existingSubrates = transaction?.comment?.customUnit?.subRates ?? []; + const existingSubRates = transaction?.comment?.customUnit?.subRates ?? []; - if (index >= existingSubrates.length) { + if (index >= existingSubRates.length) { return; } - const newSubrates = [...existingSubrates]; - newSubrates.splice(index, 1, {quantity, id, name, rate}); + const newSubRates = [...existingSubRates]; + newSubRates.splice(index, 1, {quantity, id, name, rate}); // Onyx.merge won't remove the null nested object values, this is a workaround // to remove nested keys while also preserving other object keys @@ -1042,7 +1042,7 @@ function updateSubrate(transaction: OnyxEntry, currentInd ...transaction?.comment, customUnit: { ...transaction?.comment?.customUnit, - subRates: newSubrates, + subRates: newSubRates, quantity: null, }, }, @@ -1051,7 +1051,7 @@ function updateSubrate(transaction: OnyxEntry, currentInd Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transaction?.transactionID}`, newTransaction); } -function clearSubrates(transactionID: string) { +function clearSubRates(transactionID: string) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {comment: {customUnit: {subRates: []}}}); } @@ -1061,14 +1061,14 @@ function addSubrate(transaction: OnyxEntry, currentIndex: if (index === -1) { return; } - const existingSubrates = transaction?.comment?.customUnit?.subRates ?? []; + const existingSubRates = transaction?.comment?.customUnit?.subRates ?? []; - if (index !== existingSubrates.length) { + if (index !== existingSubRates.length) { return; } - const newSubrates = [...existingSubrates]; - newSubrates.push({quantity, id, name, rate}); + const newSubRates = [...existingSubRates]; + newSubRates.push({quantity, id, name, rate}); // Onyx.merge won't remove the null nested object values, this is a workaround // to remove nested keys while also preserving other object keys @@ -1080,7 +1080,7 @@ function addSubrate(transaction: OnyxEntry, currentIndex: ...transaction?.comment, customUnit: { ...transaction?.comment?.customUnit, - subRates: newSubrates, + subRates: newSubRates, quantity: null, }, }, @@ -2858,7 +2858,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({ @@ -2990,7 +2990,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({ @@ -3241,7 +3241,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({ @@ -3497,7 +3497,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}`]; @@ -3778,7 +3778,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 isTotalUndetermined = calculatedDiffAmount === null; const diff = calculatedDiffAmount ?? 0; let updatedMoneyRequestReport: OnyxTypes.OnyxInputOrEntry; @@ -3817,7 +3817,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, ...(isTotalUndetermined && {pendingFields: {total: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}})}, }, { onyxMethod: Onyx.METHOD.MERGE, @@ -3837,7 +3837,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, ...(isTotalUndetermined && {pendingFields: {total: null}})}, }); // Optimistically modify the transaction and the transaction thread @@ -3928,7 +3928,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))) { @@ -3973,7 +3973,7 @@ function getUpdateMoneyRequestParams( failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`, - value: {...iouReport, ...(isTotalIndeterministic && {pendingFields: {total: null}})}, + value: {...iouReport, ...(isTotalUndetermined && {pendingFields: {total: null}})}, }); } @@ -5513,7 +5513,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'), @@ -6123,7 +6123,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 @@ -6131,7 +6131,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, @@ -9769,7 +9769,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; @@ -10096,7 +10096,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, @@ -10555,7 +10555,7 @@ export { removeSubrate, addSubrate, updateSubrate, - clearSubrates, + clearSubRates, setDraftSplitTransaction, setIndividualShare, setMoneyRequestAmount, 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 bf7814acc76f..5aaed77439f1 100644 --- a/src/libs/actions/OnyxDerived/configs/conciergeChatReportID.ts +++ b/src/libs/actions/OnyxDerived/configs/conciergeChatReportID.ts @@ -12,7 +12,7 @@ export default createOnyxDerivedValueConfig({ } const conciergeReport = Object.values(reports).find((report) => { - // 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) || isArchivedReportWithID(report?.reportID)) { return false; } diff --git a/src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts b/src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts index 8b3bf5d9af86..2d28cf5a9ef9 100644 --- a/src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts +++ b/src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts @@ -1,12 +1,12 @@ import Onyx from 'react-native-onyx'; import type {DeferredUpdatesDictionary} from '@libs/actions/OnyxUpdateManager/types'; -import * as SequentialQueue from '@libs/Network/SequentialQueue'; +import {pause, unpause} from '@libs/Network/SequentialQueue'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {OnyxUpdatesFromServer, Response} from '@src/types/onyx'; import {isValidOnyxUpdateFromServer} from '@src/types/onyx/OnyxUpdatesFromServer'; // eslint-disable-next-line import/no-cycle -import * as OnyxUpdateManagerUtils from '.'; +import {validateAndApplyDeferredUpdates} from '.'; let missingOnyxUpdatesQueryPromise: Promise | undefined; let deferredUpdates: DeferredUpdatesDictionary = {}; @@ -26,7 +26,7 @@ function setMissingOnyxUpdatesQueryPromise(promise: Promise OnyxUpdateManagerUtils.validateAndApplyDeferredUpdates); + missingOnyxUpdatesQueryPromise.finally(() => validateAndApplyDeferredUpdates); } - missingOnyxUpdatesQueryPromise = OnyxUpdateManagerUtils.validateAndApplyDeferredUpdates(); + missingOnyxUpdatesQueryPromise = validateAndApplyDeferredUpdates(); } type EnqueueDeferredOnyxUpdatesOptions = { @@ -78,7 +78,7 @@ type EnqueueDeferredOnyxUpdatesOptions = { */ function enqueue(updates: OnyxUpdatesFromServer | DeferredUpdatesDictionary, options?: EnqueueDeferredOnyxUpdatesOptions) { if (options?.shouldPauseSequentialQueue ?? true) { - SequentialQueue.pause(); + pause(); } // We check here if the "updates" param is a single update. @@ -126,7 +126,7 @@ function clear(options?: ClearDeferredOnyxUpdatesOptions) { if (options?.shouldUnpauseSequentialQueue ?? true) { Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); - SequentialQueue.unpause(); + unpause(); } } diff --git a/src/libs/actions/PersistedRequests.ts b/src/libs/actions/PersistedRequests.ts index c4df73067659..ad2e3285ba7c 100644 --- a/src/libs/actions/PersistedRequests.ts +++ b/src/libs/actions/PersistedRequests.ts @@ -134,7 +134,7 @@ function rollbackOngoingRequest() { } // Prepend ongoingRequest to persistedRequests - persistedRequests.unshift({...ongoingRequest, isRollbacked: true}); + persistedRequests.unshift({...ongoingRequest, isRollback: true}); // Clear the ongoingRequest ongoingRequest = null; diff --git a/src/libs/actions/PersonalDetails.ts b/src/libs/actions/PersonalDetails.ts index c45eea5fd3d8..cbdfd38ce57a 100644 --- a/src/libs/actions/PersonalDetails.ts +++ b/src/libs/actions/PersonalDetails.ts @@ -175,7 +175,7 @@ function updateDateOfBirth({dob}: DateOfBirthForm) { Navigation.goBack(); } -function updatePhoneNumber(phoneNumber: string, currenPhoneNumber: string) { +function updatePhoneNumber(phoneNumber: string, currentPhoneNumber: string) { const parameters: UpdatePhoneNumberParams = {phoneNumber}; API.write(WRITE_COMMANDS.UPDATE_PHONE_NUMBER, parameters, { optimisticData: [ @@ -192,7 +192,7 @@ function updatePhoneNumber(phoneNumber: string, currenPhoneNumber: string) { onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.PRIVATE_PERSONAL_DETAILS, value: { - phoneNumber: currenPhoneNumber, + phoneNumber: currentPhoneNumber, errorFields: { phoneNumber: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('privatePersonalDetails.error.invalidPhoneNumber'), }, @@ -260,9 +260,9 @@ function updateAutomaticTimezone(timezone: Timezone) { return; } - const formatedTimezone = DateUtils.formatToSupportedTimezone(timezone); + const formattedTimezone = DateUtils.formatToSupportedTimezone(timezone); const parameters: UpdateAutomaticTimezoneParams = { - timezone: JSON.stringify(formatedTimezone), + timezone: JSON.stringify(formattedTimezone), }; API.write(WRITE_COMMANDS.UPDATE_AUTOMATIC_TIMEZONE, parameters, { @@ -272,7 +272,7 @@ function updateAutomaticTimezone(timezone: Timezone) { key: ONYXKEYS.PERSONAL_DETAILS_LIST, value: { [currentUserAccountID]: { - timezone: formatedTimezone, + timezone: formattedTimezone, }, }, }, diff --git a/src/libs/actions/Policy/Category.ts b/src/libs/actions/Policy/Category.ts index 2e0a57c7e6f3..9f83cf098865 100644 --- a/src/libs/actions/Policy/Category.ts +++ b/src/libs/actions/Policy/Category.ts @@ -235,8 +235,8 @@ function updateImportSpreadsheetData(categoriesLength: number) { value: { shouldFinalModalBeOpened: true, importFinalModal: { - title: translateLocal('spreadsheet.importSuccessfullTitle'), - prompt: translateLocal('spreadsheet.importCategoriesSuccessfullDescription', {categories: categoriesLength}), + title: translateLocal('spreadsheet.importSuccessfulTitle'), + prompt: translateLocal('spreadsheet.importCategoriesSuccessfulDescription', {categories: categoriesLength}), }, }, }, diff --git a/src/libs/actions/Policy/Member.ts b/src/libs/actions/Policy/Member.ts index 65d7a6467c70..819764818beb 100644 --- a/src/libs/actions/Policy/Member.ts +++ b/src/libs/actions/Policy/Member.ts @@ -212,8 +212,8 @@ function updateImportSpreadsheetData(addedMembersLength: number, updatedMembersL value: { shouldFinalModalBeOpened: true, importFinalModal: { - title: translateLocal('spreadsheet.importSuccessfullTitle'), - prompt: translateLocal('spreadsheet.importMembersSuccessfullDescription', {added: addedMembersLength, updated: updatedMembersLength}), + title: translateLocal('spreadsheet.importSuccessfulTitle'), + prompt: translateLocal('spreadsheet.importMembersSuccessfulDescription', {added: addedMembersLength, updated: updatedMembersLength}), }, }, }, diff --git a/src/libs/actions/Policy/PerDiem.ts b/src/libs/actions/Policy/PerDiem.ts index 0afb011805ed..00f29fd9b1a4 100644 --- a/src/libs/actions/Policy/PerDiem.ts +++ b/src/libs/actions/Policy/PerDiem.ts @@ -147,8 +147,8 @@ function updateImportSpreadsheetData(ratesLength: number) { value: { shouldFinalModalBeOpened: true, importFinalModal: { - title: translateLocal('spreadsheet.importSuccessfullTitle'), - prompt: translateLocal('spreadsheet.importPerDiemRatesSuccessfullDescription', {rates: ratesLength}), + title: translateLocal('spreadsheet.importSuccessfulTitle'), + prompt: translateLocal('spreadsheet.importPerDiemRatesSuccessfulDescription', {rates: ratesLength}), }, }, }, diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index e74164eb0acd..9a2e2c0932b9 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -480,7 +480,10 @@ function deleteWorkspace(policyID: string, policyName: string) { } } -function setWorkspaceAutoReportingFrequency(policyID: string, frequency: ValueOf) { +function setWorkspaceAutoReportingFrequency(policyID: string | undefined, frequency: ValueOf) { + if (!policyID) { + return; + } const policy = getPolicy(policyID); const wasPolicyOnManualReporting = PolicyUtils.getCorrectedAutoReportingFrequency(policy) === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL; @@ -540,7 +543,10 @@ function setWorkspaceAutoReportingFrequency(policyID: string, frequency: ValueOf API.write(WRITE_COMMANDS.SET_WORKSPACE_AUTO_REPORTING_FREQUENCY, params, {optimisticData, failureData, successData}); } -function setWorkspaceAutoReportingMonthlyOffset(policyID: string, autoReportingOffset: number | ValueOf) { +function setWorkspaceAutoReportingMonthlyOffset(policyID: string | undefined, autoReportingOffset: number | ValueOf) { + if (!policyID) { + return; + } const value = JSON.stringify({autoReportingOffset}); const policy = getPolicy(policyID); @@ -691,7 +697,10 @@ function clearQBOErrorField(policyID: string | undefined, fieldName: string) { Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {connections: {quickbooksOnline: {config: {errorFields: {[fieldName]: null}}}}}); } -function clearQBDErrorField(policyID: string, fieldName: string) { +function clearQBDErrorField(policyID: string | undefined, fieldName: string) { + if (!policyID) { + return; + } Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {connections: {quickbooksDesktop: {config: {errorFields: {[fieldName]: null}}}}}); } @@ -3315,7 +3324,7 @@ function enablePolicyWorkflows(policyID: string, enabled: boolean) { const parameters: EnablePolicyWorkflowsParams = {policyID, enabled}; - // When disabling workflows, set autoreporting back to "immediately" + // When disabling workflows, set autoReporting back to "immediately" if (!enabled) { setWorkspaceAutoReportingFrequency(policyID, CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT); } @@ -4112,7 +4121,7 @@ function updateCustomRules(policyID: string, customRules: string) { /** * Call the API to enable or disable the billable mode for the given policy - * @param policyID - id of the policy to enable or disable the bilable mode + * @param policyID - id of the policy to enable or disable the billable mode * @param defaultBillable - whether the billable mode is enabled in the given policy */ function setPolicyBillableMode(policyID: string, defaultBillable: boolean) { @@ -4178,7 +4187,7 @@ function setPolicyBillableMode(policyID: string, defaultBillable: boolean) { /** * Call the API to disable the billable mode for the given policy - * @param policyID - id of the policy to enable or disable the bilable mode + * @param policyID - id of the policy to enable or disable the billable mode */ function disableWorkspaceBillableExpenses(policyID: string) { const policy = getPolicy(policyID); @@ -4277,7 +4286,7 @@ function setWorkspaceEReceiptsEnabled(policyID: string, eReceipts: boolean) { eReceipts, }; - API.write(WRITE_COMMANDS.SET_WORKSPACE_ERECEIPTS_ENABLED, parameters, onyxData); + API.write(WRITE_COMMANDS.SET_WORKSPACE_E_RECEIPTS_ENABLED, parameters, onyxData); } function getAdminPolicies(): Policy[] { diff --git a/src/libs/actions/Policy/Tag.ts b/src/libs/actions/Policy/Tag.ts index d5290ff41fa3..61b46ef38097 100644 --- a/src/libs/actions/Policy/Tag.ts +++ b/src/libs/actions/Policy/Tag.ts @@ -5,7 +5,7 @@ import * as API from '@libs/API'; import type { EnablePolicyTagsParams, OpenPolicyTagsPageParams, - RenamePolicyTaglistParams, + RenamePolicyTagListParams, RenamePolicyTagsParams, SetPolicyTagApproverParams, SetPolicyTagsEnabled, @@ -97,7 +97,7 @@ Onyx.connect({ function openPolicyTagsPage(policyID: string) { if (!policyID) { - Log.warn('openPolicyTasgPage invalid params', {policyID}); + Log.warn('openPolicyTagsPage invalid params', {policyID}); return; } @@ -139,8 +139,8 @@ function updateImportSpreadsheetData(tagsLength: number): OnyxData { value: { shouldFinalModalBeOpened: true, importFinalModal: { - title: translateLocal('spreadsheet.importSuccessfullTitle'), - prompt: translateLocal('spreadsheet.importTagsSuccessfullDescription', {tags: tagsLength}), + title: translateLocal('spreadsheet.importSuccessfulTitle'), + prompt: translateLocal('spreadsheet.importTagsSuccessfulDescription', {tags: tagsLength}), }, }, }, @@ -698,7 +698,7 @@ function enablePolicyTags(policyID: string, enabled: boolean) { } } -function renamePolicyTaglist(policyID: string, policyTagListName: {oldName: string; newName: string}, policyTags: OnyxEntry, 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] ?? {}; @@ -738,7 +738,7 @@ function renamePolicyTaglist(policyID: string, policyTagListName: {oldName: stri }, ], }; - const parameters: RenamePolicyTaglistParams = { + const parameters: RenamePolicyTagListParams = { policyID, oldName, newName, @@ -1058,7 +1058,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 b3cbb7406346..9ef752b02782 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, @@ -209,7 +209,7 @@ type Video = { height: number; }; -type TaskMessage = Required>; +type TaskMessage = Required>; type TaskForParameters = | { @@ -229,12 +229,12 @@ type TaskForParameters = } & TaskMessage); type GuidedSetupData = Array< - | ({type: 'message'} & AddCommentOrAttachementParams) + | ({type: 'message'} & AddCommentOrAttachmentParams) | TaskForParameters | ({ type: 'video'; } & Video & - AddCommentOrAttachementParams) + AddCommentOrAttachmentParams) >; type ReportError = { @@ -661,7 +661,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, @@ -1745,13 +1745,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 @@ -2100,7 +2100,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 @@ -2165,7 +2165,7 @@ function updateReportName(reportID: string, value: string, previousValue: string reportName: null, }, errorFields: { - reportName: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('report.genericUpdateReporNameEditFailureMessage'), + reportName: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('report.genericUpdateReportNameEditFailureMessage'), }, }, }, @@ -3224,7 +3224,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(); @@ -4418,7 +4418,7 @@ function exportReportToPDF({reportID}: ExportReportPDFParams) { const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.SET, - key: `${ONYXKEYS.COLLECTION.NVP_EXPENSIFY_REPORT_PDFFILENAME}${reportID}`, + key: `${ONYXKEYS.COLLECTION.NVP_EXPENSIFY_REPORT_PDF_FILENAME}${reportID}`, value: null, }, ]; @@ -4426,7 +4426,7 @@ function exportReportToPDF({reportID}: ExportReportPDFParams) { const failureData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.NVP_EXPENSIFY_REPORT_PDFFILENAME}${reportID}`, + key: `${ONYXKEYS.COLLECTION.NVP_EXPENSIFY_REPORT_PDF_FILENAME}${reportID}`, value: 'error', }, ]; @@ -5013,7 +5013,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); @@ -5065,7 +5065,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/RequestConflictUtils.ts b/src/libs/actions/RequestConflictUtils.ts index 0fc423d84e61..1cbeb2eb82de 100644 --- a/src/libs/actions/RequestConflictUtils.ts +++ b/src/libs/actions/RequestConflictUtils.ts @@ -119,7 +119,7 @@ function resolveCommentDeletionConflicts(persistedRequests: OnyxRequest[], repor // If we find a new message, we probably want to remove it and not perform any request given that the server // doesn't know about it yet. - if (addNewMessage.has(request.command) && !request.isRollbacked) { + if (addNewMessage.has(request.command) && !request.isRollback) { addCommentFound = true; commentCouldBeThread[reportActionID] = commentIndicesToDelete.length; } 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 5e25d4005f3c..2e8d1cea7078 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -137,7 +137,7 @@ function setSupportAuthToken(supportAuthToken: string, email: string, accountID: accountID, creationDate: new Date().getTime(), }).then(() => { - Log.info('[Supportal] Authtoken set'); + Log.info('[Supportal] AuthToken set'); }); Onyx.set(ONYXKEYS.LAST_VISITED_PATH, ''); } @@ -287,7 +287,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 = { @@ -646,7 +646,7 @@ function signInAfterTransitionFromOldDot(hybridAppSettings: string) { [ONYXKEYS.SESSION]: {email, authToken, encryptedAuthToken: decodeURIComponent(encryptedAuthToken), accountID: Number(accountID)}, [ONYXKEYS.CREDENTIALS]: {autoGeneratedLogin, autoGeneratedPassword}, [ONYXKEYS.IS_SINGLE_NEW_DOT_ENTRY]: isSingleNewDotEntry, - [ONYXKEYS.NVP_TRYNEWDOT]: { + [ONYXKEYS.NVP_TRY_NEW_DOT]: { classicRedirect: {completedHybridAppOnboarding}, nudgeMigration: nudgeMigrationTimestamp ? {timestamp: new Date(nudgeMigrationTimestamp)} : undefined, }, @@ -1068,7 +1068,7 @@ function unlinkLogin(accountID: number, validateCode: string) { key: ONYXKEYS.ACCOUNT, value: { isLoading: false, - message: 'unlinkLoginForm.succesfullyUnlinkedLogin', + message: 'unlinkLoginForm.successfullyUnlinkedLogin', }, }, { 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 d2f996c3e965..3772fc01c2f5 100644 --- a/src/libs/actions/Transaction.ts +++ b/src/libs/actions/Transaction.ts @@ -353,11 +353,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) => ReportActionsUtils.getIOUActionForReportID(transaction.reportID, transaction.transactionID)); - const optimisticDissmidedViolationReportActions = transactionsReportActions.map(() => { + const optimisticDismissedViolationReportActions = transactionsReportActions.map(() => { return buildOptimisticDismissedViolationReportAction({reason: 'manual', violationName: CONST.VIOLATIONS.DUPLICATED_TRANSACTION}); }); @@ -365,13 +365,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, }; @@ -394,7 +394,7 @@ function dismissDuplicateTransactionViolation(transactionIDs: string[], dissmiss ...transaction.comment, dismissedViolations: { duplicatedTransaction: { - [dissmissedPersonalDetails.login ?? '']: getUnixTime(new Date()), + [dismissedPersonalDetails.login ?? '']: getUnixTime(new Date()), }, }, }, @@ -418,13 +418,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, }; @@ -435,13 +435,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, }; @@ -453,7 +453,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, { diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index c00f4c91bde0..21fefa4ab5f2 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -90,7 +90,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 @@ -120,9 +120,12 @@ function closeAccount(reason: string) { } /** - * Resends a validation link to a given login + * Re-sends a validation link to a given login */ -function resendValidateCode(login: string) { +function resendValidateCode(login: string | undefined) { + if (!login) { + return; + } sessionResendValidateCode(login); } @@ -282,7 +285,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, { @@ -837,7 +840,7 @@ function playSoundForMessageType(pushJSON: OnyxServerUpdate[]) { for (const data of flatten) { // Someone completes a task - if (data.actionName === 'TASKCOMPLETED') { + if (data.actionName === 'TASK_COMPLETED') { return playSound(SOUNDS.SUCCESS); } } @@ -915,7 +918,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; }); } @@ -953,34 +956,34 @@ 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 PING-PONG] Skipping checkForLatePongReplies because the client is offline'); return; } if (pongHasBeenMissed) { - Log.info(`[Pusher PINGPONG] Skipped checking for late PONG events because a PONG has already been missed`); + Log.info(`[Pusher PING-PONG] Skipped checking for late PONG events because a PONG has already been missed`); return; } - Log.info(`[Pusher PINGPONG] Checking for late PONG events`); + Log.info(`[Pusher PING-PONG] Checking for late PONG events`); const timeSinceLastPongReceived = Date.now() - lastPongReceivedTimestamp; // If the time since the last pong was received is more than 2 * PING_INTERVAL_LENGTH_IN_SECONDS, then record it in the logs if (timeSinceLastPongReceived > NO_EVENT_RECEIVED_TO_BE_OFFLINE_THRESHOLD_IN_SECONDS * 1000) { - Log.info(`[Pusher PINGPONG] The server has not replied to the PING event in ${timeSinceLastPongReceived} ms so going offline`); + Log.info(`[Pusher PING-PONG] The server has not replied to the PING event in ${timeSinceLastPongReceived} ms so going offline`); - // When going offline, reset the pingpong state so that when the network reconnects, the client will start fresh + // When going offline, reset the ping-pong state so that when the network reconnects, the client will start fresh lastPingSentTimestamp = Date.now(); pongHasBeenMissed = true; } else { - Log.info(`[Pusher PINGPONG] Last PONG event was ${timeSinceLastPongReceived} ms ago so not going offline`); + Log.info(`[Pusher PING-PONG] Last PONG event was ${timeSinceLastPongReceived} ms ago so not going offline`); } } let pingPusherIntervalID: ReturnType; -let checkforLatePongRepliesIntervalID: ReturnType; +let checkForLatePongRepliesIntervalID: ReturnType; function initializePusherPingPong() { // Only run the ping pong from the leader client if (!ActiveClientManager.isClientTheLeader()) { @@ -1006,11 +1009,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); } @@ -1044,7 +1047,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/Wallet.ts b/src/libs/actions/Wallet.ts index f9e8ef61f057..cf2e1d86b54b 100644 --- a/src/libs/actions/Wallet.ts +++ b/src/libs/actions/Wallet.ts @@ -154,6 +154,10 @@ function verifyIdentity(parameters: VerifyIdentityParams) { * @param parameters.chatReportID When accepting the terms of wallet to pay an IOU, indicates the parent chat ID of the IOU */ function acceptWalletTerms(parameters: AcceptWalletTermsParams) { + if (!parameters.reportID) { + return; + } + const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, diff --git a/src/libs/actions/Welcome/index.ts b/src/libs/actions/Welcome/index.ts index a98b600e5baf..091054d7015c 100644 --- a/src/libs/actions/Welcome/index.ts +++ b/src/libs/actions/Welcome/index.ts @@ -130,7 +130,7 @@ function completeHybridAppOnboarding() { const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.NVP_TRYNEWDOT, + key: ONYXKEYS.NVP_TRY_NEW_DOT, value: { classicRedirect: { completedHybridAppOnboarding: true, @@ -169,7 +169,7 @@ Onyx.connect({ }); Onyx.connect({ - key: ONYXKEYS.NVP_TRYNEWDOT, + key: ONYXKEYS.NVP_TRY_NEW_DOT, callback: (value) => { tryNewDotData = value; checkTryNewDotDataReady(); diff --git a/src/libs/actions/Welcome/switchToOldDotOnNonMicroCompanySize/index.ts b/src/libs/actions/Welcome/switchToOldDotOnNonMicroCompanySize/index.ts index 3c6a943b502b..0095fca98ec5 100644 --- a/src/libs/actions/Welcome/switchToOldDotOnNonMicroCompanySize/index.ts +++ b/src/libs/actions/Welcome/switchToOldDotOnNonMicroCompanySize/index.ts @@ -14,7 +14,7 @@ const switchToOldDotOnNonMicroCompanySize: SwitchToOldDotOnNonMicroCompanySize = const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.NVP_TRYNEWDOT, + key: ONYXKEYS.NVP_TRY_NEW_DOT, value: { classicRedirect: { dismissed: true, diff --git a/src/libs/actions/connections/NetSuiteCommands.ts b/src/libs/actions/connections/NetSuiteCommands.ts index bf5b2be4b4a0..a4e0a7704e94 100644 --- a/src/libs/actions/connections/NetSuiteCommands.ts +++ b/src/libs/actions/connections/NetSuiteCommands.ts @@ -570,12 +570,15 @@ function updateNetSuiteCrossSubsidiaryCustomersConfiguration(policyID: string, i } function updateNetSuiteCustomSegments( - policyID: string, + policyID: string | undefined, records: NetSuiteCustomSegment[], oldRecords: NetSuiteCustomSegment[], modifiedSegmentID: string, pendingAction: OnyxCommon.PendingAction, ) { + if (!policyID) { + return; + } const onyxData = updateNetSuiteSyncOptionsOnyxData(policyID, CONST.NETSUITE_CONFIG.IMPORT_CUSTOM_FIELDS.CUSTOM_SEGMENTS, records, oldRecords, modifiedSegmentID, pendingAction); API.write( @@ -588,7 +591,16 @@ function updateNetSuiteCustomSegments( ); } -function updateNetSuiteCustomLists(policyID: string, records: NetSuiteCustomList[], oldRecords: NetSuiteCustomList[], modifiedListID: string, pendingAction: OnyxCommon.PendingAction) { +function updateNetSuiteCustomLists( + policyID: string | undefined, + records: NetSuiteCustomList[], + oldRecords: NetSuiteCustomList[], + modifiedListID: string, + pendingAction: OnyxCommon.PendingAction, +) { + if (!policyID) { + return; + } const onyxData = updateNetSuiteSyncOptionsOnyxData(policyID, CONST.NETSUITE_CONFIG.IMPORT_CUSTOM_FIELDS.CUSTOM_LISTS, records, oldRecords, modifiedListID, pendingAction); API.write( WRITE_COMMANDS.UPDATE_NETSUITE_CUSTOM_LISTS, diff --git a/src/libs/actions/connections/QuickbooksDesktop.ts b/src/libs/actions/connections/QuickbooksDesktop.ts index 1ab53e12b772..b34e38e96fe7 100644 --- a/src/libs/actions/connections/QuickbooksDesktop.ts +++ b/src/libs/actions/connections/QuickbooksDesktop.ts @@ -378,9 +378,12 @@ function updateQuickbooksDesktopShouldAutoCreateVendor( - policyID: string, + policyID: string | undefined, settingValue: TSettingValue, ) { + if (!policyID) { + return; + } const onyxData = buildOnyxDataForQuickbooksConfiguration(policyID, CONST.QUICKBOOKS_DESKTOP_CONFIG.MARK_CHECKS_TO_BE_PRINTED, settingValue, !settingValue); const parameters: UpdateQuickbooksDesktopGenericTypeParams = { diff --git a/src/libs/actions/connections/SageIntacct.ts b/src/libs/actions/connections/SageIntacct.ts index 8cc554b7ec79..13761d0e19bb 100644 --- a/src/libs/actions/connections/SageIntacct.ts +++ b/src/libs/actions/connections/SageIntacct.ts @@ -109,7 +109,10 @@ function prepareOnyxDataForMappingUpdate( return {optimisticData, failureData, successData}; } -function updateSageIntacctBillable(policyID: string, enabled: boolean) { +function updateSageIntacctBillable(policyID: string | undefined, enabled: boolean) { + if (!policyID) { + return; + } const parameters = { policyID, enabled, @@ -163,7 +166,10 @@ function changeMappingsValueFromDefaultToTag(policyID: string, mappings?: SageIn } } -function updateSageIntacctSyncTaxConfiguration(policyID: string, enabled: boolean) { +function updateSageIntacctSyncTaxConfiguration(policyID: string | undefined, enabled: boolean) { + if (!policyID) { + return; + } const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, @@ -532,7 +538,10 @@ function updateSageIntacctDefaultVendor(policyID: string, settingName: keyof Sag } } -function clearSageIntacctErrorField(policyID: string, key: SageIntacctOfflineStateKeys | keyof SageIntacctConnectionsConfig) { +function clearSageIntacctErrorField(policyID: string | undefined, key: SageIntacctOfflineStateKeys | keyof SageIntacctConnectionsConfig) { + if (!policyID) { + return; + } Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {connections: {intacct: {config: {errorFields: {[key]: null}}}}}); } diff --git a/src/libs/actions/connections/index.ts b/src/libs/actions/connections/index.ts index c0215e91838a..542558e0d343 100644 --- a/src/libs/actions/connections/index.ts +++ b/src/libs/actions/connections/index.ts @@ -189,7 +189,7 @@ function updatePolicyConnectionConfig { 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/FileUtils.ts b/src/libs/fileDownload/FileUtils.ts index 12ca79edb09b..81fcb9847a2e 100644 --- a/src/libs/fileDownload/FileUtils.ts +++ b/src/libs/fileDownload/FileUtils.ts @@ -70,7 +70,7 @@ function showPermissionErrorAlert() { function showCameraPermissionsAlert() { Alert.alert( translateLocal('attachmentPicker.cameraPermissionRequired'), - translateLocal('attachmentPicker.expensifyDoesntHaveAccessToCamera'), + translateLocal('attachmentPicker.expensifyDoesNotHaveAccessToCamera'), [ { text: translateLocal('common.cancel'), 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/libs/onboardingSelectors.ts b/src/libs/onboardingSelectors.ts index b578a6a36942..c7e251b059c1 100644 --- a/src/libs/onboardingSelectors.ts +++ b/src/libs/onboardingSelectors.ts @@ -29,7 +29,7 @@ function hasCompletedGuidedSetupFlowSelector(onboarding: OnyxValue): {isHybridAppOnboardingCompleted: boolean | undefined; hasBeenAddedToNudgeMigration: boolean} { +function tryNewDotOnyxSelector(tryNewDotData: OnyxValue): {isHybridAppOnboardingCompleted: boolean | undefined; hasBeenAddedToNudgeMigration: boolean} { let isHybridAppOnboardingCompleted = tryNewDotData?.classicRedirect?.completedHybridAppOnboarding; const hasBeenAddedToNudgeMigration = !!tryNewDotData?.nudgeMigration?.timestamp; diff --git a/src/pages/Debug/DebugDetails.tsx b/src/pages/Debug/DebugDetails.tsx index c5b0b068e65d..7b24dfe87beb 100644 --- a/src/pages/Debug/DebugDetails.tsx +++ b/src/pages/Debug/DebugDetails.tsx @@ -29,7 +29,7 @@ type DebugDetailsProps = { /** Type of debug form - required to access constant field options for a specific form */ formType: ValueOf; - /** The report or report action data to be displayed and editted. */ + /** The report or report action data to be displayed and edited. */ data: OnyxEntry | OnyxEntry | OnyxEntry | OnyxEntry; /** Whether the provided policy has enabled tags */ diff --git a/src/pages/Debug/Transaction/DebugTransactionViolations.tsx b/src/pages/Debug/Transaction/DebugTransactionViolations.tsx index e3d3f518f88a..9449378b6a63 100644 --- a/src/pages/Debug/Transaction/DebugTransactionViolations.tsx +++ b/src/pages/Debug/Transaction/DebugTransactionViolations.tsx @@ -11,7 +11,7 @@ import ROUTES from '@src/ROUTES'; import type {TransactionViolation} from '@src/types/onyx'; type DebugTransactionViolationsProps = { - /** The transactionID we are gettings the transaction violations for */ + /** The transactionID we are getting the transaction violations for */ transactionID: string; }; diff --git a/src/pages/EnablePayments/AddBankAccount/AddBankAccount.tsx b/src/pages/EnablePayments/AddBankAccount/AddBankAccount.tsx index 5b38a557ad2c..75963969527c 100644 --- a/src/pages/EnablePayments/AddBankAccount/AddBankAccount.tsx +++ b/src/pages/EnablePayments/AddBankAccount/AddBankAccount.tsx @@ -19,7 +19,7 @@ import SetupMethod from './SetupMethod'; import Confirmation from './substeps/ConfirmationStep'; import Plaid from './substeps/PlaidStep'; -const plaidSubsteps: Array> = [Plaid, Confirmation]; +const plaidSubSteps: Array> = [Plaid, Confirmation]; function AddBankAccount() { const [plaidData] = useOnyx(ONYXKEYS.PLAID_DATA); const [personalBankAccount] = useOnyx(ONYXKEYS.PERSONAL_BANK_ACCOUNT); @@ -38,7 +38,7 @@ function AddBankAccount() { const isSetupTypeChosen = personalBankAccountDraft?.setupType === CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID; - const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo} = useSubStep({bodyContent: plaidSubsteps, startFrom: 0, onFinished: submit}); + const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo} = useSubStep({bodyContent: plaidSubSteps, startFrom: 0, onFinished: submit}); const exitFlow = (shouldContinue = false) => { const exitReportID = personalBankAccount?.exitReportID; diff --git a/src/pages/EnablePayments/FeesAndTerms/FeesAndTerms.tsx b/src/pages/EnablePayments/FeesAndTerms/FeesAndTerms.tsx index e8db5d75cfd0..ca391d4da95d 100644 --- a/src/pages/EnablePayments/FeesAndTerms/FeesAndTerms.tsx +++ b/src/pages/EnablePayments/FeesAndTerms/FeesAndTerms.tsx @@ -5,34 +5,34 @@ import useLocalize from '@hooks/useLocalize'; import useSubStep from '@hooks/useSubStep'; import type {SubStepProps} from '@hooks/useSubStep/types'; import Navigation from '@navigation/Navigation'; -import * as BankAccounts from '@userActions/BankAccounts'; -import * as Wallet from '@userActions/Wallet'; +import {acceptWalletTerms, clearPersonalBankAccount} from '@userActions/BankAccounts'; +import {resetWalletAdditionalDetailsDraft, updateCurrentStep} from '@userActions/Wallet'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import FeesStep from './substeps/FeesStep'; import TermsStep from './substeps/TermsStep'; -const termsAndFeesSubsteps: Array> = [FeesStep, TermsStep]; +const termsAndFeesSubSteps: Array> = [FeesStep, TermsStep]; function FeesAndTerms() { const {translate} = useLocalize(); const [walletTerms] = useOnyx(ONYXKEYS.WALLET_TERMS); const submit = () => { - BankAccounts.acceptWalletTerms({ + acceptWalletTerms({ hasAcceptedTerms: true, - reportID: walletTerms?.chatReportID ?? '', + reportID: walletTerms?.chatReportID, }); - BankAccounts.clearPersonalBankAccount(); - Wallet.resetWalletAdditionalDetailsDraft(); + clearPersonalBankAccount(); + resetWalletAdditionalDetailsDraft(); Navigation.navigate(ROUTES.SETTINGS_WALLET); }; - const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo} = useSubStep({bodyContent: termsAndFeesSubsteps, startFrom: 0, onFinished: submit}); + const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo} = useSubStep({bodyContent: termsAndFeesSubSteps, startFrom: 0, onFinished: submit}); const handleBackButtonPress = () => { if (screenIndex === 0) { - Wallet.updateCurrentStep(CONST.WALLET.STEP.ONFIDO); + updateCurrentStep(CONST.WALLET.STEP.ONFIDO); return; } prevScreen(); diff --git a/src/pages/EnablePayments/PersonalInfo/PersonalInfo.tsx b/src/pages/EnablePayments/PersonalInfo/PersonalInfo.tsx index e892d8925a70..b60f6ee7f1f7 100644 --- a/src/pages/EnablePayments/PersonalInfo/PersonalInfo.tsx +++ b/src/pages/EnablePayments/PersonalInfo/PersonalInfo.tsx @@ -6,9 +6,9 @@ import useSubStep from '@hooks/useSubStep'; import type {SubStepProps} from '@hooks/useSubStep/types'; import {parsePhoneNumber} from '@libs/PhoneNumber'; import IdologyQuestions from '@pages/EnablePayments/IdologyQuestions'; -import getInitialSubstepForPersonalInfo from '@pages/EnablePayments/utils/getInitialSubstepForPersonalInfo'; -import getSubstepValues from '@pages/EnablePayments/utils/getSubstepValues'; -import * as Wallet from '@userActions/Wallet'; +import getInitialSubStepForPersonalInfo from '@pages/EnablePayments/utils/getInitialSubStepForPersonalInfo'; +import getSubStepValues from '@pages/EnablePayments/utils/getSubStepValues'; +import {setAdditionalDetailsQuestions, updateCurrentStep, updatePersonalDetails} from '@userActions/Wallet'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import INPUT_IDS from '@src/types/form/WalletAdditionalDetailsForm'; @@ -30,7 +30,7 @@ function PersonalInfoPage() { const showIdologyQuestions = walletAdditionalDetails?.questions && walletAdditionalDetails?.questions.length > 0; - const values = useMemo(() => getSubstepValues(PERSONAL_INFO_STEP_KEYS, walletAdditionalDetailsDraft, walletAdditionalDetails), [walletAdditionalDetails, walletAdditionalDetailsDraft]); + const values = useMemo(() => getSubStepValues(PERSONAL_INFO_STEP_KEYS, walletAdditionalDetailsDraft, walletAdditionalDetails), [walletAdditionalDetails, walletAdditionalDetailsDraft]); const submit = () => { const personalDetails = { phoneNumber: (values.phoneNumber && parsePhoneNumber(values.phoneNumber, {regionCode: CONST.COUNTRY.US}).number?.significant) ?? '', @@ -44,10 +44,10 @@ function PersonalInfoPage() { ssn: values?.[PERSONAL_INFO_STEP_KEYS.SSN_LAST_4] ?? '', }; // Attempt to set the personal details - Wallet.updatePersonalDetails(personalDetails); + updatePersonalDetails(personalDetails); }; - const startFrom = useMemo(() => getInitialSubstepForPersonalInfo(values), [values]); + const startFrom = useMemo(() => getInitialSubStepForPersonalInfo(values), [values]); const { componentToRender: SubStep, @@ -69,11 +69,11 @@ function PersonalInfoPage() { return; } if (screenIndex === 0) { - Wallet.updateCurrentStep(CONST.WALLET.STEP.ADD_BANK_ACCOUNT); + updateCurrentStep(CONST.WALLET.STEP.ADD_BANK_ACCOUNT); return; } if (showIdologyQuestions) { - Wallet.setAdditionalDetailsQuestions(null, ''); + setAdditionalDetailsQuestions(null, ''); return; } prevScreen(); diff --git a/src/pages/EnablePayments/PersonalInfo/substeps/ConfirmationStep.tsx b/src/pages/EnablePayments/PersonalInfo/substeps/ConfirmationStep.tsx index 09105e8e3a4d..77cbc69c3440 100644 --- a/src/pages/EnablePayments/PersonalInfo/substeps/ConfirmationStep.tsx +++ b/src/pages/EnablePayments/PersonalInfo/substeps/ConfirmationStep.tsx @@ -3,8 +3,8 @@ import {useOnyx} from 'react-native-onyx'; import CommonConfirmationStep from '@components/SubStepForms/ConfirmationStep'; import useLocalize from '@hooks/useLocalize'; import type {SubStepProps} from '@hooks/useSubStep/types'; -import * as ErrorUtils from '@libs/ErrorUtils'; -import getSubstepValues from '@pages/EnablePayments/utils/getSubstepValues'; +import {getLatestErrorMessage} from '@libs/ErrorUtils'; +import getSubStepValues from '@pages/EnablePayments/utils/getSubStepValues'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import INPUT_IDS from '@src/types/form/WalletAdditionalDetailsForm'; @@ -19,8 +19,8 @@ function ConfirmationStep({onNext, onMove, isEditing}: SubStepProps) { const [walletAdditionalDetailsDraft] = useOnyx(ONYXKEYS.FORMS.WALLET_ADDITIONAL_DETAILS_DRAFT); const isLoading = walletAdditionalDetails?.isLoading ?? false; - const error = ErrorUtils.getLatestErrorMessage(walletAdditionalDetails ?? {}); - const values = useMemo(() => getSubstepValues(PERSONAL_INFO_STEP_KEYS, walletAdditionalDetailsDraft, walletAdditionalDetails), [walletAdditionalDetails, walletAdditionalDetailsDraft]); + const error = getLatestErrorMessage(walletAdditionalDetails ?? {}); + const values = useMemo(() => getSubStepValues(PERSONAL_INFO_STEP_KEYS, walletAdditionalDetailsDraft, walletAdditionalDetails), [walletAdditionalDetails, walletAdditionalDetailsDraft]); const shouldAskForFullSSN = walletAdditionalDetails?.errorCode === CONST.WALLET.ERROR.SSN; const summaryItems = [ diff --git a/src/pages/EnablePayments/utils/getInitialSubstepForPersonalInfo.ts b/src/pages/EnablePayments/utils/getInitialSubStepForPersonalInfo.tsx similarity index 88% rename from src/pages/EnablePayments/utils/getInitialSubstepForPersonalInfo.ts rename to src/pages/EnablePayments/utils/getInitialSubStepForPersonalInfo.tsx index f1c168be8b60..f1a2cdabe431 100644 --- a/src/pages/EnablePayments/utils/getInitialSubstepForPersonalInfo.ts +++ b/src/pages/EnablePayments/utils/getInitialSubStepForPersonalInfo.tsx @@ -6,7 +6,7 @@ const personalInfoKeys = INPUT_IDS.PERSONAL_INFO_STEP; /** * Returns the initial substep for the Personal Info step based on already existing data */ -function getInitialSubstepForPersonalInfo(data: PersonalInfoStepProps): number { +function getInitialSubStepForPersonalInfo(data: PersonalInfoStepProps): number { if (data[personalInfoKeys.FIRST_NAME] === '' || data[personalInfoKeys.LAST_NAME] === '') { return 0; } @@ -30,4 +30,4 @@ function getInitialSubstepForPersonalInfo(data: PersonalInfoStepProps): number { return 5; } -export default getInitialSubstepForPersonalInfo; +export default getInitialSubStepForPersonalInfo; diff --git a/src/pages/EnablePayments/utils/getSubstepValues.ts b/src/pages/EnablePayments/utils/getSubStepValues.tsx similarity index 89% rename from src/pages/EnablePayments/utils/getSubstepValues.ts rename to src/pages/EnablePayments/utils/getSubStepValues.tsx index 2eb80ed1b2ee..ae5f7d3f311d 100644 --- a/src/pages/EnablePayments/utils/getSubstepValues.ts +++ b/src/pages/EnablePayments/utils/getSubStepValues.tsx @@ -3,7 +3,7 @@ import type {WalletAdditionalDetailsForm} from '@src/types/form'; import type {PersonalInfoStepProps} from '@src/types/form/WalletAdditionalDetailsForm'; import type {WalletAdditionalDetailsRefactor} from '@src/types/onyx/WalletAdditionalDetails'; -function getSubstepValues( +function getSubStepValues( inputKeys: Record, walletAdditionalDetailsDraft: OnyxEntry, walletAdditionalDetails: OnyxEntry, @@ -14,4 +14,4 @@ function getSubstepValues( }, {} as {[K in T]: WalletAdditionalDetailsForm[K] | string}); } -export default getSubstepValues; +export default getSubStepValues; diff --git a/src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx b/src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx index 4795320510f8..8584a2b56c48 100644 --- a/src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx +++ b/src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx @@ -23,7 +23,7 @@ import DateOfBirth from './substeps/DateOfBirth'; import LegalName from './substeps/LegalName'; import PhoneNumber from './substeps/PhoneNumber'; import type {CustomSubStepProps} from './types'; -import {getInitialSubstep, getSubstepValues} from './utils'; +import {getInitialSubStep, getSubStepValues} from './utils'; type MissingPersonalDetailsContentProps = { privatePersonalDetails: OnyxEntry; @@ -39,9 +39,9 @@ function MissingPersonalDetailsContent({privatePersonalDetails, draftValues}: Mi const ref: ForwardedRef = useRef(null); - const values = useMemo(() => getSubstepValues(privatePersonalDetails, draftValues), [privatePersonalDetails, draftValues]); + const values = useMemo(() => getSubStepValues(privatePersonalDetails, draftValues), [privatePersonalDetails, draftValues]); - const startFrom = useMemo(() => getInitialSubstep(values), [values]); + const startFrom = useMemo(() => getInitialSubStep(values), [values]); const handleFinishStep = useCallback(() => { if (!values) { diff --git a/src/pages/MissingPersonalDetails/utils.ts b/src/pages/MissingPersonalDetails/utils.ts index 9314d59c1683..64fd8e524df6 100644 --- a/src/pages/MissingPersonalDetails/utils.ts +++ b/src/pages/MissingPersonalDetails/utils.ts @@ -1,12 +1,12 @@ import type {OnyxEntry} from 'react-native-onyx'; -import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; +import {getCurrentAddress} from '@libs/PersonalDetailsUtils'; import CONST from '@src/CONST'; import type {PersonalDetailsForm} from '@src/types/form'; import INPUT_IDS from '@src/types/form/PersonalDetailsForm'; import type {PrivatePersonalDetails} from '@src/types/onyx'; -function getSubstepValues(privatePersonalDetails: OnyxEntry, personalDetailsDraft: OnyxEntry): PersonalDetailsForm { - const address = PersonalDetailsUtils.getCurrentAddress(privatePersonalDetails); +function getSubStepValues(privatePersonalDetails: OnyxEntry, personalDetailsDraft: OnyxEntry): PersonalDetailsForm { + const address = getCurrentAddress(privatePersonalDetails); const {street} = address ?? {}; const [street1, street2] = street ? street.split('\n') : [undefined, undefined]; return { @@ -23,7 +23,7 @@ function getSubstepValues(privatePersonalDetails: OnyxEntry { if (!paidGroupPolicy || onboardingPolicyID) { return; diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 0de17711be74..df26c1408699 100755 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -198,7 +198,7 @@ function ProfilePage({route}: ProfilePageProps) { source={details?.avatar} avatarID={accountID} type={CONST.ICON_TYPE_AVATAR} - size={CONST.AVATAR_SIZE.XLARGE} + size={CONST.AVATAR_SIZE.X_LARGE} fallbackIcon={fallbackIcon} /> diff --git a/src/pages/ReimbursementAccount/NonUSD/BeneficialOwnerInfo/BeneficialOwnerDetailsFormSubSteps/Confirmation.tsx b/src/pages/ReimbursementAccount/NonUSD/BeneficialOwnerInfo/BeneficialOwnerDetailsFormSubSteps/Confirmation.tsx index 696ebe4fc489..a672adcee657 100644 --- a/src/pages/ReimbursementAccount/NonUSD/BeneficialOwnerInfo/BeneficialOwnerDetailsFormSubSteps/Confirmation.tsx +++ b/src/pages/ReimbursementAccount/NonUSD/BeneficialOwnerInfo/BeneficialOwnerDetailsFormSubSteps/Confirmation.tsx @@ -111,7 +111,7 @@ function Confirmation({onNext, onMove, isEditing, ownerBeingModifiedID}: Confirm ...(isDocumentNeededStatus.isCodiceFiscaleNeeded ? [ { - title: values.codiceFisacle.map((file) => file.name).join(', '), + title: values.codiceFiscale.map((file) => file.name).join(', '), description: translate('ownershipInfoStep.codiceFiscale'), shouldShowRightIcon: true, onPress: () => { @@ -131,7 +131,7 @@ function Confirmation({onNext, onMove, isEditing, ownerBeingModifiedID}: Confirm translate, values.addressProof, values.city, - values.codiceFisacle, + values.codiceFiscale, values.copyOfID, values.dob, values.firstName, diff --git a/src/pages/ReimbursementAccount/NonUSD/utils/getValuesForBeneficialOwner.ts b/src/pages/ReimbursementAccount/NonUSD/utils/getValuesForBeneficialOwner.ts index 4d8cf52d0689..4483328718a8 100644 --- a/src/pages/ReimbursementAccount/NonUSD/utils/getValuesForBeneficialOwner.ts +++ b/src/pages/ReimbursementAccount/NonUSD/utils/getValuesForBeneficialOwner.ts @@ -17,7 +17,7 @@ type BeneficialOwnerValues = { proofOfOwnership: FileObject[]; copyOfID: FileObject[]; addressProof: FileObject[]; - codiceFisacle: FileObject[]; + codiceFiscale: FileObject[]; }; function getValuesForOwner(beneficialOwnerBeingModifiedID: string, reimbursementAccountDraft: OnyxEntry): BeneficialOwnerValues { @@ -36,7 +36,7 @@ function getValuesForOwner(beneficialOwnerBeingModifiedID: string, reimbursement proofOfOwnership: [], copyOfID: [], addressProof: [], - codiceFisacle: [], + codiceFiscale: [], }; } const beneficialOwnerPrefix = CONST.NON_USD_BANK_ACCOUNT.BENEFICIAL_OWNER_INFO_STEP.BENEFICIAL_OWNER_DATA.PREFIX; @@ -56,7 +56,7 @@ function getValuesForOwner(beneficialOwnerBeingModifiedID: string, reimbursement proofOfOwnership: `${beneficialOwnerPrefix}_${beneficialOwnerBeingModifiedID}_${beneficialOwnerInfoKey.PROOF_OF_OWNERSHIP}`, copyOfID: `${beneficialOwnerPrefix}_${beneficialOwnerBeingModifiedID}_${beneficialOwnerInfoKey.COPY_OF_ID}`, addressProof: `${beneficialOwnerPrefix}_${beneficialOwnerBeingModifiedID}_${beneficialOwnerInfoKey.ADDRESS_PROOF}`, - codiceFisacle: `${beneficialOwnerPrefix}_${beneficialOwnerBeingModifiedID}_${beneficialOwnerInfoKey.CODICE_FISCALE}`, + codiceFiscale: `${beneficialOwnerPrefix}_${beneficialOwnerBeingModifiedID}_${beneficialOwnerInfoKey.CODICE_FISCALE}`, } as const; return { @@ -73,7 +73,7 @@ function getValuesForOwner(beneficialOwnerBeingModifiedID: string, reimbursement proofOfOwnership: reimbursementAccountDraft[INPUT_KEYS.proofOfOwnership] ?? [], copyOfID: reimbursementAccountDraft[INPUT_KEYS.copyOfID] ?? [], addressProof: reimbursementAccountDraft[INPUT_KEYS.addressProof] ?? [], - codiceFisacle: reimbursementAccountDraft[INPUT_KEYS.codiceFisacle] ?? [], + codiceFiscale: reimbursementAccountDraft[INPUT_KEYS.codiceFiscale] ?? [], } as BeneficialOwnerValues; } diff --git a/src/pages/ReimbursementAccount/USD/BeneficialOwnerInfo/BeneficialOwnersStep.tsx b/src/pages/ReimbursementAccount/USD/BeneficialOwnerInfo/BeneficialOwnersStep.tsx index ea9a711f43c1..1cd60cddc439 100644 --- a/src/pages/ReimbursementAccount/USD/BeneficialOwnerInfo/BeneficialOwnersStep.tsx +++ b/src/pages/ReimbursementAccount/USD/BeneficialOwnerInfo/BeneficialOwnersStep.tsx @@ -119,7 +119,7 @@ function BeneficialOwnersStep({onBackButtonPress}: BeneficialOwnersStepProps) { setCurrentUBOSubStep(SUBSTEP.UBO_DETAILS_FORM); }; - const handleNextUBOSubstep = (value: boolean) => { + const handleNextUBOSubStep = (value: boolean) => { if (currentUBOSubStep === SUBSTEP.IS_USER_UBO) { setIsUserUBO(value); @@ -195,7 +195,7 @@ function BeneficialOwnersStep({onBackButtonPress}: BeneficialOwnersStepProps) { } else if (currentUBOSubStep === SUBSTEP.UBO_DETAILS_FORM && screenIndex > 0) { prevScreen(); } else { - setCurrentUBOSubStep((currentSubstep) => currentSubstep - 1); + setCurrentUBOSubStep((currentSubStep) => currentSubStep - 1); } }; @@ -221,7 +221,7 @@ function BeneficialOwnersStep({onBackButtonPress}: BeneficialOwnersStepProps) { description={translate('beneficialOwnerInfoStep.regulationRequiresUsToVerifyTheIdentity')} submitButtonStyles={[styles.mb0]} defaultValue={isUserUBO} - onSelectedValue={handleNextUBOSubstep} + onSelectedValue={handleNextUBOSubStep} /> )} @@ -231,7 +231,7 @@ function BeneficialOwnersStep({onBackButtonPress}: BeneficialOwnersStepProps) { description={translate('beneficialOwnerInfoStep.regulationRequiresUsToVerifyTheIdentity')} submitButtonStyles={[styles.mb0]} defaultValue={isAnyoneElseUBO} - onSelectedValue={handleNextUBOSubstep} + onSelectedValue={handleNextUBOSubStep} /> )} @@ -250,7 +250,7 @@ function BeneficialOwnersStep({onBackButtonPress}: BeneficialOwnersStepProps) { title={`${translate('beneficialOwnerInfoStep.areThereMoreIndividualsWhoOwn25percent')} ${companyName}?`} description={translate('beneficialOwnerInfoStep.regulationRequiresUsToVerifyTheIdentity')} submitButtonStyles={[styles.mb0]} - onSelectedValue={handleNextUBOSubstep} + onSelectedValue={handleNextUBOSubStep} defaultValue={false} /> )} diff --git a/src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/AddressBusiness.tsx b/src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/AddressBusiness.tsx index 64e957a76d5c..f4208fb926c9 100644 --- a/src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/AddressBusiness.tsx +++ b/src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/AddressBusiness.tsx @@ -42,7 +42,7 @@ function AddressBusiness({onNext, onMove, isEditing}: SubStepProps) { onNext={onNext} onMove={onMove} formID={ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM} - formTitle={translate('businessInfoStep.enterYourCompanysAddress')} + formTitle={translate('businessInfoStep.enterYourCompanyAddress')} formPOBoxDisclaimer={translate('common.noPO')} onSubmit={handleSubmit} stepFields={STEP_FIELDS} diff --git a/src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/IncorporationDateBusiness.tsx b/src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/IncorporationDateBusiness.tsx index 4951efb7023e..68793483109e 100644 --- a/src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/IncorporationDateBusiness.tsx +++ b/src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/IncorporationDateBusiness.tsx @@ -56,7 +56,7 @@ function IncorporationDateBusiness({onNext, isEditing}: SubStepProps) { submitButtonStyles={[styles.mb0]} shouldHideFixErrorsAlert > - {translate('businessInfoStep.selectYourCompanysIncorporationDate')} + {translate('businessInfoStep.selectYourCompanyIncorporationDate')} - {translate('businessInfoStep.selectYourCompanysType')} + {translate('businessInfoStep.selectYourCompanyType')} Navigation.navigate(ROUTES.REPORT_AVATAR.getRoute(report.reportID))} onImageRemoved={() => { diff --git a/src/pages/ReportParticipantDetailsPage.tsx b/src/pages/ReportParticipantDetailsPage.tsx index bfc4506818d1..ad41e3fdd5de 100644 --- a/src/pages/ReportParticipantDetailsPage.tsx +++ b/src/pages/ReportParticipantDetailsPage.tsx @@ -15,10 +15,10 @@ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails' import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as Report from '@libs/actions/Report'; +import {removeFromGroupChat} from '@libs/actions/Report'; import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; -import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; -import * as ReportUtils from '@libs/ReportUtils'; +import {getDisplayNameOrDefault} from '@libs/PersonalDetailsUtils'; +import {isGroupChatAdmin} from '@libs/ReportUtils'; import Navigation from '@navigation/Navigation'; import type {ParticipantsNavigatorParamList} from '@navigation/types'; import CONST from '@src/CONST'; @@ -42,17 +42,17 @@ function ReportParticipantDetails({report, route}: ReportParticipantDetailsPageP const [isRemoveMemberConfirmModalVisible, setIsRemoveMemberConfirmModalVisible] = React.useState(false); const accountID = Number(route.params.accountID); - const backTo = ROUTES.REPORT_PARTICIPANTS.getRoute(report?.reportID ?? '-1', route.params.backTo); + const backTo = ROUTES.REPORT_PARTICIPANTS.getRoute(report?.reportID, route.params.backTo); const member = report?.participants?.[accountID]; const details = personalDetails?.[accountID] ?? ({} as PersonalDetails); const fallbackIcon = details.fallbackIcon ?? ''; - const displayName = formatPhoneNumber(PersonalDetailsUtils.getDisplayNameOrDefault(details)); - const isCurrentUserAdmin = ReportUtils.isGroupChatAdmin(report, currentUserPersonalDetails?.accountID); + const displayName = formatPhoneNumber(getDisplayNameOrDefault(details)); + const isCurrentUserAdmin = isGroupChatAdmin(report, currentUserPersonalDetails?.accountID); const isSelectedMemberCurrentUser = accountID === currentUserPersonalDetails?.accountID; const removeUser = useCallback(() => { setIsRemoveMemberConfirmModalVisible(false); - Report.removeFromGroupChat(report?.reportID, [accountID]); + removeFromGroupChat(report?.reportID, [accountID]); Navigation.goBack(backTo); }, [backTo, report, accountID]); @@ -82,7 +82,7 @@ function ReportParticipantDetails({report, route}: ReportParticipantDetailsPageP source={details.avatar} avatarID={accountID} type={CONST.ICON_TYPE_AVATAR} - size={CONST.AVATAR_SIZE.XLARGE} + size={CONST.AVATAR_SIZE.X_LARGE} fallbackIcon={fallbackIcon} /> {!!(displayName ?? '') && ( diff --git a/src/pages/ReportParticipantsPage.tsx b/src/pages/ReportParticipantsPage.tsx index 1072b180bbfa..ed733fc8891d 100755 --- a/src/pages/ReportParticipantsPage.tsx +++ b/src/pages/ReportParticipantsPage.tsx @@ -293,9 +293,9 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) { }, ]; - const isAtleastOneAdminSelected = selectedMembers.some((accountId) => report.participants?.[accountId]?.role === CONST.REPORT.ROLE.ADMIN); + const isAtLeastOneAdminSelected = selectedMembers.some((accountId) => report.participants?.[accountId]?.role === CONST.REPORT.ROLE.ADMIN); - if (isAtleastOneAdminSelected) { + if (isAtLeastOneAdminSelected) { options.push({ text: translate('workspace.people.makeMember'), value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_MEMBER, @@ -304,9 +304,9 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) { }); } - const isAtleastOneMemberSelected = selectedMembers.some((accountId) => report.participants?.[accountId]?.role === CONST.REPORT.ROLE.MEMBER); + const isAtLeastOneMemberSelected = selectedMembers.some((accountId) => report.participants?.[accountId]?.role === CONST.REPORT.ROLE.MEMBER); - if (isAtleastOneMemberSelected) { + if (isAtLeastOneMemberSelected) { options.push({ text: translate('workspace.people.makeAdmin'), value: CONST.POLICY.MEMBERS_BULK_ACTION_TYPES.MAKE_ADMIN, diff --git a/src/pages/RoomMemberDetailsPage.tsx b/src/pages/RoomMemberDetailsPage.tsx index e10dd09b206a..05c7bb4cce57 100644 --- a/src/pages/RoomMemberDetailsPage.tsx +++ b/src/pages/RoomMemberDetailsPage.tsx @@ -14,12 +14,12 @@ import useLocalize from '@hooks/useLocalize'; import usePolicy from '@hooks/usePolicy'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as Report from '@libs/actions/Report'; +import {removeFromRoom} from '@libs/actions/Report'; import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; import type {RoomMembersNavigatorParamList} from '@libs/Navigation/types'; -import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; -import * as PolicyUtils from '@libs/PolicyUtils'; -import * as ReportUtils from '@libs/ReportUtils'; +import {getDisplayNameOrDefault} from '@libs/PersonalDetailsUtils'; +import {isUserPolicyAdmin} from '@libs/PolicyUtils'; +import {isPolicyExpenseChat} from '@libs/ReportUtils'; import Navigation from '@navigation/Navigation'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -43,18 +43,18 @@ function RoomMemberDetailsPage({report, route}: RoomMemberDetailsPagePageProps) const [isRemoveMemberConfirmModalVisible, setIsRemoveMemberConfirmModalVisible] = React.useState(false); const accountID = Number(route.params.accountID); - const backTo = ROUTES.ROOM_MEMBERS.getRoute(report?.reportID ?? '-1', route.params.backTo); + const backTo = ROUTES.ROOM_MEMBERS.getRoute(report?.reportID, route.params.backTo); const member = report?.participants?.[accountID]; const details = personalDetails?.[accountID] ?? ({} as PersonalDetails); const fallbackIcon = details.fallbackIcon ?? ''; - const displayName = formatPhoneNumber(PersonalDetailsUtils.getDisplayNameOrDefault(details)); + const displayName = formatPhoneNumber(getDisplayNameOrDefault(details)); const isSelectedMemberCurrentUser = accountID === currentUserPersonalDetails?.accountID; const isSelectedMemberOwner = accountID === report.ownerAccountID; - const shouldDisableRemoveUser = (ReportUtils.isPolicyExpenseChat(report) && PolicyUtils.isUserPolicyAdmin(policy, details.login)) || isSelectedMemberCurrentUser || isSelectedMemberOwner; + const shouldDisableRemoveUser = (isPolicyExpenseChat(report) && isUserPolicyAdmin(policy, details.login)) || isSelectedMemberCurrentUser || isSelectedMemberOwner; const removeUser = useCallback(() => { setIsRemoveMemberConfirmModalVisible(false); - Report.removeFromRoom(report?.reportID, [accountID]); + removeFromRoom(report?.reportID, [accountID]); Navigation.goBack(backTo); }, [backTo, report, accountID]); @@ -80,7 +80,7 @@ function RoomMemberDetailsPage({report, route}: RoomMemberDetailsPagePageProps) source={details.avatar} avatarID={accountID} type={CONST.ICON_TYPE_AVATAR} - size={CONST.AVATAR_SIZE.XLARGE} + size={CONST.AVATAR_SIZE.X_LARGE} fallbackIcon={fallbackIcon} /> {!!(details.displayName ?? '') && ( diff --git a/src/pages/Search/AdvancedSearchFilters.tsx b/src/pages/Search/AdvancedSearchFilters.tsx index fe12ab4d9fdd..ded3f2785fe9 100644 --- a/src/pages/Search/AdvancedSearchFilters.tsx +++ b/src/pages/Search/AdvancedSearchFilters.tsx @@ -415,7 +415,7 @@ function AdvancedSearchFilters() { const personalDetails = usePersonalDetails(); const {canUseLeftHandBar} = usePermissions(); - // If users have access to the leftHandBar beta, then the workspace filter is displyed in the first section of the advanced search filters + // If users have access to the leftHandBar beta, then the workspace filter is displayed in the first section of the advanced search filters const typeFiltersKeysWithOptionalPolicy = useMemo( () => canUseLeftHandBar diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersTaxRatePage.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersTaxRatePage.tsx index fa14c9f5f9d5..a61da9c7c66e 100644 --- a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersTaxRatePage.tsx +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersTaxRatePage.tsx @@ -9,7 +9,7 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import {getAllTaxRates} from '@libs/PolicyUtils'; -import * as SearchActions from '@userActions/Search'; +import {updateAdvancedFilters} from '@userActions/Search'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -36,10 +36,10 @@ function SearchFiltersTaxRatePage() { if (!singlePolicyTaxRates) { return Object.entries(allTaxRates).map(([taxRateName, taxRateKeys]) => ({name: taxRateName, value: taxRateKeys})); } - return Object.entries(singlePolicyTaxRates).map(([taxRatekey, taxRate]) => ({name: taxRate.name, value: [taxRatekey]})); + return Object.entries(singlePolicyTaxRates).map(([taxRateKey, taxRate]) => ({name: taxRate.name, value: [taxRateKey]})); }, [allTaxRates, singlePolicyTaxRates]); - const updateTaxRateFilters = useCallback((values: string[]) => SearchActions.updateAdvancedFilters({taxRate: values}), []); + const updateTaxRateFilters = useCallback((values: string[]) => updateAdvancedFilters({taxRate: values}), []); return ( >( (e) => { - // If the layout measurement is 0, it means the flashlist is not displayed but the onScroll may be triggered with offset value 0. + // If the layout measurement is 0, it means the FlashList is not displayed but the onScroll may be triggered with offset value 0. // We should ignore this case. if (e.nativeEvent.layoutMeasurement.height === 0) { return; diff --git a/src/pages/Share/ShareRootPage.tsx b/src/pages/Share/ShareRootPage.tsx index de8da74f2fa3..ffed18db372c 100644 --- a/src/pages/Share/ShareRootPage.tsx +++ b/src/pages/Share/ShareRootPage.tsx @@ -38,12 +38,12 @@ function ShareRootPage() { const {translate} = useLocalize(); const [isFileScannable, setIsFileScannable] = useState(false); const receiptFileFormats = Object.values(CONST.RECEIPT_ALLOWED_FILE_TYPES) as string[]; - const shareFileMimetypes = Object.values(CONST.SHARE_FILE_MIMETYPE) as string[]; + const shareFileMimeTypes = Object.values(CONST.SHARE_FILE_MIMETYPE) as string[]; const handleProcessFiles = useCallback(() => { ShareActionHandler.processFiles((processedFiles) => { const tempFile = Array.isArray(processedFiles) ? processedFiles.at(0) : (JSON.parse(processedFiles) as ShareTempFile); - if (!tempFile?.mimeType || !shareFileMimetypes.includes(tempFile?.mimeType)) { + if (!tempFile?.mimeType || !shareFileMimeTypes.includes(tempFile?.mimeType)) { showErrorAlert(translate('attachmentPicker.wrongFileType'), translate('attachmentPicker.notAllowedExtension')); return; } @@ -82,7 +82,7 @@ function ShareRootPage() { addTempShareFile(tempFile); } }); - }, [receiptFileFormats, shareFileMimetypes, translate]); + }, [receiptFileFormats, shareFileMimeTypes, translate]); useEffect(() => { const subscription = AppState.addEventListener('change', (nextAppState) => { diff --git a/src/pages/Share/SubmitDetailsPage.tsx b/src/pages/Share/SubmitDetailsPage.tsx index f29b7fea6c52..cbd426fb6eef 100644 --- a/src/pages/Share/SubmitDetailsPage.tsx +++ b/src/pages/Share/SubmitDetailsPage.tsx @@ -126,7 +126,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/TeachersUnite/IntroSchoolPrincipalPage.tsx b/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx index a3e92e9edb3e..d7836824eff8 100644 --- a/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx +++ b/src/pages/TeachersUnite/IntroSchoolPrincipalPage.tsx @@ -101,7 +101,7 @@ function IntroSchoolPrincipalPage() { onSubmit={onSubmit} submitButtonText={translate('common.letsStart')} > - {translate('teachersUnitePage.schoolPrincipalVerfiyExpense')} + {translate('teachersUnitePage.schoolPrincipalVerifyExpense')} ) => { const phoneLogin = getPhoneLogin(values.partnerUserID); - const validateIfnumber = validateNumber(phoneLogin); - const contactMethod = (validateIfnumber || values.partnerUserID).trim().toLowerCase(); + const validateIfNumber = validateNumber(phoneLogin); + const contactMethod = (validateIfNumber || values.partnerUserID).trim().toLowerCase(); const firstName = values.firstName.trim(); const lastName = values.lastName.trim(); diff --git a/src/pages/TransactionDuplicate/Confirmation.tsx b/src/pages/TransactionDuplicate/Confirmation.tsx index b54d45155886..c0d6bc94bc7d 100644 --- a/src/pages/TransactionDuplicate/Confirmation.tsx +++ b/src/pages/TransactionDuplicate/Confirmation.tsx @@ -121,7 +121,7 @@ function Confirmation() { {translate('violations.confirmDuplicatesInfo')} - {/* We need that provider here becuase MoneyRequestView component requires that */} + {/* We need that provider here because MoneyRequestView component requires that */} = { /* Step Names which are displayed in stepper */ stepNames: string[]; - /* Label which is displyed to describe current step */ + /* Label which is displayed to describe current step */ label: string; /* Values to choose from */ diff --git a/src/pages/TransactionReceiptPage.tsx b/src/pages/TransactionReceiptPage.tsx index 85a0397ad5cb..8be401cc218f 100644 --- a/src/pages/TransactionReceiptPage.tsx +++ b/src/pages/TransactionReceiptPage.tsx @@ -116,7 +116,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/Travel/TravelTerms.tsx b/src/pages/Travel/TravelTerms.tsx index 6dbb95aeb16b..334ae5731d2b 100644 --- a/src/pages/Travel/TravelTerms.tsx +++ b/src/pages/Travel/TravelTerms.tsx @@ -91,7 +91,7 @@ function TravelTerms({route}: TravelTermsPageProps) { {`${translate('travel.termsAndConditions.title')}`} {`${translate('travel.termsAndConditions.subtitle')}`} - {`${translate('travel.termsAndConditions.termsconditions')}.`} + {`${translate('travel.termsAndConditions.termsConditions')}.`} (null); + const threeDotRef = useRef(null); const [betas] = useOnyx(ONYXKEYS.BETAS); const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${originalReportID}`, { canEvict: false, @@ -357,7 +357,7 @@ function BaseReportActionContextMenu({ ref={(ref) => { menuItemRefs.current[index] = ref; }} - buttonRef={isMenuAction ? threedotRef : {current: null}} + buttonRef={isMenuAction ? threeDotRef : {current: null}} icon={contextAction.icon} text={text ?? ''} successIcon={contextAction.successIcon} @@ -366,7 +366,7 @@ function BaseReportActionContextMenu({ key={contextAction.textTranslateKey} onPress={(event) => interceptAnonymousUser( - () => contextAction.onPress?.(closePopup, {...payload, ...transactionPayload, event, ...(isMenuAction ? {anchorRef: threedotRef} : {})}), + () => contextAction.onPress?.(closePopup, {...payload, ...transactionPayload, event, ...(isMenuAction ? {anchorRef: threeDotRef} : {})}), contextAction.isAnonymousAction, ) } diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index 3345eefd8574..06c1f9d757c1 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, @@ -535,7 +535,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) { @@ -643,7 +643,7 @@ const ContextMenuActions: ContextMenuAction[] = [ shouldShow: ({type, reportAction, menuTarget}) => { const isAttachment = isReportActionAttachment(reportAction); - // Only hide the copylink menu item when context menu is opened over img element. + // Only hide the "copy link" menu item when context menu is opened over img element. const isAttachmentTarget = menuTarget?.current && 'tagName' in menuTarget.current && menuTarget?.current.tagName === 'IMG' && isAttachment; return type === CONST.CONTEXT_MENU_TYPES.REPORT_ACTION && !isAttachmentTarget && !isMessageDeleted(reportAction); }, diff --git a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx index 46d1912558b8..1a0b7146f8ac 100644 --- a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx +++ b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx @@ -65,7 +65,7 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef([]); - const [shoudSwitchPositionIfOverflow, setShoudSwitchPositionIfOverflow] = useState(false); + const [shouldSwitchPositionIfOverflow, setShouldSwitchPositionIfOverflow] = useState(false); const contentRef = useRef(null); const anchorRef = useRef(null); @@ -147,8 +147,8 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef