From dbe3b215f5264f8415e93df5f20c81e6a6de8938 Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Thu, 2 May 2024 16:06:52 -0700 Subject: [PATCH 1/6] Fix Chart of accounts translation --- .../workspace/accounting/qbo/import/QuickbooksImportPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/import/QuickbooksImportPage.tsx b/src/pages/workspace/accounting/qbo/import/QuickbooksImportPage.tsx index a0da62f525e1..32d9f3597a4d 100644 --- a/src/pages/workspace/accounting/qbo/import/QuickbooksImportPage.tsx +++ b/src/pages/workspace/accounting/qbo/import/QuickbooksImportPage.tsx @@ -18,14 +18,14 @@ function QuickbooksImportPage({policy}: WithPolicyProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); const policyID = policy?.id ?? ''; - const {syncClasses, syncCustomers, syncLocations, syncTax, enableNewCategories, pendingFields} = policy?.connections?.quickbooksOnline?.config ?? {}; + const {syncClasses, syncCustomers, syncLocations, syncTax, pendingFields} = policy?.connections?.quickbooksOnline?.config ?? {}; const sections = [ { description: translate('workspace.accounting.accounts'), action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_CHART_OF_ACCOUNTS.getRoute(policyID)), hasError: Boolean(policy?.errors?.enableNewCategories), - title: enableNewCategories ? translate('workspace.accounting.importAsCategory') : translate('workspace.accounting.importTypes.NONE'), + title: translate('workspace.accounting.importAsCategory'), pendingAction: pendingFields?.enableNewCategories, }, { From a6b35b19557f6094376ba7156545f031974d65a9 Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Thu, 2 May 2024 16:40:17 -0700 Subject: [PATCH 2/6] Improve chart of accounts import --- src/languages/en.ts | 6 ++--- src/languages/es.ts | 4 ++-- .../import/QuickbooksChartOfAccountsPage.tsx | 23 ++++++++++++++++++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 625a6fa090f1..8ae9b5014116 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1888,9 +1888,9 @@ export default { locations: 'Locations', customers: 'Customers/Projects', displayedAs: 'Displayed as', - accountsDescription: 'Chart of Accounts import as categories when connected to an accounting integration, this cannot be disabled.', - accountsSwitchTitle: 'Enable newly imported Chart of Accounts.', - accountsSwitchDescription: 'New categories imported from QuickBooks Online to Expensify will be either enabled or disabled by default.', + accountsDescription: 'When connected to Quickbooks Online, chart of accounts are always imported to Expensify as categories.', + accountsSwitchTitle: 'Below you can choose to have any new account imported as an enabled or disabled category by default.', + accountsSwitchDescription: 'Enabled categories are available for members to select when creating their expenses.', classesDescription: 'Choose whether to import classes, and see where classes are displayed.', customersDescription: 'Choose whether to import customers/projects and see where customers/projects are displayed.', locationsDescription: 'Choose whether to import locations, and see where locations are displayed.', diff --git a/src/languages/es.ts b/src/languages/es.ts index b82ee4dd69ea..a88ecba5794b 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1913,8 +1913,8 @@ export default { customers: 'Clientes/Proyectos', displayedAs: 'Mostrado como', accountsDescription: 'Los planes de cuentas se importan como categorías cuando está conectado con una integración de contaduría, esto no se puede desactivar.', - accountsSwitchTitle: 'Habilita el plan de cuentas recien importado', - accountsSwitchDescription: 'Las nuevas categorías importadas desde QuickBooks Online a Expensify serán activadas o desactivadas por defecto.', + accountsSwitchTitle: 'Elige abajo si las categorías importadas serán activadas o desactivadas por defecto.', + accountsSwitchDescription: 'Las categorías activas estarán disponibles para ser escogidas cuando se crea un gasto.', classesDescription: 'Elige si quieres importar las clases y donde las clases son mostradas.', customersDescription: 'Elige si queres importar clientes/proyectos y donde los clientes/proyectos son mostrados.', locationsDescription: 'Elige si quieres importar lugares y donde los lugares son mostrados.', diff --git a/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx b/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx index 8c904481b1a0..6e22a102328a 100644 --- a/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx +++ b/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx @@ -14,6 +14,7 @@ import type {WithPolicyProps} from '@pages/workspace/withPolicy'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import variables from '@styles/variables'; import CONST from '@src/CONST'; +import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; function QuickbooksChartOfAccountsPage({policy}: WithPolicyProps) { const {translate} = useLocalize(); @@ -35,9 +36,29 @@ function QuickbooksChartOfAccountsPage({policy}: WithPolicyProps) { {translate('workspace.qbo.accountsDescription')} + + + {translate('workspace.accounting.import')} + + + {}} + /> + + + + {translate('workspace.qbo.accountsSwitchTitle')} - {translate('workspace.qbo.accountsSwitchTitle')} + {translate('workspace.common.enabled')} From ce4e2f1447b5140699d93a080f972bdc1289a553 Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Thu, 2 May 2024 16:47:02 -0700 Subject: [PATCH 3/6] Prettier --- .../accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx b/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx index 6e22a102328a..35fd43c28b3b 100644 --- a/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx +++ b/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx @@ -1,6 +1,7 @@ import React from 'react'; import {View} from 'react-native'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import ScreenWrapper from '@components/ScreenWrapper'; import ScrollView from '@components/ScrollView'; @@ -14,7 +15,6 @@ import type {WithPolicyProps} from '@pages/workspace/withPolicy'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import variables from '@styles/variables'; import CONST from '@src/CONST'; -import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; function QuickbooksChartOfAccountsPage({policy}: WithPolicyProps) { const {translate} = useLocalize(); From 55412eb0358be27f5ce72a54db4aebef26ad0059 Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Fri, 3 May 2024 16:28:05 -0700 Subject: [PATCH 4/6] Fix lint --- .../accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx b/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx index 35fd43c28b3b..5d3433f95e13 100644 --- a/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx +++ b/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx @@ -43,8 +43,8 @@ function QuickbooksChartOfAccountsPage({policy}: WithPolicyProps) { {}} /> From 0c8c0a7c22e7bbf60f3620e65a4203adee49428a Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Fri, 3 May 2024 16:40:12 -0700 Subject: [PATCH 5/6] Refactor using ConnectionLayout --- .../import/QuickbooksChartOfAccountsPage.tsx | 101 ++++++++---------- 1 file changed, 43 insertions(+), 58 deletions(-) diff --git a/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx b/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx index 5d3433f95e13..9fea1f323bd1 100644 --- a/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx +++ b/src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx @@ -1,16 +1,13 @@ import React from 'react'; import {View} from 'react-native'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import ConnectionLayout from '@components/ConnectionLayout'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; -import ScreenWrapper from '@components/ScreenWrapper'; -import ScrollView from '@components/ScrollView'; import Switch from '@components/Switch'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Connections from '@libs/actions/connections'; -import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper'; import type {WithPolicyProps} from '@pages/workspace/withPolicy'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import variables from '@styles/variables'; @@ -23,66 +20,54 @@ function QuickbooksChartOfAccountsPage({policy}: WithPolicyProps) { const {enableNewCategories, pendingFields} = policy?.connections?.quickbooksOnline?.config ?? {}; return ( - - - - - {translate('workspace.qbo.accountsDescription')} - - - {translate('workspace.accounting.import')} - - - {}} - /> - - - + + {translate('workspace.accounting.import')} + + + {}} /> - {translate('workspace.qbo.accountsSwitchTitle')} - - - {translate('workspace.common.enabled')} - - - - - Connections.updatePolicyConnectionConfig( - policyID, - CONST.POLICY.CONNECTIONS.NAME.QBO, - CONST.QUICK_BOOKS_CONFIG.ENABLE_NEW_CATEGORIES, - !enableNewCategories, - ) - } - /> - - - - - {translate('workspace.qbo.accountsSwitchDescription')} + + + + {translate('workspace.qbo.accountsSwitchTitle')} + + + {translate('workspace.common.enabled')} + + + + + Connections.updatePolicyConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.QBO, CONST.QUICK_BOOKS_CONFIG.ENABLE_NEW_CATEGORIES, !enableNewCategories) + } + /> - - - + + + + {translate('workspace.qbo.accountsSwitchDescription')} + + ); } From c1942c875e47097c6c5435c6929f179c207ef15f Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Fri, 3 May 2024 16:42:22 -0700 Subject: [PATCH 6/6] Improve spanish translation --- src/languages/es.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index a88ecba5794b..af816526ff90 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1912,7 +1912,7 @@ export default { locations: 'Lugares', customers: 'Clientes/Proyectos', displayedAs: 'Mostrado como', - accountsDescription: 'Los planes de cuentas se importan como categorías cuando está conectado con una integración de contaduría, esto no se puede desactivar.', + accountsDescription: 'Cuando estás conectado a Quickbooks Online, los planes de cuentas siempre se importan a Expensify como categorías.', accountsSwitchTitle: 'Elige abajo si las categorías importadas serán activadas o desactivadas por defecto.', accountsSwitchDescription: 'Las categorías activas estarán disponibles para ser escogidas cuando se crea un gasto.', classesDescription: 'Elige si quieres importar las clases y donde las clases son mostradas.',