-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50216 from hoangzinh/ft/49697-init-QBD-connection
[QBD] Handle the initial connection for QBD
- Loading branch information
Showing
28 changed files
with
736 additions
and
6 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/components/ConnectToQuickbooksDesktopFlow/index.native.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {useEffect} from 'react'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import ROUTES from '@src/ROUTES'; | ||
import type {ConnectToQuickbooksDesktopFlowProps} from './types'; | ||
|
||
function ConnectToQuickbooksDesktopFlow({policyID}: ConnectToQuickbooksDesktopFlowProps) { | ||
useEffect(() => { | ||
Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_SETUP_REQUIRED_DEVICE_MODAL.getRoute(policyID)); | ||
// eslint-disable-next-line react-compiler/react-compiler | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
return null; | ||
} | ||
|
||
ConnectToQuickbooksDesktopFlow.displayName = 'ConnectToQuickbooksDesktopFlow'; | ||
|
||
export default ConnectToQuickbooksDesktopFlow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {useEffect} from 'react'; | ||
import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import * as PolicyAction from '@userActions/Policy/Policy'; | ||
import ROUTES from '@src/ROUTES'; | ||
import type {ConnectToQuickbooksDesktopFlowProps} from './types'; | ||
|
||
function ConnectToQuickbooksDesktopFlow({policyID}: ConnectToQuickbooksDesktopFlowProps) { | ||
const {isSmallScreenWidth} = useResponsiveLayout(); | ||
|
||
useEffect(() => { | ||
if (isSmallScreenWidth) { | ||
Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_SETUP_REQUIRED_DEVICE_MODAL.getRoute(policyID)); | ||
} else { | ||
// Since QBD doesn't support Taxes, we should disable them from the LHN when connecting to QBD | ||
PolicyAction.enablePolicyTaxes(policyID, false); | ||
Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_SETUP_MODAL.getRoute(policyID)); | ||
} | ||
}, [isSmallScreenWidth, policyID]); | ||
|
||
return null; | ||
} | ||
|
||
ConnectToQuickbooksDesktopFlow.displayName = 'ConnectToQuickbooksDesktopFlow'; | ||
|
||
export default ConnectToQuickbooksDesktopFlow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type ConnectToQuickbooksDesktopFlowProps = { | ||
policyID: string; | ||
}; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export type {ConnectToQuickbooksDesktopFlowProps}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/libs/API/parameters/ConnectPolicyToQuickBooksDesktopParams.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type ConnectPolicyToQuickBooksDesktopParams = { | ||
/** ID of the policy */ | ||
policyID: string; | ||
}; | ||
|
||
export default ConnectPolicyToQuickBooksDesktopParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as API from '@libs/API'; | ||
import type {ConnectPolicyToQuickBooksDesktopParams} from '@libs/API/parameters'; | ||
import {SIDE_EFFECT_REQUEST_COMMANDS} from '@libs/API/types'; | ||
|
||
function getQuickbooksDesktopCodatSetupLink(policyID: string) { | ||
const params: ConnectPolicyToQuickBooksDesktopParams = {policyID}; | ||
|
||
// eslint-disable-next-line rulesdir/no-api-side-effects-method | ||
return API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.CONNECT_POLICY_TO_QUICKBOOKS_DESKTOP, params); | ||
} | ||
|
||
// Disable because we will have more utils will be added in this file | ||
// eslint-disable-next-line import/prefer-default-export | ||
export {getQuickbooksDesktopCodatSetupLink}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupFlowSyncPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; | ||
|
||
function QuickBooksDesktopSetupFlowSyncPage() { | ||
// TODO: will be implemented in https://github.com/Expensify/App/issues/49698 | ||
return <FullScreenLoadingIndicator />; | ||
} | ||
|
||
QuickBooksDesktopSetupFlowSyncPage.displayName = 'QuickBooksDesktopSetupFlowSyncPage'; | ||
|
||
export default QuickBooksDesktopSetupFlowSyncPage; |
Oops, something went wrong.