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

Update knobs to controls in storybook: MetamaskTemplateRenderer #18498

Closed
georgewrmarshall opened this issue Apr 6, 2023 · 5 comments · Fixed by #18677
Closed

Update knobs to controls in storybook: MetamaskTemplateRenderer #18498

georgewrmarshall opened this issue Apr 6, 2023 · 5 comments · Fixed by #18677
Assignees
Labels
good first issue Good for newcomers team-design-system All issues relating to design system in Extension type-story

Comments

@georgewrmarshall
Copy link
Contributor

georgewrmarshall commented Apr 6, 2023

Description

Currently there are a few storybook stories still using knobs in our storybook files *.stories.js. knobs have been deprecated in favour of controls. It would be great to migrate these last stories from knobs to controls.

This issue is to migrate the ui/components/app/metamask-template-renderer/metamask-template-renderer.stories.js from knobs to controls

Screenshot 2023-04-06 at 4 34 17 PM

Requirements

If you would like to take on this issue please comment but before asking to take on this issue there are a few requirements that will help complete this task:

  • Get storybook up and running yarn storybook
  • Some knowledge of storybook is not required but would be beneficial for this task. storybook docs here

Technical Details

  • Migrate knobs to controls

Acceptance Criteria

  • knobs have been migrated to controls for listed story
  • Take Before / After screenshots of the knobs and new controls and attach to the PR
  • Tag @georgewrmarshall, @garrettbear, or @NidhiKJha in the PR to review
@georgewrmarshall georgewrmarshall added good first issue Good for newcomers type-story team-design-system All issues relating to design system in Extension labels Apr 6, 2023
@dj-pundir
Copy link
Contributor

Hey @georgewrmarshall I would like to work on this assignment. Could you please assign this to me? Thanks in advance!!!

@georgewrmarshall
Copy link
Contributor Author

Assigned thanks @dpundir-vertex!

@dj-pundir
Copy link
Contributor

Thanks @georgewrmarshall to assign me this.

I have a query while checking the storyboard for MetamaskTemplateRenderer --> "With Invalid Element" Currently It is showing me following:

image

I understand why it is showing because we are passing element: 'Unsafe', then it goes to MetaMaskTemplateRenderer component where each section is processed. In processing first we check if the section's element is exist in the component safeComponentList or not. Here is the possible elements list:

image

Is that the expected behavior when we change Knobs to Controls? Actually i am confused by seeing the error page. If that's fine we can go ahead because its used for Invalid element by the way. So it should show some error somehow.

@georgewrmarshall
Copy link
Contributor Author

Hey @dj-pundir, I'm actually not sure why the knobs implementation is working. It should also error. I understand the intention of the story but I don't think it adds much value to show the thrown error. I think we could just remove the WithInvalidElement story altogether?

@georgewrmarshall
Copy link
Contributor Author

Also I'm curious what VS Code plugin or eslint settings you have to show these deprecated components with a strike through? I might suggest adding it to the repo it would be very helpful for an initiative to improve DX I'd like to complete

Screenshot 2023-04-18 at 5 34 25 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers team-design-system All issues relating to design system in Extension type-story
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants