Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into fix-blankArea-after-loading-pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 authored May 15, 2024
2 parents c134239 + 4705d89 commit 9c1b2c4
Show file tree
Hide file tree
Showing 247 changed files with 3,689 additions and 2,567 deletions.
14 changes: 10 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
**/node_modules/*
**/dist/*
android/**/build/*
.github/actions/**/index.js"
!.storybook
!.github
.github/actions/**/index.js
*.config.js
**/.eslintrc.js
**/node_modules/**
**/dist/**
android/**/build/**
docs/vendor/**
docs/assets/**
web/gtm.js
371 changes: 164 additions & 207 deletions .eslintrc.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion .github/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// For all these Node.js scripts, we do not want to disable `console` statements
module.exports = {
rules: {
// For all these Node.js scripts, we do not want to disable `console` statements
'no-console': 'off',

'@lwc/lwc/no-async-await': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ import {promiseDoWhile} from '@github/libs/promiseWhile';
type CurrentStagingDeploys = Awaited<ReturnType<typeof GitHubUtils.octokit.actions.listWorkflowRuns>>['data']['workflow_runs'];

function run() {
console.info('[awaitStagingDeploys] POLL RATE', CONST.POLL_RATE);
console.info('[awaitStagingDeploys] run()');
console.info('[awaitStagingDeploys] getStringInput', getStringInput);
console.info('[awaitStagingDeploys] GitHubUtils', GitHubUtils);
console.info('[awaitStagingDeploys] promiseDoWhile', promiseDoWhile);

const tag = getStringInput('TAG', {required: false});
console.info('[awaitStagingDeploys] run() tag', tag);

let currentStagingDeploys: CurrentStagingDeploys = [];

console.info('[awaitStagingDeploys] run() _.throttle', lodashThrottle);

const throttleFunc = () =>
Promise.all([
// These are active deploys
Expand All @@ -42,24 +33,20 @@ function run() {
}),
])
.then((responses) => {
console.info('[awaitStagingDeploys] listWorkflowRuns responses', responses);
const workflowRuns = responses[0].data.workflow_runs;
if (!tag && typeof responses[1] === 'object') {
workflowRuns.push(...responses[1].data.workflow_runs);
}
console.info('[awaitStagingDeploys] workflowRuns', workflowRuns);
return workflowRuns;
})
.then((workflowRuns) => (currentStagingDeploys = workflowRuns.filter((workflowRun) => workflowRun.status !== 'completed')))
.then(() => {
console.info('[awaitStagingDeploys] currentStagingDeploys', currentStagingDeploys);
console.log(
!currentStagingDeploys.length
? 'No current staging deploys found'
: `Found ${currentStagingDeploys.length} staging deploy${currentStagingDeploys.length > 1 ? 's' : ''} still running...`,
);
});
console.info('[awaitStagingDeploys] run() throttleFunc', throttleFunc);

return promiseDoWhile(
() => !!currentStagingDeploys.length,
Expand Down
16 changes: 0 additions & 16 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12131,15 +12131,8 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
const promiseWhile_1 = __nccwpck_require__(9438);
function run() {
console.info('[awaitStagingDeploys] POLL RATE', CONST_1.default.POLL_RATE);
console.info('[awaitStagingDeploys] run()');
console.info('[awaitStagingDeploys] getStringInput', ActionUtils_1.getStringInput);
console.info('[awaitStagingDeploys] GitHubUtils', GithubUtils_1.default);
console.info('[awaitStagingDeploys] promiseDoWhile', promiseWhile_1.promiseDoWhile);
const tag = (0, ActionUtils_1.getStringInput)('TAG', { required: false });
console.info('[awaitStagingDeploys] run() tag', tag);
let currentStagingDeploys = [];
console.info('[awaitStagingDeploys] run() _.throttle', throttle_1.default);
const throttleFunc = () => Promise.all([
// These are active deploys
GithubUtils_1.default.octokit.actions.listWorkflowRuns({
Expand All @@ -12159,22 +12152,18 @@ function run() {
}),
])
.then((responses) => {
console.info('[awaitStagingDeploys] listWorkflowRuns responses', responses);
const workflowRuns = responses[0].data.workflow_runs;
if (!tag && typeof responses[1] === 'object') {
workflowRuns.push(...responses[1].data.workflow_runs);
}
console.info('[awaitStagingDeploys] workflowRuns', workflowRuns);
return workflowRuns;
})
.then((workflowRuns) => (currentStagingDeploys = workflowRuns.filter((workflowRun) => workflowRun.status !== 'completed')))
.then(() => {
console.info('[awaitStagingDeploys] currentStagingDeploys', currentStagingDeploys);
console.log(!currentStagingDeploys.length
? 'No current staging deploys found'
: `Found ${currentStagingDeploys.length} staging deploy${currentStagingDeploys.length > 1 ? 's' : ''} still running...`);
});
console.info('[awaitStagingDeploys] run() throttleFunc', throttleFunc);
return (0, promiseWhile_1.promiseDoWhile)(() => !!currentStagingDeploys.length, (0, throttle_1.default)(throttleFunc,
// Poll every 60 seconds instead of every 10 seconds
CONST_1.default.POLL_RATE * 6));
Expand Down Expand Up @@ -12730,15 +12719,13 @@ exports.promiseDoWhile = exports.promiseWhile = void 0;
* Simulates a while loop where the condition is determined by the result of a Promise.
*/
function promiseWhile(condition, action) {
console.info('[promiseWhile] promiseWhile()');
return new Promise((resolve, reject) => {
const loop = function () {
if (!condition()) {
resolve();
}
else {
const actionResult = action?.();
console.info('[promiseWhile] promiseWhile() actionResult', actionResult);
if (!actionResult) {
resolve();
return;
Expand All @@ -12759,11 +12746,8 @@ exports.promiseWhile = promiseWhile;
* Simulates a do-while loop where the condition is determined by the result of a Promise.
*/
function promiseDoWhile(condition, action) {
console.info('[promiseWhile] promiseDoWhile()');
return new Promise((resolve, reject) => {
console.info('[promiseWhile] promiseDoWhile() condition', condition);
const actionResult = action?.();
console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);
if (!actionResult) {
resolve();
return;
Expand Down
8 changes: 1 addition & 7 deletions .github/libs/promiseWhile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ import type {DebouncedFunc} from 'lodash';
* Simulates a while loop where the condition is determined by the result of a Promise.
*/
function promiseWhile(condition: () => boolean, action: (() => Promise<void>) | DebouncedFunc<() => Promise<void>> | undefined): Promise<void> {
console.info('[promiseWhile] promiseWhile()');

return new Promise((resolve, reject) => {
const loop = function () {
if (!condition()) {
resolve();
} else {
const actionResult = action?.();
console.info('[promiseWhile] promiseWhile() actionResult', actionResult);

if (!actionResult) {
resolve();
Expand All @@ -35,12 +32,9 @@ function promiseWhile(condition: () => boolean, action: (() => Promise<void>) |
* Simulates a do-while loop where the condition is determined by the result of a Promise.
*/
function promiseDoWhile(condition: () => boolean, action: (() => Promise<void>) | DebouncedFunc<() => Promise<void>> | undefined): Promise<void> {
console.info('[promiseWhile] promiseDoWhile()');

return new Promise((resolve, reject) => {
console.info('[promiseWhile] promiseDoWhile() condition', condition);
const actionResult = action?.();
console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);

if (!actionResult) {
resolve();
return;
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import './fonts.css';
Onyx.init({
keys: ONYXKEYS,
initialKeyStates: {
[ONYXKEYS.NETWORK]: {isOffline: false},
[ONYXKEYS.NETWORK]: {isOffline: false, isBackendReachable: true},
},
});

Expand Down
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 1001047301
versionName "1.4.73-1"
versionCode 1001047400
versionName "1.4.74-0"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.73</string>
<string>1.4.74</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.73.1</string>
<string>1.4.74.0</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.73</string>
<string>1.4.74</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.73.1</string>
<string>1.4.74.0</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key>
<string>1.4.73</string>
<string>1.4.74</string>
<key>CFBundleVersion</key>
<string>1.4.73.1</string>
<string>1.4.74.0</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.4.73-1",
"version": "1.4.74-0",
"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
12 changes: 12 additions & 0 deletions patches/react-native+0.73.4+015+copyStateOnClone.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp b/node_modules/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp
index 641b6d2..6adeb1b 100644
--- a/node_modules/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp
+++ b/node_modules/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp
@@ -331,6 +331,7 @@ ShadowNode::Unshared ShadowNode::cloneTree(
childNode = parentNode.clone({
ShadowNodeFragment::propsPlaceholder(),
std::make_shared<ShadowNode::ListOfShared>(children),
+ parentNode.getState(),
});
}

29 changes: 26 additions & 3 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,10 @@ const CONST = {
EMPTY_ARRAY,
EMPTY_OBJECT,
USE_EXPENSIFY_URL,
STATUS_EXPENSIFY_URL: 'https://status.expensify.com',
GOOGLE_MEET_URL_ANDROID: 'https://meet.google.com',
GOOGLE_DOC_IMAGE_LINK_MATCH: 'googleusercontent.com',
GOOGLE_CLOUD_URL: 'https://clients3.google.com/generate_204',
IMAGE_BASE64_MATCH: 'base64',
DEEPLINK_BASE_URL: 'new-expensify://',
PDF_VIEWER_URL: '/pdf/web/viewer.html',
Expand Down Expand Up @@ -936,9 +938,12 @@ const CONST = {
MERCHANT: 'merchant',
FROM: 'from',
TO: 'to',
CATEGORY: 'category',
TAG: 'tag',
TOTAL: 'total',
TYPE: 'type',
ACTION: 'action',
TAX_AMOUNT: 'taxAmount',
},
PRIORITY_MODE: {
GSD: 'gsd',
Expand Down Expand Up @@ -1044,6 +1049,7 @@ const CONST = {
MAX_RETRY_WAIT_TIME_MS: 10 * 1000,
PROCESS_REQUEST_DELAY_MS: 1000,
MAX_PENDING_TIME_MS: 10 * 1000,
BACKEND_CHECK_INTERVAL_MS: 60 * 1000,
MAX_REQUEST_RETRIES: 10,
NETWORK_STATUS: {
ONLINE: 'online',
Expand All @@ -1055,7 +1061,7 @@ const CONST = {
DEFAULT_TIME_ZONE: {automatic: true, selected: 'America/Los_Angeles'},
DEFAULT_ACCOUNT_DATA: {errors: null, success: '', isLoading: false},
DEFAULT_CLOSE_ACCOUNT_DATA: {errors: null, success: '', isLoading: false},
DEFAULT_NETWORK_DATA: {isOffline: false},
DEFAULT_NETWORK_DATA: {isOffline: false, isBackendReachable: true},
FORMS: {
LOGIN_FORM: 'LoginForm',
VALIDATE_CODE_FORM: 'ValidateCodeForm',
Expand Down Expand Up @@ -1298,8 +1304,15 @@ const CONST = {
XERO_CONFIG: {
AUTO_SYNC: 'autoSync',
SYNC: 'sync',
ENABLE_NEW_CATEGORIES: 'enableNewCategories',
EXPORT: 'export',
IMPORT_CUSTOMERS: 'importCustomers',
IMPORT_TAX_RATES: 'importTaxRates',
INVOICE_STATUS: {
AWAITING_PAYMENT: 'AWT_PAYMENT',
DRAFT: 'DRAFT',
AWAITING_APPROVAL: 'AWT_APPROVAL',
},
IMPORT_TRACKING_CATEGORIES: 'importTrackingCategories',
MAPPINGS: 'mappings',
TRACKING_CATEGORY_PREFIX: 'trackingCategory_',
Expand All @@ -1319,6 +1332,12 @@ const CONST = {
JOURNAL_ENTRY: 'journal_entry',
},

XERO_EXPORT_DATE: {
LAST_EXPENSE: 'LAST_EXPENSE',
REPORT_EXPORTED: 'REPORT_EXPORTED',
REPORT_SUBMITTED: 'REPORT_SUBMITTED',
},

QUICKBOOKS_EXPORT_DATE: {
LAST_EXPENSE: 'LAST_EXPENSE',
REPORT_EXPORTED: 'REPORT_EXPORTED',
Expand Down Expand Up @@ -1784,6 +1803,8 @@ const CONST = {
XERO_SYNC_IMPORT_CUSTOMERS: 'xeroSyncImportCustomers',
XERO_SYNC_IMPORT_BANK_ACCOUNTS: 'xeroSyncImportBankAccounts',
XERO_SYNC_IMPORT_TAX_RATES: 'xeroSyncImportTaxRates',
XERO_CHECK_CONNECTION: 'xeroCheckConnection',
XERO_SYNC_TITLE: 'xeroSyncTitle',
},
},
ACCESS_VARIANTS: {
Expand Down Expand Up @@ -3563,10 +3584,10 @@ const CONST = {
BACK_BUTTON_NATIVE_ID: 'backButton',

/**
* The maximum count of items per page for OptionsSelector.
* The maximum count of items per page for SelectionList.
* When paginate, it multiplies by page number.
*/
MAX_OPTIONS_SELECTOR_PAGE_LENGTH: 500,
MAX_SELECTION_LIST_PAGE_LENGTH: 500,

/**
* Bank account names
Expand Down Expand Up @@ -4746,6 +4767,8 @@ const CONST = {
DISTANCE: 'distance',
},

SEARCH_BOTTOM_TAB_URL: '/Search_Bottom_Tab',

SEARCH_DATA_TYPES: {
TRANSACTION: 'transaction',
},
Expand Down
6 changes: 4 additions & 2 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ function Expensify({
// Initialize this client as being an active client
ActiveClientManager.init();

// Used for the offline indicator appearing when someone is offline
NetworkConnection.subscribeToNetInfo();
// Used for the offline indicator appearing when someone is offline or backend is unreachable
const unsubscribeNetworkStatus = NetworkConnection.subscribeToNetworkStatus();

return () => unsubscribeNetworkStatus();
}, []);

useEffect(() => {
Expand Down
Loading

0 comments on commit 9c1b2c4

Please sign in to comment.