Skip to content

fix: correct customMessages type definitions to match translator implementation - #428

Open
rax7389 wants to merge 2 commits into
mainfrom
fix/localized-text-types
Open

fix: correct customMessages type definitions to match translator implementation#428
rax7389 wants to merge 2 commits into
mainfrom
fix/localized-text-types

Conversation

@rax7389

@rax7389 rax7389 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix customMessages type definitions to align with the actual translator implementation, ensuring consumers can correctly override all domain management text via the customMessages prop.

Why

The customMessages type definitions had structural mismatches with the translator key paths. For example, types had header.title but the translator looked for domain_table.header.title. This caused custom message overrides to silently fail.

What

  • Fixed DomainTableMessages to include domain_table wrapper matching the translator namespace/key structure
  • Added shared.domain_statuses to allow status badge customization
  • Removed incorrect modal wrapper from DomainCreateMessages, DomainVerifyMessages, DomainConfigureMessages, and DomainDeleteMessages since child components use namespace with .modal suffix
  • Fixed delete_button_text (was incorrectly named create_button_text) in delete message types
  • Added enable_provider_tooltip and disable_provider_tooltip to DomainConfigureMessages and SsoProviderTableMessages
  • Updated DomainTableActionsColumn to use correct namespace and key prefixes
  • Updated tests to match the corrected key structure

Packages

  • packages/core
  • packages/react
  • examples

Testing

  • This change adds unit test coverage
  • Tested for both SPA and RWA flows, all example apps working
  • All existing and new tests complete without errors

Checklist

  • Breaking change
  • Requires docs update
  • Backward compatible

Contributing

Summary by CodeRabbit

  • Improvements
    • Updated custom domain-management messages with a simpler, more consistent structure.
    • Added customizable status tooltips and shared domain-status labels.
    • Added clearer delete-action message support for domain workflows.
    • Updated domain table actions to use the revised translation labels and namespaces.
  • Tests
    • Updated domain-management coverage to verify the new custom-message formats and labels.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: aligning customMessages type definitions with translator implementation.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/localized-text-types

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.

@rax7389 rax7389 self-assigned this Jul 26, 2026
@rax7389

rax7389 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai Review the PR changes

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@rax7389 I’ll review the changes in #428, focusing on translator/type key alignment, consumer-facing compatibility, and test coverage.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
packages/react/src/components/auth0/my-organization/shared/domain-management/domain-configure/__tests__/domain-configure-providers-modal.test.tsx (1)

97-103: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the complete translated output.

getByText(/Custom Title/) can pass even when {domain} interpolation is broken, and this test never verifies the custom description. Assert both rendered strings using the mock domain value.

Suggested assertion
-      expect(screen.getByText(/Custom Title/)).toBeInTheDocument();
+      const domain = props.domain?.domain ?? '';
+      expect(screen.getByText(`Custom Title - ${domain}`)).toBeInTheDocument();
+      expect(screen.getByText(`Custom description for ${domain}`)).toBeInTheDocument();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/react/src/components/auth0/my-organization/shared/domain-management/domain-configure/__tests__/domain-configure-providers-modal.test.tsx`
around lines 97 - 103, Update the test for DomainConfigureProvidersModal to
assert the complete translated title using the mock domain value, ensuring
{domain} interpolation is verified. Also add an assertion for the complete
custom description rendered with that same domain value, replacing the partial
title match.
packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-provider/sso-provider-table-types.ts (1)

28-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Tooltip field naming inconsistent with the sibling addition in this PR.

enabled_tooltip/disabled_tooltip deviate from the enable_X_tooltip/disable_X_tooltip convention used for the equivalent new fields added in domain-configure-types.ts (enable_provider_tooltip/disable_provider_tooltip) and the existing enable_domain_tooltip/disable_domain_tooltip pattern in sso-domain-tab-types.ts. Consider renaming for consistency, e.g. enable_provider_tooltip/disable_provider_tooltip.

♻️ Suggested rename
     actions?: {
       edit_button_text?: string;
       delete_button_text?: string;
       remove_button_text?: string;
-      enabled_tooltip?: string;
-      disabled_tooltip?: string;
+      enable_provider_tooltip?: string;
+      disable_provider_tooltip?: string;
     };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-provider/sso-provider-table-types.ts`
around lines 28 - 29, Rename the tooltip fields in the SSO provider table types
from enabled_tooltip and disabled_tooltip to enable_provider_tooltip and
disable_provider_tooltip, matching the naming convention used by
domain-configure-types and sso-domain-tab-types. Update all references to these
fields consistently.
packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-domain/sso-domain-tab-types.ts (1)

7-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse the shared domain message interfaces for DomainTab*Messages.

DomainTabCreateMessages, DomainTabDeleteMessages, and DomainTabVerifyMessages duplicate the domain-management message interfaces rather than importing/aliasing them. Reuse the existing DomainCreateMessages, DomainDeleteMessages, and DomainVerifyMessages types to avoid duplicated shape maintenance.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-domain/sso-domain-tab-types.ts`
around lines 7 - 54, Replace the duplicated DomainTabCreateMessages,
DomainTabDeleteMessages, and DomainTabVerifyMessages definitions with imports or
type aliases to DomainCreateMessages, DomainDeleteMessages, and
DomainVerifyMessages in
packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-domain/sso-domain-tab-types.ts.
The shared definitions in
packages/core/src/i18n/custom-messages/my-organization/domain-management/domain-create-types.ts,
domain-delete-types.ts, and domain-verify-types.ts require no direct changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-domain/sso-domain-tab-types.ts`:
- Around line 7-54: Replace the duplicated DomainTabCreateMessages,
DomainTabDeleteMessages, and DomainTabVerifyMessages definitions with imports or
type aliases to DomainCreateMessages, DomainDeleteMessages, and
DomainVerifyMessages in
packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-domain/sso-domain-tab-types.ts.
The shared definitions in
packages/core/src/i18n/custom-messages/my-organization/domain-management/domain-create-types.ts,
domain-delete-types.ts, and domain-verify-types.ts require no direct changes.

In
`@packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-provider/sso-provider-table-types.ts`:
- Around line 28-29: Rename the tooltip fields in the SSO provider table types
from enabled_tooltip and disabled_tooltip to enable_provider_tooltip and
disable_provider_tooltip, matching the naming convention used by
domain-configure-types and sso-domain-tab-types. Update all references to these
fields consistently.

In
`@packages/react/src/components/auth0/my-organization/shared/domain-management/domain-configure/__tests__/domain-configure-providers-modal.test.tsx`:
- Around line 97-103: Update the test for DomainConfigureProvidersModal to
assert the complete translated title using the mock domain value, ensuring
{domain} interpolation is verified. Also add an assertion for the complete
custom description rendered with that same domain value, replacing the partial
title match.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 23e108c1-cfb0-47f6-93ce-cc12ef79a578

📥 Commits

Reviewing files that changed from the base of the PR and between b2e95fd and 433bf5c.

📒 Files selected for processing (12)
  • packages/core/src/i18n/custom-messages/my-organization/domain-management/domain-configure-types.ts
  • packages/core/src/i18n/custom-messages/my-organization/domain-management/domain-create-types.ts
  • packages/core/src/i18n/custom-messages/my-organization/domain-management/domain-delete-types.ts
  • packages/core/src/i18n/custom-messages/my-organization/domain-management/domain-table-types.ts
  • packages/core/src/i18n/custom-messages/my-organization/domain-management/domain-verify-types.ts
  • packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-domain/sso-domain-tab-types.ts
  • packages/core/src/i18n/custom-messages/my-organization/idp-management/sso-provider/sso-provider-table-types.ts
  • packages/react/src/components/auth0/my-organization/__tests__/domain-table.test.tsx
  • packages/react/src/components/auth0/my-organization/shared/domain-management/domain-configure/__tests__/domain-configure-providers-modal.test.tsx
  • packages/react/src/components/auth0/my-organization/shared/domain-management/domain-create/__tests__/domain-create-modal.test.tsx
  • packages/react/src/components/auth0/my-organization/shared/domain-management/domain-table/__tests__/domain-table-actions-column.test.tsx
  • packages/react/src/components/auth0/my-organization/shared/domain-management/domain-table/domain-table-actions-column.tsx

Base automatically changed from chore/cleanup-test-my-org to main July 27, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant