From 3f2db5821a83709eff18b9359abc0863e867c7bc Mon Sep 17 00:00:00 2001 From: truph01 Date: Thu, 30 Jan 2025 09:28:17 +0700 Subject: [PATCH 1/3] fix: Show the connected QBO file --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + .../workspace/accounting/PolicyAccountingPage.tsx | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/src/languages/en.ts b/src/languages/en.ts index f2e4428bb6ae..391b1f835184 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2819,6 +2819,7 @@ const translations = { itemsDescription: 'Choose how to handle QuickBooks Desktop items in Expensify.', }, qbo: { + connectedTo: 'Connected to', importDescription: 'Choose which coding configurations to import from QuickBooks Online to Expensify.', classes: 'Classes', locations: 'Locations', diff --git a/src/languages/es.ts b/src/languages/es.ts index 9e44e060487d..713a700cfa45 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2845,6 +2845,7 @@ const translations = { itemsDescription: 'Elige cómo gestionar los elementos de QuickBooks Desktop en Expensify.', }, qbo: { + connectedTo: 'Conectado a', importDescription: 'Elige que configuraciónes de codificación son importadas desde QuickBooks Online a Expensify.', classes: 'Clases', locations: 'Lugares', diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 2f38e66b1bed..9ade0f2f7b5a 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -249,6 +249,17 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_ENTITY.getRoute(policyID)); }, }; + case CONST.POLICY.CONNECTIONS.NAME.QBO: + return !policy?.connections?.quickbooksOnline?.config?.companyName + ? {} + : { + description: translate('workspace.qbo.connectedTo'), + title: policy?.connections?.quickbooksOnline?.config?.companyName, + wrapperStyle: [styles.sectionMenuItemTopDescription], + titleStyle: styles.fontWeightNormal, + shouldShowDescriptionOnTop: true, + }; + default: return undefined; } From 2f1ea1e3008050ed17e4335109844837e63e1791 Mon Sep 17 00:00:00 2001 From: truph01 Date: Thu, 30 Jan 2025 09:50:51 +0700 Subject: [PATCH 2/3] fix: lint --- .../workspace/accounting/PolicyAccountingPage.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 9ade0f2f7b5a..5250e8dddcd9 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -31,7 +31,6 @@ import useWindowDimensions from '@hooks/useWindowDimensions'; import {isAuthenticationError, isConnectionInProgress, isConnectionUnverified, removePolicyConnection, syncConnection} from '@libs/actions/connections'; import {getAssignedSupportData} from '@libs/actions/Policy/Policy'; import {getConciergeReportID} from '@libs/actions/Report'; -import * as PolicyUtils from '@libs/PolicyUtils'; import { areSettingsInErrorFields, findCurrentXeroOrganization, @@ -40,14 +39,16 @@ import { getCurrentXeroOrganizationName, getIntegrationLastSuccessfulDate, getXeroTenants, + hasUnsupportedIntegration, isControlPolicy, settingsPendingAction, + shouldShowSyncError, } from '@libs/PolicyUtils'; import Navigation from '@navigation/Navigation'; import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import type {AnchorPosition} from '@styles/index'; -import * as Link from '@userActions/Link'; +import {openOldDotLink} from '@userActions/Link'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -102,8 +103,8 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { connectedIntegration === connectionSyncProgress?.connectionName ? connectionSyncProgress : undefined, ); - const hasSyncError = PolicyUtils.shouldShowSyncError(policy, isSyncInProgress); - const hasUnsupportedNDIntegration = !isEmptyObject(policy?.connections) && PolicyUtils.hasUnsupportedIntegration(policy, accountingIntegrations); + const hasSyncError = shouldShowSyncError(policy, isSyncInProgress); + const hasUnsupportedNDIntegration = !isEmptyObject(policy?.connections) && hasUnsupportedIntegration(policy, accountingIntegrations); const tenants = useMemo(() => getXeroTenants(policy), [policy]); const currentXeroOrganization = findCurrentXeroOrganization(tenants, policy?.connections?.xero?.config?.tenantID); @@ -548,7 +549,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { { // Go to Expensify Classic. - Link.openOldDotLink(CONST.OLDDOT_URLS.POLICY_CONNECTIONS_URL(policyID)); + openOldDotLink(CONST.OLDDOT_URLS.POLICY_CONNECTIONS_URL(policyID)); }} > {translate('workspace.accounting.goToODToFix')} @@ -562,7 +563,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { { // Go to Expensify Classic. - Link.openOldDotLink(CONST.OLDDOT_URLS.POLICY_CONNECTIONS_URL(policyID)); + openOldDotLink(CONST.OLDDOT_URLS.POLICY_CONNECTIONS_URL(policyID)); }} > {translate('workspace.accounting.goToODToSettings')} From e3ce1c801524a99f900fe8bd1b62911e7793f784 Mon Sep 17 00:00:00 2001 From: truph01 Date: Fri, 31 Jan 2025 09:42:44 +0700 Subject: [PATCH 3/3] fix: set interactive false --- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 5250e8dddcd9..b0b858f6fe25 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -259,6 +259,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { wrapperStyle: [styles.sectionMenuItemTopDescription], titleStyle: styles.fontWeightNormal, shouldShowDescriptionOnTop: true, + interactive: false, }; default: