diff --git a/src/languages/en.ts b/src/languages/en.ts index 7962280b2315..3e7cc2cb2335 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3589,6 +3589,7 @@ const translations = { }, errorODIntegration: "There's an error with a connection that's been set up in Expensify Classic. ", goToODToFix: 'Go to Expensify Classic to fix this issue.', + goToODToSettings: 'Go to Expensify Classic to manage your settings.', setup: 'Connect', lastSync: ({relativeDate}: LastSyncAccountingParams) => `Last synced ${relativeDate}`, import: 'Import', diff --git a/src/languages/es.ts b/src/languages/es.ts index 42924462de87..7215ffcb014d 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3595,6 +3595,7 @@ const translations = { }, errorODIntegration: 'Hay un error con una conexión que se ha configurado en Expensify Classic. ', goToODToFix: 'Ve a Expensify Classic para solucionar este problema.', + goToODToSettings: 'Ve a Expensify Classic para gestionar tus configuraciones.', setup: 'Configurar', lastSync: ({relativeDate}: LastSyncAccountingParams) => `Recién sincronizado ${relativeDate}`, import: 'Importar', diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index eda772ee66b3..3e1117d4a12a 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -100,7 +100,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { ); const hasSyncError = PolicyUtils.hasSyncError(policy, isSyncInProgress); - const hasUnsupportedNDIntegration = PolicyUtils.hasUnsupportedIntegration(policy, accountingIntegrations); + const hasUnsupportedNDIntegration = !isEmptyObject(policy?.connections) && PolicyUtils.hasUnsupportedIntegration(policy, accountingIntegrations); const tenants = useMemo(() => getXeroTenants(policy), [policy]); const currentXeroOrganization = findCurrentXeroOrganization(tenants, policy?.connections?.xero?.config?.tenantID); @@ -399,7 +399,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { ]); const otherIntegrationsItems = useMemo(() => { - if (isEmptyObject(policy?.connections) && !isSyncInProgress && !(hasUnsupportedNDIntegration && hasSyncError)) { + if (isEmptyObject(policy?.connections) && !isSyncInProgress) { return; } const otherIntegrations = accountingIntegrations.filter( @@ -456,8 +456,6 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { isOffline, startIntegrationFlow, popoverAnchorRefs, - hasUnsupportedNDIntegration, - hasSyncError, ]); return ( @@ -487,7 +485,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { titleStyles={styles.accountSettingsSectionTitle} childrenStyles={styles.pt5} > - {!(hasUnsupportedNDIntegration && hasSyncError) && + {!hasUnsupportedNDIntegration && connectionsMenuItems.map((menuItem) => ( @@ -521,6 +518,20 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { )} + {hasUnsupportedNDIntegration && !hasSyncError && ( + + + { + // Go to Expensify Classic. + Link.openOldDotLink(CONST.OLDDOT_URLS.POLICY_CONNECTIONS_URL(policyID)); + }} + > + {translate('workspace.accounting.goToODToSettings')} + + + + )} {otherIntegrationsItems && ( 0; const currentConnectionName = PolicyUtils.getCurrentConnectionName(policy); @@ -284,7 +288,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) { const getHeaderText = () => ( - {isConnectedToAccounting ? ( + {!hasSyncError && isConnectedToAccounting ? ( {`${translate('workspace.categories.importedFromAccountingSoftware')} `} ([]); const [deleteReportFieldsConfirmModalVisible, setDeleteReportFieldsConfirmModalVisible] = useState(false); const hasAccountingConnections = PolicyUtils.hasAccountingConnections(policy); + const [connectionSyncProgress] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CONNECTION_SYNC_PROGRESS}${policy?.id}`); + const isSyncInProgress = isConnectionInProgress(connectionSyncProgress, policy); + const hasSyncError = PolicyUtils.hasSyncError(policy, isSyncInProgress); const isConnectedToAccounting = Object.keys(policy?.connections ?? {}).length > 0; const currentConnectionName = PolicyUtils.getCurrentConnectionName(policy); @@ -220,7 +226,7 @@ function WorkspaceReportFieldsPage({ const getHeaderText = () => ( - {isConnectedToAccounting ? ( + {!hasSyncError && isConnectedToAccounting ? ( {`${translate('workspace.reportFields.importedFromAccountingSoftware')} `} 0; const currentConnectionName = PolicyUtils.getCurrentConnectionName(policy); const [policyTagLists, isMultiLevelTags] = useMemo(() => [PolicyUtils.getTagLists(policyTags), PolicyUtils.isMultiLevelTags(policyTags)], [policyTags]); @@ -332,7 +336,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) { const getHeaderText = () => ( - {isConnectedToAccounting ? ( + {!hasSyncError && isConnectedToAccounting ? ( {`${translate('workspace.tags.importedFromAccountingSoftware')} `} 0; const currentConnectionName = PolicyUtils.getCurrentConnectionName(policy); @@ -251,7 +257,7 @@ function WorkspaceTaxesPage({ const getHeaderText = () => ( - {isConnectedToAccounting ? ( + {!hasSyncError && isConnectedToAccounting ? ( {`${translate('workspace.taxes.importedFromAccountingSoftware')} `}