Skip to content

Conversation

@DhaaraniCIT
Copy link
Contributor

@DhaaraniCIT DhaaraniCIT commented Oct 30, 2025

Description

fix: qbo incorrect account warning content fix

Clickup

https://app.clickup.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved the incorrect account warning shown during QuickBooks Online connection: the dialog now includes the selected account name (or a clear placeholder when unavailable) to make it easier to identify and correct wrong-account selections.

@github-actions github-actions bot added the size/XS Extra Small PR label Oct 30, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

The QBO onboarding incorrect-account warning now injects an accountName parameter into its translation call, populated from this.qboCompanyName with a fallback of 'a different'. The i18n entry was updated to include a {{accountName}} placeholder for dynamic rendering.

Changes

Cohort / File(s) Change Summary
QBO Onboarding Component
src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts
Added accountName parameter to the translation call for incorrectAccountWarningContent, passing `this.qboCompanyName
Localization Template
src/assets/i18n/en.json
Updated incorrectAccountWarningContent translation string to include {{accountName}} placeholder so the company name is rendered dynamically.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Small, localized change affecting one component and one i18n file.
  • Review attention: ensure the fallback 'a different' reads correctly in the translation context and that qboCompanyName is defined when used.

Poem

🐰 I hopped in code to tweak a line,
Now account names in warnings shine.
A little param, a tiny tweak—
Users see the name they seek. ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description includes both required template sections structurally (Description and Clickup), but the content is largely incomplete and uninformative. The Description section merely repeats the commit message without explaining what was actually changed, why the change was necessary, or what impact it has on the application or user experience. The Clickup URL is also generic and lacks a specific ticket reference. For a PR involving localization and component-level changes to error handling, more substantive description content would be expected.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "fix: qbo incorrect account warning content fix" directly addresses the main change in the PR—updating the QBO incorrect account warning content to include a dynamic account name parameter in both the TypeScript component and localization file. While it contains some redundancy with the "fix:" prefix and repeated "fix" word, the title is clear and specific enough that a teammate scanning the history would immediately understand this concerns fixing the warning content display for QuickBooks Online.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch qbo-disconnect-content-fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a2c2a1 and 5062a05.

📒 Files selected for processing (1)
  • src/assets/i18n/en.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/assets/i18n/en.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae1c9fc and 4a2c2a1.

📒 Files selected for processing (2)
  • src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts (1 hunks)
  • src/assets/i18n/en.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.component.{ts,html}

📄 CodeRabbit inference engine (.cursor/rules/component-i18n-key-naming.mdc)

**/*.component.{ts,html}: Top-level object in i18n files must be the component or feature folder name, converted from the file name by removing the prefixes 'feature', 'ui', or 'component' (in that order) and converting from kebab-case to camelCase.
Keys inside the top-level i18n object must not be nested beyond the first level; only one level of keys is allowed.
Keys inside the top-level i18n object must use meaningful, semantic, and context-aware names (e.g., 'title', 'accountDisabledError', 'submitButton'); avoid generic names like 'label1', 'text1', 'message1'.
Do not use prefixes like 'ui', 'feature', or 'component' in the top-level i18n object name; the object name should be the context.
Do not translate strings that are already translation keys, tracking/analytics strings, strings with only special characters, comments, non-user-visible text, or variable bindings and expressions.
One i18n object per component or feature; do not combine multiple components/features into a single i18n object.

Files:

  • src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts
src/**/*.component.{ts,html}

📄 CodeRabbit inference engine (.cursor/rules/component-i18n-key-naming.mdc)

For files in 'src/**', add or update i18n keys in the corresponding translation files located at 'src/assets/i18n/{lang}.json', and ensure the key is present in every supported language file.

Files:

  • src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts
**/*.component.ts

📄 CodeRabbit inference engine (.cursor/rules/component-creation.mdc)

Always create Angular standalone components (--standalone=true), i.e., components must declare standalone: true in @Component metadata

Files:

  • src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts
src/assets/i18n/*.json

📄 CodeRabbit inference engine (.cursor/rules/atomics-i18n-key-pattern.mdc)

src/assets/i18n/*.json: Group i18n keys under the correct atomic root: 'services', 'pipes', or 'directives' in the translation JSON files
Add i18n keys to every supported language file in 'src/assets/i18n/{lang}.json'
Keep child keys alphabetically sorted within each group in translation JSON files to reduce merge conflicts
Use only the three roots: services, pipes, directives for i18n key grouping

Files:

  • src/assets/i18n/en.json
🧠 Learnings (2)
📓 Common learnings
Learnt from: ashwin1111
PR: fylein/fyle-integrations-app#343
File: src/app/integrations/business-central/business-central-shared/business-central-export-settings/business-central-export-settings.component.html:0-0
Timestamp: 2024-06-10T19:13:15.470Z
Learning: The user ashwin1111 has confirmed the suggestion to replace the hardcoded reference to 'Sage Intacct' with a dynamic reference to the target system using the variable `targetSystemName` in the subLabel string within the `business-central-export-settings.component.html` file.
Learnt from: ashwin1111
PR: fylein/fyle-integrations-app#343
File: src/app/integrations/business-central/business-central-shared/business-central-export-settings/business-central-export-settings.component.html:0-0
Timestamp: 2024-10-08T15:51:28.972Z
Learning: The user ashwin1111 has confirmed the suggestion to replace the hardcoded reference to 'Sage Intacct' with a dynamic reference to the target system using the variable `targetSystemName` in the subLabel string within the `business-central-export-settings.component.html` file.
📚 Learning: 2024-06-10T19:13:15.470Z
Learnt from: ashwin1111
PR: fylein/fyle-integrations-app#343
File: src/app/integrations/business-central/business-central-shared/business-central-export-settings/business-central-export-settings.component.html:0-0
Timestamp: 2024-06-10T19:13:15.470Z
Learning: The user ashwin1111 has confirmed the suggestion to replace the hardcoded reference to 'Sage Intacct' with a dynamic reference to the target system using the variable `targetSystemName` in the subLabel string within the `business-central-export-settings.component.html` file.

Applied to files:

  • src/assets/i18n/en.json
🔇 Additional comments (1)
src/assets/i18n/en.json (1)

533-533: Good improvement - dynamic account name injection.

The addition of the {{accountName}} template parameter makes the warning message more specific and user-friendly by showing the actual account name. This aligns with the learnings about preferring dynamic references over hardcoded values.

Based on learnings

if (errorMessage === 'Please choose the correct QuickBooks Online account') {
this.warningHeaderText = this.translocoService.translate('qboOnboardingConnector.incorrectAccountWarningHeader');
this.warningContextText = this.translocoService.translate('qboOnboardingConnector.incorrectAccountWarningContent');
this.warningContextText = this.translocoService.translate('qboOnboardingConnector.incorrectAccountWarningContent', { accountName: this.qboCompanyName || 'a different' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Hardcoded English fallback breaks i18n consistency.

The fallback value 'a different' is hardcoded in English, which will appear in English regardless of the user's locale setting. This breaks internationalization consistency.

Consider checking if the error response contains the company name (similar to line 223 where error.error.company_name is used), or use a translatable fallback string.

Verify if the error object at line 198 contains a company_name field that could be used instead of the hardcoded fallback:


🏁 Script executed:

#!/bin/bash
# Search for error response structure in QBO connector service and related files
rg -n -A5 -B5 "Please choose the correct QuickBooks Online account" --type=ts

Length of output: 3497



---

🏁 Script executed:

```shell
#!/bin/bash
# Find qboCompanyName initialization and assignments
rg -n "qboCompanyName\s*=" --type=ts src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts

Length of output: 179


🏁 Script executed:

#!/bin/bash
# Find all references to company_name in error responses
rg -n "company_name" --type=ts -C3 src/app/integrations/qbo/

Length of output: 3582


🏁 Script executed:

#!/bin/bash
# Check for translation keys related to 'a different' or fallback
rg -n "a different" --type=json src/assets/i18n/

Length of output: 1500


🏁 Script executed:

#!/bin/bash
# Get the full error handler context around line 198-201
sed -n '190,210p' src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts

Length of output: 1301


🏁 Script executed:

#!/bin/bash
# Check line 223 referenced in scratchpad to see company_name usage
sed -n '215,230p' src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts

Length of output: 469


🏁 Script executed:

#!/bin/bash
# Search for translation keys containing 'ifferent'
rg -n "ifferent" --type=json src/assets/i18n/

Length of output: 2119


Hardcoded English fallback breaks i18n consistency.

At line 201, the fallback value 'a different' is hardcoded in English and does not exist in any translation files. This will always display in English regardless of the user's locale setting.

The error response object contains company_name (as shown in line 223's error handler pattern), so consider extracting it from error.error.company_name instead of the hardcoded fallback:

accountName: error.error?.company_name || this.translocoService.translate('qboOnboardingConnector.fallbackAccountName')

Create a translation key for the fallback scenario to maintain i18n consistency across all locales.

🤖 Prompt for AI Agents
In
src/app/integrations/qbo/qbo-onboarding/qbo-onboarding-connector/qbo-onboarding-connector.component.ts
around line 201, the fallback account name is hardcoded as the English string 'a
different', breaking i18n; replace that hardcoded fallback by pulling the
company name from the error object when available (e.g.,
error.error?.company_name) and otherwise use a translated fallback key via
this.translocoService.translate('qboOnboardingConnector.fallbackAccountName');
add the new translation key 'qboOnboardingConnector.fallbackAccountName' to all
locale files and update the error handler to pass accountName:
error.error?.company_name ||
this.translocoService.translate('qboOnboardingConnector.fallbackAccountName') so
all locales show a proper translated fallback.

@github-actions
Copy link

🔁 Code Duplication Report - Angular

Format Files analyzed Total lines Total tokens Clones found Duplicated lines Duplicated tokens
typescript 779 56245 511941 323 5390 (9.58%) 50968 (9.96%)
scss 65 3673 19979 7 144 (3.92%) 738 (3.69%)
markup 335 14627 151487 162 1718 (11.75%) 16214 (10.70%)
python 4 727 5680 3 32 (4.40%) 368 (6.48%)
yaml 3 155 905 0 0 (0.00%) 0 (0.00%)
javascript 4 194 2202 0 0 (0.00%) 0 (0.00%)
markdown 2 96 366 0 0 (0.00%) 0 (0.00%)
bash 2 67 776 0 0 (0.00%) 0 (0.00%)
Total: 1194 75784 693336 495 7284 (9.61%) 68288 (9.85%)

📊 No significant change in code duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra Small PR

Development

Successfully merging this pull request may close these issues.

2 participants