Skip to content
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

feat(Datagrid): add feature flags to select hooks until fully released #2937

Merged

Conversation

matthewgallo
Copy link
Member

@matthewgallo matthewgallo commented Apr 27, 2023

Contributes to #2917

This PR adds feature flags to some of the Datagrid hooks that we've discussed are not considered as part of the base Datagrid component. The hooks will still work as expected, there will just be a console error if the hook is not enabled and a console warning if it is enabled.

I also updated some of the feature flag logic in package-settings.js so that if a feature flag that does not exist in our list of default flags, it doesn't log anything to the console. Previously you could set any feature flag even if it wasn't some that existed, for example

pkg.feature['Datagrid.someRandomFlag'] = true;

This would have resulted in us logging a warning to the browser console Carbon for IBM Products (WARNING): Feature "Datagrid.someRandomFlag" enabled via feature flags.

Hooks that were updated to require feature flags:

useFiltering
useActionsColumn
useCustomizeColumns
useExpandedRow
useInlineEdit
useNestedRows

What did you change?

packages/cloud-cognitive/README.md
packages/cloud-cognitive/src/components/Datagrid/Datagrid.stories.js
packages/cloud-cognitive/src/components/Datagrid/Extensions/ColumnCustomization/ColumnCustomization.stories.js
packages/cloud-cognitive/src/components/Datagrid/Extensions/ExpandableRow/ExpandableRow.stories.js
packages/cloud-cognitive/src/components/Datagrid/Extensions/Filtering/Filtering.stories.js
packages/cloud-cognitive/src/components/Datagrid/Extensions/InlineEdit/InlineEdit.stories.js
packages/cloud-cognitive/src/components/Datagrid/Extensions/NestedRows/NestedRows.stories.js
packages/cloud-cognitive/src/components/Datagrid/Extensions/RowActionButtons/RowActionButtons.stories.js
packages/cloud-cognitive/src/components/Datagrid/useActionsColumn.js
packages/cloud-cognitive/src/components/Datagrid/useCustomizeColumns.js
packages/cloud-cognitive/src/components/Datagrid/useExpandedRow.js
packages/cloud-cognitive/src/components/Datagrid/useFiltering.js
packages/cloud-cognitive/src/components/Datagrid/useInlineEdit.js
packages/cloud-cognitive/src/components/Datagrid/useNestedRows.js
packages/cloud-cognitive/src/global/js/package-settings.js
packages/core/.storybook/index.scss
packages/core/.storybook/preview.js

How did you test and verify your work?

Storybook

@matthewgallo matthewgallo requested a review from a team as a code owner April 27, 2023 15:23
@netlify
Copy link

netlify bot commented Apr 27, 2023

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit 6f6e5f3
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/6453c64591c35000087a601f
😎 Deploy Preview https://deploy-preview-2937--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

davidmenendez
davidmenendez previously approved these changes Apr 27, 2023
@elycheea
Copy link
Contributor

elycheea commented May 2, 2023

@matthewgallo looks like some new conflicts. 😞

@matthewgallo
Copy link
Member Author

😅 Should be ready now

Copy link
Contributor

@elycheea elycheea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reapproving, but probably better if we use an inline notification than toast seeing it against the Datagrid stories, but think we can look into that again since this PR already touches quite a few files.

@elycheea elycheea added type: docs 📖 Improvements or additions to documentation status: ready to merge 🎉 labels May 4, 2023
@kodiakhq kodiakhq bot merged commit 387b593 into carbon-design-system:main May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Datagrid status: ready to merge 🎉 type: docs 📖 Improvements or additions to documentation version: 1 Carbon 10 / v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants