Skip to content

[OSDEV-1930] Implemented displaying additional identifiers such as RBA, LEI, and DUNS IDs on the production location profile page.#594

Merged
vladsha-dev merged 9 commits intomainfrom
OSDEV-1930-add-additional-identifiers-to-the-location-profile-page-but-only-for-the-rba-instance
Apr 23, 2025
Merged

[OSDEV-1930] Implemented displaying additional identifiers such as RBA, LEI, and DUNS IDs on the production location profile page.#594
vladsha-dev merged 9 commits intomainfrom
OSDEV-1930-add-additional-identifiers-to-the-location-profile-page-but-only-for-the-rba-instance

Conversation

@vladsha-dev
Copy link
Contributor

@vladsha-dev vladsha-dev commented Apr 17, 2025

OSDEV-1930

  • Implemented front-end logic to display additional identifiers such as RBA, LEI, and DUNS IDs as data points on the production location profile page, once the show_additional_identifiers feature flag is returned with a true value from the backend.
  • 0168_introduce_show_additional_identifiers_switch.py - This migration introduces a new switch called show_additional_identifiers, which will be used on the production location profile page to show or hide additional identifiers of the production location.
  • Updated the styles of primary and secondary text in the data points UI and the location details contributor drawer on the location profile page, as well as the hash in the React error boundary component, to prevent overflow on the page or within its field location. Replaced the deprecated word-wrap CSS property with the supported overflow-wrap CSS property.

@vladsha-dev vladsha-dev self-assigned this Apr 17, 2025
@vladsha-dev vladsha-dev marked this pull request as draft April 17, 2025 13:01
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:01 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:03 — with GitHub Actions Inactive
@barecheck
Copy link

barecheck bot commented Apr 17, 2025

React App | Jest test suite - Code coverage report

Total: 33.98%

Your code coverage diff: 0.46% ▴

✅ All code changes are covered

@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:07 — with GitHub Actions Inactive
@barecheck
Copy link

barecheck bot commented Apr 17, 2025

Dedupe Hub App | Unittest test suite - Code coverage report

Total: 56.14%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:08 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 17, 2025 13:08 — with GitHub Actions Inactive
@barecheck
Copy link

barecheck bot commented Apr 17, 2025

Contricleaner App | Unittest test suite - Code coverage report

Total: 98.91%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@barecheck
Copy link

barecheck bot commented Apr 17, 2025

Countries App | Unittest test suite - Code coverage report

Total: 100%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

…-location-profile-page-but-only-for-the-rba-instance
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 18, 2025 09:35 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 18, 2025 09:35 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 18, 2025 09:35 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 18, 2025 09:35 — with GitHub Actions Inactive
…-location-profile-page-but-only-for-the-rba-instance
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment April 21, 2025 09:37 — with GitHub Actions Inactive
@coderabbitai
Copy link

coderabbitai bot commented Apr 22, 2025

📝 Walkthrough
## Walkthrough

This update introduces a new feature flag, `show_additional_identifiers`, managed via a Django migration and surfaced in the front-end through Redux-powered feature flagging. The front-end now conditionally displays additional facility identifiers (DUNS ID, LEI ID, RBA ID) on the production location profile page when the flag is enabled. Related constants and prop types are updated to support the new flag and fields. Several UI components are refactored to use the modern CSS property `overflow-wrap` instead of the deprecated `word-wrap` for better text handling. Comprehensive tests verify the conditional rendering logic.

## Changes

| File(s)                                                                                      | Change Summary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `doc/release/RELEASE-NOTES.md`                                                               | Updated release notes for version 2.3.0 to document the new database migration, feature flag, front-end changes for additional identifiers, and CSS bugfixes. Removed previously empty sections for clarity.                                                                                                                                                                                                                                                                                                    |
| `src/django/api/migrations/0168_introduce_show_additional_identifiers_switch.py`             | Added a Django migration to create and remove the `show_additional_identifiers` feature flag using the Waffle `Switch` model.                                                                                                                                                                                                                                                                                                                                                                                 |
| `src/react/src/components/ErrorBoundary.jsx` <br> `src/react/src/components/FacilityDetailsContributorsDrawer.jsx` | Changed CSS from `wordWrap: 'break-word'` to `overflowWrap: 'break-word'` for improved compatibility and standards compliance.                                                                                                                                                                                                                                                                                                                                         |
| `src/react/src/components/FacilityDetailsDetail.jsx`                                         | Changed CSS from `wordWrap: 'break-word'` to `overflowWrap: 'anywhere'` for better text overflow handling in `primaryText` and `secondaryText` classes.                                                                                                                                                                                                                                                                                                                |
| `src/react/src/components/FacilityDetailsGeneralFields.jsx`                                  | Refactored to conditionally render additional identifier fields (DUNS ID, LEI ID, RBA ID) based on the `SHOW_ADDITIONAL_IDENTIFIERS` feature flag. Added a helper function for extended field rendering.                                                                                                                                                                                                                                                               |
| `src/react/src/util/constants.jsx`                                                           | Added `SHOW_ADDITIONAL_IDENTIFIERS` flag, appended new identifier field types to `EXTENDED_FIELD_TYPES`, and introduced the `ADDITIONAL_IDENTIFIERS` array.                                                                                                                                                                                                                                                                                                            |
| `src/react/src/util/propTypes.js`                                                            | Updated `featureFlagPropType` to include `SHOW_ADDITIONAL_IDENTIFIERS` as a valid flag value.                                                                                                                                                                                                                                                                                                                                                                          |
| `src/react/src/__tests__/components/FacilityDetailsGeneralFields.test.js`                    | Added tests for conditional rendering of additional identifier fields in the `FacilityDetailsGeneralFields` component, verifying behavior with the feature flag enabled and disabled.                                                                                                                                                                                                                                                                                   |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant Frontend
    participant ReduxStore
    participant Backend (API)
    participant DB (Waffle Switch)

    User->>Frontend: Request Facility Profile Page
    Frontend->>Backend (API): Fetch facility details & feature flags
    Backend (API)->>DB (Waffle Switch): Query 'show_additional_identifiers' flag
    DB (Waffle Switch)-->>Backend (API): Return flag state
    Backend (API)-->>Frontend: Return facility data & flag state
    Frontend->>ReduxStore: Store flag state
    Frontend->>Frontend: Conditionally render additional identifiers (DUNS, LEI, RBA) if flag enabled
    User-->>Frontend: View profile page with/without additional identifiers

Possibly related PRs

Suggested reviewers

  • mazursasha1990
  • roman-stolar

</details>

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 6ce78c87c72cbf3118c0a1d561b4f2233f3bb79d and a2349dabc259f1291056756bb1b744203355bb20.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/react/src/__tests__/components/FacilityDetailsGeneralFields.test.js` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* src/react/src/__tests__/components/FacilityDetailsGeneralFields.test.js

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (13)</summary>

* GitHub Check: run-integration-test-code-quality
* GitHub Check: run-flake8-linter
* GitHub Check: run-eslint-linter-and-prettier-formatter
* GitHub Check: run-dd-code-quality
* GitHub Check: run-countries-code-quality
* GitHub Check: run-contricleaner-code-quality
* GitHub Check: get-base-branch-fe-cov
* GitHub Check: get-base-branch-django-cov
* GitHub Check: get-base-branch-countries-cov
* GitHub Check: get-base-branch-dd-cov
* GitHub Check: get-base-branch-contricleaner-cov
* GitHub Check: run-fe-code-quality
* GitHub Check: run-django-code-quality

</details>

</details>
<!-- internal state start -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iAzV9awUGHdYzTza7YzQ7f2wPZKCBO0r+xlYkblfEAVb2mgFiajBJxsvXKxJXWMd+ucoEoBuscwFsa5fsd5ecZXZ2azr2c8Z5Jn0CYSpr2ZI0EVZsbxuM28FpliQMRMIpZaa5v8HhwXCsAqWfZpAnDIC1SU0Jupq9GyjYx9RUMGBPW5uCfZCYERfgGRYhWRS8piZpE8MGB1VYbjs7GA55aXbA+2cFcg+FazJYtzOhjBelA+fqbhL4F+f+fCC4tZtLN3ELWEvoJJaQfWtrE2rQapbKN2rg7pfy3waKxjkpCnZiFw+tQI++CI68pI76Z5KsRYfSmflfhE+5YceTok4Ffcag+cyUJOUUnQB8AzBiGreKlmhaXIESBGDI9xDYCUzEcuuuJB3ldrifZfZRKUeBNtgMGjiUT104Rdi+rTPTjqEzkiR+rxPzkQ1DmLgjjLkMEq89nUEAiwRRXGAiloC/D8gOm68rigAKCfGPgKAJCRCfGJBICKCfBID0z0yfCKDQHm6KAYBJE24KDyDQAfGJByCfAEByAECfD0wEFJCjntkgAfAVE24YBu4YD02PgYAEBGAKByHO4YG25yFoAJAfCu+JBGGPjm4KF+9UD0zyHoAe4gHQDm+JAR5UAYAlTyBGByGPjyByCKFB701B9UCu702JGJDFQKHm4JFUDFUm4q8e769wAG6s06mG7oAO1iX0CAA== -->

<!-- internal state end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=opensupplyhub/open-supply-hub&utm_content=594):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link

@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: 3

🧹 Nitpick comments (3)
src/react/src/components/FacilityDetailsContributorsDrawer.jsx (1)

44-44: Consider using consistent text-wrapping behavior.

While modernizing the CSS property from wordWrap to overflowWrap is good, I notice you're using 'break-word' here but 'anywhere' in the FacilityDetailsDetail component. Consider using the same value consistently across components for predictable text wrapping behavior.

-            overflowWrap: 'break-word',
+            overflowWrap: 'anywhere',
src/react/src/__tests__/components/FacilityDetailsGeneralFields.test.js (2)

140-142: Consider enhancing the formatExtendedField mock for more realistic testing.

Your current formatter mock is very simple and doesn't reflect how the real component might handle complex data structures. Consider expanding it to better simulate the actual formatter behavior, especially for handling arrays of values.

-    const handleFormat = ({ value, formatValue }) => ({
-        primary: formatValue(value),
-    });
+    const handleFormat = ({ value, formatValue }) => {
+        // Handle potential array of values or complex structures
+        const formattedValue = Array.isArray(value)
+            ? value.map(v => formatValue(v.value ? v.value.raw_value : v)).join(', ')
+            : formatValue(value.value ? value.value.raw_value : value);
+            
+        return {
+            primary: formattedValue,
+        };
+    };

156-181: Enhance test coverage with edge cases.

Your tests only cover the basic cases of feature flag being true or false. Consider adding tests for edge cases such as:

  • What happens if an identifier has multiple entries?
  • What happens if an identifier is missing or has null values?
  • What happens if the feature flag is undefined?

For example, you could add a test like this:

test('handles missing identifier values gracefully', () => {
    // Create a modified mock with missing identifier values
    const modifiedMock = {
        ...mockData,
        properties: {
            ...mockData.properties,
            extended_fields: {
                ...mockData.properties.extended_fields,
                duns_id: [],
                lei_id: null,
                rba_id: [{ value: null }]
            }
        }
    };
    
    const preloadedState = {
        featureFlags: {
            fetching: false,
            flags: {
                show_additional_identifiers: true,
            },
        },
    };
    
    const { getByText, queryByText } = renderWithProviders(
        <FacilityDetailsGeneralFields {...defaultProps} data={modifiedMock} />,
        { preloadedState },
    );
    
    // The labels should still appear but not the values
    expect(getByText('DUNS ID')).toBeInTheDocument();
    expect(queryByText('2120383532')).not.toBeInTheDocument();
    // Add similar assertions for other identifiers
});
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdfb700 and 38235ad.

📒 Files selected for processing (9)
  • doc/release/RELEASE-NOTES.md (2 hunks)
  • src/django/api/migrations/0168_introduce_show_additional_identifiers_switch.py (1 hunks)
  • src/react/src/__tests__/components/FacilityDetailsGeneralFields.test.js (1 hunks)
  • src/react/src/components/ErrorBoundary.jsx (1 hunks)
  • src/react/src/components/FacilityDetailsContributorsDrawer.jsx (1 hunks)
  • src/react/src/components/FacilityDetailsDetail.jsx (1 hunks)
  • src/react/src/components/FacilityDetailsGeneralFields.jsx (3 hunks)
  • src/react/src/util/constants.jsx (2 hunks)
  • src/react/src/util/propTypes.js (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/react/src/components/FacilityDetailsDetail.jsx (1)
src/react/src/App.jsx (1)
  • theme (32-78)
src/react/src/util/propTypes.js (1)
src/react/src/util/constants.jsx (2)
  • SHOW_ADDITIONAL_IDENTIFIERS (564-564)
  • SHOW_ADDITIONAL_IDENTIFIERS (564-564)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: run-integration-test-code-quality
  • GitHub Check: run-flake8-linter
  • GitHub Check: run-django-code-quality
  • GitHub Check: run-countries-code-quality
  • GitHub Check: run-dd-code-quality
  • GitHub Check: run-contricleaner-code-quality
  • GitHub Check: get-base-branch-contricleaner-cov
  • GitHub Check: get-base-branch-countries-cov
  • GitHub Check: get-base-branch-dd-cov
  • GitHub Check: get-base-branch-django-cov
🔇 Additional comments (16)
src/django/api/migrations/0168_introduce_show_additional_identifiers_switch.py (1)

7-14: LGTM: Well-structured migration for feature flag creation.

The migration properly creates a Waffle Switch for the new show_additional_identifiers feature flag, with a sensible default of inactive. The forward migration creates the switch while the reverse migration correctly removes it, following best practices.

src/react/src/util/constants.jsx (3)

564-564: LGTM: New feature flag constant matches migration.

The new SHOW_ADDITIONAL_IDENTIFIERS constant correctly matches the name defined in the Django migration file, ensuring consistent naming across front-end and back-end.


1077-1091: LGTM: Additional identifiers properly implemented.

The three new extended field types for DUNS ID, LEI ID, and RBA ID follow the established pattern for defining field types with appropriate formatters.


1094-1098: LGTM: New array for identifier keys.

The ADDITIONAL_IDENTIFIERS frozen array provides a convenient way to reference all the new identifier field names in one place, making it easier to consistently check for these fields throughout the codebase.

src/react/src/components/FacilityDetailsDetail.jsx (2)

23-23: Modernized CSS property with improved text wrapping behavior.

The change from deprecated wordWrap to modern overflowWrap property is good. Changing from break-word to anywhere will allow text to break at any point (not just word boundaries), which can prevent overflow issues with very long identifiers that might not have spaces.


30-30: Modernized CSS property with consistent behavior.

Similar update to the secondary text styling, ensuring consistent text wrapping behavior throughout the component.

src/react/src/components/ErrorBoundary.jsx (1)

13-13: Good CSS update: Replaced deprecated property

Replaced deprecated wordWrap CSS property with the modern overflowWrap property. This aligns with best practices and ensures consistent text overflow behavior.

src/react/src/util/propTypes.js (2)

33-33: Added new feature flag import

Properly imported the SHOW_ADDITIONAL_IDENTIFIERS constant from constants file.


360-360: Updated feature flag prop type

Added the new SHOW_ADDITIONAL_IDENTIFIERS to the feature flag prop type validation list. This ensures proper type checking for components using this feature flag.

src/react/src/components/FacilityDetailsGeneralFields.jsx (4)

16-17: Added necessary imports for feature flag implementation

Added import for ADDITIONAL_IDENTIFIERS constant to properly filter extended field types.


19-20: Added feature flag constant import

The SHOW_ADDITIONAL_IDENTIFIERS constant is properly imported from constants to enable conditional rendering.


167-182: Well-implemented conditional rendering of extended fields

Great implementation of the renderExtendedFields method that conditionally shows additional identifiers based on the feature flag. The approach is clean:

  1. Filter out additional identifiers from extended fields
  2. Use FeatureFlag component with appropriate alternative prop
  3. Render all fields when the flag is enabled or filtered fields when disabled

This ensures that the additional identifiers (DUNS, LEI, RBA IDs) only appear when the backend feature flag is enabled.


206-207: Updated rendering logic

Properly replaced direct rendering of extended fields with the new conditional rendering function while maintaining the embed mode logic.

doc/release/RELEASE-NOTES.md (3)

16-16: Good documentation of migration

Clearly documented the new migration that introduces the show_additional_identifiers switch.


28-29: Well-documented bugfix

Clear explanation of the CSS property update from word-wrap to overflow-wrap that addresses text overflow issues.


32-32: Clear feature documentation

Well-documented feature addition explaining how the new additional identifiers will be shown conditionally based on the feature flag.

Copy link

@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: 0

🧹 Nitpick comments (2)
doc/release/RELEASE-NOTES.md (2)

29-29: Refine phrasing for clarity
The bugfix entry is accurate, but the phrase “as well as the hash in the React error boundary component” could be more specific. Consider rewording to clarify what “hash” refers to—for example, “the error boundary’s hash display”.


35-35: Improve conditional-rendering description
The “What’s new” bullet is correct, but the clause “once the show_additional_identifiers feature flag is returned with a true value from the backend” can be streamlined—for example:
“when the backend returns show_additional_identifiers = true.”

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38235ad and 6ce78c8.

📒 Files selected for processing (1)
  • doc/release/RELEASE-NOTES.md (2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
doc/release/RELEASE-NOTES.md

31-31: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


32-32: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: run-integration-test-code-quality
  • GitHub Check: run-flake8-linter
  • GitHub Check: run-eslint-linter-and-prettier-formatter
  • GitHub Check: run-fe-code-quality
  • GitHub Check: run-countries-code-quality
  • GitHub Check: run-django-code-quality
  • GitHub Check: run-dd-code-quality
  • GitHub Check: run-contricleaner-code-quality
  • GitHub Check: get-base-branch-contricleaner-cov
  • GitHub Check: get-base-branch-django-cov
  • GitHub Check: get-base-branch-countries-cov
  • GitHub Check: get-base-branch-dd-cov
  • GitHub Check: get-base-branch-fe-cov
🔇 Additional comments (1)
doc/release/RELEASE-NOTES.md (1)

16-16: New migration documented correctly
The entry for 0168_introduce_show_additional_identifiers_switch.py clearly describes the added feature flag switch. This aligns with the PR’s database migration.

@sonarqubecloud
Copy link

Copy link
Contributor

@mazursasha1990 mazursasha1990 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants