-
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
Merged
lakchote
merged 20 commits into
Expensify:main
from
hoangzinh:ft/49697-init-QBD-connection
Oct 9, 2024
Merged
Changes from 10 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ccd51ed
Show QBD option in accounting page
hoangzinh 7eb1301
Required setup QBD page
hoangzinh fc7a7e3
Setup QBD page
hoangzinh 426a2fc
Go to setup flow sync page when user click on "done" button
hoangzinh 50a17fe
Update icon and centralize view
hoangzinh 431e80c
Fix linter & typecheck
hoangzinh d94d6fa
Add beta feature for QBD on newdot
hoangzinh 2ddf2a3
Correct beta constant name and remove redundant code
hoangzinh 95f0699
Update style according to Figma
hoangzinh b714b9a
Use loading page instead of loading indicator
hoangzinh aaf196d
Fix button is not full width
hoangzinh 8f2aa90
Update translation es
hoangzinh f79efbd
Merge branch 'main' into ft/49697-init-QBD-connection
hoangzinh cb0bcc2
Update comment text
hoangzinh 040533b
Merge branch 'main' into ft/49697-init-QBD-connection
hoangzinh 16e4bbc
Centralize QBD route & translation with another PR
hoangzinh 8fad5ec
Update style according to Figma
hoangzinh 971db88
Update order of connections
hoangzinh f0a5c50
Merge branch 'main' into ft/49697-init-QBD-connection
hoangzinh b736632
Update styling
hoangzinh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 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; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.