Skip to content

fix: fix data dictionary basiccell component to render boolean values as string (#474)#475

Merged
NoopDog merged 2 commits into
mainfrom
fran/474-dd-basic-cell
May 13, 2025
Merged

fix: fix data dictionary basiccell component to render boolean values as string (#474)#475
NoopDog merged 2 commits into
mainfrom
fran/474-dd-basic-cell

Conversation

@frano-m

@frano-m frano-m commented May 13, 2025

Copy link
Copy Markdown
Contributor

Closes #474.

This pull request refactors the BasicCell component in the DataDictionary table to improve type safety and enhance value rendering. The main changes include extending the BasicCell component's type definitions and introducing a utility function to handle value parsing.

Changes to BasicCell component:

Addition of parseValue utility:

Copilot AI 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.

Pull Request Overview

This PR fixes the rendering issue for boolean values in the DataDictionary BasicCell component and improves type safety by introducing a dedicated value parsing utility.

  • Refactors BasicCell to extend the TValue type parameter (defaulting to ReactNode)
  • Introduces and integrates the parseValue utility for consistent value transformation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/components/DataDictionary/components/Table/components/BasicCell/utils.ts Added parseValue utility to handle boolean-to-string conversion
src/components/DataDictionary/components/Table/components/BasicCell/basicCell.tsx Updated BasicCell to use parseValue instead of casting the value directly
Comments suppressed due to low confidence (1)

src/components/DataDictionary/components/Table/components/BasicCell/utils.ts:9

  • [nitpick] Consider adding unit tests for parseValue to verify its behavior with various ReactNode types, ensuring consistent rendering for non-boolean values in future updates.
if (typeof value === "boolean") return value.toString();

Comment thread src/components/DataDictionary/components/Table/components/BasicCell/utils.ts Outdated
@NoopDog NoopDog merged commit d754d31 into main May 13, 2025
@frano-m frano-m deleted the fran/474-dd-basic-cell branch May 22, 2025 04:46
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.

Fix data dictionary BasicCell component to render boolean values as string

3 participants