-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[QBD] Handle the initial connection for QBD #50216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
ccd51ed
7eb1301
fc7a7e3
426a2fc
50a17fe
431e80c
d94d6fa
2ddf2a3
95f0699
b714b9a
aaf196d
8f2aa90
f79efbd
cb0bcc2
040533b
16e4bbc
8fad5ec
971db88
f0a5c50
b736632
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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; |
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 QBO doesn't support Taxes, we should disable them from the LHN when connecting to QBO | ||
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; |
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}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2919,6 +2919,18 @@ const translations = { | |
} | ||
}, | ||
}, | ||
qbd: { | ||
qbdSetup: 'QuickBooks Desktop setup', | ||
requiredSetupDevice: { | ||
title: "Can't connect from this device", | ||
body1: "You'll need to setup this connection from the computer that hosts your QuickBooks Desktop company file.", | ||
body2: "Once you're connected, you'll be able to sync and export from anywhere.", | ||
}, | ||
setupPage: { | ||
title: 'Open this link to connect', | ||
body: 'To complete setup, open the following link on the computer where QuickBooks Desktop is running', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #50216 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yeah, the mockup is too small. Let's wait response here then I will update later There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree ! |
||
}, | ||
}, | ||
type: { | ||
free: 'Free', | ||
control: 'Control', | ||
|
@@ -3421,6 +3433,7 @@ const translations = { | |
title: 'Connections', | ||
subtitle: 'Connect to your accounting system to code transactions with your chart of accounts, auto-match payments, and keep your finances in sync.', | ||
qbo: 'Quickbooks Online', | ||
qbd: 'Quickbooks Desktop', | ||
xero: 'Xero', | ||
netsuite: 'NetSuite', | ||
intacct: 'Sage Intacct', | ||
|
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; |
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}; |
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; |
Uh oh!
There was an error while loading. Please reload this page.