-
Notifications
You must be signed in to change notification settings - Fork 30
CONSOLE-3305: add DetailsPage and associated components #14
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
Conversation
ba42874 to
9f476e0
Compare
action menu working actions menu page header update tests updated index.ts
Option to have action menu icon after text
update
…ls-to-use-monorepo-common" This reverts commit a406b86, reversing changes made to 364a2d740a5daa1c5528af118e7fd3d4dff64ba7.
fhlavac
left a comment
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, thank you for the docs examples @rhamilto 🙂
rhamilto
left a comment
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.
A few comments to clarify significant changes.
packages/module/patternfly-docs/content/extensions/extended-components/examples/DetailsPage.md
Show resolved
Hide resolved
packages/module/patternfly-docs/content/extensions/extended-components/examples/DetailsPage.md
Show resolved
Hide resolved
jhadvig
left a comment
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.
/lgtm
packages/module/patternfly-docs/content/extensions/extended-components/examples/DetailsPage.md
Show resolved
Hide resolved
Hyperkid123
left a comment
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 have a few comments.
|
@Hyperkid123, thanks for the review and comments! I believe all your comments relate to the code as it exists in https://github.com/openshift/dynamic-plugin-sdk (what I'm doing in this PR is migrating it over). I don't know the entire history since @vidyanambiar did the work, but it certainly can be reconsidered here. Just want to make sure everyone is on the same page and the history is considered. cc: @jhadvig, @florkbr |
|
@rhamilto Yup I am ware of its origin. We want to make sure that we do not transfer any product-specific code to this generic repository. Component API changes are OK and to be expected to some degree. Functionality should be preserved. |
| if (location?.pathname && navigate) { | ||
| const currentPathName = location.pathname; | ||
| if (params?.selectedTab) { | ||
| navigate(currentPathName.replace(params.selectedTab, eventKey as string), { |
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.
Hmm. The Tab component does support a href prop, but we can't customize the root component.
I think using the Link from the router package component is optimal but the Tab component support is currently not good enough. If we use it as a child node of the Tab title prop, we will require some extra styling. Can you experiment with it to see if we can use it? Let me know if its too much work for too little reward. We can skip it if it is.
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.
For starters, I'm unclear how to deal with routing in general in the context of patternfly-docs. For example, how do I make use of react-router-dom hooks? Adding them to an example does not work. Perhaps it's not possible?
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, that is fair. I see we have two options. We either endorses the react-router-dom library for routing and expect the consuming app to have the router context setup, or we extend the API to not just only use click events to handle navigation but also proved the option to configure root elements of components that support the usage of link tags.
The reason why it's not working in example docs is because the Router context was never set up.
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.
@Hyperkid123, I defer to those of you with more experience on the subject. What do y'all think? @jhadvig, @florkbr, @fhlavac, @dlabaj
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.
We do try to keep this repo as generic as possible. I would personally go with providing the API to modify the components rather than enforcing any libraries. After all, the long-term goal of this repo is to be product agnostic.
That said, there are other files that already use the router hooks etc.
Is it OK if we say, is OK for now, but we will make a breaking change in the near future that would change the component API to allow this generic approach?
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 agree that the intent of this repo is for reusable UI components that extend PF in a meaningful way. The flows may be specific to Redhat.
@dlabaj can we reuse the PF beta mechanism for releasing these components? That way we can really think through the API changes going forward. I'd imagine this would be valuable to other components we contribute in the future.
jhadvig
left a comment
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.
Really nice work @rhamilto
Thanks @Hyperkid123 @dlabaj @florkbr for guidance here 👍
/lgtm
|
@Hyperkid123 @rhamilto I performed a quick test locally and it appears we can add the I'm looking at the promotion of the truncate component in PF5 as an example: patternfly/patternfly-react@34c1688 |
Done. Thanks, @florkbr. |
|
🎉 This PR is included in version 1.0.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
| import { Tabs, Tab, TabProps as PfTabProps, TabTitleText } from '@patternfly/react-core'; | ||
| import React from 'react'; | ||
| import { useNavigate, useLocation } from 'react-router-dom'; | ||
| import '@patternfly/react-styles/css/utilities/Spacing/spacing.css'; |
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.
D'oh! This should have been removed. cc: @florkbr, @jhadvig, @Hyperkid123, @dlabaj
I will open a PR to fix as this blocks me from making use of DetailsPage in https://github.com/openshift/crontab-plugin
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.
PR to resolve: #22
| ouiaId={tab?.ouiaId} | ||
| key={tab.eventKey} | ||
| > | ||
| <div className="pf-u-m-md">{tab.children}</div> |
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.
<div className="pf-u-m-md"> is probably a mistake here as it is possible to not want padding on the tab children.
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.
Opened a PR to address: #26



Uh oh!
There was an error while loading. Please reload this page.