-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add decorator in dataTable #18114
base: main
Are you sure you want to change the base?
chore: add decorator in dataTable #18114
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for tackling the data table!!! this is looking really good! left some comments, but lmk if you have any questions!
packages/styles/scss/components/data-table/sort/_data-table-sort.scss
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18114 +/- ##
==========================================
- Coverage 84.31% 84.15% -0.17%
==========================================
Files 404 406 +2
Lines 14359 14407 +48
Branches 4656 4636 -20
==========================================
+ Hits 12107 12124 +17
- Misses 2090 2119 +29
- Partials 162 164 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Worth calling out that this more tightly couples this prop with AILabel
due to the few instances where the display name is checked. e.g. decorator?.type?.displayName === 'AILabel'
. It's not a huge deal, but it does mean things will behave differently if someone implements their own AILabel, as unlikely as that may be.
packages/react/src/components/DataTable/stories/DataTable-ai-label.stories.js
Outdated
Show resolved
Hide resolved
|
||
const didWarnAboutDeprecation = {}; | ||
|
||
export default function deprecateComponent(componentName, message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised we didn't have this already, thanks for adding it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good just a few minor comments! happy to discuss more too!
@@ -98,15 +107,15 @@ const TableExpandRow = React.forwardRef( | |||
[`${prefix}--parent-row`]: true, | |||
[`${prefix}--expandable-row`]: isExpanded, | |||
[`${prefix}--data-table--selected`]: isSelected, | |||
[`${prefix}--data-table--slug-row`]: rowHasSlug, | |||
[`${prefix}--data-table--ai-label-row`]: rowHasAILabel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need both untill v12... people could be targetting these classes
[`${prefix}--data-table--ai-label-row`]: rowHasAILabel, | |
[`${prefix}--data-table--slug-row`]: slug && rowHasAILabel, | |
[`${prefix}--data-table--ai-label-row`]: rowHasAILabel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Ari, here Slug is just a constant name which I have changed to decorator in line no 78 of this file and added condition for both Slug or decorator. However, yes we can add both the classes [${prefix}--data-table--slug-row
] and [${prefix}--data-table--ai-label-row
] on same condition keeping in mind if any user is using the [${prefix}--data-table--slug-row
] class name.
Thanks Ari, I have added the comment and made the changes wherever possible. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like the snapshots may need an update to pass CI!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! just don't forget to put the data table stories back
Closes #18005
Add decorator in dataTable component
Changelog
Added a new component
TableDecoratorRow
Added a new deprecated warning function for components
Changed
slug
as deprecated prop in all dataTable componentsTableSlugRow
component as deprecatedai-lable
anddecorator
both.Testing / Reviewing