WEB-239: Fix Tax Components view page translation and layout#3103
WEB-239: Fix Tax Components view page translation and layout#3103DeathGun44 wants to merge 1 commit intoopenMF:devfrom
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Template Translation & Rendering src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.html |
Replaced previous translation usage for debitAccountType and creditAccountType with dynamically constructed keys ('labels.inputs.accounting.' + value.split('.')[1].toUpperCase()) passed to the translate pipe. Removed translate/filtering for debitAccount.glCode and debitAccount.name, rendering raw values instead. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
- WEB-593 Translate account types in the Transfer Details Page #3019: Similar template change composing translation keys from account-type values instead of displaying raw codes.
Suggested reviewers
- IOhacker
- alberto-art3ch
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately describes the main changes: fixing translation issues and layout for the Tax Components view page, which aligns with the code changes that replace direct text lookups with dynamic translation keys. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
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.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.html`:
- Around line 42-45: The template expressions accessing
taxComponentData.debitAccountType.value.split('.')[1].toUpperCase() and the
identical creditAccountType variant can throw if value lacks a '.'; update both
expressions to safely handle missing separators by using optional chaining and a
fallback segment (e.g. use value?.split('.')?.[1] || 'UNKNOWN' before calling
toUpperCase()), and wrap the full concatenation in parentheses so the translate
pipe applies to the entire key string; locate these expressions in the
view-tax-component.component.html template and replace them accordingly for
strict-safe behavior.
🧹 Nitpick comments (1)
src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.html (1)
34-47: Consider consolidating the duplicate@ifblocks for account type label and value.Each account type uses two separate
@ifblocks checking the same condition (e.g., lines 34 and 40 both checktaxComponentData.debitAccountType). These could be combined into a single@ifwrapping both the label and valuedivs, reducing duplication. This isn't introduced by this PR though, so feel free to defer.Also applies to: 62-75
src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.html
Show resolved
Hide resolved
src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.html
Show resolved
Hide resolved
- Fix account type translations to properly extract and uppercase type names - Fix account display formatting to show clean glCode and name - Resolve untranslated labels showing as 'accountType.liability' etc.
a43e471 to
d6e70bd
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@IOhacker ready for re-review |
| ({{ 'labels.inputs.accounting.' + taxComponentData.debitAccount.glCode }}) | ||
| {{ taxComponentData.debitAccount.name | translate }} | ||
| ({{ taxComponentData.debitAccount.glCode }}) | ||
| {{ taxComponentData.debitAccount.name }} |
There was a problem hiding this comment.
Why this value is not translated?
There was a problem hiding this comment.
@IOhacker
Thanks for catching this! The account name shouldn't be translated because it's user-created database data, not a UI label.
The old code was concatenating 'labels.inputs.accounting.' + glCode, which created non-existent translation keys like 'labels.inputs.accounting.66'. The translation system only has keys for account types (LIABILITY, ASSET, INCOME), not for dynamic GL codes or account names.
I verified this is consistent with the rest of the codebase - similar components like
view-rule.component.html
and
manage-tax-components.component.html
display account names and GL codes without translation pipes.
Happy to discuss further if needed!
Description
Fixed untranslated account type labels on Tax Components view page.
Screenshots
Before: Untranslated labels

After: Properly translated

Checklist
Summary by CodeRabbit