Skip to content

feat!: create data dictionary chip (#451)#467

Merged
NoopDog merged 1 commit into
mainfrom
fran/451-dd-chip
May 12, 2025
Merged

feat!: create data dictionary chip (#451)#467
NoopDog merged 1 commit into
mainfrom
fran/451-dd-chip

Conversation

@frano-m

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

Copy link
Copy Markdown
Contributor

Closes #451.

This pull request introduces several updates to enhance type flexibility, improve table cell components, and extend theming capabilities. The key changes include refactoring type definitions for attributes, updating table cell components to support generic types, and adding new variants to the MuiChip theme configuration.

Type System Enhancements:

  • Refactored AttributeValueTypes to support generic types, making it more flexible for various use cases in src/common/entities.ts.
  • Updated the DataDictionaryColumnDef interface to include optional properties for accessor function and cell renderer names, and modified the width property to support GridTrackSize types.

Table Cell Component Improvements:

  • Refactored BasicCell to use generic types and the CellContext type from @tanstack/react-table, improving type safety and flexibility.
  • Removed the BasicCellProps type in favor of directly using CellContext, simplifying the codebase.
  • Added a new ChipCell component to render Chip elements dynamically based on cell data, using generic types for flexibility.
  • Introduced a rowHasKey type guard to validate the presence of specific keys in rows, aiding in the creation of generic accessor functions.

Theming Enhancements:

  • Extended the MuiChip theme configuration to include a new status variant with typography updates and additional styling for default color. [1] [2]
image

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 introduces a data dictionary chip with extended theming support, enhanced type flexibility, and updated table cell components. Key changes include refactoring type definitions to support generics, adding a new ChipCell component that leverages these types, and extending the MuiChip theme with a new “status” variant.

  • Introduces generic type enhancements in common entities.
  • Adds and refactors table cell components including a new ChipCell.
  • Extends theming in MuiChip with a “status” variant.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/theme/common/components.ts Extended MuiChip theming with a new status variant and additional styling.
src/components/Table/components/ChipCell/chipCell.tsx Added a new ChipCell component to dynamically render Chip elements.
src/components/Table/columnDef/accessorFn/typeGuards.ts Added a type guard (rowHasKey) for generic accessor functions.
src/components/DataDictionary/components/Table/components/BasicCell/basicCell.tsx Refactored BasicCell to use generic types and simplified its implementation.
src/common/entities.ts Updated AttributeValueTypes to be generic and revised DataDictionaryColumnDef accordingly.
Comments suppressed due to low confidence (2)

src/theme/common/components.ts:417

  • Consider verifying that the removal of the typography styling for the 'status' variant (in the non-default color configuration) is intentional; if consistent styling is desired, merging the typography style across all 'status' variants may be beneficial.
...theme.typography[TEXT_BODY_SMALL_500],

src/common/entities.ts:25

  • Changing AttributeValueTypes from a union type to a generic type may affect modules that previously assumed it was limited to string or boolean; ensure that all consumers explicitly provide the appropriate TValue or update their type expectations accordingly.
export type AttributeValueTypes<TValue = unknown> = TValue;

@frano-m frano-m force-pushed the fran/451-dd-chip branch from af7c74c to 1406773 Compare May 12, 2025 04:52
@NoopDog NoopDog merged commit f3fa731 into main May 12, 2025
2 checks passed
@frano-m frano-m deleted the fran/451-dd-chip branch May 22, 2025 04:45
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.

Create data dictionary chip

3 participants