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

fix: add new props to feature flag props #17239

Conversation

riddhybansal
Copy link
Contributor

@riddhybansal riddhybansal commented Aug 22, 2024

Closes #17238

Add new boolean props for all existing feature flags

Update FeatureFlag internals to map the boolean props back into an object form to be used in the scope of FeatureFlagContext

Changelog

New

  • Add new boolean props for all existing feature flags

-Update FeatureFlag internals to map the boolean props back into an object form to be used in the scope of FeatureFlagContext

  • Added test cases for the props added

Testing / Reviewing

  • Feature flag should render with boolean prop and flag object also. Added test case for the same.

Copy link

netlify bot commented Aug 22, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 58ab74c
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66c6ef6e72bb6200087b2738
😎 Deploy Preview https://deploy-preview-17239--v11-carbon-react.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 configuration.

Copy link

netlify bot commented Aug 22, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 58ab74c
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66c6ef6ec3c13c000892a2e4
😎 Deploy Preview https://deploy-preview-17239--carbon-elements.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 configuration.

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for adding tests! Just a couple questions

const parentScope = useContext(FeatureFlagContext);
const [prevParentScope, setPrevParentScope] = useState(parentScope);

const combinedFlags = {
'enable-use-controlled-state-with-value': enableUseControlledStateWithValue,
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't look like this is actually used anywhere anymore, is that what you see as well? The useControlledStateWithValue in here doesn't seem to be used anywhere either

export const useControlledStateWithValue = enabled(
'enable-use-controlled-state-with-value'
);

If so we should remove this one

Comment on lines +35 to +40
enableUseControlledStateWithValue,
enableV12TileDefaultIcons,
enableV12TileRadioIcons,
enableV12Overflowmenu,
enableTreeviewControllable,
enableExperimentalFocusWrapWithoutSentinels,
Copy link
Member

Choose a reason for hiding this comment

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

Do these need the same defaults as what's defined in the root flag definition?

- name: enable-experimental-tile-contrast
description: >
Enable the experimental tile improved contrast styles
enabled: false
- name: enable-v12-tile-default-icons
description: >
Enable rendering of default icons in the tile components
enabled: false
- name: enable-v12-tile-radio-icons
description: >
Enable rendering of radio icons in the RadioTile component
enabled: false
- name: enable-v12-overflowmenu
description: >
Enable the use of the v12 OverflowMenu leveraging the Menu subcomponents
enabled: false
- name: enable-treeview-controllable
description: >
Enable the new TreeView controllable API
enabled: false
- name: enable-v12-structured-list-visible-icons
description: >
Enable rendering of radio icons in the StructuredList component
enabled: false
- name: enable-experimental-focus-wrap-without-sentinels
description: >
Enable the new focus wrap behavior that doesn't use sentinel nodes
enabled: false

@riddhybansal
Copy link
Contributor Author

riddhybansal commented Aug 26, 2024

Hey there there is no need to merge this PR , commit of this PR is directly added here #17266, All the change request will be fixed on #17266

@tay1orjones
Copy link
Member

Closing in favor of #17266, I moved my review comments to there as well

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.

Add new boolean props for all existing feature flags
2 participants