Skip to content

Commit

Permalink
Merge branch 'main' into hayata-do-not-allow-users-from-requiring-tag…
Browse files Browse the repository at this point in the history
…s-when-there-is-no-active-tags
  • Loading branch information
Hayata Suenaga committed May 16, 2024
2 parents a6a3c05 + 5900fea commit cf290b1
Show file tree
Hide file tree
Showing 338 changed files with 6,927 additions and 5,116 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 .github/libs/sanitizeStringForJSONParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const replacer = (str: string): string =>
* Solution partly taken from SO user Gabriel Rodríguez Flores 🙇
* https://stackoverflow.com/questions/52789718/how-to-remove-special-characters-before-json-parse-while-file-reading
*/
const sanitizeStringForJSONParse = (inputString: string): string => {
const sanitizeStringForJSONParse = (inputString: string | number | boolean | null | undefined): string => {
if (typeof inputString !== 'string') {
throw new TypeError('Input must me of type String');
}
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: 1 addition & 3 deletions __mocks__/@react-navigation/native/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import {useIsFocused as realUseIsFocused, useTheme as realUseTheme} from '@react
// We only want these mocked for storybook, not jest
const useIsFocused: typeof realUseIsFocused = process.env.NODE_ENV === 'test' ? realUseIsFocused : () => true;

// @ts-expect-error as we're mocking this function
const useTheme: typeof realUseTheme = process.env.NODE_ENV === 'test' ? realUseTheme : () => ({});
const useTheme = process.env.NODE_ENV === 'test' ? realUseTheme : () => ({});

export * from '@react-navigation/core';
export * from '@react-navigation/native';
export {useIsFocused, useTheme};
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 1001047404
versionName "1.4.74-4"
// 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ After adopting the new Expensify Card, domain admins can issue virtual cards to

**To assign a virtual card:**

1. Head to **Settings** > **Domains** > [**Company Cards**](https://www.expensify.com/domain_companycards).
2. Click the **Issue Virtual Cards** button.
3. Enter a card name (i.e., "Google Ads").
4. Select a domain member to assign the card to.
5. Enter a card limit.
6. Select a **Limit Type** of _Fixed_ or _Monthly_.
7. Click **Issue Card**.
Head to **Settings** > **Domains** > [**Company Cards**](https://www.expensify.com/domain_companycards) and click the **Issue Virtual Cards** button. From there:

1. Enter a card name (i.e., "Google Ads").
2. Select a domain member to assign the card to.
3. Enter a card limit.
4. Select a **Limit Type** of _Fixed_ or _Monthly_.
5. Click **Issue Card**.

![The Issue Virtual Cards modal is open in the middle of the screen. There are four options to set; Card Name, Assignee, Card Limit, and Limit type. A cancel (left) and save (right) button are at the bottom right of the modal.]({{site.url}}/assets/images/AdminissuedVirtualCards.png){:width="100%"}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ The sky's the limit for this referral program! Your referral can be anyone - a f

1. There are a bunch of different ways to refer someone to New Expensify:
- Start a chat
- Request money
- Send money
- Split a bill
- Submit an expense to them
- Split an expense with them
- Pay someone (them)
- Assign them a task
- @ mention them
- Invite them to a room
Expand Down
31 changes: 0 additions & 31 deletions docs/articles/expensify-classic/workspaces/reports/Currency.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Resolve Errors Adding a Bank Account
description: Troubleshooting issues adding a business bank account in Expensify.
---
<div id="new-expensify" markdown="1">

Expensify is required to verify the identity of the individual who is connecting a business bank account.

**If you get a generic error message while uploading your ID, please go through the following steps:**
1. Ensure you are using either Safari (on iPhone) or Chrome (on Android) as your web browser.
2. Check your browser's permissions to make sure that the camera and microphone settings are set to "Allow"
3. Clear your web cache for Safari (on iPhone) or Chrome (on Android).
4. If using a corporate Wi-Fi network, confirm that your corporate firewall isn't blocking the website.
5. Make sure no other apps are overlapping your screen, such as the Facebook Messenger bubble, while recording the video.
6. On iPhone, if using iOS version 15 or later, disable the Hide IP address feature in Safari.
7. If possible, try these steps on another device
8. If you have another phone available, try to follow these steps on that device

If the issue persists, please contact your Account Manager or Concierge for further troubleshooting assistance.

</div>
2 changes: 2 additions & 0 deletions docs/redirects.csv
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,5 @@ https://help.expensify.com/articles/expensify-classic/reports/The-Reports-Page,h
https://help.expensify.com/articles/new-expensify/getting-started/Free-plan-upgrade-to-collect-plan,https://help.expensify.com/articles/new-expensify/getting-started/Upgrade-to-a-Collect-Plan
https://help.expensify.com/articles/new-expensify/bank-accounts-and-payments/Connect-a-Bank-Account,https://help.expensify.com/new-expensify/hubs/expenses/Connect-a-Bank-Account
https://help.expensify.com/articles/new-expensify/settings/Profile,https://help.expensify.com/new-expensify/hubs/settings/
https://help.expensify.com/articles/new-expensify/expenses/Referral-Program.html,https://help.expensify.com/articles/expensify-classic/expensify-partner-program/Referral-Program
https://help.expensify.com/articles/expensify-classic/workspaces/reports/Currency,https://help.expensify.com/articles/expensify-classic/workspaces/Currency
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.4</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.4</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.4</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
12 changes: 6 additions & 6 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.73-1",
"version": "1.4.74-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 @@ -65,7 +65,7 @@
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@dotlottie/react-player": "^1.6.3",
"@expensify/react-native-live-markdown": "0.1.69",
"@expensify/react-native-live-markdown": "0.1.70",
"@expo/metro-runtime": "~3.1.1",
"@formatjs/intl-datetimeformat": "^6.10.0",
"@formatjs/intl-listformat": "^7.2.2",
Expand Down
Loading

0 comments on commit cf290b1

Please sign in to comment.