Skip to content

Commit 19b489c

Browse files
authored
Merge pull request #50879 from hoangzinh/49705-qbd-import-customers
[QBD] [Import] Customers/projects page
2 parents 46436be + 4922667 commit 19b489c

File tree

15 files changed

+210
-3
lines changed

15 files changed

+210
-3
lines changed

src/CONST.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,7 @@ const CONST = {
14971497
SHOULD_AUTO_CREATE_VENDOR: 'shouldAutoCreateVendor',
14981498
MAPPINGS: {
14991499
CLASSES: 'classes',
1500+
CUSTOMERS: 'customers',
15001501
},
15011502
},
15021503

src/ROUTES.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,14 @@ const ROUTES = {
725725
route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/import/classes/displayed_as',
726726
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-desktop/import/classes/displayed_as` as const,
727727
},
728+
POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS: {
729+
route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/import/customers',
730+
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-desktop/import/customers` as const,
731+
},
732+
POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS: {
733+
route: 'settings/workspaces/:policyID/accounting/quickbooks-desktop/import/customers/displayed_as',
734+
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/quickbooks-desktop/import/customers/displayed_as` as const,
735+
},
728736
WORKSPACE_PROFILE_NAME: {
729737
route: 'settings/workspaces/:policyID/profile/name',
730738
getRoute: (policyID: string) => `settings/workspaces/${policyID}/profile/name` as const,

src/SCREENS.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ const SCREENS = {
330330
QUICKBOOKS_DESKTOP_CHART_OF_ACCOUNTS: 'Policy_Accounting_Quickbooks_Desktop_Import_Chart_Of_Accounts',
331331
QUICKBOOKS_DESKTOP_CLASSES: 'Policy_Accounting_Quickbooks_Desktop_Import_Classes',
332332
QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS: 'Policy_Accounting_Quickbooks_Desktop_Import_Classes_Dipslayed_As',
333+
QUICKBOOKS_DESKTOP_CUSTOMERS: 'Policy_Accounting_Quickbooks_Desktop_Import_Customers',
334+
QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS: 'Policy_Accounting_Quickbooks_Desktop_Import_Customers_Dipslayed_As',
333335
XERO_IMPORT: 'Policy_Accounting_Xero_Import',
334336
XERO_ORGANIZATION: 'Policy_Accounting_Xero_Customers',
335337
XERO_CHART_OF_ACCOUNTS: 'Policy_Accounting_Xero_Import_Chart_Of_Accounts',

src/languages/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,6 +2458,7 @@ const translations = {
24582458
classesDescription: 'Choose how to handle QuickBooks Desktop classes in Expensify.',
24592459
tagsDisplayedAsDescription: 'Line item level',
24602460
reportFieldsDisplayedAsDescription: 'Report level',
2461+
customersDescription: 'Choose how to handle QuickBooks Desktop customers/projects in Expensify.',
24612462
advancedConfig: {
24622463
autoSyncDescription: 'Expensify will automatically sync with QuickBooks Desktop every day.',
24632464
createEntities: 'Auto-create entities',

src/languages/es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,6 +2482,7 @@ const translations = {
24822482
classesDescription: 'Elige cómo gestionar las clases de QuickBooks Desktop en Expensify.',
24832483
tagsDisplayedAsDescription: 'Nivel de partida',
24842484
reportFieldsDisplayedAsDescription: 'Nivel de informe',
2485+
customersDescription: 'Elige cómo gestionar los clientes/proyectos de QuickBooks Desktop en Expensify.',
24852486
advancedConfig: {
24862487
autoSyncDescription: 'Expensify se sincronizará automáticamente con QuickBooks Desktop todos los días.',
24872488
createEntities: 'Crear entidades automáticamente',

src/libs/API/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ const WRITE_COMMANDS = {
267267
UPDATE_QUICKBOOKS_DESKTOP_REIMBURSABLE_EXPENSES_EXPORT_DESTINATION: 'UpdateQuickbooksDesktopReimbursableExpensesExportDestination',
268268
UPDATE_QUICKBOOKS_DESKTOP_ENABLE_NEW_CATEGORIES: 'UpdateQuickbooksDesktopEnableNewCategories',
269269
UPDATE_QUICKBOOKS_DESKTOP_SYNC_CLASSES: 'UpdateQuickbooksDesktopSyncClasses',
270+
UPDATE_QUICKBOOKS_DESKTOP_SYNC_CUSTOMERS: 'UpdateQuickbooksDesktopSyncCustomers',
270271
REMOVE_POLICY_CONNECTION: 'RemovePolicyConnection',
271272
SET_POLICY_TAXES_ENABLED: 'SetPolicyTaxesEnabled',
272273
DELETE_POLICY_TAXES: 'DeletePolicyTaxes',
@@ -706,6 +707,7 @@ type WriteCommandParameters = {
706707
[WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_REIMBURSABLE_EXPENSES_EXPORT_DESTINATION]: Parameters.UpdateQuickbooksDesktopExpensesExportDestinationTypeParams;
707708
[WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_ENABLE_NEW_CATEGORIES]: Parameters.UpdateQuickbooksDesktopGenericTypeParams;
708709
[WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_SYNC_CLASSES]: Parameters.UpdateQuickbooksDesktopGenericTypeParams;
710+
[WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_SYNC_CUSTOMERS]: Parameters.UpdateQuickbooksDesktopGenericTypeParams;
709711
[WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_EXPORT]: Parameters.UpdateQuickbooksDesktopGenericTypeParams;
710712
[WRITE_COMMANDS.UPDATE_POLICY_CONNECTION_CONFIG]: Parameters.UpdatePolicyConnectionConfigParams;
711713
[WRITE_COMMANDS.UPDATE_MANY_POLICY_CONNECTION_CONFIGS]: Parameters.UpdateManyPolicyConnectionConfigurationsParams;

src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
336336
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CLASSES]: () => require<ReactComponentModule>('../../../../pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage').default,
337337
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS]: () =>
338338
require<ReactComponentModule>('../../../../pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesDisplayedAsPage').default,
339+
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CUSTOMERS]: () =>
340+
require<ReactComponentModule>('../../../../pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage').default,
341+
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS]: () =>
342+
require<ReactComponentModule>('../../../../pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersDisplayedAsPage').default,
339343
[SCREENS.REIMBURSEMENT_ACCOUNT]: () => require<ReactComponentModule>('../../../../pages/ReimbursementAccount/ReimbursementAccountPage').default,
340344
[SCREENS.GET_ASSISTANCE]: () => require<ReactComponentModule>('../../../../pages/GetAssistancePage').default,
341345
[SCREENS.SETTINGS.TWO_FACTOR_AUTH]: () => require<ReactComponentModule>('../../../../pages/settings/Security/TwoFactorAuth/TwoFactorAuthPage').default,

src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ const FULL_SCREEN_TO_RHP_MAPPING: Partial<Record<FullScreenName, string[]>> = {
5959
SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CHART_OF_ACCOUNTS,
6060
SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CLASSES,
6161
SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS,
62+
SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CUSTOMERS,
63+
SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS,
6264
SCREENS.WORKSPACE.ACCOUNTING.XERO_IMPORT,
6365
SCREENS.WORKSPACE.ACCOUNTING.XERO_CHART_OF_ACCOUNTS,
6466
SCREENS.WORKSPACE.ACCOUNTING.XERO_ORGANIZATION,

src/libs/Navigation/linkingConfig/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
420420
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CHART_OF_ACCOUNTS]: {path: ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CHART_OF_ACCOUNTS.route},
421421
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CLASSES]: {path: ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CLASSES.route},
422422
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS]: {path: ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS.route},
423+
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CUSTOMERS]: {path: ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS.route},
424+
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS]: {path: ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS.route},
423425
[SCREENS.WORKSPACE.ACCOUNTING.XERO_IMPORT]: {path: ROUTES.POLICY_ACCOUNTING_XERO_IMPORT.route},
424426
[SCREENS.WORKSPACE.ACCOUNTING.XERO_CHART_OF_ACCOUNTS]: {path: ROUTES.POLICY_ACCOUNTING_XERO_CHART_OF_ACCOUNTS.route},
425427
[SCREENS.WORKSPACE.ACCOUNTING.XERO_ORGANIZATION]: {path: ROUTES.POLICY_ACCOUNTING_XERO_ORGANIZATION.route},

src/libs/Navigation/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,12 @@ type SettingsNavigatorParamList = {
475475
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CLASSES_DISPLAYED_AS]: {
476476
policyID: string;
477477
};
478+
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CUSTOMERS]: {
479+
policyID: string;
480+
};
481+
[SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS]: {
482+
policyID: string;
483+
};
478484
[SCREENS.WORKSPACE.ACCOUNTING.XERO_IMPORT]: {
479485
policyID: string;
480486
};

src/libs/actions/connections/QuickbooksDesktop.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,20 @@ function updateQuickbooksDesktopSyncClasses<TSettingValue extends Connections['q
410410
API.write(WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_SYNC_CLASSES, parameters, onyxData);
411411
}
412412

413+
function updateQuickbooksDesktopSyncCustomers<TSettingValue extends Connections['quickbooksDesktop']['config']['mappings']['customers']>(
414+
policyID: string,
415+
settingValue: TSettingValue,
416+
oldSettingValue?: TSettingValue,
417+
) {
418+
const onyxData = buildOnyxDataForQuickbooksDesktopMappingsConfiguration(policyID, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS, settingValue, oldSettingValue);
419+
const parameters: UpdateQuickbooksDesktopGenericTypeParams = {
420+
policyID,
421+
settingValue,
422+
idempotencyKey: String(CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS),
423+
};
424+
API.write(WRITE_COMMANDS.UPDATE_QUICKBOOKS_DESKTOP_SYNC_CUSTOMERS, parameters, onyxData);
425+
}
426+
413427
function updateQuickbooksDesktopPreferredExporter<TSettingValue extends Connections['quickbooksDesktop']['config']['export']['exporter']>(
414428
policyID: string,
415429
settingValue: TSettingValue,
@@ -462,4 +476,5 @@ export {
462476
updateQuickbooksDesktopEnableNewCategories,
463477
updateQuickbooksDesktopExportDate,
464478
updateQuickbooksDesktopSyncClasses,
479+
updateQuickbooksDesktopSyncCustomers,
465480
};
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import React, {useCallback} from 'react';
2+
import RadioListItem from '@components/SelectionList/RadioListItem';
3+
import type {ListItem} from '@components/SelectionList/types';
4+
import SelectionScreen from '@components/SelectionScreen';
5+
import useLocalize from '@hooks/useLocalize';
6+
import usePermissions from '@hooks/usePermissions';
7+
import useThemeStyles from '@hooks/useThemeStyles';
8+
import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop';
9+
import * as ErrorUtils from '@libs/ErrorUtils';
10+
import * as PolicyUtils from '@libs/PolicyUtils';
11+
import Navigation from '@navigation/Navigation';
12+
import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections';
13+
import withPolicyConnections from '@pages/workspace/withPolicyConnections';
14+
import {clearQBDErrorField} from '@userActions/Policy/Policy';
15+
import CONST from '@src/CONST';
16+
import ROUTES from '@src/ROUTES';
17+
18+
type CardListItem = ListItem & {
19+
value: keyof typeof CONST.INTEGRATION_ENTITY_MAP_TYPES;
20+
};
21+
22+
function QuickbooksDesktopCustomersDisplayedAsPage({policy}: WithPolicyConnectionsProps) {
23+
const {translate} = useLocalize();
24+
const {canUseNewDotQBD} = usePermissions();
25+
const styles = useThemeStyles();
26+
const policyID = policy?.id ?? '-1';
27+
const qbdConfig = policy?.connections?.quickbooksDesktop?.config;
28+
29+
const data: CardListItem[] = [
30+
{
31+
value: CONST.INTEGRATION_ENTITY_MAP_TYPES.TAG,
32+
text: translate('workspace.common.tags'),
33+
alternateText: translate('workspace.qbd.tagsDisplayedAsDescription'),
34+
keyForList: CONST.INTEGRATION_ENTITY_MAP_TYPES.TAG,
35+
isSelected: qbdConfig?.mappings?.customers === CONST.INTEGRATION_ENTITY_MAP_TYPES.TAG,
36+
},
37+
{
38+
value: CONST.INTEGRATION_ENTITY_MAP_TYPES.REPORT_FIELD,
39+
text: translate('workspace.common.reportFields'),
40+
alternateText: translate('workspace.qbd.reportFieldsDisplayedAsDescription'),
41+
keyForList: CONST.INTEGRATION_ENTITY_MAP_TYPES.REPORT_FIELD,
42+
isSelected: qbdConfig?.mappings?.customers === CONST.INTEGRATION_ENTITY_MAP_TYPES.REPORT_FIELD,
43+
},
44+
];
45+
46+
const selectDisplayedAs = useCallback(
47+
(row: CardListItem) => {
48+
if (row.value !== qbdConfig?.mappings?.customers) {
49+
QuickbooksDesktop.updateQuickbooksDesktopSyncCustomers(policyID, row.value, qbdConfig?.mappings?.customers);
50+
}
51+
Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS.getRoute(policyID));
52+
},
53+
[qbdConfig?.mappings?.customers, policyID],
54+
);
55+
56+
return (
57+
<SelectionScreen
58+
policyID={policyID}
59+
accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]}
60+
featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
61+
displayName={QuickbooksDesktopCustomersDisplayedAsPage.displayName}
62+
sections={data.length ? [{data}] : []}
63+
listItem={RadioListItem}
64+
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS.getRoute(policyID))}
65+
onSelectRow={selectDisplayedAs}
66+
initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList}
67+
title="workspace.common.displayedAs"
68+
shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done
69+
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD}
70+
pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS], qbdConfig?.pendingFields)}
71+
errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS)}
72+
errorRowStyles={[styles.ph5, styles.pv3]}
73+
onClose={() => clearQBDErrorField(policyID, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS)}
74+
shouldSingleExecuteRowSelect
75+
/>
76+
);
77+
}
78+
79+
QuickbooksDesktopCustomersDisplayedAsPage.displayName = 'QuickbooksDesktopCustomersDisplayedAsPage';
80+
81+
export default withPolicyConnections(QuickbooksDesktopCustomersDisplayedAsPage);
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import React from 'react';
2+
import ConnectionLayout from '@components/ConnectionLayout';
3+
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
4+
import OfflineWithFeedback from '@components/OfflineWithFeedback';
5+
import useLocalize from '@hooks/useLocalize';
6+
import usePermissions from '@hooks/usePermissions';
7+
import useThemeStyles from '@hooks/useThemeStyles';
8+
import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop';
9+
import * as ErrorUtils from '@libs/ErrorUtils';
10+
import Navigation from '@libs/Navigation/Navigation';
11+
import * as PolicyUtils from '@libs/PolicyUtils';
12+
import type {WithPolicyProps} from '@pages/workspace/withPolicy';
13+
import withPolicyConnections from '@pages/workspace/withPolicyConnections';
14+
import ToggleSettingOptionRow from '@pages/workspace/workflows/ToggleSettingsOptionRow';
15+
import {clearQBDErrorField} from '@userActions/Policy/Policy';
16+
import CONST from '@src/CONST';
17+
import ROUTES from '@src/ROUTES';
18+
19+
function QuickbooksDesktopCustomersPage({policy}: WithPolicyProps) {
20+
const {translate} = useLocalize();
21+
const styles = useThemeStyles();
22+
const {canUseNewDotQBD} = usePermissions();
23+
const policyID = policy?.id ?? '-1';
24+
const qbdConfig = policy?.connections?.quickbooksDesktop?.config;
25+
const isSwitchOn = !!(qbdConfig?.mappings?.customers && qbdConfig.mappings.customers !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE);
26+
const isReportFieldsSelected = qbdConfig?.mappings?.customers === CONST.INTEGRATION_ENTITY_MAP_TYPES.REPORT_FIELD;
27+
28+
return (
29+
<ConnectionLayout
30+
displayName={QuickbooksDesktopCustomersPage.displayName}
31+
headerTitle="workspace.qbd.customers"
32+
title="workspace.qbd.customersDescription"
33+
accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]}
34+
policyID={policyID}
35+
featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
36+
contentContainerStyle={[styles.pb2, styles.ph5]}
37+
shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] Will be removed when release
38+
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD}
39+
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_IMPORT.getRoute(policyID))}
40+
>
41+
<ToggleSettingOptionRow
42+
title={translate('workspace.accounting.import')}
43+
switchAccessibilityLabel={translate('workspace.qbd.customers')}
44+
isActive={isSwitchOn}
45+
onToggle={() =>
46+
QuickbooksDesktop.updateQuickbooksDesktopSyncCustomers(
47+
policyID,
48+
isSwitchOn ? CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE : CONST.INTEGRATION_ENTITY_MAP_TYPES.TAG,
49+
qbdConfig?.mappings?.classes,
50+
)
51+
}
52+
pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS], qbdConfig?.pendingFields)}
53+
errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS)}
54+
onCloseError={() => clearQBDErrorField(policyID, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS)}
55+
/>
56+
{isSwitchOn && (
57+
<OfflineWithFeedback pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS], qbdConfig?.pendingFields)}>
58+
<MenuItemWithTopDescription
59+
title={isReportFieldsSelected ? translate('workspace.common.reportFields') : translate('workspace.common.tags')}
60+
description={translate('workspace.common.displayedAs')}
61+
wrapperStyle={[styles.sectionMenuItemTopDescription, styles.mt4]}
62+
shouldShowRightIcon
63+
onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS_DISPLAYED_AS.getRoute(policyID))}
64+
brickRoadIndicator={
65+
PolicyUtils.areSettingsInErrorFields([CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS], qbdConfig?.errorFields)
66+
? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR
67+
: undefined
68+
}
69+
/>
70+
</OfflineWithFeedback>
71+
)}
72+
</ConnectionLayout>
73+
);
74+
}
75+
76+
QuickbooksDesktopCustomersPage.displayName = 'QuickbooksDesktopCustomersPage';
77+
78+
export default withPolicyConnections(QuickbooksDesktopCustomersPage);

src/pages/workspace/accounting/qbd/import/QuickbooksDesktopImportPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ function QuickbooksDesktopImportPage({policy}: WithPolicyProps) {
4141
},
4242
{
4343
description: translate('workspace.qbd.customers'),
44-
action: () => {}, // TODO: [QBD] will be implemented in https://github.com/Expensify/App/issues/49705
44+
action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_CUSTOMERS.getRoute(policyID)),
4545
title: translate(`workspace.accounting.importTypes.${mappings?.customers ?? CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE}`),
46-
subscribedSettings: [CONST.QUICKBOOKS_CONFIG.SYNC_CUSTOMERS],
46+
subscribedSettings: [CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS],
4747
},
4848
{
4949
description: translate('workspace.qbd.items'),

0 commit comments

Comments
 (0)