feat!: create data dictionary chip (#451)#467
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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;
NoopDog
approved these changes
May 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
MuiChiptheme configuration.Type System Enhancements:
AttributeValueTypesto support generic types, making it more flexible for various use cases insrc/common/entities.ts.DataDictionaryColumnDefinterface to include optional properties for accessor function and cell renderer names, and modified thewidthproperty to supportGridTrackSizetypes.Table Cell Component Improvements:
BasicCellto use generic types and theCellContexttype from@tanstack/react-table, improving type safety and flexibility.BasicCellPropstype in favor of directly usingCellContext, simplifying the codebase.ChipCellcomponent to renderChipelements dynamically based on cell data, using generic types for flexibility.rowHasKeytype guard to validate the presence of specific keys in rows, aiding in the creation of generic accessor functions.Theming Enhancements:
MuiChiptheme configuration to include a newstatusvariant with typography updates and additional styling fordefaultcolor. [1] [2]