diff --git a/src/components/SelectionScreen.tsx b/src/components/SelectionScreen.tsx index baa33919c9f4..ee9233aff2f0 100644 --- a/src/components/SelectionScreen.tsx +++ b/src/components/SelectionScreen.tsx @@ -151,7 +151,7 @@ function SelectionScreen({ initiallyFocusedOptionKey={initiallyFocusedOptionKey} listEmptyContent={listEmptyContent} listFooterContent={listFooterContent} - sectionListStyle={[styles.flexGrow0]} + sectionListStyle={!!sections.length && [styles.flexGrow0]} shouldSingleExecuteRowSelect={shouldSingleExecuteRowSelect} > id === selectedBankAccountId); - return (bankAccounts ?? []).map(({id, name}, index) => ({ + return (bankAccounts ?? []).map(({id, name}) => ({ value: id, text: name, keyForList: id, - isSelected: isMatchFound ? selectedBankAccountId === id : index === 0, + isSelected: selectedBankAccountId === id, })); } @@ -1027,7 +1026,7 @@ export { getXeroTenants, findCurrentXeroOrganization, getCurrentXeroOrganizationName, - getXeroBankAccountsWithDefaultSelect, + getXeroBankAccounts, findSelectedVendorWithDefaultSelect, findSelectedBankAccountWithDefaultSelect, findSelectedInvoiceItemWithDefaultSelect, diff --git a/src/libs/actions/connections/index.ts b/src/libs/actions/connections/index.ts index aea384689aab..c47c57d57466 100644 --- a/src/libs/actions/connections/index.ts +++ b/src/libs/actions/connections/index.ts @@ -14,6 +14,10 @@ import type Policy from '@src/types/onyx/Policy'; type ConnectionNameExceptNetSuite = Exclude; +type Nullable = { + [P in keyof T]: T[P] | null; +}; + function removePolicyConnection(policyID: string, connectionName: PolicyConnectionName) { const optimisticData: OnyxUpdate[] = [ { @@ -74,6 +78,7 @@ function updatePolicyXeroConnectionConfig, + oldSettingValue?: Nullable>, ) { const optimisticData: OnyxUpdate[] = [ { @@ -101,7 +106,7 @@ function updatePolicyXeroConnectionConfig category.id === categoryId); - const currentTrackingCategoryValue = currentTrackingCategory ? mappings?.[`${TRACKING_CATEGORIES_KEY}${currentTrackingCategory.id}`] ?? '' : ''; + const currentTrackingCategoryValue = currentTrackingCategory ? mappings?.[`${CONST.XERO_CONFIG.TRACKING_CATEGORY_PREFIX}${currentTrackingCategory.id}`] ?? '' : ''; const optionsList = useMemo( () => @@ -67,11 +65,12 @@ function XeroMapTrackingCategoryConfigurationPage({policy}: WithPolicyProps) { CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.MAPPINGS, categoryId ? {[`${CONST.XERO_CONFIG.TRACKING_CATEGORY_PREFIX}${categoryId}`]: option.value} : {}, + categoryId ? {[`${CONST.XERO_CONFIG.TRACKING_CATEGORY_PREFIX}${categoryId}`]: currentTrackingCategoryValue} : {}, ); } Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_TRACKING_CATEGORIES.getRoute(policyID)); }, - [categoryId, categoryName, policyID], + [categoryId, categoryName, currentTrackingCategoryValue, policyID], ); return ( diff --git a/src/pages/workspace/accounting/xero/XeroOrganizationConfigurationPage.tsx b/src/pages/workspace/accounting/xero/XeroOrganizationConfigurationPage.tsx index a9015d2440be..b23363c79963 100644 --- a/src/pages/workspace/accounting/xero/XeroOrganizationConfigurationPage.tsx +++ b/src/pages/workspace/accounting/xero/XeroOrganizationConfigurationPage.tsx @@ -59,7 +59,7 @@ function XeroOrganizationConfigurationPage({ return; } - updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.TENANT_ID, keyForList); + updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.TENANT_ID, keyForList, xeroConfig?.tenantID); Navigation.goBack(); }; diff --git a/src/pages/workspace/accounting/xero/XeroTaxesConfigurationPage.tsx b/src/pages/workspace/accounting/xero/XeroTaxesConfigurationPage.tsx index 1abdc90064b2..57053cb30808 100644 --- a/src/pages/workspace/accounting/xero/XeroTaxesConfigurationPage.tsx +++ b/src/pages/workspace/accounting/xero/XeroTaxesConfigurationPage.tsx @@ -33,7 +33,15 @@ function XeroTaxesConfigurationPage({policy}: WithPolicyProps) { title={translate('workspace.accounting.import')} switchAccessibilityLabel={translate('workspace.xero.customers')} isActive={isSwitchOn} - onToggle={() => Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.IMPORT_TAX_RATES, !xeroConfig?.importTaxRates)} + onToggle={() => + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.IMPORT_TAX_RATES, + !xeroConfig?.importTaxRates, + xeroConfig?.importTaxRates, + ) + } errors={ErrorUtils.getLatestErrorField(xeroConfig ?? {}, CONST.XERO_CONFIG.IMPORT_TAX_RATES)} onCloseError={() => Policy.clearXeroErrorField(policyID, CONST.XERO_CONFIG.IMPORT_TAX_RATES)} pendingAction={PolicyUtils.settingsPendingAction([CONST.XERO_CONFIG.IMPORT_TAX_RATES], xeroConfig?.pendingFields)} diff --git a/src/pages/workspace/accounting/xero/XeroTrackingCategoryConfigurationPage.tsx b/src/pages/workspace/accounting/xero/XeroTrackingCategoryConfigurationPage.tsx index 47bc37f688ef..9d27c8887e6e 100644 --- a/src/pages/workspace/accounting/xero/XeroTrackingCategoryConfigurationPage.tsx +++ b/src/pages/workspace/accounting/xero/XeroTrackingCategoryConfigurationPage.tsx @@ -59,6 +59,7 @@ function XeroTrackingCategoryConfigurationPage({policy}: WithPolicyProps) { CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.IMPORT_TRACKING_CATEGORIES, !xeroConfig?.importTrackingCategories, + xeroConfig?.importTrackingCategories, ) } pendingAction={settingsPendingAction([CONST.XERO_CONFIG.IMPORT_TRACKING_CATEGORIES], xeroConfig?.pendingFields)} diff --git a/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx b/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx index 3ed20b02b62f..287163ae69cc 100644 --- a/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx +++ b/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx @@ -29,9 +29,9 @@ function XeroAdvancedPage({policy}: WithPolicyConnectionsProps) { const getSelectedAccountName = useMemo( () => (accountID: string) => { const selectedAccount = (bankAccounts ?? []).find((bank) => bank.id === accountID); - return selectedAccount?.name ?? bankAccounts?.[0]?.name ?? ''; + return selectedAccount?.name ?? translate('workspace.xero.notConfigured'); }, - [bankAccounts], + [bankAccounts, translate], ); const selectedBankAccountName = getSelectedAccountName(invoiceCollectionsAccountID ?? '-1'); @@ -59,9 +59,15 @@ function XeroAdvancedPage({policy}: WithPolicyConnectionsProps) { wrapperStyle={styles.mv3} isActive={!!autoSync?.enabled} onToggle={() => - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.AUTO_SYNC, { - enabled: !autoSync?.enabled, - }) + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.AUTO_SYNC, + { + enabled: !autoSync?.enabled, + }, + {enabled: autoSync?.enabled ?? null}, + ) } pendingAction={settingsPendingAction([CONST.XERO_CONFIG.ENABLED], pendingFields)} errors={ErrorUtils.getLatestErrorField(xeroConfig ?? {}, CONST.XERO_CONFIG.ENABLED)} @@ -76,9 +82,15 @@ function XeroAdvancedPage({policy}: WithPolicyConnectionsProps) { wrapperStyle={styles.mv3} isActive={!!sync?.syncReimbursedReports} onToggle={() => - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.SYNC, { - syncReimbursedReports: !sync?.syncReimbursedReports, - }) + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.SYNC, + { + syncReimbursedReports: !sync?.syncReimbursedReports, + }, + {syncReimbursedReports: sync?.syncReimbursedReports ?? null}, + ) } pendingAction={settingsPendingAction([CONST.XERO_CONFIG.SYNC_REIMBURSED_REPORTS], pendingFields)} errors={ErrorUtils.getLatestErrorField(xeroConfig ?? {}, CONST.XERO_CONFIG.SYNC_REIMBURSED_REPORTS)} diff --git a/src/pages/workspace/accounting/xero/advanced/XeroBillPaymentAccountSelectorPage.tsx b/src/pages/workspace/accounting/xero/advanced/XeroBillPaymentAccountSelectorPage.tsx index f255e55bb1d9..0e940435816a 100644 --- a/src/pages/workspace/accounting/xero/advanced/XeroBillPaymentAccountSelectorPage.tsx +++ b/src/pages/workspace/accounting/xero/advanced/XeroBillPaymentAccountSelectorPage.tsx @@ -11,7 +11,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as Connections from '@libs/actions/connections'; import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; -import {getXeroBankAccountsWithDefaultSelect, settingsPendingAction} from '@libs/PolicyUtils'; +import {getXeroBankAccounts, settingsPendingAction} from '@libs/PolicyUtils'; import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import variables from '@styles/variables'; @@ -27,7 +27,7 @@ function XeroBillPaymentAccountSelectorPage({policy}: WithPolicyConnectionsProps const {config} = policy?.connections?.xero ?? {}; const {reimbursementAccountID, syncReimbursedReports} = policy?.connections?.xero?.config.sync ?? {}; - const xeroSelectorOptions = useMemo(() => getXeroBankAccountsWithDefaultSelect(policy ?? undefined, reimbursementAccountID), [reimbursementAccountID, policy]); + const xeroSelectorOptions = useMemo(() => getXeroBankAccounts(policy ?? undefined, reimbursementAccountID), [reimbursementAccountID, policy]); const listHeaderComponent = useMemo( () => ( @@ -42,12 +42,18 @@ function XeroBillPaymentAccountSelectorPage({policy}: WithPolicyConnectionsProps const updateAccount = useCallback( ({value}: SelectorType) => { - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.SYNC, { - reimbursementAccountID: value, - }); + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.SYNC, + { + reimbursementAccountID: value, + }, + {reimbursementAccountID: reimbursementAccountID ?? null}, + ); Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_ADVANCED.getRoute(policyID)); }, - [policyID], + [policyID, reimbursementAccountID], ); const listEmptyContent = useMemo( diff --git a/src/pages/workspace/accounting/xero/advanced/XeroInvoiceAccountSelectorPage.tsx b/src/pages/workspace/accounting/xero/advanced/XeroInvoiceAccountSelectorPage.tsx index 866a4ea5e2c0..de3b4be0b656 100644 --- a/src/pages/workspace/accounting/xero/advanced/XeroInvoiceAccountSelectorPage.tsx +++ b/src/pages/workspace/accounting/xero/advanced/XeroInvoiceAccountSelectorPage.tsx @@ -11,7 +11,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as Connections from '@libs/actions/connections'; import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; -import {getXeroBankAccountsWithDefaultSelect, settingsPendingAction} from '@libs/PolicyUtils'; +import {getXeroBankAccounts, settingsPendingAction} from '@libs/PolicyUtils'; import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import variables from '@styles/variables'; @@ -27,7 +27,7 @@ function XeroInvoiceAccountSelectorPage({policy}: WithPolicyConnectionsProps) { const {config} = policy?.connections?.xero ?? {}; const {invoiceCollectionsAccountID, syncReimbursedReports} = policy?.connections?.xero?.config.sync ?? {}; - const xeroSelectorOptions = useMemo(() => getXeroBankAccountsWithDefaultSelect(policy ?? undefined, invoiceCollectionsAccountID), [invoiceCollectionsAccountID, policy]); + const xeroSelectorOptions = useMemo(() => getXeroBankAccounts(policy ?? undefined, invoiceCollectionsAccountID), [invoiceCollectionsAccountID, policy]); const listHeaderComponent = useMemo( () => ( @@ -42,12 +42,18 @@ function XeroInvoiceAccountSelectorPage({policy}: WithPolicyConnectionsProps) { const updateAccount = useCallback( ({value}: SelectorType) => { - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.SYNC, { - invoiceCollectionsAccountID: value, - }); + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.SYNC, + { + invoiceCollectionsAccountID: value, + }, + {invoiceCollectionsAccountID: invoiceCollectionsAccountID ?? null}, + ); Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_ADVANCED.getRoute(policyID)); }, - [policyID], + [policyID, invoiceCollectionsAccountID], ); const listEmptyContent = useMemo( diff --git a/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx b/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx index 457872770b86..4dfd2e92bd0c 100644 --- a/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx @@ -11,7 +11,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as Connections from '@libs/actions/connections'; import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; -import {getXeroBankAccountsWithDefaultSelect} from '@libs/PolicyUtils'; +import {getXeroBankAccounts} from '@libs/PolicyUtils'; import * as PolicyUtils from '@libs/PolicyUtils'; import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; @@ -28,7 +28,7 @@ function XeroBankAccountSelectPage({policy}: WithPolicyConnectionsProps) { const {config} = policy?.connections?.xero ?? {}; const xeroSelectorOptions = useMemo( - () => getXeroBankAccountsWithDefaultSelect(policy ?? undefined, config?.export?.nonReimbursableAccount), + () => getXeroBankAccounts(policy ?? undefined, config?.export?.nonReimbursableAccount), [config?.export?.nonReimbursableAccount, policy], ); @@ -46,13 +46,19 @@ function XeroBankAccountSelectPage({policy}: WithPolicyConnectionsProps) { const updateBankAccount = useCallback( ({value}: SelectorType) => { if (initiallyFocusedOptionKey !== value) { - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.EXPORT, { - nonReimbursableAccount: value, - }); + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.EXPORT, + { + nonReimbursableAccount: value, + }, + {nonReimbursableAccount: config?.export?.nonReimbursableAccount ?? null}, + ); } Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_EXPORT.getRoute(policyID)); }, - [policyID, initiallyFocusedOptionKey], + [initiallyFocusedOptionKey, policyID, config?.export?.nonReimbursableAccount], ); const listEmptyContent = useMemo( diff --git a/src/pages/workspace/accounting/xero/export/XeroPreferredExporterSelectPage.tsx b/src/pages/workspace/accounting/xero/export/XeroPreferredExporterSelectPage.tsx index 56593df406c2..1dd51f845d8a 100644 --- a/src/pages/workspace/accounting/xero/export/XeroPreferredExporterSelectPage.tsx +++ b/src/pages/workspace/accounting/xero/export/XeroPreferredExporterSelectPage.tsx @@ -67,7 +67,13 @@ function XeroPreferredExporterSelectPage({policy}: WithPolicyConnectionsProps) { const selectExporter = useCallback( (row: CardListItem) => { if (row.value !== config?.export?.exporter) { - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.EXPORT, {exporter: row.value}); + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.EXPORT, + {exporter: row.value}, + {exporter: config?.export?.exporter ?? null}, + ); } Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_EXPORT.getRoute(policyID)); }, diff --git a/src/pages/workspace/accounting/xero/export/XeroPurchaseBillDateSelectPage.tsx b/src/pages/workspace/accounting/xero/export/XeroPurchaseBillDateSelectPage.tsx index ae8270b6907d..57b37f13d648 100644 --- a/src/pages/workspace/accounting/xero/export/XeroPurchaseBillDateSelectPage.tsx +++ b/src/pages/workspace/accounting/xero/export/XeroPurchaseBillDateSelectPage.tsx @@ -47,7 +47,13 @@ function XeroPurchaseBillDateSelectPage({policy}: WithPolicyConnectionsProps) { const selectExportDate = useCallback( (row: MenuListItem) => { if (row.value !== config?.export?.billDate) { - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.EXPORT, {billDate: row.value}); + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.EXPORT, + {billDate: row.value}, + {billDate: config?.export?.billDate ?? null}, + ); } Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_EXPORT_PURCHASE_BILL_DATE_SELECT.getRoute(policyID)); }, diff --git a/src/pages/workspace/accounting/xero/export/XeroPurchaseBillStatusSelectorPage.tsx b/src/pages/workspace/accounting/xero/export/XeroPurchaseBillStatusSelectorPage.tsx index 303cbafa22d7..d1902f8a3c46 100644 --- a/src/pages/workspace/accounting/xero/export/XeroPurchaseBillStatusSelectorPage.tsx +++ b/src/pages/workspace/accounting/xero/export/XeroPurchaseBillStatusSelectorPage.tsx @@ -52,9 +52,15 @@ function XeroPurchaseBillStatusSelectorPage({policy}: WithPolicyConnectionsProps return; } if (row.value !== invoiceStatus) { - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.EXPORT, { - billStatus: {...config?.export?.billStatus, purchase: row.value}, - }); + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.EXPORT, + { + billStatus: {...config?.export?.billStatus, purchase: row.value}, + }, + {billStatus: config?.export?.billStatus ?? null}, + ); } Navigation.goBack(ROUTES.POLICY_ACCOUNTING_XERO_BILL_STATUS_SELECTOR.getRoute(policyID)); }, diff --git a/src/pages/workspace/accounting/xero/import/XeroChartOfAccountsPage.tsx b/src/pages/workspace/accounting/xero/import/XeroChartOfAccountsPage.tsx index 924d18264b7b..20a6e24eb105 100644 --- a/src/pages/workspace/accounting/xero/import/XeroChartOfAccountsPage.tsx +++ b/src/pages/workspace/accounting/xero/import/XeroChartOfAccountsPage.tsx @@ -60,7 +60,13 @@ function XeroChartOfAccountsPage({policy}: WithPolicyProps) { shouldPlaceSubtitleBelowSwitch isActive={!!xeroConfig?.enableNewCategories} onToggle={() => - Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.ENABLE_NEW_CATEGORIES, !xeroConfig?.enableNewCategories) + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.ENABLE_NEW_CATEGORIES, + !xeroConfig?.enableNewCategories, + xeroConfig?.enableNewCategories, + ) } pendingAction={settingsPendingAction([CONST.XERO_CONFIG.ENABLE_NEW_CATEGORIES], xeroConfig?.pendingFields)} errors={ErrorUtils.getLatestErrorField(xeroConfig ?? {}, CONST.XERO_CONFIG.ENABLE_NEW_CATEGORIES)} diff --git a/src/pages/workspace/accounting/xero/import/XeroCustomerConfigurationPage.tsx b/src/pages/workspace/accounting/xero/import/XeroCustomerConfigurationPage.tsx index c1ab8c82ba95..29c7125213d1 100644 --- a/src/pages/workspace/accounting/xero/import/XeroCustomerConfigurationPage.tsx +++ b/src/pages/workspace/accounting/xero/import/XeroCustomerConfigurationPage.tsx @@ -42,7 +42,15 @@ function XeroCustomerConfigurationPage({policy}: WithPolicyProps) { /> } isActive={isSwitchOn} - onToggle={() => Connections.updatePolicyXeroConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.XERO, CONST.XERO_CONFIG.IMPORT_CUSTOMERS, !xeroConfig?.importCustomers)} + onToggle={() => + Connections.updatePolicyXeroConnectionConfig( + policyID, + CONST.POLICY.CONNECTIONS.NAME.XERO, + CONST.XERO_CONFIG.IMPORT_CUSTOMERS, + !xeroConfig?.importCustomers, + xeroConfig?.importCustomers, + ) + } errors={ErrorUtils.getLatestErrorField(xeroConfig ?? {}, CONST.XERO_CONFIG.IMPORT_CUSTOMERS)} onCloseError={() => Policy.clearXeroErrorField(policyID, CONST.XERO_CONFIG.IMPORT_CUSTOMERS)} pendingAction={PolicyUtils.settingsPendingAction([CONST.XERO_CONFIG.IMPORT_CUSTOMERS], xeroConfig?.pendingFields)}