feat!: create table cell for displaying links (#468)#473
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new LinkCell component along with utilities, stories, and tests to support both client-side and external navigation while handling invalid links gracefully.
- Adds the LinkCell component to render links or fall back to plain text.
- Implements utility functions and type guards for processing link attributes.
- Provides comprehensive Storybook stories and unit tests.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/linkCell.test.tsx | Unit tests verifying different rendering behaviors of the LinkCell component. |
| src/theme/common/components.ts | Adds an underlineNone style configuration for MuiLink. |
| src/components/common/Link/typeGuards.ts | Introduces assertion functions for validating link attributes. |
| src/components/Table/components/TableCell/components/LinkCell/utils.ts | Implements utility functions to determine the correct component and attributes for a link. |
| src/components/Table/components/TableCell/components/LinkCell/stories/types.ts | Provides type definitions for the LinkCell stories. |
| src/components/Table/components/TableCell/components/LinkCell/stories/linkCell.stories.tsx | Defines multiple Storybook stories for the LinkCell component. |
| src/components/Table/components/TableCell/components/LinkCell/stories/args.ts | Configures reusable arguments for LinkCell Storybook stories. |
| src/components/Table/components/TableCell/components/LinkCell/linkCell.tsx | Implements the LinkCell component using the utilities and type guards. |
| package.json | Updates development dependencies by adding @emotion/jest. |
fe6dcca to
97bd561
Compare
97bd561 to
497f8cb
Compare
NoopDog
approved these changes
May 13, 2025
NoopDog
approved these changes
May 13, 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 #468.
This pull request introduces a new
LinkCellcomponent for rendering links in a table cell, along with supporting utilities, stories, and tests. The changes focus on adding functionality for client-side and external navigation, handling invalid links gracefully, and providing customization options.New
LinkCellComponent and Utilities:LinkCellcomponent to render links or fallback to plain text for invalid URLs, with support for client-side navigation usingnext/link(src/components/Table/components/TableCell/components/LinkCell/linkCell.tsx).getComponent,getRelAttribute,getTargetAttribute) to determine the appropriate link component,rel, andtargetattributes based on navigation type (src/components/Table/components/TableCell/components/LinkCell/utils.ts).assertAnchorRelAttribute,assertAnchorTargetAttribute) to validaterelandtargetattributes (src/components/common/Link/typeGuards.ts).Stories for
LinkCell:LinkCellcomponent, including client-side, external, invalid links, and custom styles (src/components/Table/components/TableCell/components/LinkCell/stories/linkCell.stories.tsx).src/components/Table/components/TableCell/components/LinkCell/stories/args.ts).Testing:
LinkCellcomponent to verify rendering behavior for client-side links, external links, invalid links, and custom styles (tests/linkCell.test.tsx).Styling Enhancements:
MuiLinktheme to support aunderlineNonestyle that removes underline on hover (src/theme/common/components.ts).Dependency Updates:
@emotion/jestas a development dependency for testing styled components (package.json).