-
Notifications
You must be signed in to change notification settings - Fork 841
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(website): add missing props tables #8126
base: main
Are you sure you want to change the base?
fix(website): add missing props tables #8126
Conversation
357a102
to
045973c
Compare
045973c
to
535fff7
Compare
|
||
<PropTable definition={docgen.EuiTreeView} /> | ||
<PropTable definition={treeViewDocgen.EuiTreeView} /> | ||
<PropTable definition={treeViewItemDocgen.EuiTreeViewItem} /> |
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.
EuiTreeViewItem
is basically an internal subcomponent. The TreeView API doesn't expect it to be usable by consumers.
Instead we should provide types for the required items
prop (same as here) which uses EuiTreeViewNode
s. (ref) EuiTreeViewNode
does not directly translate to EuiTreeViewItem
.
I do notice that those additional types are not provided by the generated docgen though 👀
@tkajtoch Is there a way to add those?
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.
@mgadewoll I understand, thanks! I see that EuiTreeView is a compound component:
eui/packages/eui/src/components/tree_view/tree_view.tsx
Lines 370 to 373 in b937ece
export const EuiTreeView = Object.assign( | |
withEuiTheme<EuiTreeViewProps>(EuiTreeViewClass), | |
{ Item: EuiTreeViewItem } | |
); |
and there is one usage of EuiTreeView.Item in Kibana:
x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.tsx
If this is not generally allowed, it would be good to add a deprecation note / create a task in Kibana to refactor and remove the subcomponent Item.
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.
Yeah it's a compound but the EuiTreeView
component doesn't expect it to be used with it (besides the internal usage). But I don't think it's disallowed per se as it's exported and with that it could be used standalone - which apparently it is 😅 (good thinking on checking Kibana)
I guess we can keep the props table for it for now in that case 👍
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.
@mgadewoll what would you say about EuiBreadcrumb? 🤔 It's also an internal component but not compound and not exported.
Investigating a way to showcase types like EuiTreeViewNode might still be necessary, probably not on this PR though (?). We can move the discussion to Slack.
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.
If it's not exported, I'd opt to not show it as it might only cause confusion on the usage if we show something that's not needed for consumers. 👍
Investigating a way to showcase types like EuiTreeViewNode might still be necessary, probably not on this PR though (?)
Yes, I'd not want to block this PR because of it, as it's not clear yet if it's even possible with the available docgen generator. Let's investigate this separately.
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.
@mgadewoll I updated the prop tables to NOT show internal components (unless they can also be used standalone). I created an issue for the investigation #141 and added the list of missing types from this PR. Could you take a look?
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.
Looks good to me, thanks for the update! 👍
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 adding the missing props tables!
535fff7
to
8aad618
Compare
8aad618
to
f194f0f
Compare
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
Summary
I added missing props tables to EUI+ pages. Check the issue for the whole list: #139
If you notice any more let me know, I can add them as part of this PR.
QA
Use the staging link from the comment below. Cross-reference with the list in the issue ☝🏻