From 91246ad1cf30475bc1aa8f3815402e166a160de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ord=C3=B3=C3=B1ez?= Date: Fri, 18 Aug 2023 15:54:45 -0500 Subject: [PATCH 01/79] fix: Unify iou and task description ux --- src/components/ReportActionItem/MoneyRequestView.js | 2 ++ src/pages/EditRequestDescriptionPage.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/components/ReportActionItem/MoneyRequestView.js b/src/components/ReportActionItem/MoneyRequestView.js index c05cf14f2fc1..70b55a466848 100644 --- a/src/components/ReportActionItem/MoneyRequestView.js +++ b/src/components/ReportActionItem/MoneyRequestView.js @@ -113,6 +113,8 @@ function MoneyRequestView({report, parentReport, shouldShowHorizontalRule, polic disabled={isSettled || !canEdit} shouldShowRightIcon={canEdit} onPress={() => Navigation.navigate(ROUTES.getEditRequestRoute(report.reportID, CONST.EDIT_REQUEST_FIELD.DESCRIPTION))} + wrapperStyle={[styles.pv2, styles.taskDescriptionMenuItem]} + numberOfLinesTitle={0} /> (descriptionInputRef.current = e)} + autoGrowHeight + containerStyles={[styles.autoGrowHeightMultilineInput]} + textAlignVertical="top" /> From 32f311e554546d006c54045bba8442d73cc64cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ord=C3=B3=C3=B1ez?= Date: Tue, 22 Aug 2023 08:27:25 -0500 Subject: [PATCH 02/79] Task: Remove new line created in merge --- src/components/ReportActionItem/MoneyRequestView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.js b/src/components/ReportActionItem/MoneyRequestView.js index eb610a01a71b..03c4f5d54db2 100644 --- a/src/components/ReportActionItem/MoneyRequestView.js +++ b/src/components/ReportActionItem/MoneyRequestView.js @@ -121,7 +121,7 @@ function MoneyRequestView({report, parentReport, shouldShowHorizontalRule, polic style={[StyleUtils.getReportWelcomeBackgroundImageStyle(true)]} /> - + {hasReceipt && ( Date: Tue, 22 Aug 2023 11:31:03 -0500 Subject: [PATCH 03/79] Handle submitOnEnter as per 24636 --- src/pages/EditRequestDescriptionPage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/EditRequestDescriptionPage.js b/src/pages/EditRequestDescriptionPage.js index 1dfd412a63f9..deb8dc154a96 100644 --- a/src/pages/EditRequestDescriptionPage.js +++ b/src/pages/EditRequestDescriptionPage.js @@ -52,6 +52,7 @@ function EditRequestDescriptionPage({defaultDescription, onSubmit}) { autoGrowHeight containerStyles={[styles.autoGrowHeightMultilineInput]} textAlignVertical="top" + submitOnEnter={!Browser.isMobile()} /> From 7d6c389fda66fea9b2c8eb1b905a3995afc60c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ord=C3=B3=C3=B1ez?= Date: Tue, 22 Aug 2023 11:43:03 -0500 Subject: [PATCH 04/79] Include import for browser validation --- src/pages/EditRequestDescriptionPage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/EditRequestDescriptionPage.js b/src/pages/EditRequestDescriptionPage.js index deb8dc154a96..3916daecd33c 100644 --- a/src/pages/EditRequestDescriptionPage.js +++ b/src/pages/EditRequestDescriptionPage.js @@ -10,6 +10,7 @@ import styles from '../styles/styles'; import Navigation from '../libs/Navigation/Navigation'; import CONST from '../CONST'; import useLocalize from '../hooks/useLocalize'; +import * as Browser from '../libs/Browser'; const propTypes = { /** Transaction default description value */ From da0b80bab4da33c1b983e98dbb43dfe8a7d3fa8d Mon Sep 17 00:00:00 2001 From: Mahesh Vagicherla Date: Sun, 3 Sep 2023 17:13:12 +0530 Subject: [PATCH 05/79] fix not found page on thread leave --- src/pages/home/ReportScreen.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 6daa15785921..faeafe54259d 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -284,6 +284,8 @@ function ReportScreen({ ComposerActions.setShouldShowComposeInput(true); }, [route, report, errors, fetchReportIfNeeded, prevReport.reportID]); + console.log(report); + return ( Date: Sun, 3 Sep 2023 17:32:20 +0530 Subject: [PATCH 06/79] remove console --- src/pages/home/ReportScreen.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index faeafe54259d..7ee049319436 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -284,8 +284,6 @@ function ReportScreen({ ComposerActions.setShouldShowComposeInput(true); }, [route, report, errors, fetchReportIfNeeded, prevReport.reportID]); - console.log(report); - return ( Date: Mon, 4 Sep 2023 22:00:32 +0700 Subject: [PATCH 07/79] fix: 23441 Opening report via deep link animates the page twice --- src/libs/actions/Report.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 8b898a6aaaea..f2aa7df24971 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1764,9 +1764,6 @@ function openReportFromDeepLink(url, isAuthenticated) { // Navigate to the report after sign-in/sign-up. InteractionManager.runAfterInteractions(() => { SidebarUtils.isSidebarLoadedReady().then(() => { - if (reportID) { - Navigation.navigate(ROUTES.getReportRoute(reportID), CONST.NAVIGATION.TYPE.UP); - } if (route === ROUTES.CONCIERGE) { navigateToConciergeChat(); } From a413ae93f82e8bbf864990783b431a736b507889 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 4 Sep 2023 22:25:20 +0700 Subject: [PATCH 08/79] lint fix --- src/libs/actions/Report.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index f2aa7df24971..9adafbd070d8 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1764,9 +1764,10 @@ function openReportFromDeepLink(url, isAuthenticated) { // Navigate to the report after sign-in/sign-up. InteractionManager.runAfterInteractions(() => { SidebarUtils.isSidebarLoadedReady().then(() => { - if (route === ROUTES.CONCIERGE) { - navigateToConciergeChat(); + if (route !== ROUTES.CONCIERGE) { + return; } + navigateToConciergeChat(); }); }); } From 26d9c88190746c23109aacca597ca598c4827907 Mon Sep 17 00:00:00 2001 From: tienifr Date: Tue, 5 Sep 2023 16:54:49 +0700 Subject: [PATCH 09/79] fix: window height changes --- src/hooks/useWindowDimensions.js | 6 ++++-- src/styles/variables.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hooks/useWindowDimensions.js b/src/hooks/useWindowDimensions.js index 58e6b8758927..b09e0c0754b1 100644 --- a/src/hooks/useWindowDimensions.js +++ b/src/hooks/useWindowDimensions.js @@ -1,5 +1,5 @@ // eslint-disable-next-line no-restricted-imports -import {useWindowDimensions} from 'react-native'; +import {Dimensions, useWindowDimensions} from 'react-native'; import variables from '../styles/variables'; /** @@ -8,7 +8,9 @@ import variables from '../styles/variables'; */ export default function () { const {width: windowWidth, height: windowHeight} = useWindowDimensions(); - const isExtraSmallScreenHeight = windowHeight <= variables.extraSmallMobileResponsiveHeightBreakpoint; + // On mWeb, when soft keyboard opens, window height changes. We use screen height instead. + const screenHeight = Dimensions.get('screen').height; + const isExtraSmallScreenHeight = screenHeight <= variables.extraSmallMobileResponsiveHeightBreakpoint; const isSmallScreenWidth = windowWidth <= variables.mobileResponsiveWidthBreakpoint; const isMediumScreenWidth = windowWidth > variables.mobileResponsiveWidthBreakpoint && windowWidth <= variables.tabletResponsiveWidthBreakpoint; const isLargeScreenWidth = windowWidth > variables.tabletResponsiveWidthBreakpoint; diff --git a/src/styles/variables.ts b/src/styles/variables.ts index f584e657c693..89cc2c2e5ec6 100644 --- a/src/styles/variables.ts +++ b/src/styles/variables.ts @@ -74,7 +74,7 @@ export default { emojiLineHeight: 28, iouAmountTextSize: 40, extraSmallMobileResponsiveWidthBreakpoint: 320, - extraSmallMobileResponsiveHeightBreakpoint: 550, + extraSmallMobileResponsiveHeightBreakpoint: 667, mobileResponsiveWidthBreakpoint: 800, modalFullscreenBackdropOpacity: 0.5, tabletResponsiveWidthBreakpoint: 1024, From 3ae81481626f2dd53c774a87f0d9c0110d74c16e Mon Sep 17 00:00:00 2001 From: Tienifr <113963320+tienifr@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:15:46 +0700 Subject: [PATCH 10/79] Update comment Co-authored-by: Rajat Parashar --- src/hooks/useWindowDimensions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useWindowDimensions.js b/src/hooks/useWindowDimensions.js index b09e0c0754b1..6ef46e65473d 100644 --- a/src/hooks/useWindowDimensions.js +++ b/src/hooks/useWindowDimensions.js @@ -8,7 +8,7 @@ import variables from '../styles/variables'; */ export default function () { const {width: windowWidth, height: windowHeight} = useWindowDimensions(); - // On mWeb, when soft keyboard opens, window height changes. We use screen height instead. + // When the soft keyboard opens on mWeb, the window height changes. Use static screen height instead to get real screenHeight. const screenHeight = Dimensions.get('screen').height; const isExtraSmallScreenHeight = screenHeight <= variables.extraSmallMobileResponsiveHeightBreakpoint; const isSmallScreenWidth = windowWidth <= variables.mobileResponsiveWidthBreakpoint; From 34a2fdb7c5c1cb394513c73452de9c1a544a6e89 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 5 Sep 2023 11:20:59 -1000 Subject: [PATCH 11/79] Add a log for Doza so that we can try to figure out why he is hitting this code --- src/libs/actions/App.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 6028e0468696..30553bf50964 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -453,6 +453,11 @@ function beginDeepLinkRedirect(shouldAuthenticateWithCurrentAccount = true) { // eslint-disable-next-line rulesdir/no-api-side-effects-method API.makeRequestWithSideEffects('OpenOldDotLink', {shouldRetry: false}, {}).then((response) => { + if (!response) { + Log.alert('Trying to redirect via deep link, but the response is empty', {response}, true); + return; + } + Browser.openRouteInDesktopApp(response.shortLivedAuthToken, currentUserEmail); }); } From c5cc1c80b35f0760003a3b4b01d969d6e66dad4c Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 5 Sep 2023 15:59:45 -1000 Subject: [PATCH 12/79] add more params --- src/libs/actions/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 30553bf50964..64785e98d5c0 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -454,7 +454,7 @@ function beginDeepLinkRedirect(shouldAuthenticateWithCurrentAccount = true) { // eslint-disable-next-line rulesdir/no-api-side-effects-method API.makeRequestWithSideEffects('OpenOldDotLink', {shouldRetry: false}, {}).then((response) => { if (!response) { - Log.alert('Trying to redirect via deep link, but the response is empty', {response}, true); + Log.alert('Trying to redirect via deep link, but the response is empty', {response, shouldAuthenticateWithCurrentAccount, currentUserAccountID}, true); return; } From e4d3e4a0edcabe9e21482455dfde8c42f4337530 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 5 Sep 2023 16:10:30 -1000 Subject: [PATCH 13/79] Add more to the comment --- src/libs/actions/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 64785e98d5c0..e77fb98c2826 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -454,7 +454,7 @@ function beginDeepLinkRedirect(shouldAuthenticateWithCurrentAccount = true) { // eslint-disable-next-line rulesdir/no-api-side-effects-method API.makeRequestWithSideEffects('OpenOldDotLink', {shouldRetry: false}, {}).then((response) => { if (!response) { - Log.alert('Trying to redirect via deep link, but the response is empty', {response, shouldAuthenticateWithCurrentAccount, currentUserAccountID}, true); + Log.alert('Trying to redirect via deep link, but the response is empty. User likely not authenticated.', {response, shouldAuthenticateWithCurrentAccount, currentUserAccountID}, true); return; } From ea27b24b456094eb341b7bfd8704222d44673a16 Mon Sep 17 00:00:00 2001 From: Mahesh Vagicherla Date: Wed, 6 Sep 2023 21:31:47 +0530 Subject: [PATCH 14/79] fix shouldShow condition for report --- src/pages/home/ReportScreen.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 7ee049319436..56f55a13c0cb 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -37,6 +37,8 @@ import ReportScreenContext from './ReportScreenContext'; import TaskHeaderActionButton from '../../components/TaskHeaderActionButton'; import DragAndDropProvider from '../../components/DragAndDrop/Provider'; import usePrevious from '../../hooks/usePrevious'; +import CONST from '../../CONST'; +import withReportOrNotFound from './report/withReportOrNotFound'; const propTypes = { /** Navigation route context info provided by react navigation */ @@ -104,6 +106,15 @@ const defaultProps = { personalDetails: {}, }; +/** + * + * Function to check weather the report available in props is default + * + * @param {Object} report + * @returns {Boolean} + */ +const checkDefaultReport = (report) => report === defaultProps.report; + /** * Get the currently viewed report ID as number * @@ -147,6 +158,8 @@ function ReportScreen({ // There are no reportActions at all to display and we are still in the process of loading the next set of actions. const isLoadingInitialReportActions = _.isEmpty(reportActions) && report.isLoadingReportActions; + const isOptimisticDelete = lodashGet(report, 'statusNum') === CONST.REPORT.STATUS.CLOSED; + const shouldHideReport = !ReportUtils.canAccessReport(report, policies, betas); const isLoading = !reportID || !isSidebarLoaded || _.isEmpty(personalDetails) || firstRenderRef.current; @@ -159,6 +172,8 @@ function ReportScreen({ const isTopMostReportId = Navigation.getTopmostReportId() === getReportID(route); + const isDefaultReport = checkDefaultReport(report); + let headerView = ( (!_.isEmpty(report) && !isDefaultReport && !report.reportID && !isOptimisticDelete && !report.isLoadingReportActions && !isLoading) || shouldHideReport, + [report, isLoading, shouldHideReport, isDefaultReport, isOptimisticDelete], + ); + return ( Date: Wed, 6 Sep 2023 08:20:52 -1000 Subject: [PATCH 15/79] run prettier --- src/libs/actions/App.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index e77fb98c2826..3d0d7d27c204 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -454,7 +454,11 @@ function beginDeepLinkRedirect(shouldAuthenticateWithCurrentAccount = true) { // eslint-disable-next-line rulesdir/no-api-side-effects-method API.makeRequestWithSideEffects('OpenOldDotLink', {shouldRetry: false}, {}).then((response) => { if (!response) { - Log.alert('Trying to redirect via deep link, but the response is empty. User likely not authenticated.', {response, shouldAuthenticateWithCurrentAccount, currentUserAccountID}, true); + Log.alert( + 'Trying to redirect via deep link, but the response is empty. User likely not authenticated.', + {response, shouldAuthenticateWithCurrentAccount, currentUserAccountID}, + true, + ); return; } From 6aad9e284691ec26af64ed55946ed242a0d9cf2b Mon Sep 17 00:00:00 2001 From: Nam Le Date: Sat, 9 Sep 2023 21:59:50 +0700 Subject: [PATCH 16/79] fix padding description and amount --- src/components/ReportActionItem/MoneyRequestPreview.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview.js b/src/components/ReportActionItem/MoneyRequestPreview.js index 05c3463538c6..844d1c544238 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview.js +++ b/src/components/ReportActionItem/MoneyRequestPreview.js @@ -292,12 +292,12 @@ function MoneyRequestPreview(props) { {requestMerchant} )} - + {!isCurrentUserManager && props.shouldShowPendingConversionMessage && ( - {props.translate('iou.pendingConversionMessage')} + {props.translate('iou.pendingConversionMessage')} )} - {shouldShowDescription && {description}} + {shouldShowDescription && {description}} {props.isBillSplit && !_.isEmpty(participantAccountIDs) && ( From fd1453b031dca18211e6db36c082110a475fe54f Mon Sep 17 00:00:00 2001 From: Mahesh Vagicherla Date: Sun, 10 Sep 2023 18:27:35 +0530 Subject: [PATCH 17/79] remove unused import --- src/pages/home/ReportScreen.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 56f55a13c0cb..ca8abef48cda 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -38,7 +38,6 @@ import TaskHeaderActionButton from '../../components/TaskHeaderActionButton'; import DragAndDropProvider from '../../components/DragAndDrop/Provider'; import usePrevious from '../../hooks/usePrevious'; import CONST from '../../CONST'; -import withReportOrNotFound from './report/withReportOrNotFound'; const propTypes = { /** Navigation route context info provided by react navigation */ From d9260f440c9e8f750cc7bed665cce3642e8fd34f Mon Sep 17 00:00:00 2001 From: Yauheni Date: Mon, 11 Sep 2023 13:03:08 +0200 Subject: [PATCH 18/79] Fix styles for wallet money badge which is not center vertically --- src/styles/styles.js | 2 +- src/styles/variables.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index 1c1340600a51..4c4ad70eea40 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -760,7 +760,7 @@ const styles = { badgeText: { color: themeColors.text, fontSize: variables.fontSizeSmall, - lineHeight: variables.lineHeightNormal, + lineHeight: variables.lineHeightXSmall, ...whiteSpace.noWrap, }, diff --git a/src/styles/variables.ts b/src/styles/variables.ts index eb182ab1eca0..eccfc61795b8 100644 --- a/src/styles/variables.ts +++ b/src/styles/variables.ts @@ -88,6 +88,7 @@ export default { optionRowHeightCompact: 52, optionsListSectionHeaderHeight: getValueUsingPixelRatio(32, 38), overlayOpacity: 0.6, + lineHeightXSmall: getValueUsingPixelRatio(11, 17), lineHeightSmall: getValueUsingPixelRatio(14, 16), lineHeightNormal: getValueUsingPixelRatio(16, 21), lineHeightLarge: getValueUsingPixelRatio(18, 24), From 72ade3dc942914bf416b0f8b88075ec81ed5b5fb Mon Sep 17 00:00:00 2001 From: Yauheni Date: Mon, 11 Sep 2023 14:54:10 +0200 Subject: [PATCH 19/79] Update styles for safari --- src/styles/styles.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index 4c4ad70eea40..e90591c9e720 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -32,6 +32,8 @@ import Colors from './colors'; // touchCallout is an iOS safari only property that controls the display of the callout information when you touch and hold a target const touchCalloutNone = Browser.isMobileSafari() ? {WebkitTouchCallout: 'none'} : {}; +const lineHeightBadgeSafari = Browser.isSafari() ? {lineHeight: variables.lineHeightXSmall} : {}; + const picker = { backgroundColor: themeColors.transparent, color: themeColors.text, @@ -760,7 +762,8 @@ const styles = { badgeText: { color: themeColors.text, fontSize: variables.fontSizeSmall, - lineHeight: variables.lineHeightXSmall, + lineHeight: variables.lineHeightNormal, + ...lineHeightBadgeSafari, ...whiteSpace.noWrap, }, From e90946ab114bf0c6ce82b28d0674568bad08ce3d Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 01:27:27 +0800 Subject: [PATCH 20/79] added a check if the value was a number and return if it is --- src/libs/actions/OnyxUpdateManager.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index f0051b85f302..a26b5c334b1c 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -35,6 +35,11 @@ export default () => { return; } + if (_.isNumber(val)) { + Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); + return; + } + const updateParams = val; const lastUpdateIDFromServer = val.lastUpdateID; const previousUpdateIDFromServer = val.previousUpdateID; From 0236648bb72d02b99bf13372a4bf62d89fac696e Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 01:30:05 +0800 Subject: [PATCH 21/79] adding comment --- src/libs/actions/OnyxUpdateManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index a26b5c334b1c..e3361f3925f7 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -34,7 +34,9 @@ export default () => { if (!val) { return; } - + + // Since we used the same key that used to store lastUpdateID, once we start watching this variable we need + // to confirm that the value is what we expect and not a number. if (_.isNumber(val)) { Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); return; From 6187e713540e6d8f349a7ea05235558e44b2842a Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 01:30:25 +0800 Subject: [PATCH 22/79] adding prettier --- src/libs/actions/OnyxUpdateManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index e3361f3925f7..924f6ef5245e 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -34,8 +34,8 @@ export default () => { if (!val) { return; } - - // Since we used the same key that used to store lastUpdateID, once we start watching this variable we need + + // Since we used the same key that used to store lastUpdateID, once we start watching this variable we need // to confirm that the value is what we expect and not a number. if (_.isNumber(val)) { Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); From 9be34e858ab8e0fba38dc25e885fad7eb2c3bbfe Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 01:37:36 +0800 Subject: [PATCH 23/79] changing to is object instead --- src/libs/actions/OnyxUpdateManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index 924f6ef5245e..df5792aeef3f 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -37,7 +37,7 @@ export default () => { // Since we used the same key that used to store lastUpdateID, once we start watching this variable we need // to confirm that the value is what we expect and not a number. - if (_.isNumber(val)) { + if (!_.isObject(val)) { Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); return; } From a98dc74d82573f710e30fbf9b1ec2df7789ddbb4 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 01:51:19 +0800 Subject: [PATCH 24/79] changing if to check format of the update --- src/libs/actions/OnyxUpdateManager.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index df5792aeef3f..a3d7735e14c0 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -35,9 +35,14 @@ export default () => { return; } - // Since we used the same key that used to store lastUpdateID, once we start watching this variable we need - // to confirm that the value is what we expect and not a number. - if (!_.isObject(val)) { + // Since we used the same key that used to store another object, let's confirm that the current object is + // following the new format before we proceed. If it isn't, then let's clera the object in Onyx. + if ( + !_.isObject(val) || + !val.hasOwnProperty('type') || + !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && val.hasOwnProperty('request') && val.hasOwnProperty('response')) || + !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && !val.hasOwnProperty('updates')) + ) { Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); return; } From 6425ff1b697be7ff34a37fca6bfeb4eb6c4c8bc5 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 01:55:34 +0800 Subject: [PATCH 25/79] import _ --- src/libs/actions/OnyxUpdateManager.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index a3d7735e14c0..a56941623c6f 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -1,4 +1,5 @@ import Onyx from 'react-native-onyx'; +import _ from 'underscore'; import ONYXKEYS from '../../ONYXKEYS'; import Log from '../Log'; import * as SequentialQueue from '../Network/SequentialQueue'; From 3c59fb43cc2310c76f0a22dba1d500747a0061f1 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 02:02:50 +0800 Subject: [PATCH 26/79] linter and addressing comments --- src/libs/actions/OnyxUpdateManager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index a56941623c6f..73f158785a18 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -5,6 +5,7 @@ import Log from '../Log'; import * as SequentialQueue from '../Network/SequentialQueue'; import * as App from './App'; import * as OnyxUpdates from './OnyxUpdates'; +import CONST from '../../CONST'; // This file is in charge of looking at the updateIDs coming from the server and comparing them to the last updateID that the client has. // If the client is behind the server, then we need to @@ -37,12 +38,13 @@ export default () => { } // Since we used the same key that used to store another object, let's confirm that the current object is - // following the new format before we proceed. If it isn't, then let's clera the object in Onyx. + // following the new format before we proceed. If it isn't, then let's clear the object in Onyx. if ( !_.isObject(val) || !val.hasOwnProperty('type') || - !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && val.hasOwnProperty('request') && val.hasOwnProperty('response')) || - !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && !val.hasOwnProperty('updates')) + + !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && Object.prototype.hasOwnProperty.call(val, 'request') && Object.prototype.hasOwnProperty.call(val, 'response')) || + !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && Object.prototype.hasOwnProperty.call(val, 'updates')) ) { Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); return; From e4172fdd5cd55d58548f517d29d7dc7a9bbbf177 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 02:07:46 +0800 Subject: [PATCH 27/79] missing linter --- src/libs/actions/OnyxUpdateManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index 73f158785a18..7a37d1f3de41 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -41,7 +41,7 @@ export default () => { // following the new format before we proceed. If it isn't, then let's clear the object in Onyx. if ( !_.isObject(val) || - !val.hasOwnProperty('type') || + !Object.prototype.hasOwnProperty.call(val,'type') || !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && Object.prototype.hasOwnProperty.call(val, 'request') && Object.prototype.hasOwnProperty.call(val, 'response')) || !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && Object.prototype.hasOwnProperty.call(val, 'updates')) From 1810160f19877dcf98db5215c4784f13d3e6e95e Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Sep 2023 02:13:30 +0800 Subject: [PATCH 28/79] prettier --- src/libs/actions/OnyxUpdateManager.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index 7a37d1f3de41..acc26884bc2f 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -41,8 +41,7 @@ export default () => { // following the new format before we proceed. If it isn't, then let's clear the object in Onyx. if ( !_.isObject(val) || - !Object.prototype.hasOwnProperty.call(val,'type') || - + !Object.prototype.hasOwnProperty.call(val, 'type') || !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && Object.prototype.hasOwnProperty.call(val, 'request') && Object.prototype.hasOwnProperty.call(val, 'response')) || !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && Object.prototype.hasOwnProperty.call(val, 'updates')) ) { From f2da0c74ca47d0fed0c623f20413e58516b8d2a1 Mon Sep 17 00:00:00 2001 From: akamefi202 Date: Tue, 5 Sep 2023 14:33:54 -0400 Subject: [PATCH 29/79] reset money request info --- src/pages/iou/steps/NewRequestAmountPage.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pages/iou/steps/NewRequestAmountPage.js b/src/pages/iou/steps/NewRequestAmountPage.js index 32a9134cb101..e23efd5f7d12 100644 --- a/src/pages/iou/steps/NewRequestAmountPage.js +++ b/src/pages/iou/steps/NewRequestAmountPage.js @@ -99,6 +99,12 @@ function NewRequestAmountPage({route, iou, report, selectedTab}) { // Because we use Onyx to store IOU info, when we try to make two different money requests from different tabs, // it can result in an IOU sent with improper values. In such cases we want to reset the flow and redirect the user to the first step of the IOU. useEffect(() => { + const moneyRequestID = `${iouType}${reportID}`; + const shouldReset = iou.id !== moneyRequestID; + if (shouldReset) { + IOU.resetMoneyRequestInfo(moneyRequestID); + } + if (isEditing) { // ID in Onyx could change by initiating a new request in a separate browser tab or completing a request if (prevMoneyRequestID.current !== iou.id) { @@ -109,11 +115,6 @@ function NewRequestAmountPage({route, iou, report, selectedTab}) { Navigation.goBack(ROUTES.getMoneyRequestRoute(iouType, reportID), true); return; } - const moneyRequestID = `${iouType}${reportID}`; - const shouldReset = iou.id !== moneyRequestID; - if (shouldReset) { - IOU.resetMoneyRequestInfo(moneyRequestID); - } if (!isDistanceRequestTab && (_.isEmpty(iou.participants) || iou.amount === 0 || shouldReset)) { Navigation.goBack(ROUTES.getMoneyRequestRoute(iouType, reportID), true); From 9ea79cdaf6b2ef4c49bdafc3cc03ad83fd74dcc7 Mon Sep 17 00:00:00 2001 From: Nam Le Date: Wed, 13 Sep 2023 00:05:30 +0700 Subject: [PATCH 30/79] add padding amount --- src/components/ReportActionItem/MoneyRequestPreview.js | 2 +- src/styles/styles.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview.js b/src/components/ReportActionItem/MoneyRequestPreview.js index 844d1c544238..ed8a68849d47 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview.js +++ b/src/components/ReportActionItem/MoneyRequestPreview.js @@ -300,7 +300,7 @@ function MoneyRequestPreview(props) { {shouldShowDescription && {description}} {props.isBillSplit && !_.isEmpty(participantAccountIDs) && ( - + {props.translate('iou.amountEach', { amount: CurrencyUtils.convertToDisplayString( IOUUtils.calculateAmount(isPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount, requestCurrency), diff --git a/src/styles/styles.js b/src/styles/styles.js index 040c9cb8d910..f068a7469525 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -2687,6 +2687,10 @@ const styles = { padding: 16, }, + amountSplitPadding: { + paddingTop: 2, + }, + moneyRequestPreviewBoxLoading: { // When a new IOU request arrives it is very briefly in a loading state, so set the minimum height of the container to 94 to match the rendered height after loading. // Otherwise, the IOU request pay button will not be fully visible and the user will have to scroll up to reveal the entire IOU request container. From a874f6d0cc45bf9b8e007e62af5a5213b16c0022 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 12 Sep 2023 20:33:49 +0100 Subject: [PATCH 31/79] do not display suggestions if composer input is not focused --- .../home/report/ReportActionCompose/ComposerWithSuggestions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js index 6a29c5b6cfef..e443f9479c88 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js @@ -306,7 +306,7 @@ function ComposerWithSuggestions({ const onSelectionChange = useCallback( (e) => { - if (suggestionsRef.current.onSelectionChange(e)) { + if (textInputRef.current && textInputRef.current.isFocused() && suggestionsRef.current.onSelectionChange(e)) { return; } From 71fc6c112ca94ff0dacf4cd649bcd2840e526fe1 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Wed, 13 Sep 2023 00:49:37 +0500 Subject: [PATCH 32/79] feat: update some package versions to avoid console warnings --- package-lock.json | 22 ++++++++++++------- package.json | 4 ++-- .../Device/getDeviceInfo/getBaseInfo.js | 4 ++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 43d2d49acb08..69080fb2963d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -88,7 +88,7 @@ "react-native-onyx": "1.0.72", "react-native-pager-view": "^6.2.0", "react-native-pdf": "^6.7.1", - "react-native-performance": "^4.0.0", + "react-native-performance": "^5.1.0", "react-native-permissions": "^3.0.1", "react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#eae05855286dc699954415cc1d629bfd8e8e47e2", "react-native-plaid-link-sdk": "^10.0.0", @@ -98,7 +98,7 @@ "react-native-render-html": "6.3.1", "react-native-safe-area-context": "4.4.1", "react-native-screens": "3.21.0", - "react-native-svg": "^13.9.0", + "react-native-svg": "^13.13.0", "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", @@ -40369,8 +40369,9 @@ } }, "node_modules/react-native-performance": { - "version": "4.0.0", - "license": "MIT", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/react-native-performance/-/react-native-performance-5.1.0.tgz", + "integrity": "sha512-rq/YBf0/GptSOM/Lj64/1yRq8uN2YE0psFB16wFbYBbTcIEp/0rrgN2HyS5lhvfBOFgKoDRWQ53jHSCb+QJ5eA==", "peerDependencies": { "react-native": "*" } @@ -40527,8 +40528,9 @@ } }, "node_modules/react-native-svg": { - "version": "13.9.0", - "license": "MIT", + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.13.0.tgz", + "integrity": "sha512-L8y8uEiMG0Tr++Nb2+24wlMuv18+bmq/CMoFFtTUlEqVvGCoK2ea8WamPl/9bV8gjL+Rngg5NqEBvKS23sbYoA==", "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3" @@ -75661,7 +75663,9 @@ } }, "react-native-performance": { - "version": "4.0.0", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/react-native-performance/-/react-native-performance-5.1.0.tgz", + "integrity": "sha512-rq/YBf0/GptSOM/Lj64/1yRq8uN2YE0psFB16wFbYBbTcIEp/0rrgN2HyS5lhvfBOFgKoDRWQ53jHSCb+QJ5eA==", "requires": {} }, "react-native-performance-flipper-reporter": { @@ -75758,7 +75762,9 @@ } }, "react-native-svg": { - "version": "13.9.0", + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.13.0.tgz", + "integrity": "sha512-L8y8uEiMG0Tr++Nb2+24wlMuv18+bmq/CMoFFtTUlEqVvGCoK2ea8WamPl/9bV8gjL+Rngg5NqEBvKS23sbYoA==", "requires": { "css-select": "^5.1.0", "css-tree": "^1.1.3" diff --git a/package.json b/package.json index 10b89a9b7523..5295610bebe3 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "react-native-onyx": "1.0.72", "react-native-pager-view": "^6.2.0", "react-native-pdf": "^6.7.1", - "react-native-performance": "^4.0.0", + "react-native-performance": "^5.1.0", "react-native-permissions": "^3.0.1", "react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#eae05855286dc699954415cc1d629bfd8e8e47e2", "react-native-plaid-link-sdk": "^10.0.0", @@ -138,7 +138,7 @@ "react-native-render-html": "6.3.1", "react-native-safe-area-context": "4.4.1", "react-native-screens": "3.21.0", - "react-native-svg": "^13.9.0", + "react-native-svg": "^13.13.0", "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", diff --git a/src/libs/actions/Device/getDeviceInfo/getBaseInfo.js b/src/libs/actions/Device/getDeviceInfo/getBaseInfo.js index a02178cbc0a3..7e4cde5b70df 100644 --- a/src/libs/actions/Device/getDeviceInfo/getBaseInfo.js +++ b/src/libs/actions/Device/getDeviceInfo/getBaseInfo.js @@ -1,8 +1,8 @@ -import {version} from '../../../../../package.json'; +import packageConfig from '../../../../../package.json' export default function getBaseInfo() { return { - app_version: version, + app_version: packageConfig.version, timestamp: new Date().toISOString().slice(0, 19), }; } From 34afbb6231bb2842f3267cdcd9452a8a24ec26fc Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Wed, 13 Sep 2023 00:59:17 +0500 Subject: [PATCH 33/79] fix: lint errors --- src/libs/actions/Device/getDeviceInfo/getBaseInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Device/getDeviceInfo/getBaseInfo.js b/src/libs/actions/Device/getDeviceInfo/getBaseInfo.js index 7e4cde5b70df..bb66f3fe7a9b 100644 --- a/src/libs/actions/Device/getDeviceInfo/getBaseInfo.js +++ b/src/libs/actions/Device/getDeviceInfo/getBaseInfo.js @@ -1,4 +1,4 @@ -import packageConfig from '../../../../../package.json' +import packageConfig from '../../../../../package.json'; export default function getBaseInfo() { return { From 89455eb68f6a1f929b61ad1ebb31ed9e0f80ff26 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Wed, 13 Sep 2023 13:39:38 +0800 Subject: [PATCH 34/79] changing to underscore function --- src/libs/actions/OnyxUpdateManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index acc26884bc2f..1c96a2d11d74 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -41,9 +41,9 @@ export default () => { // following the new format before we proceed. If it isn't, then let's clear the object in Onyx. if ( !_.isObject(val) || - !Object.prototype.hasOwnProperty.call(val, 'type') || - !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && Object.prototype.hasOwnProperty.call(val, 'request') && Object.prototype.hasOwnProperty.call(val, 'response')) || - !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && Object.prototype.hasOwnProperty.call(val, 'updates')) + !_.has(val, 'type') || + !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && _.has(val, 'request') && _.has(val, 'response')) || + !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && _.has(val, 'updates')) ) { Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); return; From 79086884d390450b99d8b4750f940acef9a738c2 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Wed, 13 Sep 2023 09:20:20 +0200 Subject: [PATCH 35/79] Refactor styles --- src/components/MenuItem.js | 4 ++-- src/styles/styles.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js index adf3fa0cdd80..890933ce8093 100644 --- a/src/components/MenuItem.js +++ b/src/components/MenuItem.js @@ -266,9 +266,9 @@ const MenuItem = React.forwardRef((props, ref) => { - {Boolean(props.badgeText) && ( + {true && ( Date: Wed, 13 Sep 2023 09:23:04 +0200 Subject: [PATCH 36/79] Revert changes --- src/components/MenuItem.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js index 890933ce8093..adf3fa0cdd80 100644 --- a/src/components/MenuItem.js +++ b/src/components/MenuItem.js @@ -266,9 +266,9 @@ const MenuItem = React.forwardRef((props, ref) => { - {true && ( + {Boolean(props.badgeText) && ( Date: Wed, 13 Sep 2023 22:40:07 +0530 Subject: [PATCH 37/79] Fix: Mobile Chrome Jumpy MagicCodeInput --- src/components/MagicCodeInput.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/MagicCodeInput.js b/src/components/MagicCodeInput.js index b21a275a6597..454aacc8a03b 100644 --- a/src/components/MagicCodeInput.js +++ b/src/components/MagicCodeInput.js @@ -258,7 +258,13 @@ function MagicCodeInput(props) { {/* Hide the input above the text. Cannot set opacity to 0 as it would break pasting on iOS Safari. */} (inputRefs.current[index] = ref)} + ref={(ref) => { + inputRefs.current[index] = ref; + // Setting attribute type to "search" to prevent Password Manager from appearing in Mobile Chrome + if (ref && ref.setAttribute) { + ref.setAttribute('type', 'search'); + } + }} autoFocus={index === 0 && props.autoFocus} inputMode="numeric" textContentType="oneTimeCode" From 48ff412f9de2998e4e5122d8955a06c101f81093 Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Wed, 13 Sep 2023 19:34:44 +0100 Subject: [PATCH 38/79] migrate withNavigationFallback.js class to function --- src/components/withNavigationFallback.js | 50 +++++++++++------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/src/components/withNavigationFallback.js b/src/components/withNavigationFallback.js index bc4ea5dd3fad..d5067d7598b0 100644 --- a/src/components/withNavigationFallback.js +++ b/src/components/withNavigationFallback.js @@ -1,39 +1,34 @@ -import React, {Component} from 'react'; +import React, {forwardRef, useContext} from 'react'; import {NavigationContext} from '@react-navigation/core'; import getComponentDisplayName from '../libs/getComponentDisplayName'; import refPropTypes from './refPropTypes'; export default function (WrappedComponent) { - class WithNavigationFallback extends Component { - render() { - if (!this.context) { - return ( - true, - addListener: () => () => {}, - removeListener: () => () => {}, - }} - > - - - ); - } + function WithNavigationFallback(props) { + const context = useContext(NavigationContext); - return ( + return !context ? ( + true, + addListener: () => () => {}, + removeListener: () => () => {}, + }} + > - ); - } + + ) : ( + + ); } - WithNavigationFallback.contextType = NavigationContext; WithNavigationFallback.displayName = `WithNavigationFocusWithFallback(${getComponentDisplayName(WrappedComponent)})`; WithNavigationFallback.propTypes = { forwardedRef: refPropTypes, @@ -41,7 +36,8 @@ export default function (WrappedComponent) { WithNavigationFallback.defaultProps = { forwardedRef: undefined, }; - return React.forwardRef((props, ref) => ( + + return forwardRef((props, ref) => ( Date: Thu, 14 Sep 2023 12:25:44 +0700 Subject: [PATCH 39/79] reset modal if accountIDs changed --- src/pages/workspace/WorkspaceMembersPage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 5110bed598f1..58a602756e1e 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -107,8 +107,12 @@ function WorkspaceMembersPage(props) { useEffect(() => { validateSelection(); }, [props.preferredLocale, validateSelection]); - + const accountIDs = useMemo(() => _.keys(props.policyMembers), [props.policyMembers]); + const prevAccountIDs = usePrevious(accountIDs); useEffect(() => { + if (removeMembersConfirmModalVisible && !_.isEqual(accountIDs, prevAccountIDs)) { + setRemoveMembersConfirmModalVisible(false); + } setSelectedEmployees((prevSelected) => _.intersection( prevSelected, From beefbefe216582ce667899c1fd846f70a3dd0780 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 14 Sep 2023 12:56:20 +0700 Subject: [PATCH 40/79] add import --- src/pages/workspace/WorkspaceMembersPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 58a602756e1e..8237b6c75e09 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -1,4 +1,4 @@ -import React, {useCallback, useEffect, useState} from 'react'; +import React, {useCallback, useEffect, useState, useMemo} from 'react'; import _ from 'underscore'; import lodashGet from 'lodash/get'; import {View} from 'react-native'; From 58918c09ecca8b3a77ed712e783d3ed5e3a3b08f Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 14 Sep 2023 16:31:25 +0800 Subject: [PATCH 41/79] ignore unselectable text from selection --- src/components/Button/index.js | 1 + src/components/CollapsibleSection/index.js | 1 + .../HTMLEngineProvider/HTMLRenderers/EditedRenderer.js | 2 ++ src/components/MenuItem.js | 1 + src/components/MultipleAvatars.js | 2 ++ src/components/NewDatePicker/CalendarPicker/index.js | 7 ++++++- src/components/Pressable/GenericPressable/index.js | 2 +- src/components/Reactions/AddReactionBubble.js | 1 + src/components/Reactions/EmojiReactionBubble.js | 6 ++++-- src/components/Reactions/MiniQuickEmojiReactions.js | 7 ++++++- src/components/SelectionList/BaseSelectionList.js | 1 + src/components/SelectionList/RadioListItem.js | 2 ++ src/components/SelectionList/UserListItem.js | 1 + src/components/TextInput/BaseTextInput.js | 1 + src/pages/home/report/FloatingMessageCounter/index.js | 2 ++ src/pages/home/report/ReportActionItemFragment.js | 1 + src/pages/home/report/ReportActionItemThread.js | 2 ++ 17 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/components/Button/index.js b/src/components/Button/index.js index bfde528a4750..c16860344837 100644 --- a/src/components/Button/index.js +++ b/src/components/Button/index.js @@ -218,6 +218,7 @@ class Button extends Component { this.props.icon && styles.textAlignLeft, ...this.props.textStyles, ]} + dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} > {this.props.text} diff --git a/src/components/CollapsibleSection/index.js b/src/components/CollapsibleSection/index.js index e9c3a90a7b30..7009d1905e1d 100644 --- a/src/components/CollapsibleSection/index.js +++ b/src/components/CollapsibleSection/index.js @@ -51,6 +51,7 @@ class CollapsibleSection extends React.Component { {this.props.title} diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/EditedRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/EditedRenderer.js index d91510c3ec6a..262a4d1f178e 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/EditedRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/EditedRenderer.js @@ -1,5 +1,6 @@ import _ from 'underscore'; import React from 'react'; +import CONST from '../../../CONST'; import htmlRendererPropTypes from './htmlRendererPropTypes'; import withLocalize, {withLocalizePropTypes} from '../../withLocalize'; import Text from '../../Text'; @@ -28,6 +29,7 @@ function EditedRenderer(props) { {' '} diff --git a/src/components/MenuItem.js b/src/components/MenuItem.js index adf3fa0cdd80..1971608ccee4 100644 --- a/src/components/MenuItem.js +++ b/src/components/MenuItem.js @@ -225,6 +225,7 @@ const MenuItem = React.forwardRef((props, ref) => { {convertToLTR(props.title)} diff --git a/src/components/MultipleAvatars.js b/src/components/MultipleAvatars.js index 4c6ba1307fb7..916646b5619a 100644 --- a/src/components/MultipleAvatars.js +++ b/src/components/MultipleAvatars.js @@ -221,6 +221,7 @@ function MultipleAvatars(props) { {`+${avatars.length - props.maxAvatarsInRow}`} @@ -278,6 +279,7 @@ function MultipleAvatars(props) { {`+${props.icons.length - 1}`} diff --git a/src/components/NewDatePicker/CalendarPicker/index.js b/src/components/NewDatePicker/CalendarPicker/index.js index fe0c36d32e41..1e1ef3c3fad3 100644 --- a/src/components/NewDatePicker/CalendarPicker/index.js +++ b/src/components/NewDatePicker/CalendarPicker/index.js @@ -130,7 +130,10 @@ class CalendarPicker extends React.PureComponent { return ( - + this.setState({isYearPickerVisible: true})} style={[styles.alignItemsCenter, styles.flexRow, styles.flex1, styles.justifyContentStart]} @@ -186,6 +189,7 @@ class CalendarPicker extends React.PureComponent { {dayOfWeek[0]} @@ -212,6 +216,7 @@ class CalendarPicker extends React.PureComponent { accessibilityLabel={day ? day.toString() : undefined} focusable={Boolean(day)} accessible={Boolean(day)} + dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} > {({hovered, pressed}) => ( ( aria-labelledby={props.accessibilityLabelledBy} aria-valuenow={props.accessibilityValue} nativeID={props.nativeID} - dataSet={{tag: 'pressable', ...(props.noDragArea && {dragArea: false})}} + dataSet={{tag: 'pressable', ...(props.noDragArea && {dragArea: false}), ...props.dataSet}} /> )); diff --git a/src/components/Reactions/AddReactionBubble.js b/src/components/Reactions/AddReactionBubble.js index 922be96084d8..0315c63aabf1 100644 --- a/src/components/Reactions/AddReactionBubble.js +++ b/src/components/Reactions/AddReactionBubble.js @@ -94,6 +94,7 @@ function AddReactionBubble(props) { accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON} // disable dimming pressDimmingValue={1} + dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} > {({hovered, pressed}) => ( <> diff --git a/src/components/Reactions/EmojiReactionBubble.js b/src/components/Reactions/EmojiReactionBubble.js index bb37735d6920..818bc8f33309 100644 --- a/src/components/Reactions/EmojiReactionBubble.js +++ b/src/components/Reactions/EmojiReactionBubble.js @@ -60,6 +60,7 @@ function EmojiReactionBubble(props) { styles.emojiReactionBubble, StyleUtils.getEmojiReactionBubbleStyle(hovered || pressed, props.hasUserReacted, props.isContextMenu), props.shouldBlockReactions && styles.cursorDisabled, + styles.userSelectNone, ]} onPress={() => { if (props.shouldBlockReactions) { @@ -83,9 +84,10 @@ function EmojiReactionBubble(props) { }} accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON} accessibilityLabel={props.emojiCodes.join('')} + dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} > - {props.emojiCodes.join('')} - {props.count > 0 && {props.count}} + {props.emojiCodes.join('')} + {props.count > 0 && {props.count}} ); } diff --git a/src/components/Reactions/MiniQuickEmojiReactions.js b/src/components/Reactions/MiniQuickEmojiReactions.js index 82f83cb1e961..a22a2967cefe 100644 --- a/src/components/Reactions/MiniQuickEmojiReactions.js +++ b/src/components/Reactions/MiniQuickEmojiReactions.js @@ -80,7 +80,12 @@ function MiniQuickEmojiReactions(props) { tooltipText={`:${EmojiUtils.getLocalizedEmojiName(emoji.name, props.preferredLocale)}:`} onPress={Session.checkIfActionIsAllowed(() => props.onEmojiSelected(emoji, props.emojiReactions))} > - {EmojiUtils.getPreferredEmojiCode(emoji, props.preferredSkinTone)} + + {EmojiUtils.getPreferredEmojiCode(emoji, props.preferredSkinTone)} + ))} diff --git a/src/components/SelectionList/UserListItem.js b/src/components/SelectionList/UserListItem.js index dd90fc750510..49997dc8a80d 100644 --- a/src/components/SelectionList/UserListItem.js +++ b/src/components/SelectionList/UserListItem.js @@ -63,6 +63,7 @@ function UserListItem({item, isFocused = false, showTooltip, onSelectRow, onDism hoverDimmingValue={1} hoverStyle={styles.hoveredComponentBG} focusStyle={styles.hoveredComponentBG} + dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} > {props.prefixCharacter} diff --git a/src/pages/home/report/FloatingMessageCounter/index.js b/src/pages/home/report/FloatingMessageCounter/index.js index 73fe02df129b..721fac0a41af 100644 --- a/src/pages/home/report/FloatingMessageCounter/index.js +++ b/src/pages/home/report/FloatingMessageCounter/index.js @@ -1,6 +1,7 @@ import React, {useEffect, useMemo, useCallback} from 'react'; import {Animated, View} from 'react-native'; import PropTypes from 'prop-types'; +import CONST from '../../../../CONST'; import styles from '../../../../styles/styles'; import Button from '../../../../components/Button'; import Text from '../../../../components/Text'; @@ -75,6 +76,7 @@ function FloatingMessageCounter(props) { {translate('newMessages')} diff --git a/src/pages/home/report/ReportActionItemFragment.js b/src/pages/home/report/ReportActionItemFragment.js index d768fcacd5b7..e9fd30f5b057 100644 --- a/src/pages/home/report/ReportActionItemFragment.js +++ b/src/pages/home/report/ReportActionItemFragment.js @@ -151,6 +151,7 @@ function ReportActionItemFragment(props) { {' '} diff --git a/src/pages/home/report/ReportActionItemThread.js b/src/pages/home/report/ReportActionItemThread.js index ebd965e80daf..9c688911759e 100644 --- a/src/pages/home/report/ReportActionItemThread.js +++ b/src/pages/home/report/ReportActionItemThread.js @@ -62,6 +62,7 @@ function ReportActionItemThread(props) { {`${numberOfRepliesText} ${replyText}`} @@ -69,6 +70,7 @@ function ReportActionItemThread(props) { selectable={false} numberOfLines={1} style={[styles.ml2, styles.textMicroSupporting, styles.flex1]} + dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} > {timeStamp} From 6f197b915df61286ef11723ca8e3e93278f3e57c Mon Sep 17 00:00:00 2001 From: Etotaziba Olei Date: Thu, 14 Sep 2023 09:46:59 +0100 Subject: [PATCH 42/79] useMemo for navigation context value --- src/components/withNavigationFallback.js | 26 ++++++++++-------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/components/withNavigationFallback.js b/src/components/withNavigationFallback.js index d5067d7598b0..e82946c9e049 100644 --- a/src/components/withNavigationFallback.js +++ b/src/components/withNavigationFallback.js @@ -1,4 +1,4 @@ -import React, {forwardRef, useContext} from 'react'; +import React, {forwardRef, useContext, useMemo} from 'react'; import {NavigationContext} from '@react-navigation/core'; import getComponentDisplayName from '../libs/getComponentDisplayName'; import refPropTypes from './refPropTypes'; @@ -7,26 +7,22 @@ export default function (WrappedComponent) { function WithNavigationFallback(props) { const context = useContext(NavigationContext); - return !context ? ( - true, - addListener: () => () => {}, - removeListener: () => () => {}, - }} - > + const navigationContextValue = useMemo(() => ({isFocused: () => true, addListener: () => () => {}, removeListener: () => () => {}}), []); + + return context ? ( + + ) : ( + - ) : ( - ); } WithNavigationFallback.displayName = `WithNavigationFocusWithFallback(${getComponentDisplayName(WrappedComponent)})`; From f873188cfe7e098d2a505cdd14eb255cf0b7b90a Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 14 Sep 2023 17:38:39 +0800 Subject: [PATCH 43/79] update cardType --- src/CONST.ts | 1 + src/types/onyx/Card.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index 1ef2f3e83246..fc38e272606f 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -723,6 +723,7 @@ const CONST = { ERROR_TITLE: { SOCKET: 'Issue connecting to database', DUPLICATE_RECORD: '400 Unique Constraints Violation', + NETWORK_REQUEST_FAILED: 'Network request failed', }, NETWORK: { METHOD: { diff --git a/src/types/onyx/Card.ts b/src/types/onyx/Card.ts index 1efa5906360e..8489fce75f41 100644 --- a/src/types/onyx/Card.ts +++ b/src/types/onyx/Card.ts @@ -1,5 +1,6 @@ import {ValueOf} from 'type-fest'; import CONST from '../../CONST'; +import * as OnyxCommon from './OnyxCommon'; type State = 3 /* OPEN */ | 4 /* NOT_ACTIVATED */ | 5 /* STATE_DEACTIVATED */ | 6 /* CLOSED */ | 7 /* STATE_SUSPENDED */; @@ -14,6 +15,7 @@ type Card = { fraud: ValueOf; cardholderFirstName: string; cardholderLastName: string; + errors?: OnyxCommon.Errors; }; export default Card; From 0f15346ddf86d48116bb2b6657f6b145a6f43204 Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 14 Sep 2023 17:23:18 +0700 Subject: [PATCH 44/79] fix: 26828 Receipt modal closes when API response updates image url --- .../extractAttachmentsFromReport.js | 1 + .../Attachments/AttachmentCarousel/index.js | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/Attachments/AttachmentCarousel/extractAttachmentsFromReport.js b/src/components/Attachments/AttachmentCarousel/extractAttachmentsFromReport.js index d5da25c89576..8a623a44709f 100644 --- a/src/components/Attachments/AttachmentCarousel/extractAttachmentsFromReport.js +++ b/src/components/Attachments/AttachmentCarousel/extractAttachmentsFromReport.js @@ -59,6 +59,7 @@ function extractAttachmentsFromReport(report, reportActions) { isAuthTokenRequired: true, file: {name: transaction.filename}, isReceipt: true, + transactionID, }); return; } diff --git a/src/components/Attachments/AttachmentCarousel/index.js b/src/components/Attachments/AttachmentCarousel/index.js index 5c731a0ccfee..574cb496d02f 100644 --- a/src/components/Attachments/AttachmentCarousel/index.js +++ b/src/components/Attachments/AttachmentCarousel/index.js @@ -19,6 +19,7 @@ import BlockingView from '../../BlockingViews/BlockingView'; import * as Illustrations from '../../Icon/Illustrations'; import variables from '../../../styles/variables'; import * as DeviceCapabilities from '../../../libs/DeviceCapabilities'; +import * as ReportActionsUtils from '../../../libs/ReportActionsUtils'; const viewabilityConfig = { // To facilitate paging through the attachments, we want to consider an item "viewable" when it is @@ -38,13 +39,25 @@ function AttachmentCarousel({report, reportActions, source, onNavigate, setDownl const [activeSource, setActiveSource] = useState(source); const [shouldShowArrows, setShouldShowArrows, autoHideArrows, cancelAutoHideArrows] = useCarouselArrows(); + const compareImage = useCallback( + (attachment) => { + if (attachment.isReceipt) { + const action = ReportActionsUtils.getParentReportAction(report); + const transactionID = _.get(action, ['originalMessage', 'IOUTransactionID']); + return attachment.transactionID === transactionID; + } + return attachment.source === source; + }, + [source, report], + ); + useEffect(() => { const attachmentsFromReport = extractAttachmentsFromReport(report, reportActions); - const initialPage = _.findIndex(attachmentsFromReport, (a) => a.source === source); + const initialPage = _.findIndex(attachmentsFromReport, compareImage); // Dismiss the modal when deleting an attachment during its display in preview. - if (initialPage === -1 && _.find(attachments, (a) => a.source === source)) { + if (initialPage === -1 && _.find(attachments, compareImage)) { Navigation.dismissModal(); } else { setPage(initialPage); @@ -57,7 +70,7 @@ function AttachmentCarousel({report, reportActions, source, onNavigate, setDownl if (!_.isUndefined(attachmentsFromReport[initialPage])) onNavigate(attachmentsFromReport[initialPage]); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [report, reportActions, source]); + }, [reportActions, compareImage]); /** * Updates the page state when the user navigates between attachments From 189975ddca9be8a151a10cc826ec3bbb83eb9881 Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 14 Sep 2023 17:34:27 +0700 Subject: [PATCH 45/79] fix native --- .../AttachmentCarousel/index.native.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/Attachments/AttachmentCarousel/index.native.js b/src/components/Attachments/AttachmentCarousel/index.native.js index 95cda7c2f5c9..a7a2f35a2ccc 100644 --- a/src/components/Attachments/AttachmentCarousel/index.native.js +++ b/src/components/Attachments/AttachmentCarousel/index.native.js @@ -16,6 +16,7 @@ import * as Illustrations from '../../Icon/Illustrations'; import variables from '../../../styles/variables'; import compose from '../../../libs/compose'; import withLocalize from '../../withLocalize'; +import * as ReportActionsUtils from '../../../libs/ReportActionsUtils'; function AttachmentCarousel({report, reportActions, source, onNavigate, onClose, setDownloadButtonVisibility, translate}) { const pagerRef = useRef(null); @@ -27,13 +28,25 @@ function AttachmentCarousel({report, reportActions, source, onNavigate, onClose, const [isPinchGestureRunning, setIsPinchGestureRunning] = useState(true); const [shouldShowArrows, setShouldShowArrows, autoHideArrows, cancelAutoHideArrows] = useCarouselArrows(); + const compareImage = useCallback( + (attachment) => { + if (attachment.isReceipt) { + const action = ReportActionsUtils.getParentReportAction(report); + const transactionID = _.get(action, ['originalMessage', 'IOUTransactionID']); + return attachment.transactionID === transactionID; + } + return attachment.source === source; + }, + [source, report], + ); + useEffect(() => { const attachmentsFromReport = extractAttachmentsFromReport(report, reportActions); - const initialPage = _.findIndex(attachmentsFromReport, (a) => a.source === source); + const initialPage = _.findIndex(attachmentsFromReport, compareImage); // Dismiss the modal when deleting an attachment during its display in preview. - if (initialPage === -1 && _.find(attachments, (a) => a.source === source)) { + if (initialPage === -1 && _.find(attachments, compareImage)) { Navigation.dismissModal(); } else { setPage(initialPage); @@ -46,7 +59,7 @@ function AttachmentCarousel({report, reportActions, source, onNavigate, onClose, if (!_.isUndefined(attachmentsFromReport[initialPage])) onNavigate(attachmentsFromReport[initialPage]); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [report, reportActions, source]); + }, [reportActions, compareImage]); /** * Updates the page state when the user navigates between attachments From bf499d39e3ef7981c478d33626a8db6207925a65 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Thu, 14 Sep 2023 18:25:48 +0500 Subject: [PATCH 46/79] feat: bump react-native-onyx version --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 69080fb2963d..5089fc4d068b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,7 +85,7 @@ "react-native-linear-gradient": "^2.8.1", "react-native-localize": "^2.2.6", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.72", + "react-native-onyx": "1.0.77", "react-native-pager-view": "^6.2.0", "react-native-pdf": "^6.7.1", "react-native-performance": "^5.1.0", @@ -40311,9 +40311,9 @@ } }, "node_modules/react-native-onyx": { - "version": "1.0.72", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.72.tgz", - "integrity": "sha512-roJuA92qZH2PLYSqBhSPCse+Ra2EJu4FBpVqguwJRp6oaLNHR1CtPTgU1xMh/kj2nWmdpcqKoOc3nS35asb80g==", + "version": "1.0.77", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.77.tgz", + "integrity": "sha512-HmeS1Pz/BkKNbYuhWULC9I0VRBDt8yadG0ZFIW6wuZ+VajhjD960qh7Il1+XzEBI6Vb4d7BZkPcad87ad1IEOQ==", "dependencies": { "ascii-table": "0.0.9", "fast-equals": "^4.0.3", @@ -40327,7 +40327,7 @@ "idb-keyval": "^6.2.1", "react": ">=18.1.0", "react-native-device-info": "^10.3.0", - "react-native-performance": "^4.0.0", + "react-native-performance": "^5.1.0", "react-native-quick-sqlite": "^8.0.0-beta.2" }, "peerDependenciesMeta": { @@ -75638,9 +75638,9 @@ } }, "react-native-onyx": { - "version": "1.0.72", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.72.tgz", - "integrity": "sha512-roJuA92qZH2PLYSqBhSPCse+Ra2EJu4FBpVqguwJRp6oaLNHR1CtPTgU1xMh/kj2nWmdpcqKoOc3nS35asb80g==", + "version": "1.0.77", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.77.tgz", + "integrity": "sha512-HmeS1Pz/BkKNbYuhWULC9I0VRBDt8yadG0ZFIW6wuZ+VajhjD960qh7Il1+XzEBI6Vb4d7BZkPcad87ad1IEOQ==", "requires": { "ascii-table": "0.0.9", "fast-equals": "^4.0.3", diff --git a/package.json b/package.json index 5295610bebe3..cdb683d3b61d 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "react-native-linear-gradient": "^2.8.1", "react-native-localize": "^2.2.6", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.72", + "react-native-onyx": "1.0.77", "react-native-pager-view": "^6.2.0", "react-native-pdf": "^6.7.1", "react-native-performance": "^5.1.0", From 9fc3688e75902c182cebd8243f29d0baf147aa26 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Thu, 14 Sep 2023 19:07:17 +0500 Subject: [PATCH 47/79] fix: close the popover when the browser history changes --- src/components/PopoverProvider/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/PopoverProvider/index.js b/src/components/PopoverProvider/index.js index efa230d920d5..7212bb741c6e 100644 --- a/src/components/PopoverProvider/index.js +++ b/src/components/PopoverProvider/index.js @@ -100,6 +100,14 @@ function PopoverContextProvider(props) { }; }, [closePopover]); + React.useEffect(() => { + const listener = () => closePopover(); + window.addEventListener('popstate', listener); + return () => { + window.removeEventListener('popstate', listener); + }; + }, [closePopover]); + const onOpen = React.useCallback( (popoverParams) => { if (activePopoverRef.current && activePopoverRef.current.ref !== popoverParams.ref) { From 171189edd98d843a53974d041a814e713868436b Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 14 Sep 2023 22:18:23 +0800 Subject: [PATCH 48/79] rm network const --- src/CONST.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index fc38e272606f..1ef2f3e83246 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -723,7 +723,6 @@ const CONST = { ERROR_TITLE: { SOCKET: 'Issue connecting to database', DUPLICATE_RECORD: '400 Unique Constraints Violation', - NETWORK_REQUEST_FAILED: 'Network request failed', }, NETWORK: { METHOD: { From 197613af429f9a7af29634720de170760ec76757 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Thu, 14 Sep 2023 19:57:52 +0500 Subject: [PATCH 49/79] fix: move the popstate listener inside Popover component --- src/components/Popover/index.js | 16 ++++++++++++++++ src/components/PopoverProvider/index.js | 8 -------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/Popover/index.js b/src/components/Popover/index.js index bfd02ba1d3e3..fe04c4d69be6 100644 --- a/src/components/Popover/index.js +++ b/src/components/Popover/index.js @@ -11,6 +11,22 @@ import PopoverWithoutOverlay from '../PopoverWithoutOverlay'; * On small screen widths, it uses BottomDocked modal type, and a Popover type on wide screen widths. */ function Popover(props) { + // Not adding this inside the PopoverProvider + // because this is an issue on smaller screens as well. + React.useEffect(() => { + const listener = () => { + if (!props.isVisible) { + return; + } + + props.onClose(); + }; + window.addEventListener('popstate', listener); + return () => { + window.removeEventListener('popstate', listener); + }; + }, [props.onClose, props.isVisible]); + if (!props.fullscreen && !props.isSmallScreenWidth) { return createPortal( { - const listener = () => closePopover(); - window.addEventListener('popstate', listener); - return () => { - window.removeEventListener('popstate', listener); - }; - }, [closePopover]); - const onOpen = React.useCallback( (popoverParams) => { if (activePopoverRef.current && activePopoverRef.current.ref !== popoverParams.ref) { From 07e0a5a5e939078573c7d46008a4ebb7e3682809 Mon Sep 17 00:00:00 2001 From: Mahesh Date: Thu, 14 Sep 2023 20:28:31 +0530 Subject: [PATCH 50/79] small changes --- src/pages/home/ReportScreen.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 19c8732dcfa0..84599d233452 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -302,7 +302,8 @@ function ReportScreen({ ComposerActions.setShouldShowComposeInput(true); }, [route, report, errors, fetchReportIfNeeded, prevReport.reportID]); - const isReportAvailable = useMemo( + // eslint-disable-next-line rulesdir/no-negated-variables + const shouldShowNotFoundPage = useMemo( () => (!_.isEmpty(report) && !isDefaultReport && !report.reportID && !isOptimisticDelete && !report.isLoadingReportActions && !isLoading) || shouldHideReport, [report, isLoading, shouldHideReport, isDefaultReport, isOptimisticDelete], ); @@ -320,7 +321,7 @@ function ReportScreen({ shouldDisableFocusTrap > Date: Thu, 14 Sep 2023 23:07:31 +0800 Subject: [PATCH 51/79] add cardName --- src/types/onyx/Card.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/Card.ts b/src/types/onyx/Card.ts index 8489fce75f41..e89c966d49da 100644 --- a/src/types/onyx/Card.ts +++ b/src/types/onyx/Card.ts @@ -11,6 +11,7 @@ type Card = { availableSpend: number; domainName: string; maskedPan: string; + cardName: string; isVirtual: boolean; fraud: ValueOf; cardholderFirstName: string; From 6c5cd02b56d3140f7d2aa2557c562e453e89984e Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Thu, 14 Sep 2023 20:16:34 +0500 Subject: [PATCH 52/79] fix: lint errors --- src/components/Popover/index.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/components/Popover/index.js b/src/components/Popover/index.js index fe04c4d69be6..f2c61b38c008 100644 --- a/src/components/Popover/index.js +++ b/src/components/Popover/index.js @@ -11,39 +11,40 @@ import PopoverWithoutOverlay from '../PopoverWithoutOverlay'; * On small screen widths, it uses BottomDocked modal type, and a Popover type on wide screen widths. */ function Popover(props) { + const {isVisible, onClose, isSmallScreenWidth, fullscreen, animationInTiming, onLayout, animationOutTiming, disableAnimation, withoutOverlay, anchorPosition} = props; // Not adding this inside the PopoverProvider // because this is an issue on smaller screens as well. React.useEffect(() => { const listener = () => { - if (!props.isVisible) { + if (!isVisible) { return; } - props.onClose(); + onClose(); }; window.addEventListener('popstate', listener); return () => { window.removeEventListener('popstate', listener); }; - }, [props.onClose, props.isVisible]); + }, [onClose, isVisible]); - if (!props.fullscreen && !props.isSmallScreenWidth) { + if (!fullscreen && !isSmallScreenWidth) { return createPortal( , document.body, ); } - if (props.withoutOverlay && !props.isSmallScreenWidth) { + if (withoutOverlay && !isSmallScreenWidth) { // eslint-disable-next-line react/jsx-props-no-spreading return createPortal(, document.body); } @@ -52,12 +53,12 @@ function Popover(props) { ); } From 66dac40e0c72dad31cabc1b71fe7a4f623bd766c Mon Sep 17 00:00:00 2001 From: Getabalew Tesfaye Date: Thu, 14 Sep 2023 19:02:41 +0300 Subject: [PATCH 53/79] fix report preview from being clickable on empty space --- src/components/ReportActionItem/MoneyRequestPreview.js | 1 + src/components/ReportActionItem/ReportPreview.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview.js b/src/components/ReportActionItem/MoneyRequestPreview.js index 02da03225062..1fce3b119dd8 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview.js +++ b/src/components/ReportActionItem/MoneyRequestPreview.js @@ -343,6 +343,7 @@ function MoneyRequestPreview(props) { onLongPress={showContextMenu} accessibilityLabel={props.isBillSplit ? props.translate('iou.split') : props.translate('iou.cash')} accessibilityHint={CurrencyUtils.convertToDisplayString(requestAmount, requestCurrency)} + style={styles.moneyRequestPreviewBox} > {childContainer} diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js index b95fdaad1025..01f220d01270 100644 --- a/src/components/ReportActionItem/ReportPreview.js +++ b/src/components/ReportActionItem/ReportPreview.js @@ -177,7 +177,7 @@ function ReportPreview(props) { onPressIn={() => DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} onPressOut={() => ControlSelection.unblock()} onLongPress={(event) => showContextMenuForReport(event, props.contextMenuAnchor, props.chatReportID, props.action, props.checkIfContextMenuActive)} - style={[styles.flexRow, styles.justifyContentBetween]} + style={[styles.flexRow, styles.justifyContentBetween, styles.reportPreviewBox]} accessibilityRole="button" accessibilityLabel={props.translate('iou.viewDetails')} > From 0d52b9def117ab1b281bc0e7fdd130615526711c Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 14 Sep 2023 23:45:46 +0700 Subject: [PATCH 54/79] make code cleaner --- src/pages/workspace/WorkspaceMembersPage.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 8237b6c75e09..2b69e171d500 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -75,7 +75,9 @@ function WorkspaceMembersPage(props) { const [errors, setErrors] = useState({}); const [searchValue, setSearchValue] = useState(''); const prevIsOffline = usePrevious(props.network.isOffline); - + const accountIDs = useMemo(() => _.keys(props.policyMembers), [props.policyMembers]); + const prevAccountIDs = usePrevious(accountIDs); + /** * Get members for the current workspace */ @@ -107,8 +109,7 @@ function WorkspaceMembersPage(props) { useEffect(() => { validateSelection(); }, [props.preferredLocale, validateSelection]); - const accountIDs = useMemo(() => _.keys(props.policyMembers), [props.policyMembers]); - const prevAccountIDs = usePrevious(accountIDs); + useEffect(() => { if (removeMembersConfirmModalVisible && !_.isEqual(accountIDs, prevAccountIDs)) { setRemoveMembersConfirmModalVisible(false); From f33af5c089a3d30e746a58b73b9c2f48e0760ccb Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 14 Sep 2023 23:53:13 +0700 Subject: [PATCH 55/79] fix lint --- src/pages/workspace/WorkspaceMembersPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 2b69e171d500..7bb9a91c130e 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -77,7 +77,7 @@ function WorkspaceMembersPage(props) { const prevIsOffline = usePrevious(props.network.isOffline); const accountIDs = useMemo(() => _.keys(props.policyMembers), [props.policyMembers]); const prevAccountIDs = usePrevious(accountIDs); - + /** * Get members for the current workspace */ From b662396056b723221654e7134e3ee2ffc63d8a21 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Fri, 15 Sep 2023 00:18:34 +0200 Subject: [PATCH 56/79] Fix conflicts --- src/styles/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index f07d7d43be9d..f863f56d27f2 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -34,7 +34,7 @@ const touchCalloutNone = Browser.isMobileSafari() ? {WebkitTouchCallout: 'none'} const lineHeightBadge = getPlatform() === CONST.PLATFORM.WEB ? {lineHeight: variables.lineHeightXSmall} : {lineHeight: variables.lineHeightNormal}; -const picker = { +const picker = (theme) => ({ backgroundColor: theme.transparent, color: theme.text, fontFamily: fontFamily.EXP_NEUE, From 98d3411bee469cc4305f0a6291e4a6fee335c673 Mon Sep 17 00:00:00 2001 From: Amy Evans Date: Thu, 14 Sep 2023 17:32:17 -0500 Subject: [PATCH 57/79] Revert "Convert SearchPage to functional component" --- src/pages/SearchPage.js | 229 ++++++++++++++++++++++------------------ 1 file changed, 125 insertions(+), 104 deletions(-) diff --git a/src/pages/SearchPage.js b/src/pages/SearchPage.js index dd42ed80c3d4..6505b604b614 100755 --- a/src/pages/SearchPage.js +++ b/src/pages/SearchPage.js @@ -1,5 +1,5 @@ import _ from 'underscore'; -import React, {useCallback, useEffect, useState, useMemo} from 'react'; +import React, {Component} from 'react'; import {View} from 'react-native'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; @@ -9,15 +9,17 @@ import * as ReportUtils from '../libs/ReportUtils'; import ONYXKEYS from '../ONYXKEYS'; import styles from '../styles/styles'; import Navigation from '../libs/Navigation/Navigation'; +import withWindowDimensions, {windowDimensionsPropTypes} from '../components/withWindowDimensions'; import * as Report from '../libs/actions/Report'; import HeaderWithBackButton from '../components/HeaderWithBackButton'; import ScreenWrapper from '../components/ScreenWrapper'; import Timing from '../libs/actions/Timing'; import CONST from '../CONST'; +import withLocalize, {withLocalizePropTypes} from '../components/withLocalize'; +import compose from '../libs/compose'; import personalDetailsPropType from './personalDetailsPropType'; import reportPropTypes from './reportPropTypes'; import Performance from '../libs/Performance'; -import useLocalize from '../hooks/useLocalize'; const propTypes = { /* Onyx Props */ @@ -30,6 +32,11 @@ const propTypes = { /** All reports shared with the user */ reports: PropTypes.objectOf(reportPropTypes), + + /** Window Dimensions Props */ + ...windowDimensionsPropTypes, + + ...withLocalizePropTypes, }; const defaultProps = { @@ -38,157 +45,171 @@ const defaultProps = { reports: {}, }; -function SearchPage({betas, personalDetails, reports}) { - // Data for initialization (runs only on the first render) - const { - recentReports: initialRecentReports, - personalDetails: initialPersonalDetails, - userToInvite: initialUserToInvite, - // Ignoring the rule because in this case we need the data only initially - // eslint-disable-next-line react-hooks/exhaustive-deps - } = useMemo(() => OptionsListUtils.getSearchOptions(reports, personalDetails, '', betas), []); - - const [searchValue, setSearchValue] = useState(''); - const [searchOptions, setSearchOptions] = useState({ - recentReports: initialRecentReports, - personalDetails: initialPersonalDetails, - userToInvite: initialUserToInvite, - }); - - const {translate} = useLocalize(); - - const updateOptions = useCallback(() => { - const { - recentReports: localRecentReports, - personalDetails: localPersonalDetails, - userToInvite: localUserToInvite, - } = OptionsListUtils.getSearchOptions(reports, personalDetails, searchValue.trim(), betas); - - setSearchOptions({ - recentReports: localRecentReports, - personalDetails: localPersonalDetails, - userToInvite: localUserToInvite, - }); - }, [reports, personalDetails, searchValue, betas]); - - const debouncedUpdateOptions = useMemo(() => _.debounce(updateOptions, 75), [updateOptions]); +class SearchPage extends Component { + constructor(props) { + super(props); - useEffect(() => { Timing.start(CONST.TIMING.SEARCH_RENDER); Performance.markStart(CONST.TIMING.SEARCH_RENDER); - }, []); - useEffect(() => { - debouncedUpdateOptions(); - }, [searchValue, debouncedUpdateOptions]); + this.searchRendered = this.searchRendered.bind(this); + this.selectReport = this.selectReport.bind(this); + this.onChangeText = this.onChangeText.bind(this); + this.debouncedUpdateOptions = _.debounce(this.updateOptions.bind(this), 75); + + const {recentReports, personalDetails, userToInvite} = OptionsListUtils.getSearchOptions(props.reports, props.personalDetails, '', props.betas); + + this.state = { + searchValue: '', + recentReports, + personalDetails, + userToInvite, + }; + } + + componentDidUpdate(prevProps) { + if (_.isEqual(prevProps.reports, this.props.reports) && _.isEqual(prevProps.personalDetails, this.props.personalDetails)) { + return; + } + this.updateOptions(); + } + + onChangeText(searchValue = '') { + this.setState({searchValue}, this.debouncedUpdateOptions); + } /** * Returns the sections needed for the OptionsSelector * * @returns {Array} */ - const getSections = () => { + getSections() { const sections = []; let indexOffset = 0; - if (searchOptions.recentReports.length > 0) { + if (this.state.recentReports.length > 0) { sections.push({ - data: searchOptions.recentReports, + data: this.state.recentReports, shouldShow: true, indexOffset, }); - indexOffset += searchOptions.recentReports.length; + indexOffset += this.state.recentReports.length; } - if (searchOptions.personalDetails.length > 0) { + if (this.state.personalDetails.length > 0) { sections.push({ - data: searchOptions.personalDetails, + data: this.state.personalDetails, shouldShow: true, indexOffset, }); - indexOffset += searchOptions.recentReports.length; + indexOffset += this.state.recentReports.length; } - if (searchOptions.userToInvite) { + if (this.state.userToInvite) { sections.push({ - data: [searchOptions.userToInvite], + data: [this.state.userToInvite], shouldShow: true, indexOffset, }); } return sections; - }; + } - const searchRendered = () => { + searchRendered() { Timing.end(CONST.TIMING.SEARCH_RENDER); Performance.markEnd(CONST.TIMING.SEARCH_RENDER); - }; - - const onChangeText = (value = '') => { - setSearchValue(value); - }; + } + + updateOptions() { + const {recentReports, personalDetails, userToInvite} = OptionsListUtils.getSearchOptions( + this.props.reports, + this.props.personalDetails, + this.state.searchValue.trim(), + this.props.betas, + ); + this.setState({ + userToInvite, + recentReports, + personalDetails, + }); + } /** * Reset the search value and redirect to the selected report * * @param {Object} option */ - const selectReport = (option) => { + selectReport(option) { if (!option) { return; } + if (option.reportID) { - setSearchValue(''); - Navigation.dismissModal(option.reportID); + this.setState( + { + searchValue: '', + }, + () => { + Navigation.dismissModal(option.reportID); + }, + ); } else { Report.navigateToAndOpenReport([option.login]); } - }; - - const isOptionsDataReady = ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(personalDetails); - const headerMessage = OptionsListUtils.getHeaderMessage( - searchOptions.recentReports.length + searchOptions.personalDetails.length !== 0, - Boolean(searchOptions.userToInvite), - searchValue, - ); - return ( - - {({didScreenTransitionEnd, safeAreaPaddingBottomStyle}) => ( - <> - - - - - - )} - - ); + } + + render() { + const sections = this.getSections(); + const isOptionsDataReady = ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(this.props.personalDetails); + const headerMessage = OptionsListUtils.getHeaderMessage( + this.state.recentReports.length + this.state.personalDetails.length !== 0, + Boolean(this.state.userToInvite), + this.state.searchValue, + ); + + return ( + + {({didScreenTransitionEnd, safeAreaPaddingBottomStyle}) => ( + <> + + + + + + )} + + ); + } } SearchPage.propTypes = propTypes; SearchPage.defaultProps = defaultProps; -SearchPage.displayName = 'SearchPage'; -export default withOnyx({ - reports: { - key: ONYXKEYS.COLLECTION.REPORT, - }, - personalDetails: { - key: ONYXKEYS.PERSONAL_DETAILS_LIST, - }, - betas: { - key: ONYXKEYS.BETAS, - }, -})(SearchPage); + +export default compose( + withLocalize, + withWindowDimensions, + withOnyx({ + reports: { + key: ONYXKEYS.COLLECTION.REPORT, + }, + personalDetails: { + key: ONYXKEYS.PERSONAL_DETAILS_LIST, + }, + betas: { + key: ONYXKEYS.BETAS, + }, + }), +)(SearchPage); From 77987583c046c62175c1463d1378332b009a2997 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 15 Sep 2023 10:23:33 +0800 Subject: [PATCH 58/79] create getCompanyCards --- src/CONST.ts | 1 + src/libs/CardUtils.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 1ef2f3e83246..fb3e2ead7976 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1170,6 +1170,7 @@ const CONST = { SMALL_NORMAL: 'small-normal', }, EXPENSIFY_CARD: { + BANK: 'Expensify Card', FRAUD_TYPES: { DOMAIN: 'domain', INDIVIDUAL: 'individal', diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index bbb938a666ac..b82a12a7f42d 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -1,3 +1,6 @@ +import {Card} from "../types/onyx"; +import CONST from "../CONST"; + /** * @returns string with a month in MM format */ @@ -15,4 +18,8 @@ function getYearFromExpirationDateString(expirationDateString: string) { return cardYear.length === 2 ? `20${cardYear}` : cardYear; } -export {getMonthFromExpirationDateString, getYearFromExpirationDateString}; +function getCompanyCards(cardList: Card[]) { + return cardList.filter(card => card.bank !== CONST.EXPENSIFY_CARD.BANK); +} + +export {getMonthFromExpirationDateString, getYearFromExpirationDateString, getCompanyCards}; From 73e1a7c8680cf330dfb316456fc724362aa9df73 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 15 Sep 2023 10:58:47 +0800 Subject: [PATCH 59/79] handle edge cases --- src/libs/CardUtils.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index b82a12a7f42d..1e3caf365e3e 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -18,8 +18,11 @@ function getYearFromExpirationDateString(expirationDateString: string) { return cardYear.length === 2 ? `20${cardYear}` : cardYear; } -function getCompanyCards(cardList: Card[]) { - return cardList.filter(card => card.bank !== CONST.EXPENSIFY_CARD.BANK); +function getCompanyCards(cardList: {string: Card}) { + if (!cardList) { + return []; + } + return Object.values(cardList).filter(card => card.bank !== CONST.EXPENSIFY_CARD.BANK); } export {getMonthFromExpirationDateString, getYearFromExpirationDateString, getCompanyCards}; From b9aa5ab4b04b6d7c8533801587ed2667a577d837 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 15 Sep 2023 11:00:58 +0800 Subject: [PATCH 60/79] fix style --- src/libs/CardUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index 1e3caf365e3e..beb0ea800091 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -1,5 +1,5 @@ -import {Card} from "../types/onyx"; -import CONST from "../CONST"; +import {Card} from '../types/onyx'; +import CONST from '../CONST'; /** * @returns string with a month in MM format @@ -22,7 +22,7 @@ function getCompanyCards(cardList: {string: Card}) { if (!cardList) { return []; } - return Object.values(cardList).filter(card => card.bank !== CONST.EXPENSIFY_CARD.BANK); + return Object.values(cardList).filter((card) => card.bank !== CONST.EXPENSIFY_CARD.BANK); } export {getMonthFromExpirationDateString, getYearFromExpirationDateString, getCompanyCards}; From 626108d5b4aad488992f9d3047acfb6c0e1830b6 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 15 Sep 2023 04:51:14 +0100 Subject: [PATCH 61/79] prevent the pan responder from intercepting clicks / taps on web platforms --- src/components/MapView/responder/index.android.ts | 8 ++++++++ src/components/MapView/responder/index.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/components/MapView/responder/index.android.ts diff --git a/src/components/MapView/responder/index.android.ts b/src/components/MapView/responder/index.android.ts new file mode 100644 index 000000000000..a0fce71d8ef5 --- /dev/null +++ b/src/components/MapView/responder/index.android.ts @@ -0,0 +1,8 @@ +import {PanResponder} from 'react-native'; + +const responder = PanResponder.create({ + onStartShouldSetPanResponder: () => true, + onPanResponderTerminationRequest: () => false, +}); + +export default responder; diff --git a/src/components/MapView/responder/index.ts b/src/components/MapView/responder/index.ts index a0fce71d8ef5..422d6c1b4963 100644 --- a/src/components/MapView/responder/index.ts +++ b/src/components/MapView/responder/index.ts @@ -1,7 +1,7 @@ import {PanResponder} from 'react-native'; const responder = PanResponder.create({ - onStartShouldSetPanResponder: () => true, + onMoveShouldSetPanResponder: () => true, onPanResponderTerminationRequest: () => false, }); From 941fbc919f37fc6f9e482c128c1ae78396889cd6 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Fri, 15 Sep 2023 14:06:02 +0800 Subject: [PATCH 62/79] changing OR to AND --- src/libs/actions/OnyxUpdateManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index 1c96a2d11d74..209b095550cb 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -42,7 +42,7 @@ export default () => { if ( !_.isObject(val) || !_.has(val, 'type') || - !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && _.has(val, 'request') && _.has(val, 'response')) || + !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && _.has(val, 'request') && _.has(val, 'response')) && !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && _.has(val, 'updates')) ) { Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); From 5029f33f05b75d82253883a51853c4331742e836 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Fri, 15 Sep 2023 14:15:16 +0800 Subject: [PATCH 63/79] fixing clause, adding OR and unpausing sequential queue --- src/libs/actions/OnyxUpdateManager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/OnyxUpdateManager.js b/src/libs/actions/OnyxUpdateManager.js index 209b095550cb..e0f3f8fd4622 100644 --- a/src/libs/actions/OnyxUpdateManager.js +++ b/src/libs/actions/OnyxUpdateManager.js @@ -42,10 +42,11 @@ export default () => { if ( !_.isObject(val) || !_.has(val, 'type') || - !(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && _.has(val, 'request') && _.has(val, 'response')) && - !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && _.has(val, 'updates')) + (!(val.type === CONST.ONYX_UPDATE_TYPES.HTTPS && _.has(val, 'request') && _.has(val, 'response')) && !(val.type === CONST.ONYX_UPDATE_TYPES.PUSHER && _.has(val, 'updates'))) ) { + console.debug('[OnyxUpdateManager] Invalid format found for updates, cleaning and unpausing the queue'); Onyx.set(ONYXKEYS.ONYX_UPDATES_FROM_SERVER, null); + SequentialQueue.unpause(); return; } From 3a72eeff7a741d9276bd636f93327fa7f0c18c84 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 15:43:11 +0800 Subject: [PATCH 64/79] Remove mWeb Banner --- src/Expensify.js | 1 - src/ONYXKEYS.ts | 4 - src/components/DownloadAppModal.js | 79 ------------------- src/libs/actions/DownloadAppModal.js | 11 --- .../FloatingActionButtonAndPopover.js | 13 +-- 5 files changed, 1 insertion(+), 107 deletions(-) delete mode 100644 src/components/DownloadAppModal.js delete mode 100644 src/libs/actions/DownloadAppModal.js diff --git a/src/Expensify.js b/src/Expensify.js index 1086bd32cff9..dfb223a9e227 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -193,7 +193,6 @@ function Expensify(props) { {shouldInit && ( <> - diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 2e0b75910bae..9e0a05dbf708 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -87,9 +87,6 @@ const ONYXKEYS = { SESSION: 'session', BETAS: 'betas', - /** Denotes if the Download App Banner has been dismissed */ - SHOW_DOWNLOAD_APP_BANNER: 'showDownloadAppBanner', - /** NVP keys * Contains the user's payPalMe data */ PAYPAL: 'paypal', @@ -306,7 +303,6 @@ type OnyxValues = { [ONYXKEYS.ACTIVE_CLIENTS]: string[]; [ONYXKEYS.DEVICE_ID]: string; [ONYXKEYS.IS_SIDEBAR_LOADED]: boolean; - [ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER]: boolean; [ONYXKEYS.PERSISTED_REQUESTS]: OnyxTypes.Request[]; [ONYXKEYS.QUEUED_ONYX_UPDATES]: OnyxTypes.QueuedOnyxUpdates; [ONYXKEYS.CURRENT_DATE]: string; diff --git a/src/components/DownloadAppModal.js b/src/components/DownloadAppModal.js deleted file mode 100644 index c96c6b3d28c0..000000000000 --- a/src/components/DownloadAppModal.js +++ /dev/null @@ -1,79 +0,0 @@ -import React, {useState} from 'react'; -import PropTypes from 'prop-types'; -import {withOnyx} from 'react-native-onyx'; -import ONYXKEYS from '../ONYXKEYS'; -import styles from '../styles/styles'; -import CONST from '../CONST'; -import AppIcon from '../../assets/images/expensify-app-icon.svg'; -import useLocalize from '../hooks/useLocalize'; -import * as Link from '../libs/actions/Link'; -import * as Browser from '../libs/Browser'; -import getOperatingSystem from '../libs/getOperatingSystem'; -import setShowDownloadAppModal from '../libs/actions/DownloadAppModal'; -import ConfirmModal from './ConfirmModal'; - -const propTypes = { - /** ONYX PROP to hide banner for a user that has dismissed it */ - // eslint-disable-next-line react/forbid-prop-types - showDownloadAppBanner: PropTypes.bool, - - /** Whether the user is logged in */ - isAuthenticated: PropTypes.bool.isRequired, -}; - -const defaultProps = { - showDownloadAppBanner: true, -}; - -function DownloadAppModal({isAuthenticated, showDownloadAppBanner}) { - const [shouldShowBanner, setShouldShowBanner] = useState(Browser.isMobile() && isAuthenticated && showDownloadAppBanner); - - const {translate} = useLocalize(); - - const handleCloseBanner = () => { - setShowDownloadAppModal(false); - setShouldShowBanner(false); - }; - - let link = ''; - - if (getOperatingSystem() === CONST.OS.IOS) { - link = CONST.APP_DOWNLOAD_LINKS.IOS; - } else if (getOperatingSystem() === CONST.OS.ANDROID) { - link = CONST.APP_DOWNLOAD_LINKS.ANDROID; - } - - const handleOpenAppStore = () => { - setShowDownloadAppModal(false); - setShouldShowBanner(false); - Link.openExternalLink(link, true); - }; - - return ( - - ); -} - -DownloadAppModal.displayName = 'DownloadAppModal'; -DownloadAppModal.propTypes = propTypes; -DownloadAppModal.defaultProps = defaultProps; - -export default withOnyx({ - showDownloadAppBanner: { - key: ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER, - }, -})(DownloadAppModal); diff --git a/src/libs/actions/DownloadAppModal.js b/src/libs/actions/DownloadAppModal.js deleted file mode 100644 index 5dc2d3fdca22..000000000000 --- a/src/libs/actions/DownloadAppModal.js +++ /dev/null @@ -1,11 +0,0 @@ -import Onyx from 'react-native-onyx'; -import ONYXKEYS from '../../ONYXKEYS'; - -/** - * @param {Boolean} shouldShowBanner - */ -function setShowDownloadAppModal(shouldShowBanner) { - Onyx.set(ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER, shouldShowBanner); -} - -export default setShowDownloadAppModal; diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index cb77a832705c..e217bc8226b6 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -62,9 +62,6 @@ const propTypes = { /** Indicated whether the report data is loading */ isLoading: PropTypes.bool, - /** For first time users, whether the download app banner should show */ - shouldShowDownloadAppBanner: PropTypes.bool, - /** Forwarded ref to FloatingActionButtonAndPopover */ innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), }; @@ -75,7 +72,6 @@ const defaultProps = { betas: [], isLoading: false, innerRef: null, - shouldShowDownloadAppBanner: true, }; /** @@ -158,12 +154,8 @@ function FloatingActionButtonAndPopover(props) { if (currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) { return; } - // Avoid rendering the create menu for first-time users until they have dismissed the download app banner (mWeb only). - if (props.shouldShowDownloadAppBanner && Browser.isMobile()) { - return; - } Welcome.show({routes, showCreateMenu}); - }, [props.shouldShowDownloadAppBanner, props.navigation, showCreateMenu, props.demoInfo]); + }, [props.navigation, showCreateMenu, props.demoInfo]); useEffect(() => { if (!didScreenBecomeInactive()) { @@ -291,9 +283,6 @@ export default compose( isLoading: { key: ONYXKEYS.IS_LOADING_REPORT_DATA, }, - shouldShowDownloadAppBanner: { - key: ONYXKEYS.SHOW_DOWNLOAD_APP_BANNER, - }, }), )( forwardRef((props, ref) => ( From 3bb9c868d6f7e80e8d3d6813968d8fc9abef64e2 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 15:55:20 +0800 Subject: [PATCH 65/79] remove languages and imports --- src/Expensify.js | 1 - src/components/ConfirmContent.js | 4 ++-- src/languages/es.ts | 5 ----- src/styles/variables.ts | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Expensify.js b/src/Expensify.js index dfb223a9e227..fba65e42c06c 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -30,7 +30,6 @@ import KeyboardShortcutsModal from './components/KeyboardShortcutsModal'; import AppleAuthWrapper from './components/SignInButtons/AppleAuthWrapper'; import EmojiPicker from './components/EmojiPicker/EmojiPicker'; import * as EmojiPickerAction from './libs/actions/EmojiPickerAction'; -import DownloadAppModal from './components/DownloadAppModal'; import DeeplinkWrapper from './components/DeeplinkWrapper'; // This lib needs to be imported, but it has nothing to export since all it contains is an Onyx connection diff --git a/src/components/ConfirmContent.js b/src/components/ConfirmContent.js index 9a72d4e7d584..ab3e23d6b1c1 100644 --- a/src/components/ConfirmContent.js +++ b/src/components/ConfirmContent.js @@ -100,8 +100,8 @@ function ConfirmContent(props) { diff --git a/src/languages/es.ts b/src/languages/es.ts index 7315c42cebab..25897e071881 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -335,11 +335,6 @@ export default { `¡Siempre es genial ver una cara nueva por aquí! Por favor ingresa el código mágico enviado a ${login}. Debería llegar en un par de minutos.`, welcomeEnterMagicCode: ({login}: WelcomeEnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${login}. Debería llegar en un par de minutos.`, }, - DownloadAppModal: { - downloadTheApp: 'Descarga la aplicación', - keepTheConversationGoing: 'Mantén la conversación en New Expensify, descarga la aplicación para una experiencia mejorada.', - noThanks: 'No, gracias', - }, login: { hero: { header: 'Divida las facturas, solicite pagos y chatee con sus amigos.', diff --git a/src/styles/variables.ts b/src/styles/variables.ts index eb182ab1eca0..731f3349444c 100644 --- a/src/styles/variables.ts +++ b/src/styles/variables.ts @@ -25,7 +25,7 @@ export default { componentBorderRadiusLarge: 16, componentBorderRadiusCard: 12, componentBorderRadiusRounded: 24, - downloadAppModalAppIconSize: 48, + appModalAppIconSize: 48, buttonBorderRadius: 100, avatarSizeLargeBordered: 88, avatarSizeLarge: 80, From 26d93bb2e3a211b7758291b5ca6943750f087492 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 16:02:52 +0800 Subject: [PATCH 66/79] remove from es too --- src/languages/en.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 03adaa1e66b1..77851a8a1a38 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -344,11 +344,6 @@ export default { `It's always great to see a new face around here! Please enter the magic code sent to ${login}. It should arrive within a minute or two.`, welcomeEnterMagicCode: ({login}: WelcomeEnterMagicCodeParams) => `Please enter the magic code sent to ${login}. It should arrive within a minute or two.`, }, - DownloadAppModal: { - downloadTheApp: 'Download the app', - keepTheConversationGoing: 'Keep the conversation going in New Expensify, download the app for an enhanced experience.', - noThanks: 'No thanks', - }, login: { hero: { header: 'Split bills, request payments, and chat with friends.', From a0f63bd530b64cb0bda61d219ea9b9cf7eafd5d2 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 16:08:19 +0800 Subject: [PATCH 67/79] Revert to old pattern for running logic on first render --- .../sidebar/SidebarScreen/FloatingActionButtonAndPopover.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index e217bc8226b6..657af3bd07b3 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -155,7 +155,8 @@ function FloatingActionButtonAndPopover(props) { return; } Welcome.show({routes, showCreateMenu}); - }, [props.navigation, showCreateMenu, props.demoInfo]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); useEffect(() => { if (!didScreenBecomeInactive()) { From 0ede2e62e3af24a872f45757486b7a926e49d0ba Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 15 Sep 2023 16:13:48 +0800 Subject: [PATCH 68/79] lint, unused import --- .../home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index 657af3bd07b3..6acee38beaea 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -5,7 +5,6 @@ import lodashGet from 'lodash/get'; import {View} from 'react-native'; import styles from '../../../../styles/styles'; import * as Expensicons from '../../../../components/Icon/Expensicons'; -import * as Browser from '../../../../libs/Browser'; import Navigation from '../../../../libs/Navigation/Navigation'; import ROUTES from '../../../../ROUTES'; import NAVIGATORS from '../../../../NAVIGATORS'; From 766041a3ad80dfb00fe64252d5914d9a9575f651 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Fri, 15 Sep 2023 15:53:52 +0500 Subject: [PATCH 69/79] feat: add blank line --- src/components/Popover/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Popover/index.js b/src/components/Popover/index.js index f2c61b38c008..25cb5f92e2e2 100644 --- a/src/components/Popover/index.js +++ b/src/components/Popover/index.js @@ -12,6 +12,7 @@ import PopoverWithoutOverlay from '../PopoverWithoutOverlay'; */ function Popover(props) { const {isVisible, onClose, isSmallScreenWidth, fullscreen, animationInTiming, onLayout, animationOutTiming, disableAnimation, withoutOverlay, anchorPosition} = props; + // Not adding this inside the PopoverProvider // because this is an issue on smaller screens as well. React.useEffect(() => { From 62a35bb169dab9ed68bac3e97c9a1ed923bf7b4b Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Fri, 15 Sep 2023 16:00:39 +0500 Subject: [PATCH 70/79] lint fix --- src/components/Popover/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Popover/index.js b/src/components/Popover/index.js index 25cb5f92e2e2..a886fbbd0c6b 100644 --- a/src/components/Popover/index.js +++ b/src/components/Popover/index.js @@ -12,7 +12,7 @@ import PopoverWithoutOverlay from '../PopoverWithoutOverlay'; */ function Popover(props) { const {isVisible, onClose, isSmallScreenWidth, fullscreen, animationInTiming, onLayout, animationOutTiming, disableAnimation, withoutOverlay, anchorPosition} = props; - + // Not adding this inside the PopoverProvider // because this is an issue on smaller screens as well. React.useEffect(() => { From 6a9f592efdd4c6008acdebbe33823eab19cf68d5 Mon Sep 17 00:00:00 2001 From: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> Date: Sat, 16 Sep 2023 01:18:23 +0600 Subject: [PATCH 71/79] Revert "Add focus trap to the RHP" --- package-lock.json | 50 ------------- package.json | 1 - src/components/FocusTrapView/index.js | 75 ------------------- src/components/FocusTrapView/index.native.js | 11 --- src/components/ScreenWrapper/index.js | 35 ++++----- src/components/ScreenWrapper/propTypes.js | 8 -- src/pages/ProfilePage.js | 2 +- src/pages/home/ReportScreen.js | 1 - .../SidebarScreen/BaseSidebarScreen.js | 1 - 9 files changed, 15 insertions(+), 169 deletions(-) delete mode 100644 src/components/FocusTrapView/index.js delete mode 100644 src/components/FocusTrapView/index.native.js diff --git a/package-lock.json b/package-lock.json index 3e08356a76ef..1ff099a94add 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,6 @@ "domhandler": "^4.3.0", "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#35bff866a8d345b460ea6256f0a0f0a8a7f81086", "fbjs": "^3.0.2", - "focus-trap-react": "^10.2.1", "htmlparser2": "^7.2.0", "idb-keyval": "^6.2.1", "jest-when": "^3.5.2", @@ -28295,28 +28294,6 @@ "readable-stream": "^2.3.6" } }, - "node_modules/focus-trap": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.2.tgz", - "integrity": "sha512-p6vGNNWLDGwJCiEjkSK6oERj/hEyI9ITsSwIUICBoKLlWiTWXJRfQibCwcoi50rTZdbi87qDtUlMCmQwsGSgPw==", - "dependencies": { - "tabbable": "^6.2.0" - } - }, - "node_modules/focus-trap-react": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/focus-trap-react/-/focus-trap-react-10.2.1.tgz", - "integrity": "sha512-UrAKOn52lvfHF6lkUMfFhlQxFgahyNW5i6FpHWkDxAeD4FSk3iwx9n4UEA4Sims0G5WiGIi0fAyoq3/UVeNCYA==", - "dependencies": { - "focus-trap": "^7.5.2", - "tabbable": "^6.2.0" - }, - "peerDependencies": { - "prop-types": "^15.8.1", - "react": ">=16.3.0", - "react-dom": ">=16.3.0" - } - }, "node_modules/follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -44692,11 +44669,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/tabbable": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", - "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" - }, "node_modules/table": { "version": "6.8.1", "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", @@ -67708,23 +67680,6 @@ "readable-stream": "^2.3.6" } }, - "focus-trap": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.2.tgz", - "integrity": "sha512-p6vGNNWLDGwJCiEjkSK6oERj/hEyI9ITsSwIUICBoKLlWiTWXJRfQibCwcoi50rTZdbi87qDtUlMCmQwsGSgPw==", - "requires": { - "tabbable": "^6.2.0" - } - }, - "focus-trap-react": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/focus-trap-react/-/focus-trap-react-10.2.1.tgz", - "integrity": "sha512-UrAKOn52lvfHF6lkUMfFhlQxFgahyNW5i6FpHWkDxAeD4FSk3iwx9n4UEA4Sims0G5WiGIi0fAyoq3/UVeNCYA==", - "requires": { - "focus-trap": "^7.5.2", - "tabbable": "^6.2.0" - } - }, "follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -78848,11 +78803,6 @@ "version": "2.0.15", "dev": true }, - "tabbable": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", - "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" - }, "table": { "version": "6.8.1", "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", diff --git a/package.json b/package.json index 221c3fa7cbf2..42f4a176cf80 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,6 @@ "domhandler": "^4.3.0", "expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#35bff866a8d345b460ea6256f0a0f0a8a7f81086", "fbjs": "^3.0.2", - "focus-trap-react": "^10.2.1", "htmlparser2": "^7.2.0", "idb-keyval": "^6.2.1", "jest-when": "^3.5.2", diff --git a/src/components/FocusTrapView/index.js b/src/components/FocusTrapView/index.js deleted file mode 100644 index 2dcab7b9d998..000000000000 --- a/src/components/FocusTrapView/index.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * The FocusTrap is only used on web and desktop - */ -import React, {useEffect, useRef} from 'react'; -import FocusTrap from 'focus-trap-react'; -import {View} from 'react-native'; -import {PropTypes} from 'prop-types'; -import {useIsFocused} from '@react-navigation/native'; - -const propTypes = { - /** Children to wrap with FocusTrap */ - children: PropTypes.node.isRequired, - - /** Whether to enable the FocusTrap */ - enabled: PropTypes.bool, - - /** - * Whether to disable auto focus - * It is used when the component inside the FocusTrap have their own auto focus logic - */ - shouldEnableAutoFocus: PropTypes.bool, -}; - -const defaultProps = { - enabled: true, - shouldEnableAutoFocus: false, -}; - -function FocusTrapView({enabled, shouldEnableAutoFocus, ...props}) { - const isFocused = useIsFocused(); - - /** - * Focus trap always needs a focusable element. - * In case that we don't have any focusable elements in the modal, - * the FocusTrap will use fallback View element using this ref. - */ - const ref = useRef(null); - - /** - * We have to set the 'tabindex' attribute to 0 to make the View focusable. - * Currently, it is not possible to set this through props. - * After the upgrade of 'react-native-web' to version 0.19 we can use 'tabIndex={0}' prop instead. - */ - useEffect(() => { - if (!ref.current) { - return; - } - ref.current.setAttribute('tabindex', '0'); - }, []); - - return enabled ? ( - shouldEnableAutoFocus && ref.current, - fallbackFocus: () => ref.current, - clickOutsideDeactivates: true, - }} - > - - - ) : ( - props.children - ); -} - -FocusTrapView.displayName = 'FocusTrapView'; -FocusTrapView.propTypes = propTypes; -FocusTrapView.defaultProps = defaultProps; - -export default FocusTrapView; diff --git a/src/components/FocusTrapView/index.native.js b/src/components/FocusTrapView/index.native.js deleted file mode 100644 index 5720601f5a2b..000000000000 --- a/src/components/FocusTrapView/index.native.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * The FocusTrap is only used on web and desktop - */ - -function FocusTrapView({children}) { - return children; -} - -FocusTrapView.displayName = 'FocusTrapView'; - -export default FocusTrapView; diff --git a/src/components/ScreenWrapper/index.js b/src/components/ScreenWrapper/index.js index f0f8b8a4b09b..f760e5d5aeb4 100644 --- a/src/components/ScreenWrapper/index.js +++ b/src/components/ScreenWrapper/index.js @@ -3,7 +3,6 @@ import React from 'react'; import _ from 'underscore'; import lodashGet from 'lodash/get'; import {PickerAvoidingView} from 'react-native-picker-select'; -import FocusTrapView from '../FocusTrapView'; import KeyboardAvoidingView from '../KeyboardAvoidingView'; import CONST from '../../CONST'; import styles from '../../styles/styles'; @@ -125,26 +124,20 @@ class ScreenWrapper extends React.Component { style={styles.flex1} enabled={this.props.shouldEnablePickerAvoiding} > - - - {this.props.environment === CONST.ENVIRONMENT.DEV && } - {this.props.environment === CONST.ENVIRONMENT.DEV && } - { - // If props.children is a function, call it to provide the insets to the children. - _.isFunction(this.props.children) - ? this.props.children({ - insets, - safeAreaPaddingBottomStyle, - didScreenTransitionEnd: this.state.didScreenTransitionEnd, - }) - : this.props.children - } - {this.props.isSmallScreenWidth && this.props.shouldShowOfflineIndicator && } - + + {this.props.environment === CONST.ENVIRONMENT.DEV && } + {this.props.environment === CONST.ENVIRONMENT.DEV && } + { + // If props.children is a function, call it to provide the insets to the children. + _.isFunction(this.props.children) + ? this.props.children({ + insets, + safeAreaPaddingBottomStyle, + didScreenTransitionEnd: this.state.didScreenTransitionEnd, + }) + : this.props.children + } + {this.props.isSmallScreenWidth && this.props.shouldShowOfflineIndicator && } diff --git a/src/components/ScreenWrapper/propTypes.js b/src/components/ScreenWrapper/propTypes.js index c3538b3c026d..83033d9e97b7 100644 --- a/src/components/ScreenWrapper/propTypes.js +++ b/src/components/ScreenWrapper/propTypes.js @@ -48,12 +48,6 @@ const propTypes = { /** Styles for the offline indicator */ offlineIndicatorStyle: stylePropTypes, - - /** Whether to disable the focus trap */ - shouldDisableFocusTrap: PropTypes.bool, - - /** Whether to disable auto focus of the focus trap */ - shouldEnableAutoFocus: PropTypes.bool, }; const defaultProps = { @@ -69,8 +63,6 @@ const defaultProps = { shouldShowOfflineIndicator: true, offlineIndicatorStyle: [], headerGapStyles: [], - shouldDisableFocusTrap: false, - shouldEnableAutoFocus: false, }; export {propTypes, defaultProps}; diff --git a/src/pages/ProfilePage.js b/src/pages/ProfilePage.js index b306164a8ba0..19f2b1fdc0c6 100755 --- a/src/pages/ProfilePage.js +++ b/src/pages/ProfilePage.js @@ -144,7 +144,7 @@ function ProfilePage(props) { const chatReportWithCurrentUser = !isCurrentUser && !Session.isAnonymousUser() ? ReportUtils.getChatByParticipants([accountID]) : 0; return ( - + Navigation.goBack(navigateBackTo)} diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 004087c22308..f4f501d287e1 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -299,7 +299,6 @@ function ReportScreen({ {({insets}) => ( <> From a72d62bb424596ddb1c7cc65e3874db71055cb90 Mon Sep 17 00:00:00 2001 From: 0xmiroslav Date: Sat, 16 Sep 2023 15:40:54 +0200 Subject: [PATCH 72/79] fix wrong pass of pressable ref --- src/components/PressableWithSecondaryInteraction/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PressableWithSecondaryInteraction/index.js b/src/components/PressableWithSecondaryInteraction/index.js index 3f9039489b7c..d84a3f282e97 100644 --- a/src/components/PressableWithSecondaryInteraction/index.js +++ b/src/components/PressableWithSecondaryInteraction/index.js @@ -47,7 +47,7 @@ function PressableWithSecondaryInteraction({ if (forwardedRef) { if (_.isFunction(forwardedRef)) { - forwardedRef(pressableRef); + forwardedRef(pressableRef.current); } else if (_.isObject(forwardedRef)) { // eslint-disable-next-line no-param-reassign forwardedRef.current = pressableRef.current; From 48dc5c05f7cd1eeac81c108fe3bde6e687e36ca5 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 18 Sep 2023 02:13:16 +0000 Subject: [PATCH 73/79] Update version to 1.3.70-6 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index d9eb60471773..58dcbf444e20 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -90,8 +90,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001037005 - versionName "1.3.70-5" + versionCode 1001037006 + versionName "1.3.70-6" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 440e48e0c83d..9290498c08a0 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.3.70.5 + 1.3.70.6 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 9d7fc804acd9..ed191861e3ca 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.3.70.5 + 1.3.70.6 diff --git a/package-lock.json b/package-lock.json index 3e08356a76ef..1f3c104d0ca8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.3.70-5", + "version": "1.3.70-6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.3.70-5", + "version": "1.3.70-6", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 221c3fa7cbf2..4456256d4f43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.3.70-5", + "version": "1.3.70-6", "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.", From b5b7e769452cba757ca3b0cbe26fcb48acf11825 Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Mon, 18 Sep 2023 13:54:09 +0800 Subject: [PATCH 74/79] Add support for system messages for categories --- src/libs/ReportUtils.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index f24959c4bac2..d981c0fce42d 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1535,6 +1535,11 @@ function getModifiedExpenseMessage(reportAction) { if (hasModifiedMerchant) { return getProperSchemaForModifiedExpenseMessage(reportActionOriginalMessage.merchant, reportActionOriginalMessage.oldMerchant, Localize.translateLocal('common.merchant'), true); } + + const hasModifiedCategory = _.has(reportActionOriginalMessage, 'oldCategory') && _.has(reportActionOriginalMessage, 'category'); + if (hasModifiedCategory) { + return getProperSchemaForModifiedExpenseMessage(reportActionOriginalMessage.category, reportActionOriginalMessage.oldCategory, Localize.translateLocal('common.category'), true); + } } /** @@ -1575,6 +1580,11 @@ function getModifiedExpenseOriginalMessage(oldTransaction, transactionChanges, i originalMessage.currency = lodashGet(transactionChanges, 'currency', originalMessage.oldCurrency); } + if (_.has(transactionChanges, 'category')) { + originalMessage.oldCategory = TransactionUtils.getCategory(oldTransaction); + originalMessage.newCategory = transactionChanges.category; + } + return originalMessage; } From a4fa0d4662e2073d9bb6c0b440416328ce951c2c Mon Sep 17 00:00:00 2001 From: OSBotify Date: Mon, 18 Sep 2023 06:04:03 +0000 Subject: [PATCH 75/79] Update version to 1.3.70-7 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 58dcbf444e20..c6a9c3147118 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -90,8 +90,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001037006 - versionName "1.3.70-6" + versionCode 1001037007 + versionName "1.3.70-7" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 9290498c08a0..03dcc7770df0 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.3.70.6 + 1.3.70.7 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index ed191861e3ca..941d232244e1 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.3.70.6 + 1.3.70.7 diff --git a/package-lock.json b/package-lock.json index 0eff3c9aaced..382dcf45f55e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.3.70-6", + "version": "1.3.70-7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.3.70-6", + "version": "1.3.70-7", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 8d0375f4b219..0073dedb741c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.3.70-6", + "version": "1.3.70-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.", From a524c898cd27ce4e573969024afd83c971fb889e Mon Sep 17 00:00:00 2001 From: Yauheni Date: Mon, 18 Sep 2023 09:05:26 +0200 Subject: [PATCH 76/79] Add comment --- src/styles/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index f863f56d27f2..a91320617690 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -31,7 +31,7 @@ import Colors from './colors'; // touchCallout is an iOS safari only property that controls the display of the callout information when you touch and hold a target const touchCalloutNone = Browser.isMobileSafari() ? {WebkitTouchCallout: 'none'} : {}; - +// to prevent vertical text offset in browsers for badges, new lineHeight values have been added const lineHeightBadge = getPlatform() === CONST.PLATFORM.WEB ? {lineHeight: variables.lineHeightXSmall} : {lineHeight: variables.lineHeightNormal}; const picker = (theme) => ({ From e8ab19d1db2bc08c6c9db5df26c9691000722662 Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Mon, 18 Sep 2023 15:16:12 +0800 Subject: [PATCH 77/79] Update src/libs/ReportUtils.js Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com> --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index d981c0fce42d..9396ea921b61 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1582,7 +1582,7 @@ function getModifiedExpenseOriginalMessage(oldTransaction, transactionChanges, i if (_.has(transactionChanges, 'category')) { originalMessage.oldCategory = TransactionUtils.getCategory(oldTransaction); - originalMessage.newCategory = transactionChanges.category; + originalMessage.category = transactionChanges.category; } return originalMessage; From 5305a7bb534f3e3302e3a8f2c03d324801fcd86a Mon Sep 17 00:00:00 2001 From: Yauheni Date: Mon, 18 Sep 2023 10:21:00 +0200 Subject: [PATCH 78/79] Make changes only for Safari --- src/styles/styles.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index a91320617690..e4e9692c4d61 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -22,7 +22,6 @@ import pointerEventsAuto from './pointerEventsAuto'; import getPopOverVerticalOffset from './getPopOverVerticalOffset'; import overflowXHidden from './overflowXHidden'; import CONST from '../CONST'; -import getPlatform from '../libs/getPlatform'; import * as Browser from '../libs/Browser'; import cursor from './utilities/cursor'; import userSelect from './utilities/userSelect'; @@ -31,8 +30,8 @@ import Colors from './colors'; // touchCallout is an iOS safari only property that controls the display of the callout information when you touch and hold a target const touchCalloutNone = Browser.isMobileSafari() ? {WebkitTouchCallout: 'none'} : {}; -// to prevent vertical text offset in browsers for badges, new lineHeight values have been added -const lineHeightBadge = getPlatform() === CONST.PLATFORM.WEB ? {lineHeight: variables.lineHeightXSmall} : {lineHeight: variables.lineHeightNormal}; +// to prevent vertical text offset in Safari for badges, new lineHeight values have been added +const lineHeightBadge = Browser.isSafari ? {lineHeight: variables.lineHeightXSmall} : {lineHeight: variables.lineHeightNormal}; const picker = (theme) => ({ backgroundColor: theme.transparent, From 8f6dd9264843d6711e613d326e219938c12be8cc Mon Sep 17 00:00:00 2001 From: Yauheni Date: Mon, 18 Sep 2023 10:21:39 +0200 Subject: [PATCH 79/79] Make changes only for Safari x2 --- src/styles/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index e4e9692c4d61..0c88d5aa74f5 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -31,7 +31,7 @@ import Colors from './colors'; // touchCallout is an iOS safari only property that controls the display of the callout information when you touch and hold a target const touchCalloutNone = Browser.isMobileSafari() ? {WebkitTouchCallout: 'none'} : {}; // to prevent vertical text offset in Safari for badges, new lineHeight values have been added -const lineHeightBadge = Browser.isSafari ? {lineHeight: variables.lineHeightXSmall} : {lineHeight: variables.lineHeightNormal}; +const lineHeightBadge = Browser.isSafari() ? {lineHeight: variables.lineHeightXSmall} : {lineHeight: variables.lineHeightNormal}; const picker = (theme) => ({ backgroundColor: theme.transparent,