Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into krishna2323/issue/41440
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishna2323 authored Jun 11, 2024
2 parents 721e407 + 6044241 commit 41276b8
Show file tree
Hide file tree
Showing 75 changed files with 787 additions and 313 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001048016
versionName "1.4.80-16"
versionCode 1001048107
versionName "1.4.81-7"
// 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 docs/_data/_routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ platforms:

- href: integrations
title: Integrations
icon: /assets/images/workflow.svg
icon: /assets/images/simple-illustration__monitor-remotesync.svg
description: Integrate with accounting or HR software to streamline expense approvals.

- href: spending-insights
Expand Down Expand Up @@ -131,7 +131,7 @@ platforms:

- href: connections
title: Connections
icon: /assets/images/workflow.svg
icon: /assets/images/simple-illustration__monitor-remotesync.svg
description: Connect to accounting software to streamline expense approvals.

- href: settings
Expand Down
30 changes: 30 additions & 0 deletions docs/assets/images/simple-illustration__monitor-remotesync.svg
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 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.80</string>
<string>1.4.81</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.80.16</string>
<string>1.4.81.7</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.80</string>
<string>1.4.81</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.80.16</string>
<string>1.4.81.7</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.80</string>
<string>1.4.81</string>
<key>CFBundleVersion</key>
<string>1.4.80.16</string>
<string>1.4.81.7</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ PODS:
- RNGoogleSignin (10.0.1):
- GoogleSignIn (~> 7.0)
- React-Core
- RNLiveMarkdown (0.1.82):
- RNLiveMarkdown (0.1.83):
- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
Expand All @@ -1870,9 +1870,9 @@ PODS:
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNLiveMarkdown/common (= 0.1.82)
- RNLiveMarkdown/common (= 0.1.83)
- Yoga
- RNLiveMarkdown/common (0.1.82):
- RNLiveMarkdown/common (0.1.83):
- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
Expand Down Expand Up @@ -2589,7 +2589,7 @@ SPEC CHECKSUMS:
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNGestureHandler: 74b7b3d06d667ba0bbf41da7718f2607ae0dfe8f
RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0
RNLiveMarkdown: d160a948e52282067439585c89a3962582c082ce
RNLiveMarkdown: 88030b7d9a31f5f6e67743df48ad952d64513b4a
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
rnmapbox-maps: df8fe93dbd251f25022f4023d31bc04160d4d65c
RNPermissions: 0b61d30d21acbeafe25baaa47d9bae40a0c65216
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.80-16",
"version": "1.4.81-7",
"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.82",
"@expensify/react-native-live-markdown": "0.1.83",
"@expo/metro-runtime": "~3.1.1",
"@formatjs/intl-datetimeformat": "^6.10.0",
"@formatjs/intl-listformat": "^7.2.2",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {PickerStateProvider} from 'react-native-picker-select';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import '../wdyr';
import ActiveElementRoleProvider from './components/ActiveElementRoleProvider';
import ActiveWorkspaceContextProvider from './components/ActiveWorkspace/ActiveWorkspaceProvider';
import ActiveWorkspaceContextProvider from './components/ActiveWorkspaceProvider';
import ColorSchemeWrapper from './components/ColorSchemeWrapper';
import ComposeProviders from './components/ComposeProviders';
import CustomStatusBarAndBackground from './components/CustomStatusBarAndBackground';
Expand Down
8 changes: 7 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ const CONST = {
NAME_DISTANCE: 'Distance',
DISTANCE_UNIT_MILES: 'mi',
DISTANCE_UNIT_KILOMETERS: 'km',
MILEAGE_IRS_RATE: 0.655,
MILEAGE_IRS_RATE: 0.67,
DEFAULT_RATE: 'Default Rate',
RATE_DECIMALS: 3,
FAKE_P2P_ID: '_FAKE_P2P_ID_',
Expand Down Expand Up @@ -3394,6 +3394,11 @@ const CONST = {
* @deprecated Please stop using the accessibilityRole prop and use the role prop instead.
*/
IMAGE: 'image',

/**
* @deprecated Please stop using the accessibilityRole prop and use the role prop instead.
*/
TEXTBOX: 'textbox',
},
/**
* Acceptable values for the `role` attribute on react native components.
Expand Down Expand Up @@ -4753,6 +4758,7 @@ const CONST = {

SESSION_STORAGE_KEYS: {
INITIAL_URL: 'INITIAL_URL',
ACTIVE_WORKSPACE_ID: 'ACTIVE_WORKSPACE_ID',
},

RESERVATION_TYPE: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useMemo, useState} from 'react';
import ActiveWorkspaceContext from '@components/ActiveWorkspace/ActiveWorkspaceContext';
import type ChildrenProps from '@src/types/utils/ChildrenProps';
import ActiveWorkspaceContext from './ActiveWorkspaceContext';

function ActiveWorkspaceContextProvider({children}: ChildrenProps) {
const [activeWorkspaceID, setActiveWorkspaceID] = useState<string | undefined>(undefined);
Expand All @@ -10,7 +10,7 @@ function ActiveWorkspaceContextProvider({children}: ChildrenProps) {
activeWorkspaceID,
setActiveWorkspaceID,
}),
[activeWorkspaceID],
[activeWorkspaceID, setActiveWorkspaceID],
);

return <ActiveWorkspaceContext.Provider value={value}>{children}</ActiveWorkspaceContext.Provider>;
Expand Down
29 changes: 29 additions & 0 deletions src/components/ActiveWorkspaceProvider/index.website.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, {useCallback, useMemo, useState} from 'react';
import ActiveWorkspaceContext from '@components/ActiveWorkspace/ActiveWorkspaceContext';
import CONST from '@src/CONST';
import type ChildrenProps from '@src/types/utils/ChildrenProps';

function ActiveWorkspaceContextProvider({children}: ChildrenProps) {
const [activeWorkspaceID, updateActiveWorkspaceID] = useState<string | undefined>(undefined);

const setActiveWorkspaceID = useCallback((workspaceID: string | undefined) => {
updateActiveWorkspaceID(workspaceID);
if (workspaceID && sessionStorage) {
sessionStorage?.setItem(CONST.SESSION_STORAGE_KEYS.ACTIVE_WORKSPACE_ID, workspaceID);
} else {
sessionStorage?.removeItem(CONST.SESSION_STORAGE_KEYS.ACTIVE_WORKSPACE_ID);
}
}, []);

const value = useMemo(
() => ({
activeWorkspaceID,
setActiveWorkspaceID,
}),
[activeWorkspaceID, setActiveWorkspaceID],
);

return <ActiveWorkspaceContext.Provider value={value}>{children}</ActiveWorkspaceContext.Provider>;
}

export default ActiveWorkspaceContextProvider;
2 changes: 1 addition & 1 deletion src/components/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Breadcrumbs({breadcrumbs, style}: BreadcrumbsProps) {
<Text style={[styles.breadcrumbSeparator]}>/</Text>
<Text
numberOfLines={1}
style={[styles.mw75, styles.flexShrink0, styles.breadcrumb]}
style={[styles.mw75, styles.flexShrink0, styles.breadcrumb, styles.flex1]}
>
{secondaryBreadcrumb.text}
</Text>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Composer/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function Composer(
// On Android the selection prop is required on the TextInput but this prop has issues on IOS
selection,
value,
isGroupPolicyReport = false,
...props
}: ComposerProps,
ref: ForwardedRef<TextInput>,
Expand All @@ -36,7 +37,7 @@ function Composer(
const {isFocused, shouldResetFocus} = useResetComposerFocus(textInput);
const textContainsOnlyEmojis = useMemo(() => EmojiUtils.containsOnlyEmojis(value ?? ''), [value]);
const theme = useTheme();
const markdownStyle = useMarkdownStyle(value);
const markdownStyle = useMarkdownStyle(value, !isGroupPolicyReport ? ['mentionReport'] : []);
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();

Expand Down
3 changes: 2 additions & 1 deletion src/components/Composer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ function Composer(
isReportActionCompose = false,
isComposerFullSize = false,
shouldContainScroll = false,
isGroupPolicyReport = false,
...props
}: ComposerProps,
ref: ForwardedRef<TextInput | HTMLInputElement>,
) {
const textContainsOnlyEmojis = useMemo(() => EmojiUtils.containsOnlyEmojis(value ?? ''), [value]);
const theme = useTheme();
const styles = useThemeStyles();
const markdownStyle = useMarkdownStyle(value);
const markdownStyle = useMarkdownStyle(value, !isGroupPolicyReport ? ['mentionReport'] : []);
const StyleUtils = useStyleUtils();
const textRef = useRef<HTMLElement & RNText>(null);
const textInput = useRef<AnimatedMarkdownTextInputRef | null>(null);
Expand Down
3 changes: 3 additions & 0 deletions src/components/Composer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ type ComposerProps = TextInputProps & {

/** Should make the input only scroll inside the element avoid scroll out to parent */
shouldContainScroll?: boolean;

/** Indicates whether the composer is in a group policy report. Used for disabling report mentioning style in markdown input */
isGroupPolicyReport?: boolean;
};

export type {TextSelection, ComposerProps};
4 changes: 2 additions & 2 deletions src/components/LHNOptionsList/LHNOptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ function LHNOptionsList({
);

const extraData = useMemo(
() => [reportActions, reports, policy, personalDetails, data.length, draftComments],
[reportActions, reports, policy, personalDetails, data.length, draftComments],
() => [reportActions, reports, policy, personalDetails, data.length, draftComments, optionMode],
[reportActions, reports, policy, personalDetails, data.length, draftComments, optionMode],
);

const previousOptionMode = usePrevious(optionMode);
Expand Down
7 changes: 4 additions & 3 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import MoneyReportHeaderStatusBar from './MoneyReportHeaderStatusBar';
import MoneyRequestHeaderStatusBar from './MoneyRequestHeaderStatusBar';
import type {ActionHandledType} from './ProcessMoneyReportHoldMenu';
import ProcessMoneyReportHoldMenu from './ProcessMoneyReportHoldMenu';
import SettlementButton from './SettlementButton';

Expand Down Expand Up @@ -79,7 +80,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
isActionOwner && (ReportUtils.canAddOrDeleteTransactions(moneyRequestReport) || ReportUtils.isTrackExpenseReport(transactionThreadReport)) && !isDeletedParentAction;
const [isHoldMenuVisible, setIsHoldMenuVisible] = useState(false);
const [paymentType, setPaymentType] = useState<PaymentMethodType>();
const [requestType, setRequestType] = useState<'pay' | 'approve'>();
const [requestType, setRequestType] = useState<ActionHandledType>();
const canAllowSettlement = ReportUtils.hasUpdatedTotal(moneyRequestReport, policy);
const policyType = policy?.type;
const isPayer = ReportUtils.isPayer(session, moneyRequestReport);
Expand Down Expand Up @@ -124,7 +125,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
return;
}
setPaymentType(type);
setRequestType('pay');
setRequestType(CONST.IOU.REPORT_ACTION_TYPE.PAY);
if (ReportUtils.hasHeldExpenses(moneyRequestReport.reportID)) {
setIsHoldMenuVisible(true);
} else if (ReportUtils.isInvoiceReport(moneyRequestReport)) {
Expand All @@ -135,7 +136,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
};

const confirmApproval = () => {
setRequestType('approve');
setRequestType(CONST.IOU.REPORT_ACTION_TYPE.APPROVE);
if (ReportUtils.hasHeldExpenses(moneyRequestReport.reportID)) {
setIsHoldMenuVisible(true);
} else {
Expand Down
Loading

0 comments on commit 41276b8

Please sign in to comment.