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(website): add missing props tables #8126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

weronikaolejniczak
Copy link
Contributor

@weronikaolejniczak weronikaolejniczak commented Nov 8, 2024

Summary

I added missing props tables to EUI+ pages. Check the issue for the whole list: #139

Screenshot 2024-11-11 at 11 14 26

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 ☝🏻

@weronikaolejniczak weronikaolejniczak added documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog labels Nov 8, 2024
@weronikaolejniczak weronikaolejniczak requested a review from a team as a code owner November 8, 2024 18:21
@weronikaolejniczak weronikaolejniczak changed the title chore(website): add missing props tables fix(website): add missing props tables Nov 8, 2024

<PropTable definition={docgen.EuiTreeView} />
<PropTable definition={treeViewDocgen.EuiTreeView} />
<PropTable definition={treeViewItemDocgen.EuiTreeViewItem} />
Copy link
Contributor

@mgadewoll mgadewoll Nov 11, 2024

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 EuiTreeViewNodes. (ref) EuiTreeViewNode does not directly translate to EuiTreeViewItem.

Screenshot 2024-11-11 at 10 28 59

I do notice that those additional types are not provided by the generated docgen though 👀
@tkajtoch Is there a way to add those?

Copy link
Contributor Author

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:

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.

Copy link
Contributor

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 👍

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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! 👍

Copy link
Contributor

@mgadewoll mgadewoll left a 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!

@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants