Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
Browse files Browse the repository at this point in the history
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
  • Loading branch information
kubabutkiewicz committed Jun 13, 2024
2 parents 27e0cc7 + 06cde0a commit 8c5e2e3
Show file tree
Hide file tree
Showing 32 changed files with 213 additions and 85 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 1001048204
versionName "1.4.82-4"
versionCode 1001048300
versionName "1.4.83-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.82</string>
<string>1.4.83</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.82.4</string>
<string>1.4.83.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.82</string>
<string>1.4.83</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.82.4</string>
<string>1.4.83.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.82</string>
<string>1.4.83</string>
<key>CFBundleVersion</key>
<string>1.4.82.4</string>
<string>1.4.83.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.82-4",
"version": "1.4.83-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
6 changes: 0 additions & 6 deletions src/components/AmountPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ import React, {forwardRef, useState} from 'react';
import type {ForwardedRef} from 'react';
import {View} from 'react-native';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import useStyleUtils from '@hooks/useStyleUtils';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import callOrReturn from '@src/types/utils/callOrReturn';
import AmountSelectorModal from './AmountSelectorModal';
import type {AmountPickerProps} from './types';

function AmountPicker({value, description, title, errorText = '', onInputChange, furtherDetails, rightLabel, ...rest}: AmountPickerProps, forwardedRef: ForwardedRef<View>) {
const StyleUtils = useStyleUtils();
const [isPickerVisible, setIsPickerVisible] = useState(false);

const showPickerModal = () => {
Expand All @@ -29,15 +26,12 @@ function AmountPicker({value, description, title, errorText = '', onInputChange,
hidePickerModal();
};

const descStyle = !value || value.length === 0 ? StyleUtils.getFontSizeStyle(variables.fontSizeLabel) : null;

return (
<View>
<MenuItemWithTopDescription
ref={forwardedRef}
shouldShowRightIcon
title={callOrReturn(title, value)}
descriptionTextStyle={descStyle}
description={description}
onPress={showPickerModal}
furtherDetails={furtherDetails}
Expand Down
23 changes: 12 additions & 11 deletions src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,18 @@ function Banner({
)}
{content && content}

{shouldRenderHTML && text ? (
<RenderHTML html={text} />
) : (
<Text
style={[styles.flex1, styles.flexWrap, textStyles]}
onPress={onPress}
suppressHighlighting
>
{text}
</Text>
)}
{text &&
(shouldRenderHTML ? (
<RenderHTML html={text} />
) : (
<Text
style={[styles.flex1, styles.flexWrap, textStyles]}
onPress={onPress}
suppressHighlighting
>
{text}
</Text>
))}
</View>
{shouldShowCloseButton && !!onClose && (
<Tooltip text={translate('common.close')}>
Expand Down
11 changes: 8 additions & 3 deletions src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {Route} from '@src/ROUTES';
import type {Policy, Report, ReportAction} from '@src/types/onyx';
import type {OriginalMessageIOU} from '@src/types/onyx/OriginalMessage';
import type IconAsset from '@src/types/utils/IconAsset';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import Button from './Button';
import ConfirmModal from './ConfirmModal';
import HeaderWithBackButton from './HeaderWithBackButton';
Expand Down Expand Up @@ -53,7 +54,8 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${(parentReportAction as ReportAction & OriginalMessageIOU)?.originalMessage?.IOUTransactionID ?? -1}`);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [session] = useOnyx(ONYXKEYS.SESSION);
const [shownHoldUseExplanation] = useOnyx(ONYXKEYS.NVP_HOLD_USE_EXPLAINED, {initWithStoredValues: false});
const [holdUseExplained, holdUseExplainedResult] = useOnyx(ONYXKEYS.NVP_HOLD_USE_EXPLAINED);
const isLoadingHoldUseExplained = isLoadingOnyxValue(holdUseExplainedResult);

const styles = useThemeStyles();
const theme = useTheme();
Expand Down Expand Up @@ -175,8 +177,11 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
}

useEffect(() => {
setShouldShowHoldMenu(isOnHold && !shownHoldUseExplanation);
}, [isOnHold, shownHoldUseExplanation]);
if (isLoadingHoldUseExplained) {
return;
}
setShouldShowHoldMenu(isOnHold && !holdUseExplained);
}, [isOnHold, holdUseExplained, isLoadingHoldUseExplained]);

useEffect(() => {
if (!shouldShowHoldMenu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function MoneyRequestPreviewContent({
const isFullySettled = isSettled && !isSettlementOrApprovalPartial;
const isFullyApproved = ReportUtils.isReportApproved(iouReport) && !isSettlementOrApprovalPartial;
const shouldShowRBR = hasNoticeTypeViolations || hasViolations || hasFieldErrors || (!isFullySettled && !isFullyApproved && isOnHold);
const showCashOrCard = isCardTransaction ? translate('iou.card') : translate('iou.cash');
const shouldShowHoldMessage = !(isSettled && !isSettlementOrApprovalPartial) && isOnHold;

/*
Expand Down Expand Up @@ -140,7 +141,7 @@ function MoneyRequestPreviewContent({
};

const getPreviewHeaderText = (): string => {
let message = translate('iou.cash');
let message = showCashOrCard;

if (isDistanceRequest) {
message = translate('common.distance');
Expand Down Expand Up @@ -363,7 +364,7 @@ function MoneyRequestPreviewContent({
onPressOut={() => ControlSelection.unblock()}
onLongPress={showContextMenu}
shouldUseHapticsOnLongPress
accessibilityLabel={isBillSplit ? translate('iou.split') : translate('iou.cash')}
accessibilityLabel={isBillSplit ? translate('iou.split') : showCashOrCard}
accessibilityHint={CurrencyUtils.convertToDisplayString(requestAmount, requestCurrency)}
style={[
styles.moneyRequestPreviewBox,
Expand Down
3 changes: 1 addition & 2 deletions src/components/SelectionList/BaseListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function BaseListItem<TItem extends ListItem>({
wrapperStyle,
containerStyle,
isDisabled = false,
shouldPreventDefaultFocusOnSelectRow = false,
shouldPreventEnterKeySubmit = false,
canSelectMultiple = false,
onSelectRow,
Expand Down Expand Up @@ -88,7 +87,7 @@ function BaseListItem<TItem extends ListItem>({
hoverDimmingValue={1}
hoverStyle={[!item.isDisabled && styles.hoveredComponentBG, hoverStyle]}
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
onMouseDown={shouldPreventDefaultFocusOnSelectRow ? (e) => e.preventDefault() : undefined}
onMouseDown={(e) => e.preventDefault()}
id={keyForList ?? ''}
style={pressableStyle}
onFocus={onFocus}
Expand Down
2 changes: 0 additions & 2 deletions src/components/SelectionList/InviteMemberListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ function InviteMemberListItem<TItem extends ListItem>({
onSelectRow,
onCheckboxPress,
onDismissError,
shouldPreventDefaultFocusOnSelectRow,
rightHandSideComponent,
onFocus,
shouldSyncFocus,
Expand Down Expand Up @@ -56,7 +55,6 @@ function InviteMemberListItem<TItem extends ListItem>({
canSelectMultiple={canSelectMultiple}
onSelectRow={onSelectRow}
onDismissError={onDismissError}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
rightHandSideComponent={rightHandSideComponent}
errors={item.errors}
pendingAction={item.pendingAction}
Expand Down
2 changes: 0 additions & 2 deletions src/components/SelectionList/RadioListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function RadioListItem<TItem extends ListItem>({
isDisabled,
onSelectRow,
onDismissError,
shouldPreventDefaultFocusOnSelectRow,
shouldPreventEnterKeySubmit,
rightHandSideComponent,
isMultilineSupported = false,
Expand All @@ -34,7 +33,6 @@ function RadioListItem<TItem extends ListItem>({
showTooltip={showTooltip}
onSelectRow={onSelectRow}
onDismissError={onDismissError}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
shouldPreventEnterKeySubmit={shouldPreventEnterKeySubmit}
rightHandSideComponent={rightHandSideComponent}
keyForList={item.keyForList}
Expand Down
3 changes: 0 additions & 3 deletions src/components/SelectionList/Search/ReportListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ function ReportListItem<TItem extends ListItem>({
canSelectMultiple,
onSelectRow,
onDismissError,
shouldPreventDefaultFocusOnSelectRow,
onFocus,
shouldSyncFocus,
}: ReportListItemProps<TItem>) {
Expand Down Expand Up @@ -119,7 +118,6 @@ function ReportListItem<TItem extends ListItem>({
canSelectMultiple={canSelectMultiple}
onSelectRow={() => openReportInRHP(transactionItem)}
onDismissError={onDismissError}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
onFocus={onFocus}
shouldSyncFocus={shouldSyncFocus}
/>
Expand All @@ -138,7 +136,6 @@ function ReportListItem<TItem extends ListItem>({
canSelectMultiple={canSelectMultiple}
onSelectRow={onSelectRow}
onDismissError={onDismissError}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
errors={item.errors}
pendingAction={item.pendingAction}
keyForList={item.keyForList}
Expand Down
2 changes: 0 additions & 2 deletions src/components/SelectionList/Search/TransactionListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function TransactionListItem<TItem extends ListItem>({
canSelectMultiple,
onSelectRow,
onDismissError,
shouldPreventDefaultFocusOnSelectRow,
onFocus,
shouldSyncFocus,
}: TransactionListItemProps<TItem>) {
Expand Down Expand Up @@ -42,7 +41,6 @@ function TransactionListItem<TItem extends ListItem>({
canSelectMultiple={canSelectMultiple}
onSelectRow={onSelectRow}
onDismissError={onDismissError}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
errors={item.errors}
pendingAction={item.pendingAction}
keyForList={item.keyForList}
Expand Down
2 changes: 0 additions & 2 deletions src/components/SelectionList/TableListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function TableListItem<TItem extends ListItem>({
onSelectRow,
onCheckboxPress,
onDismissError,
shouldPreventDefaultFocusOnSelectRow,
rightHandSideComponent,
onFocus,
shouldSyncFocus,
Expand Down Expand Up @@ -53,7 +52,6 @@ function TableListItem<TItem extends ListItem>({
canSelectMultiple={canSelectMultiple}
onSelectRow={onSelectRow}
onDismissError={onDismissError}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
rightHandSideComponent={rightHandSideComponent}
errors={item.errors}
pendingAction={item.pendingAction}
Expand Down
2 changes: 0 additions & 2 deletions src/components/SelectionList/UserListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function UserListItem<TItem extends ListItem>({
onSelectRow,
onCheckboxPress,
onDismissError,
shouldPreventDefaultFocusOnSelectRow,
shouldPreventEnterKeySubmit,
rightHandSideComponent,
onFocus,
Expand Down Expand Up @@ -59,7 +58,6 @@ function UserListItem<TItem extends ListItem>({
canSelectMultiple={canSelectMultiple}
onSelectRow={onSelectRow}
onDismissError={onDismissError}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
shouldPreventEnterKeySubmit={shouldPreventEnterKeySubmit}
rightHandSideComponent={rightHandSideComponent}
errors={item.errors}
Expand Down
6 changes: 0 additions & 6 deletions src/components/TextPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import React, {forwardRef, useState} from 'react';
import type {ForwardedRef} from 'react';
import {View} from 'react-native';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import TextSelectorModal from './TextSelectorModal';
import type {TextPickerProps} from './types';

function TextPicker({value, description, placeholder = '', errorText = '', onInputChange, furtherDetails, rightLabel, ...rest}: TextPickerProps, forwardedRef: ForwardedRef<View>) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const [isPickerVisible, setIsPickerVisible] = useState(false);

const showPickerModal = () => {
Expand All @@ -29,15 +26,12 @@ function TextPicker({value, description, placeholder = '', errorText = '', onInp
hidePickerModal();
};

const descStyle = !value || value.length === 0 ? StyleUtils.getFontSizeStyle(variables.fontSizeLabel) : null;

return (
<View>
<MenuItemWithTopDescription
ref={forwardedRef}
shouldShowRightIcon
title={value ?? placeholder ?? ''}
descriptionTextStyle={descStyle}
description={description}
onPress={showPickerModal}
furtherDetails={furtherDetails}
Expand Down
4 changes: 2 additions & 2 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@ export default {
save: 'Save',
genericFailureMessage: 'An error occurred updating the workspace, please try again.',
avatarUploadFailureMessage: 'An error occurred uploading the avatar, please try again.',
addressContext: 'A Workspace Address is required to enable Expensify Travel. Please enter an address associated with your business.',
addressContext: 'A workspace address is required to enable Expensify Travel. Please enter an address associated with your business.',
},
bankAccount: {
continueWithSetup: 'Continue with setup',
Expand All @@ -2639,7 +2639,7 @@ export default {
clearProgress: 'Starting over will clear the progress you have made so far.',
areYouSure: 'Are you sure?',
workspaceCurrency: 'Workspace currency',
updateCurrencyPrompt: 'It looks like your Workspace is currently set to a different currency than USD. Please click the button below to update your currency to USD now.',
updateCurrencyPrompt: 'It looks like your workspace is currently set to a different currency than USD. Please click the button below to update your currency to USD now.',
updateToUSD: 'Update to USD',
},
changeOwner: {
Expand Down
10 changes: 8 additions & 2 deletions src/libs/API/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,16 @@ type OnyxData = {

// For all write requests, we'll send the lastUpdateID that is applied to this client. This will
// allow us to calculate previousUpdateID faster.
let lastUpdateIDAppliedToClient = 0;
let lastUpdateIDAppliedToClient = -1;
Onyx.connect({
key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
callback: (value) => (lastUpdateIDAppliedToClient = value ?? 0),
callback: (value) => {
if (value) {
lastUpdateIDAppliedToClient = value;
} else {
lastUpdateIDAppliedToClient = -1;
}
},
});

/**
Expand Down
7 changes: 7 additions & 0 deletions src/libs/API/parameters/SetPolicyTagsRequired.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type SetPolicyTagsRequired = {
policyID: string;
tagListIndex: number;
requireTagList: boolean;
};

export default SetPolicyTagsRequired;
Loading

0 comments on commit 8c5e2e3

Please sign in to comment.