Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into krishna2323/issue/47272
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishna2323 authored Aug 23, 2024
2 parents 7c8e35e + 28fbed6 commit 052cbf4
Show file tree
Hide file tree
Showing 59 changed files with 4,925 additions and 115 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,6 @@ web-build/

# Storage location for downloaded app source maps (see scripts/symbolicate-profile.ts)
.sourcemaps/

# Jeykll
docs/.bundle
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009002400
versionName "9.0.24-0"
versionCode 1009002401
versionName "9.0.24-1"
// 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions config/webpack/webpack.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ const getConfiguration = (environment: Environment): Promise<Configuration> =>
snapshot: {
// A list of paths webpack trusts would not be modified while webpack is running
managedPaths: [
// Onyx can be modified on the fly, changes to other node_modules would not be reflected live
/([\\/]node_modules[\\/](?!react-native-onyx))/,
// Onyx and react-native-live-markdown can be modified on the fly, changes to other node_modules would not be reflected live
/([\\/]node_modules[\\/](?!react-native-onyx|@expensify\/react-native-live-markdown))/,
],
},
});
Expand Down
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>9.0.24.0</string>
<string>9.0.24.1</string>
<key>FullStory</key>
<dict>
<key>OrgId</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>9.0.24.0</string>
<string>9.0.24.1</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>9.0.24</string>
<key>CFBundleVersion</key>
<string>9.0.24.0</string>
<string>9.0.24.1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
17 changes: 15 additions & 2 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "9.0.24-0",
"version": "9.0.24-1",
"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 @@ -290,6 +290,7 @@
"jest-cli": "29.4.1",
"jest-environment-jsdom": "^29.4.1",
"jest-transformer-svg": "^2.0.1",
"link": "^2.1.1",
"memfs": "^4.6.0",
"onchange": "^7.1.0",
"openai": "^4.47.2",
Expand Down
4,513 changes: 4,513 additions & 0 deletions patches/link+2.1.1.patch

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,7 @@ const CONST = {
ARE_WORKFLOWS_ENABLED: 'areWorkflowsEnabled',
ARE_REPORT_FIELDS_ENABLED: 'areReportFieldsEnabled',
ARE_CONNECTIONS_ENABLED: 'areConnectionsEnabled',
ARE_COMPANY_CARDS_ENABLED: 'areCompanyCardsEnabled',
ARE_EXPENSIFY_CARDS_ENABLED: 'areExpensifyCardsEnabled',
ARE_INVOICES_ENABLED: 'areInvoicesEnabled',
ARE_TAXES_ENABLED: 'tax',
Expand Down Expand Up @@ -2428,6 +2429,7 @@ const CONST = {
WORKSPACE_MEMBERS: 'WorkspaceManageMembers',
WORKSPACE_EXPENSIFY_CARD: 'WorkspaceExpensifyCard',
WORKSPACE_WORKFLOWS: 'WorkspaceWorkflows',
WORKSPACE_COMPANY_CARDS: 'WorkspaceCompanyCards',
WORKSPACE_BANK_ACCOUNT: 'WorkspaceBankAccount',
WORKSPACE_SETTINGS: 'WorkspaceSettings',
WORKSPACE_FEATURES: 'WorkspaceFeatures',
Expand Down Expand Up @@ -5479,6 +5481,14 @@ const CONST = {
description: 'workspace.upgrade.taxCodes.description' as const,
icon: 'Coins',
},
companyCards: {
id: 'companyCards' as const,
alias: 'company-cards',
name: 'Company Cards',
title: 'workspace.upgrade.companyCards.title' as const,
description: 'workspace.upgrade.companyCards.description' as const,
icon: 'CompanyCard',
},
rules: {
id: 'rules' as const,
alias: 'rules',
Expand Down
2 changes: 2 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ const ONYXKEYS = {
// Shared NVPs
/** Collection of objects where each object represents the owner of the workspace that is past due billing AND the user is a member of. */
SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END: 'sharedNVP_private_billingGracePeriodEnd_',
SHARED_NVP_PRIVATE_DOMAIN_MEMBER: 'sharedNVP_private_domain_member_',

/**
* Stores the card list for a given fundID and feed in the format: cards_<fundID>_<bankName>
Expand Down Expand Up @@ -749,6 +750,7 @@ type OnyxCollectionValuesMapping = {
[ONYXKEYS.COLLECTION.POLICY_CONNECTION_SYNC_PROGRESS]: OnyxTypes.PolicyConnectionSyncProgress;
[ONYXKEYS.COLLECTION.SNAPSHOT]: OnyxTypes.SearchResults;
[ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END]: OnyxTypes.BillingGraceEndPeriod;
[ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER]: OnyxTypes.CompanyCards;
[ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS]: OnyxTypes.ExpensifyCardSettings;
[ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST]: OnyxTypes.WorkspaceCardsList;
[ONYXKEYS.COLLECTION.EXPENSIFY_CARD_CONTINUOUS_RECONCILIATION_CONNECTION]: OnyxTypes.PolicyConnectionName;
Expand Down
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,10 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/expensify-card/settings/frequency',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/expensify-card/settings/frequency` as const,
},
WORKSPACE_COMPANY_CARDS: {
route: 'settings/workspaces/:policyID/company-cards',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/company-cards` as const,
},
WORKSPACE_RULES: {
route: 'settings/workspaces/:policyID/rules',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/rules` as const,
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ const SCREENS = {
RATE_AND_UNIT: 'Workspace_RateAndUnit',
RATE_AND_UNIT_RATE: 'Workspace_RateAndUnit_Rate',
RATE_AND_UNIT_UNIT: 'Workspace_RateAndUnit_Unit',
COMPANY_CARDS: 'Workspace_CompanyCards',
EXPENSIFY_CARD: 'Workspace_ExpensifyCard',
EXPENSIFY_CARD_DETAILS: 'Workspace_ExpensifyCard_Details',
EXPENSIFY_CARD_LIMIT: 'Workspace_ExpensifyCard_Limit',
Expand Down
1 change: 0 additions & 1 deletion src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ function AttachmentModal({
onSelected: () => {
setIsDeleteReceiptConfirmModalVisible(true);
},
shouldCallAfterModalHide: true,
});
}
return menuItems;
Expand Down
38 changes: 19 additions & 19 deletions src/components/AvatarWithImagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as FileUtils from '@libs/fileDownload/FileUtils';
import getImageResolution from '@libs/fileDownload/getImageResolution';
import type {AvatarSource} from '@libs/UserUtils';
import variables from '@styles/variables';
import * as Modal from '@userActions/Modal';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import type * as OnyxCommon from '@src/types/onyx/OnyxCommon';
Expand Down Expand Up @@ -43,7 +44,6 @@ type MenuItem = {
icon: IconAsset;
text: string;
onSelected: () => void;
shouldCallAfterModalHide?: boolean;
};

type AvatarWithImagePickerProps = {
Expand Down Expand Up @@ -260,19 +260,19 @@ function AvatarWithImagePicker({
* Create menu items list for avatar menu
*/
const createMenuItems = (openPicker: OpenPicker): MenuItem[] => {
const menuItems: MenuItem[] = [
const menuItems = [
{
icon: Expensicons.Upload,
text: translate('avatarWithImagePicker.uploadPhoto'),
onSelected: () => {
if (Browser.isSafari()) {
return;
}
openPicker({
onPicked: showAvatarCropModal,
});
},
shouldCallAfterModalHide: true,
onSelected: () =>
Modal.close(() => {
if (Browser.isSafari()) {
return;
}
openPicker({
onPicked: showAvatarCropModal,
});
}),
},
];

Expand Down Expand Up @@ -344,14 +344,14 @@ function AvatarWithImagePicker({
menuItems.push({
icon: Expensicons.Eye,
text: translate('avatarWithImagePicker.viewPhoto'),
onSelected: () => {
if (typeof onViewPhotoPress !== 'function') {
show();
return;
}
onViewPhotoPress();
},
shouldCallAfterModalHide: true,
onSelected: () =>
Modal.close(() => {
if (typeof onViewPhotoPress !== 'function') {
show();
return;
}
onViewPhotoPress();
}),
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/ButtonWithDropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import mergeRefs from '@libs/mergeRefs';
import * as Modal from '@userActions/Modal';
import CONST from '@src/CONST';
import type {AnchorPosition} from '@src/styles';
import type {ButtonWithDropdownMenuProps} from './types';
Expand Down Expand Up @@ -177,12 +178,11 @@ function ButtonWithDropdownMenu<IValueType>({
menuItems={options.map((item, index) => ({
...item,
onSelected: item.onSelected
? () => item.onSelected?.()
? () => Modal.close(() => item.onSelected?.())
: () => {
onOptionSelected?.(item);
setSelectedItemIndex(index);
},
shouldCallAfterModalHide: true,
}))}
/>
)}
Expand Down
1 change: 1 addition & 0 deletions src/components/FocusTrap/WIDE_LAYOUT_INACTIVE_SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const WIDE_LAYOUT_INACTIVE_SCREENS: string[] = [
SCREENS.WORKSPACE.TAXES,
SCREENS.WORKSPACE.REPORT_FIELDS,
SCREENS.WORKSPACE.EXPENSIFY_CARD,
SCREENS.WORKSPACE.COMPANY_CARDS,
SCREENS.WORKSPACE.DISTANCE_RATES,
SCREENS.SEARCH.CENTRAL_PANE,
SCREENS.SETTINGS.TROUBLESHOOT,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon/Illustrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import CheckmarkCircle from '@assets/images/simple-illustrations/simple-illustra
import CoffeeMug from '@assets/images/simple-illustrations/simple-illustration__coffeemug.svg';
import Coins from '@assets/images/simple-illustrations/simple-illustration__coins.svg';
import CommentBubbles from '@assets/images/simple-illustrations/simple-illustration__commentbubbles.svg';
import CompanyCard from '@assets/images/simple-illustrations/simple-illustration__company-card.svg';
import ConciergeBubble from '@assets/images/simple-illustrations/simple-illustration__concierge-bubble.svg';
import ConciergeNew from '@assets/images/simple-illustrations/simple-illustration__concierge.svg';
import CreditCardsNew from '@assets/images/simple-illustrations/simple-illustration__credit-cards.svg';
Expand Down Expand Up @@ -102,6 +101,7 @@ import Tire from '@assets/images/simple-illustrations/simple-illustration__tire.
import TrackShoe from '@assets/images/simple-illustrations/simple-illustration__track-shoe.svg';
import TrashCan from '@assets/images/simple-illustrations/simple-illustration__trashcan.svg';
import TreasureChest from '@assets/images/simple-illustrations/simple-illustration__treasurechest.svg';
import CompanyCard from '@assets/images/simple-illustrations/simple-illustration__twocards-horizontal.svg';
import VirtualCard from '@assets/images/simple-illustrations/simple-illustration__virtualcard.svg';
import WalletAlt from '@assets/images/simple-illustrations/simple-illustration__wallet-alt.svg';
import Workflows from '@assets/images/simple-illustrations/simple-illustration__workflows.svg';
Expand Down
11 changes: 0 additions & 11 deletions src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import * as Modal from '@userActions/Modal';
import CONST from '@src/CONST';
import type {AnchorPosition} from '@src/styles';
import type AnchorAlignment from '@src/types/utils/AnchorAlignment';
Expand Down Expand Up @@ -36,11 +35,6 @@ type PopoverMenuItem = MenuItemProps & {

/** Determines whether the menu item is disabled or not */
disabled?: boolean;

/** Determines whether the menu item's onSelected() function is called after the modal is hidden
* It is meant to be used in situations where, after clicking on the modal, another one is opened.
*/
shouldCallAfterModalHide?: boolean;
};

type PopoverModalProps = Pick<ModalProps, 'animationIn' | 'animationOut' | 'animationInTiming'>;
Expand Down Expand Up @@ -134,11 +128,6 @@ function PopoverMenu({
setEnteredSubMenuIndexes([...enteredSubMenuIndexes, index]);
const selectedSubMenuItemIndex = selectedItem?.subMenuItems.findIndex((option) => option.isSelected);
setFocusedIndex(selectedSubMenuItemIndex);
} else if (selectedItem.shouldCallAfterModalHide) {
Modal.close(() => {
onItemSelected(selectedItem, index);
selectedItem.onSelected?.();
});
} else {
onItemSelected(selectedItem, index);
selectedItem.onSelected?.();
Expand Down
13 changes: 13 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2112,6 +2112,7 @@ export default {
expensifyCard: 'Expensify Card',
workflows: 'Workflows',
workspace: 'Workspace',
companyCards: 'Company cards',
edit: 'Edit workspace',
enabled: 'Enabled',
disabled: 'Disabled',
Expand Down Expand Up @@ -2876,6 +2877,13 @@ export default {
ctaTitle: 'Issue new card',
},
},
companyCards: {
title: 'Company Cards',
subtitle: 'Import spend from existing company cards',
disableCardTitle: 'Disable Company Cards',
disableCardPrompt: 'You can’t disable company cards because this feature is in use. Reach out to the Concierge for next steps.',
disableCardButton: 'Chat with Concierge',
},
workflows: {
title: 'Workflows',
subtitle: 'Configure how spend is approved and paid.',
Expand Down Expand Up @@ -3559,6 +3567,11 @@ export default {
description: `Add tax codes to your taxes for easy export of expenses to your accounting and payroll systems.`,
onlyAvailableOnPlan: 'Tax codes are only available on the Control plan, starting at ',
},
companyCards: {
title: 'Company Cards',
description: `Company cards lets you import spend for existing company cards from all major card issuers. You can assign cards to employees, and automatically import transactions.`,
onlyAvailableOnPlan: 'Company cards are only available on the Control plan, starting at ',
},
rules: {
title: 'Rules',
description: `Rules run in the background and keep your spend under control so you don't have to sweat the small stuff.\n\nRequire expense details like receipts and descriptions, set limits and defaults, and automate approvals and payments – all in one place.`,
Expand Down
Loading

0 comments on commit 052cbf4

Please sign in to comment.