Skip to content

Commit

Permalink
Merge branch 'main' into ts-migration/HTMLRenderers
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js
  • Loading branch information
ruben-rebelo committed Feb 8, 2024
2 parents 5c7dbb8 + e632a82 commit 54821c2
Show file tree
Hide file tree
Showing 92 changed files with 4,588 additions and 1,015 deletions.
7 changes: 0 additions & 7 deletions __mocks__/@react-native-firebase/crashlytics.js

This file was deleted.

15 changes: 15 additions & 0 deletions __mocks__/@react-native-firebase/crashlytics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type {FirebaseCrashlyticsTypes} from '@react-native-firebase/crashlytics';

type CrashlyticsModule = Pick<FirebaseCrashlyticsTypes.Module, 'log' | 'recordError' | 'setCrashlyticsCollectionEnabled'>;

type CrashlyticsMock = () => CrashlyticsModule;

// <App> uses <ErrorBoundary> and we need to mock the imported crashlytics module
// due to an error that happens otherwise https://github.com/invertase/react-native-firebase/issues/2475
const crashlyticsMock: CrashlyticsMock = () => ({
log: jest.fn(),
recordError: jest.fn(),
setCrashlyticsCollectionEnabled: jest.fn(),
});

export default crashlyticsMock;
1 change: 0 additions & 1 deletion __mocks__/@react-native-firebase/perf.js

This file was deleted.

5 changes: 5 additions & 0 deletions __mocks__/@react-native-firebase/perf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type PerfMock = () => void;

const perfMock: PerfMock = () => {};

export default perfMock;
6 changes: 0 additions & 6 deletions __mocks__/react-freeze.js

This file was deleted.

8 changes: 8 additions & 0 deletions __mocks__/react-freeze.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type {Freeze as FreezeComponent} from 'react-freeze';

const Freeze: typeof FreezeComponent = (props) => props.children as JSX.Element;

export {
// eslint-disable-next-line import/prefer-default-export
Freeze,
};
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001043800
versionName "1.4.38-0"
versionCode 1001043804
versionName "1.4.38-4"
}

flavorDimensions "default"
Expand Down
3,422 changes: 3,422 additions & 0 deletions assets/images/olddot-wireframe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion contributingGuides/NAVIGATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ When creating RHP flows, you have to remember a couple things:

- Since you can deeplink to different pages inside the RHP navigator, it is important to provide the possibility for the user to properly navigate back from any page with UP press (`HeaderWithBackButton` component).

- An example can be deeplinking to `/settings/profile/personal-details`. From there, when pressing the UP button, you should navigate to `/settings/profile`, so in order for it to work, you should provide the correct route in `onBackButtonPress` prop of `HeaderWithBackButton` (`Navigation.goBack(ROUTES.SETTINGS_PROFILE)` in this example).
- An example can be deeplinking to `/settings/profile/timezone/select`. From there, when pressing the UP button, you should navigate to `/settings/profile/timezone`, so in order for it to work, you should provide the correct route in `onBackButtonPress` prop of `HeaderWithBackButton` (`Navigation.goBack(ROUTES.SETTINGS_PROFILE)` in this example).

- We use a custom `goBack` function to handle the browser and the `react-navigation` history stack. Under the hood, it resolves to either replacing the current screen with the one we navigate to (deeplinking scenario) or just going back if we reached the current page by navigating in App (pops the screen). It ensures the requested behaviors on web, which is navigating back to the place from where you deeplinked when going into the RHP flow by it.

Expand Down
65 changes: 0 additions & 65 deletions docs/articles/expensify-classic/getting-started/Using-The-App.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/redirects.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ https://community.expensify.com/discussion/4826/how-to-set-your-annual-subscript
https://community.expensify.com/discussion/5667/deep-dive-how-does-the-annual-subscription-billing-work,https://help.expensify.com/articles/expensify-classic/billing-and-subscriptions/Annual-Subscription
https://help.expensify.com/expensify-classic/hubs/getting-started/plan-types,https://use.expensify.com/
https://help.expensify.com/articles/expensify-classic/getting-started/Employees,https://help.expensify.com/articles/expensify-classic/getting-started/Join-your-company's-workspace
https://help.expensify.com/articles/expensify-classic/getting-started/Using-The-App,https://help.expensify.com/articles/expensify-classic/getting-started/Join-your-company's-workspace
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.38.0</string>
<string>1.4.38.4</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.38.0</string>
<string>1.4.38.4</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>1.4.38</string>
<key>CFBundleVersion</key>
<string>1.4.38.0</string>
<string>1.4.38.4</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module.exports = {
doNotFake: ['nextTick'],
},
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/jest/setup.js', './node_modules/@react-native-google-signin/google-signin/jest/build/setup.js'],
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect', '<rootDir>/jest/setupAfterEnv.js', '<rootDir>/tests/perf-test/setupAfterEnv.js'],
setupFiles: ['<rootDir>/jest/setup.ts', './node_modules/@react-native-google-signin/google-signin/jest/build/setup.js'],
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect', '<rootDir>/jest/setupAfterEnv.ts', '<rootDir>/tests/perf-test/setupAfterEnv.js'],
cacheDirectory: '<rootDir>/.jest-cache',
moduleNameMapper: {
'\\.(lottie)$': '<rootDir>/__mocks__/fileMock.js',
Expand Down
5 changes: 3 additions & 2 deletions jest/setup.js → jest/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import mockClipboard from '@react-native-clipboard/clipboard/jest/clipboard-mock';
import '@shopify/flash-list/jestSetup';
import 'react-native-gesture-handler/jestSetup';
import mockStorage from 'react-native-onyx/dist/storage/__mocks__';
import * as reanimatedJestUtils from 'react-native-reanimated/src/reanimated2/jestUtils';
import 'setimmediate';
import setupMockImages from './setupMockImages';
Expand All @@ -19,7 +20,7 @@ jest.mock('@react-native-clipboard/clipboard', () => mockClipboard);
// Mock react-native-onyx storage layer because the SQLite storage layer doesn't work in jest.
// Mocking this file in __mocks__ does not work because jest doesn't support mocking files that are not directly used in the testing project,
// and we only want to mock the storage layer, not the whole Onyx module.
jest.mock('react-native-onyx/dist/storage', () => require('react-native-onyx/dist/storage/__mocks__'));
jest.mock('react-native-onyx/dist/storage', () => mockStorage);

// Turn off the console logs for timing events. They are not relevant for unit tests and create a lot of noise
jest.spyOn(console, 'debug').mockImplementation((...params) => {
Expand All @@ -34,6 +35,6 @@ jest.spyOn(console, 'debug').mockImplementation((...params) => {

// This mock is required for mocking file systems when running tests
jest.mock('react-native-fs', () => ({
unlink: jest.fn(() => new Promise((res) => res())),
unlink: jest.fn(() => new Promise<void>((res) => res())),
CachesDirectoryPath: jest.fn(),
}));
File renamed without changes.
8 changes: 2 additions & 6 deletions jest/setupMockImages.js → jest/setupMockImages.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import fs from 'fs';
import path from 'path';
import _ from 'underscore';

/**
* @param {String} imagePath
*/
function mockImages(imagePath) {
function mockImages(imagePath: string) {
const imageFilenames = fs.readdirSync(path.resolve(__dirname, `../assets/${imagePath}/`));
// eslint-disable-next-line rulesdir/prefer-early-return
_.each(imageFilenames, (fileName) => {
imageFilenames.forEach((fileName) => {
if (/\.svg/.test(fileName)) {
jest.mock(`../assets/${imagePath}/${fileName}`, () => () => '');
}
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.4.38-0",
"version": "1.4.38-4",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down Expand Up @@ -59,7 +59,7 @@
},
"dependencies": {
"@dotlottie/react-player": "^1.6.3",
"@expensify/react-native-live-markdown": "git+ssh://[email protected]/Expensify/react-native-live-markdown.git#2ed4240336e50abb4a7fa9ff6a3c180f8bc9ce5b",
"@expensify/react-native-live-markdown": "git+ssh://[email protected]/Expensify/react-native-live-markdown.git#77f85a5265043c6100f1fa65edd58901724faf08",
"@expo/metro-runtime": "~3.1.1",
"@formatjs/intl-datetimeformat": "^6.10.0",
"@formatjs/intl-getcanonicallocales": "^2.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js b/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
index 0516679..e338d90 100644
--- a/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
+++ b/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
@@ -1546,7 +1546,7 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
// Next check if the user just scrolled within the start threshold
// and call onStartReached only once for a given content length,
// and only if onEndReached is not being executed
- else if (
+ if (
onStartReached != null &&
this.state.cellsAroundViewport.first === 0 &&
isWithinStartThreshold &&
@@ -1558,13 +1558,11 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {

// If the user scrolls away from the start or end and back again,
// cause onStartReached or onEndReached to be triggered again
- else {
- this._sentStartForContentLength = isWithinStartThreshold
- ? this._sentStartForContentLength
- : 0;
- this._sentEndForContentLength = isWithinEndThreshold
- ? this._sentEndForContentLength
- : 0;
+ if (!isWithinStartThreshold) {
+ this._sentStartForContentLength = 0;
+ }
+ if (!isWithinEndThreshold) {
+ this._sentEndForContentLength = 0;
}
}

9 changes: 9 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ const CONST = {
ADMIN_POLICIES_URL: 'admin_policies',
ADMIN_DOMAINS_URL: 'admin_domains',
INBOX: 'inbox',
DISMMISSED_REASON: '?dismissedReason=missingFeatures',
},

SIGN_IN_FORM_WIDTH: 300,
Expand Down Expand Up @@ -3174,6 +3175,14 @@ const CONST = {
CHAT_SPLIT: 'newDotSplitChat',
},

MANAGE_TEAMS_CHOICE: {
MULTI_LEVEL: 'multiLevelApproval',
CUSTOM_EXPENSE: 'customExpenseCoding',
CARD_TRACKING: 'companyCardTracking',
ACCOUNTING: 'accountingIntegrations',
RULE: 'ruleEnforcement',
},

MINI_CONTEXT_MENU_MAX_ITEMS: 4,

WORKSPACE_SWITCHER: {
Expand Down
Loading

0 comments on commit 54821c2

Please sign in to comment.