Skip to content

Commit

Permalink
Merge branch 'main' into @chrispader/bump-onyx-to-2-0-40
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed May 17, 2024
2 parents bcc3f96 + e8ae3c5 commit 789b646
Show file tree
Hide file tree
Showing 274 changed files with 4,669 additions and 3,910 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'],
},
};
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 1001047304
versionName "1.4.73-4"
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.

1 change: 1 addition & 0 deletions docs/redirects.csv
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,4 @@ https://help.expensify.com/articles/new-expensify/getting-started/Free-plan-upgr
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.4</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.4</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.4</string>
<string>1.4.74.4</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-4",
"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
22 changes: 14 additions & 8 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 @@ -1047,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 @@ -1058,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 @@ -3565,7 +3568,7 @@ const CONST = {
TRACK_EXPENSE: 'track-expenses',
},
'track-expenses': {
VIDEO_URL: `${CLOUDFRONT_URL}/videos/guided-setup-track-business.mp4`,
VIDEO_URL: `${CLOUDFRONT_URL}/videos/guided-setup-track-business-v2.mp4`,
LEARN_MORE_LINK: `${USE_EXPENSIFY_URL}/track-expenses`,
},
},
Expand All @@ -3581,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 @@ -3778,7 +3781,7 @@ const CONST = {
[onboardingChoices.EMPLOYER]: {
message: 'Getting paid back is as easy as sending a message. Let’s go over the basics.',
video: {
url: `${CLOUDFRONT_URL}/videos/guided-setup-get-paid-back.mp4`,
url: `${CLOUDFRONT_URL}/videos/guided-setup-get-paid-back-v2.mp4`,
thumbnailUrl: `${CLOUDFRONT_URL}/images/guided-setup-get-paid-back.jpg`,
duration: 55,
width: 1280,
Expand Down Expand Up @@ -3821,7 +3824,7 @@ const CONST = {
[onboardingChoices.MANAGE_TEAM]: {
message: 'Here are some important tasks to help get your team’s expenses under control.',
video: {
url: `${CLOUDFRONT_URL}/videos/guided-setup-manage-team.mp4`,
url: `${CLOUDFRONT_URL}/videos/guided-setup-manage-team-v2.mp4`,
thumbnailUrl: `${CLOUDFRONT_URL}/images/guided-setup-manage-team.jpg`,
duration: 55,
width: 1280,
Expand Down Expand Up @@ -3907,7 +3910,7 @@ const CONST = {
[onboardingChoices.PERSONAL_SPEND]: {
message: 'Here’s how to track your spend in a few clicks.',
video: {
url: `${CLOUDFRONT_URL}/videos/guided-setup-track-personal.mp4`,
url: `${CLOUDFRONT_URL}/videos/guided-setup-track-personal-v2.mp4`,
thumbnailUrl: `${CLOUDFRONT_URL}/images/guided-setup-track-personal.jpg`,
duration: 55,
width: 1280,
Expand Down Expand Up @@ -3935,7 +3938,7 @@ const CONST = {
[onboardingChoices.CHAT_SPLIT]: {
message: 'Splitting bills with friends is as easy as sending a message. Here’s how.',
video: {
url: `${CLOUDFRONT_URL}/videos/guided-setup-chat-split-bills.mp4`,
url: `${CLOUDFRONT_URL}/videos/guided-setup-chat-split-bills-v2.mp4`,
thumbnailUrl: `${CLOUDFRONT_URL}/images/guided-setup-chat-split-bills.jpg`,
duration: 55,
width: 1280,
Expand Down Expand Up @@ -4764,6 +4767,9 @@ const CONST = {
DISTANCE: 'distance',
},

SEARCH_RESULTS_PAGE_SIZE: 50,
SEARCH_BOTTOM_TAB_URL: '/Search_Bottom_Tab',

SEARCH_DATA_TYPES: {
TRANSACTION: 'transaction',
},
Expand Down
10 changes: 7 additions & 3 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ type ExpensifyOnyxProps = {

type ExpensifyProps = ExpensifyOnyxProps;

const SplashScreenHiddenContext = React.createContext({});
type SplashScreenHiddenContextType = {isSplashHidden?: boolean};

const SplashScreenHiddenContext = React.createContext<SplashScreenHiddenContextType>({});

function Expensify({
isCheckingPublicRoom = true,
Expand Down Expand Up @@ -140,8 +142,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
6 changes: 6 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ const ONYXKEYS = {
/** Onboarding Purpose selected by the user during Onboarding flow */
ONBOARDING_PURPOSE_SELECTED: 'onboardingPurposeSelected',

/** Onboarding policyID selected by the user during Onboarding flow */
ONBOARDING_POLICY_ID: 'onboardingPolicyID',

/** Onboarding Purpose selected by the user during Onboarding flow */
ONBOARDING_ADMINS_CHAT_REPORT_ID: 'onboardingAdminsChatReportID',

Expand Down Expand Up @@ -336,6 +339,7 @@ const ONYXKEYS = {
WORKSPACE_INVITE_MEMBERS_DRAFT: 'workspaceInviteMembersDraft_',
WORKSPACE_INVITE_MESSAGE_DRAFT: 'workspaceInviteMessageDraft_',
REPORT: 'report_',
REPORT_NAME_VALUE_PAIRS: 'reportNameValuePairs_',
REPORT_DRAFT: 'reportDraft_',
// REPORT_METADATA is a perf optimization used to hold loading states (isLoadingInitialReportActions, isLoadingOlderReportActions, isLoadingNewerReportActions).
// A lot of components are connected to the Report entity and do not care about the actions. Setting the loading state
Expand Down Expand Up @@ -548,6 +552,7 @@ type OnyxCollectionValuesMapping = {
[ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT]: OnyxTypes.InvitedEmailsToAccountIDs;
[ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MESSAGE_DRAFT]: string;
[ONYXKEYS.COLLECTION.REPORT]: OnyxTypes.Report;
[ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS]: OnyxTypes.ReportNameValuePairs;
[ONYXKEYS.COLLECTION.REPORT_DRAFT]: OnyxTypes.Report;
[ONYXKEYS.COLLECTION.REPORT_METADATA]: OnyxTypes.ReportMetadata;
[ONYXKEYS.COLLECTION.REPORT_ACTIONS]: OnyxTypes.ReportActions;
Expand Down Expand Up @@ -662,6 +667,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.MAX_CANVAS_HEIGHT]: number;
[ONYXKEYS.MAX_CANVAS_WIDTH]: number;
[ONYXKEYS.ONBOARDING_PURPOSE_SELECTED]: string;
[ONYXKEYS.ONBOARDING_POLICY_ID]: string;
[ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID]: string;
[ONYXKEYS.IS_SEARCHING_FOR_REPORTS]: boolean;
[ONYXKEYS.LAST_VISITED_PATH]: string | undefined;
Expand Down
4 changes: 0 additions & 4 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,6 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/export/invoice-account-select',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/export/invoice-account-select` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_PAYABLE_SELECT: {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/export/company-card-expense-account/account-payable-select',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/export/company-card-expense-account/account-payable-select` as const,
},
POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_PREFERRED_EXPORTER: {
route: 'settings/workspaces/:policyID/accounting/quickbooks-online/export/preferred-exporter',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-online/export/preferred-exporter` as const,
Expand Down
Loading

0 comments on commit 789b646

Please sign in to comment.