-
Notifications
You must be signed in to change notification settings - Fork 367
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
refactor: [M3-7542] - TagsInput & TagsPanel Storybook v7 Stories #9963
Conversation
2042f0a
to
d7aa486
Compare
@@ -89,7 +89,6 @@ const preview: Preview = { | |||
<Description /> | |||
<Primary /> | |||
<Controls /> | |||
<Stories /> |
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.
Listing all stories in documentation often leads to state issues and it will make things a bit easier to test visual regression by focusing on individual stories.
Documentation is meant to be a playground on the default rendering of the component.
We can always put it back in if people feel it's necessary.
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.
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's to show the list of stories in the Documentation page under the args table
Coverage Report: ✅ |
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.
✅ tests
✅ storybook works!
Thanks Alban!
@@ -89,7 +89,6 @@ const preview: Preview = { | |||
<Description /> | |||
<Primary /> | |||
<Controls /> | |||
<Stories /> |
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.
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.
TagsPanel.test.tsx
passes ✅
|
||
return ( | ||
<Box sx={{ height: 300 }}> | ||
<TagsPanel {...args} tags={tags} updateTags={handleUpdateTags} /> |
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.
Should we have better support for disabled
and align
?
Currently when it's disabled
, we lose the click-X-to-remove functionality for tags, but new tags can still be added (this isn't possible in prod Storybook).
Changing the selection for align
doesn't seem to have any effect at all (this is true in prod Storybook also).
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.
Currently when it's disabled, we lose the click-X-to-remove functionality for tags, but new tags can still be added (this isn't possible in prod Storybook).
I wasn't able to reproduce this but I remove align
cause it's used nowhere and not even forwarded
disabled: false, | ||
hideLabel: false, | ||
label: '', | ||
menuPlacement: 'bottom', |
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.
Should we have better support for menuPlacement
? Toggling between "top" and "bottom" has no effect (it's broken in prod Storybook also)
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 also wasn't able to reproduce this - menu placement gets toggled as expected. I did improve the styling of the story so the select sits in the middle of the canvas to help viewing it better tho.
eff758d
to
baa799f
Compare
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.
|
||
const queryClient = new QueryClient(); | ||
|
||
const renderWithQueryClient = (ui: any) => { |
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.
Can we type this? Not sure if JSX.Element
is the best or not
Also, should we move this to packages/manager/src/utilities/testHelpers.tsx
?
const renderWithQueryClient = (ui: any) => { | |
const renderWithQueryClient = (ui: JSX.Element) => { |
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.
ah yes i left this one out. sure thing - we can be more specific too using
React.ReactElement<TagsPanelProps>
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.
also moved Tag there - makes sense!
Description 📝
Small PR to handle
.tsx
v7 stories forTagsInput
&TagsPanel
There is no change that should affect client-side code. This only touches our book.
Changes 🔄
TagsInput
&TagsPanel
TagsPanel
TagsPanel
)Preview 📷
How to test 🧪
Verification steps
yarn storybook
yarn test TagsPanel.test.tsx
As an Author I have considered 🤔
Check all that apply