Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pac-guerreiro/refacto…
Browse files Browse the repository at this point in the history
…r/39129-add-comments-to-remaining-onyx-types
  • Loading branch information
fabioh8010 committed Jun 7, 2024
2 parents a354239 + 9c5bf21 commit 199e228
Show file tree
Hide file tree
Showing 19 changed files with 87 additions and 71 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 1001048011
versionName "1.4.80-11"
versionCode 1001048014
versionName "1.4.80-14"
// 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
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>1.4.80.11</string>
<string>1.4.80.14</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>1.4.80.11</string>
<string>1.4.80.14</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>1.4.80</string>
<key>CFBundleVersion</key>
<string>1.4.80.11</string>
<string>1.4.80.14</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.70):
- RNLiveMarkdown (0.1.82):
- 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.70)
- RNLiveMarkdown/common (= 0.1.82)
- Yoga
- RNLiveMarkdown/common (0.1.70):
- RNLiveMarkdown/common (0.1.82):
- 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: 23250f3d64c9d5f82ff36c4733c03544af0222d2
RNLiveMarkdown: d160a948e52282067439585c89a3962582c082ce
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
rnmapbox-maps: df8fe93dbd251f25022f4023d31bc04160d4d65c
RNPermissions: 0b61d30d21acbeafe25baaa47d9bae40a0c65216
Expand Down
17 changes: 11 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-11",
"version": "1.4.80-14",
"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.70",
"@expensify/react-native-live-markdown": "0.1.82",
"@expo/metro-runtime": "~3.1.1",
"@formatjs/intl-datetimeformat": "^6.10.0",
"@formatjs/intl-listformat": "^7.2.2",
Expand Down
5 changes: 3 additions & 2 deletions src/components/AttachmentPicker/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import RNFetchBlob from 'react-native-blob-util';
import RNDocumentPicker from 'react-native-document-picker';
import type {DocumentPickerOptions, DocumentPickerResponse} from 'react-native-document-picker';
import {launchImageLibrary} from 'react-native-image-picker';
import type {Asset, Callback, CameraOptions, ImagePickerResponse} from 'react-native-image-picker';
import type {Asset, Callback, CameraOptions, ImageLibraryOptions, ImagePickerResponse} from 'react-native-image-picker';
import ImageSize from 'react-native-image-size';
import type {FileObject, ImagePickerResponse as FileResponse} from '@components/AttachmentModal';
import * as Expensicons from '@components/Icon/Expensicons';
Expand Down Expand Up @@ -41,11 +41,12 @@ type Item = {
* See https://github.com/react-native-image-picker/react-native-image-picker/#options
* for ImagePicker configuration options
*/
const imagePickerOptions = {
const imagePickerOptions: Partial<CameraOptions | ImageLibraryOptions> = {
includeBase64: false,
saveToPhotos: false,
selectionLimit: 1,
includeExtra: false,
assetRepresentationMode: 'current',
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,7 @@ function MoneyRequestConfirmationList({
footerContent={footerContent}
listFooterContent={listFooterContent}
containerStyle={[styles.flexBasisAuto]}
removeClippedSubviews={false}
/>
</MouseProvider>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/SectionList/index.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function SectionListWithRef<ItemT, SectionT>(props: SectionListProps<ItemT, Sect
// For Android we want to use removeClippedSubviews since it helps manage memory consumption. When we
// run out memory images stop loading and appear as grey circles
// eslint-disable-next-line react/jsx-props-no-multi-spaces
removeClippedSubviews
removeClippedSubviews={props.removeClippedSubviews ?? true}
/>
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function BaseSelectionList<TItem extends ListItem>(
onEndReachedThreshold,
windowSize = 5,
updateCellsBatchingPeriod = 50,
removeClippedSubviews = true,
}: BaseSelectionListProps<TItem>,
ref: ForwardedRef<SelectionListHandle>,
) {
Expand Down Expand Up @@ -677,6 +678,7 @@ function BaseSelectionList<TItem extends ListItem>(
<>
{!listHeaderContent && header()}
<SectionList
removeClippedSubviews={removeClippedSubviews}
ref={listRef}
sections={slicedSections}
stickySectionHeadersEnabled={false}
Expand Down
3 changes: 3 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
/** Styles for the section title */
sectionTitleStyles?: StyleProp<ViewStyle>;

/** This may improve scroll performance for large lists */
removeClippedSubviews?: boolean;

/**
* When true, the list won't be visible until the list layout is measured. This prevents the list from "blinking" as it's scrolled to the bottom which is recommended for large lists.
* When false, the list will render immediately and scroll to the bottom which works great for small lists.
Expand Down
3 changes: 2 additions & 1 deletion src/libs/actions/ExitSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ function switchToOldDot() {
},
];

API.write(
// eslint-disable-next-line rulesdir/no-api-side-effects-method
return API.makeRequestWithSideEffects(
'SwitchToOldDot',
{
reason: exitReason,
Expand Down
16 changes: 8 additions & 8 deletions src/libs/actions/Policy/DistanceRate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,12 @@ function updateDistanceTaxClaimableValue(policyID: string, customUnit: CustomUni
for (const rateID of Object.keys(customUnit.rates)) {
if (rateIDs.includes(rateID)) {
const foundRate = customUnitRates.find((rate) => rate.customUnitRateID === rateID);
optimisticRates[rateID] = {...foundRate, pendingFields: {rate: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}};
successRates[rateID] = {...foundRate, pendingFields: {rate: null}};
optimisticRates[rateID] = {...foundRate, pendingFields: {taxClaimablePercentage: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}};
successRates[rateID] = {...foundRate, pendingFields: {taxClaimablePercentage: null}};
failureRates[rateID] = {
...currentRates[rateID],
pendingFields: {rate: null},
errorFields: {rate: ErrorUtils.getMicroSecondOnyxError('common.genericErrorMessage')},
pendingFields: {taxClaimablePercentage: null},
errorFields: {taxClaimablePercentage: ErrorUtils.getMicroSecondOnyxError('common.genericErrorMessage')},
};
}
}
Expand Down Expand Up @@ -601,12 +601,12 @@ function updateDistanceTaxRate(policyID: string, customUnit: CustomUnit, customU
for (const rateID of Object.keys(customUnit.rates)) {
if (rateIDs.includes(rateID)) {
const foundRate = customUnitRates.find((rate) => rate.customUnitRateID === rateID);
optimisticRates[rateID] = {...foundRate, pendingFields: {rate: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}};
successRates[rateID] = {...foundRate, pendingFields: {rate: null}};
optimisticRates[rateID] = {...foundRate, pendingFields: {taxRateExternalID: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}};
successRates[rateID] = {...foundRate, pendingFields: {taxRateExternalID: null}};
failureRates[rateID] = {
...currentRates[rateID],
pendingFields: {rate: null},
errorFields: {rate: ErrorUtils.getMicroSecondOnyxError('common.genericErrorMessage')},
pendingFields: {taxRateExternalID: null},
errorFields: {taxRateExternalID: ErrorUtils.getMicroSecondOnyxError('common.genericErrorMessage')},
};
}
}
Expand Down
17 changes: 8 additions & 9 deletions src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,14 @@ function ExitSurveyConfirmPage({exitReason, isLoading, route, navigation}: ExitS
large
text={translate('exitSurvey.goToExpensifyClassic')}
onPress={() => {
ExitSurvey.switchToOldDot();

if (NativeModules.HybridAppModule) {
Navigation.resetToHome();
NativeModules.HybridAppModule.closeReactNativeApp();
return;
}

Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX);
ExitSurvey.switchToOldDot().then(() => {
if (NativeModules.HybridAppModule) {
Navigation.resetToHome();
NativeModules.HybridAppModule.closeReactNativeApp();
return;
}
Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX);
});
}}
isLoading={isLoading ?? false}
isDisabled={isOffline}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type * as OnyxTypes from '@src/types/onyx';
import type {Rate} from '@src/types/onyx/Policy';
import type {Rate, TaxRateAttributes} from '@src/types/onyx/Policy';

type PolicyDistanceRateDetailsPageOnyxProps = {
/** Policy details */
Expand Down Expand Up @@ -90,7 +90,7 @@ function PolicyDistanceRateDetailsPage({policy, route}: PolicyDistanceRateDetail
const taxClaimableValueToDisplay = taxClaimablePercentage && rate.rate ? CurrencyUtils.convertAmountToDisplayString(taxClaimablePercentage * rate.rate, currency) : '';
const unitToDisplay = translate(`common.${customUnit?.attributes?.unit ?? CONST.CUSTOM_UNITS.DISTANCE_UNIT_MILES}`);

const clearErrorFields = (fieldName: keyof Rate) => {
const clearErrorFields = (fieldName: keyof Rate | keyof TaxRateAttributes) => {
DistanceRate.clearPolicyDistanceRateErrorFields(policyID, customUnit.customUnitID, rateID, {...errorFields, [fieldName]: null});
};

Expand Down Expand Up @@ -138,10 +138,10 @@ function PolicyDistanceRateDetailsPage({policy, route}: PolicyDistanceRateDetail
</OfflineWithFeedback>
{isDistanceTrackTaxEnabled && (
<OfflineWithFeedback
errors={ErrorUtils.getLatestErrorField(rate, 'attributes')}
pendingAction={rate?.pendingFields?.attributes}
errors={ErrorUtils.getLatestErrorField(rate, 'taxRateExternalID')}
pendingAction={rate?.pendingFields?.taxRateExternalID}
errorRowStyles={styles.mh5}
onClose={() => clearErrorFields('attributes')}
onClose={() => clearErrorFields('taxRateExternalID')}
>
<View style={styles.w100}>
<MenuItemWithTopDescription
Expand All @@ -155,10 +155,10 @@ function PolicyDistanceRateDetailsPage({policy, route}: PolicyDistanceRateDetail
)}
{isDistanceTrackTaxEnabled && (
<OfflineWithFeedback
errors={ErrorUtils.getLatestErrorField(rate, 'attributes')}
pendingAction={rate?.pendingFields?.attributes}
errors={ErrorUtils.getLatestErrorField(rate, 'taxClaimablePercentage')}
pendingAction={rate?.pendingFields?.taxClaimablePercentage}
errorRowStyles={styles.mh5}
onClose={() => clearErrorFields('attributes')}
onClose={() => clearErrorFields('taxClaimablePercentage')}
>
<MenuItemWithTopDescription
shouldShowRightIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ import * as DistanceRate from '@userActions/Policy/DistanceRate';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {PendingAction} from '@src/types/onyx/OnyxCommon';

type ListItemType = {
value: string;
text: string;
isSelected: boolean;
keyForList: string;
pendingAction?: PendingAction;
};

type PolicyDistanceRateTaxRateEditPageProps = WithPolicyOnyxProps & StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.DISTANCE_RATE_TAX_RATE_EDIT>;
Expand All @@ -41,6 +43,8 @@ function PolicyDistanceRateTaxRateEditPage({route, policy}: PolicyDistanceRateTa
text: `${value.name} (${value.value})`,
isSelected: taxRateExternalID === key,
keyForList: key,
pendingAction: value.pendingAction,
isDisabled: value.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
}));
return result;
}, [policy, taxRateExternalID]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function PolicyDistanceRatesSettingsPage({policy, policyCategories, route}: Poli
</OfflineWithFeedback>
)}
<OfflineWithFeedback errorRowStyles={styles.mh5}>
<View style={[styles.mt2, styles.mh4]}>
<View style={[styles.mt2, styles.mh5]}>
<View style={[styles.flexRow, styles.mb2, styles.mr2, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.distanceRates.trackTax')}</Text>
<Switch
Expand All @@ -135,14 +135,10 @@ function PolicyDistanceRatesSettingsPage({policy, policyCategories, route}: Poli
</View>
</View>
{!isPolicyTrackTaxEnabled && (
<View style={[styles.mh4]}>
<Text
style={styles.colorMuted}
fontSize={14}
>
<View style={[styles.mh5]}>
<Text style={styles.colorMuted}>
{translate('workspace.distanceRates.taxFeatureNotEnabledMessage')}
<TextLink
fontSize={14}
onPress={() => {
Navigation.dismissModal();
Navigation.navigate(ROUTES.WORKSPACE_MORE_FEATURES.getRoute(policyID));
Expand Down
Loading

0 comments on commit 199e228

Please sign in to comment.