From 25b802e9c3ad886c2255dc286ff01ad6d11c3687 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Wed, 24 Jan 2024 22:22:16 +0200 Subject: [PATCH 1/7] Default shouldShowLoading to false in WorkspacePageWithSections --- src/pages/workspace/WorkspacePageWithSections.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspacePageWithSections.tsx b/src/pages/workspace/WorkspacePageWithSections.tsx index 8817f813a990..46fa8f14fac7 100644 --- a/src/pages/workspace/WorkspacePageWithSections.tsx +++ b/src/pages/workspace/WorkspacePageWithSections.tsx @@ -84,7 +84,7 @@ function WorkspacePageWithSections({ shouldUseScrollView = false, shouldSkipVBBACall = false, user, - shouldShowLoading = true, + shouldShowLoading = false, }: WorkspacePageWithSectionsProps) { const styles = useThemeStyles(); useNetwork({onReconnect: () => fetchData(shouldSkipVBBACall)}); From 1ba471fca14b8ff5a6a8a59991233afd5c393fd2 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Wed, 24 Jan 2024 22:43:13 +0200 Subject: [PATCH 2/7] revert bad initial change --- src/pages/workspace/WorkspacePageWithSections.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspacePageWithSections.tsx b/src/pages/workspace/WorkspacePageWithSections.tsx index 46fa8f14fac7..67c31c5329a8 100644 --- a/src/pages/workspace/WorkspacePageWithSections.tsx +++ b/src/pages/workspace/WorkspacePageWithSections.tsx @@ -84,7 +84,7 @@ function WorkspacePageWithSections({ shouldUseScrollView = false, shouldSkipVBBACall = false, user, - shouldShowLoading = false, + shouldShowLoading = true, }: WorkspacePageWithSectionsProps) { const styles = useThemeStyles(); useNetwork({onReconnect: () => fetchData(shouldSkipVBBACall)}); @@ -115,6 +115,10 @@ function WorkspacePageWithSections({ return !PolicyUtils.isPolicyAdmin(policy) || PolicyUtils.isPendingDeletePolicy(policy); }, [policy]); + console.debug("CRISTI - isLoading: " + isLoading); + console.debug("CRISTI - firstRender.current: " + firstRender.current); + console.debug("CRISTI - shouldShowLoading: " + shouldShowLoading); + return ( Date: Wed, 24 Jan 2024 22:54:11 +0200 Subject: [PATCH 3/7] Fix deploy blocker --- src/pages/workspace/WorkspacePageWithSections.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspacePageWithSections.tsx b/src/pages/workspace/WorkspacePageWithSections.tsx index 67c31c5329a8..d516f024aef0 100644 --- a/src/pages/workspace/WorkspacePageWithSections.tsx +++ b/src/pages/workspace/WorkspacePageWithSections.tsx @@ -79,7 +79,7 @@ function WorkspacePageWithSections({ guidesCallTaskID = '', headerText, policy, - reimbursementAccount = {}, + reimbursementAccount = {isLoading: false}, route, shouldUseScrollView = false, shouldSkipVBBACall = false, From fd6abead14a08df9d8d7814fc758d4476789db12 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Wed, 24 Jan 2024 22:56:08 +0200 Subject: [PATCH 4/7] Remove console debug --- src/pages/workspace/WorkspacePageWithSections.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pages/workspace/WorkspacePageWithSections.tsx b/src/pages/workspace/WorkspacePageWithSections.tsx index d516f024aef0..c9c371a6a0c7 100644 --- a/src/pages/workspace/WorkspacePageWithSections.tsx +++ b/src/pages/workspace/WorkspacePageWithSections.tsx @@ -115,10 +115,6 @@ function WorkspacePageWithSections({ return !PolicyUtils.isPolicyAdmin(policy) || PolicyUtils.isPendingDeletePolicy(policy); }, [policy]); - console.debug("CRISTI - isLoading: " + isLoading); - console.debug("CRISTI - firstRender.current: " + firstRender.current); - console.debug("CRISTI - shouldShowLoading: " + shouldShowLoading); - return ( Date: Wed, 24 Jan 2024 23:16:37 +0200 Subject: [PATCH 5/7] make currentStep option in ACHData --- src/types/onyx/ReimbursementAccount.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index c0ade25e4d79..8ab10e79cb09 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -8,7 +8,7 @@ type BankAccountSubStep = ValueOf; type ACHData = { /** Step of the setup flow that we are on. Determines which view is presented. */ - currentStep: BankAccountStep; + currentStep?: BankAccountStep; /** Optional subStep we would like the user to start back on */ subStep?: BankAccountSubStep; From ba79d4e78db87dd9208d312796c1b47d226a9f8c Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Wed, 24 Jan 2024 23:26:39 +0200 Subject: [PATCH 6/7] Use ReimbursementAccountProps.reimbursementAccountDefaultProps --- src/pages/workspace/WorkspacePageWithSections.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspacePageWithSections.tsx b/src/pages/workspace/WorkspacePageWithSections.tsx index c9c371a6a0c7..8b98d29245d5 100644 --- a/src/pages/workspace/WorkspacePageWithSections.tsx +++ b/src/pages/workspace/WorkspacePageWithSections.tsx @@ -22,6 +22,7 @@ import type {Policy, ReimbursementAccount, User} from '@src/types/onyx'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import type {WithPolicyAndFullscreenLoadingProps} from './withPolicyAndFullscreenLoading'; import withPolicyAndFullscreenLoading from './withPolicyAndFullscreenLoading'; +import * as ReimbursementAccountProps from '@pages/ReimbursementAccount/reimbursementAccountPropTypes'; type WorkspacePageWithSectionsOnyxProps = { /** From Onyx */ @@ -79,7 +80,7 @@ function WorkspacePageWithSections({ guidesCallTaskID = '', headerText, policy, - reimbursementAccount = {isLoading: false}, + reimbursementAccount = ReimbursementAccountProps.reimbursementAccountDefaultProps, route, shouldUseScrollView = false, shouldSkipVBBACall = false, From 20f70c64b4aa61f6dacc0c90ad92e09eb68ee2b3 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Wed, 24 Jan 2024 23:27:21 +0200 Subject: [PATCH 7/7] Run prettier --- src/pages/workspace/WorkspacePageWithSections.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspacePageWithSections.tsx b/src/pages/workspace/WorkspacePageWithSections.tsx index 8b98d29245d5..7a4d9c1f4106 100644 --- a/src/pages/workspace/WorkspacePageWithSections.tsx +++ b/src/pages/workspace/WorkspacePageWithSections.tsx @@ -14,6 +14,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import BankAccount from '@libs/models/BankAccount'; import Navigation from '@libs/Navigation/Navigation'; import * as PolicyUtils from '@libs/PolicyUtils'; +import * as ReimbursementAccountProps from '@pages/ReimbursementAccount/reimbursementAccountPropTypes'; import * as BankAccounts from '@userActions/BankAccounts'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -22,7 +23,6 @@ import type {Policy, ReimbursementAccount, User} from '@src/types/onyx'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import type {WithPolicyAndFullscreenLoadingProps} from './withPolicyAndFullscreenLoading'; import withPolicyAndFullscreenLoading from './withPolicyAndFullscreenLoading'; -import * as ReimbursementAccountProps from '@pages/ReimbursementAccount/reimbursementAccountPropTypes'; type WorkspacePageWithSectionsOnyxProps = { /** From Onyx */