-
Notifications
You must be signed in to change notification settings - Fork 39
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
Allow sending action which is rendered next to tile title #283
Conversation
✅ Deploy Preview for quickstarts ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Overall looks good. Just wondering if we would be better off building the bookmark button internally instead of allowing some to make it themself. There where some strange layout issues if they didn't build it correctly. Let me know.
<Title headingLevel="h3" data-test="title" id={quickStartId}> | ||
<QuickStartMarkdownView content={name} /> | ||
</Title> | ||
{action} |
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.
What's your thoughts on creating the bookmark internally? I was able to create some strange results passing in the button component not set to a link. The alignment also looked good in some cases but if the title got to large it looked to low. I would think we would want it to stick to the top. Let me know your thoughts.
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 was thinking about it from the start as well, but I was not that big of a fan of it. Good point on style misalignment, how about we change this to an object with actionIcon
, onActionClick
and actionAriaLabel
. Right now we want to show plain button. If someone would want to display a dropdown in here, with these 3 items they should be able to do that (by using dropdown menu and attaching it to the right place) should there be such need in the future.
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.
That works for me. Maybe make one of the cards in the demo doc with how to implement it. So people would know.
@@ -17,13 +17,15 @@ interface QuickStartTileProps { | |||
status: QuickStartStatus; | |||
isActive: boolean; | |||
onClick?: () => void; | |||
action?: React.ReactNode; |
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.
Wondering if should just allow a callback function instead and build the bookmark button ourself inside. I got some strange results passing in the incorrect type of button.
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 we are not going to build it internally, we need documentation for how to use these props and this component. At the very least, we should add comments to each of these QuickStartTileProps
. Eventually, those props can be used in the quickstarts docs on PF.org
I'm noticing that there is no example in the PF docs for how to build a CustomCatalog
as is done in the demo app. ideally, we'd have an example that would also expose the APIs for all these components consumers could be using. That would need to be done in a follow up issue.
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 like this approach! I've changed it to be a button with predefined config. For power users I've also allowed passing buttonProps
should they need to tinker with the button (for example changing the hover state etc.).
@nicolethoen good point on adding this to a CustomCatalog
, I've added another section with same content as is rest and added the bookmark toggle.
@@ -17,13 +17,15 @@ interface QuickStartTileProps { | |||
status: QuickStartStatus; | |||
isActive: boolean; | |||
onClick?: () => void; | |||
action?: React.ReactNode; |
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 we are not going to build it internally, we need documentation for how to use these props and this component. At the very least, we should add comments to each of these QuickStartTileProps
. Eventually, those props can be used in the quickstarts docs on PF.org
I'm noticing that there is no example in the PF docs for how to build a CustomCatalog
as is done in the demo app. ideally, we'd have an example that would also expose the APIs for all these components consumers could be using. That would need to be done in a follow up issue.
@@ -9,4 +9,9 @@ | |||
& .pf-v5-c-badge:not(:last-of-type) { | |||
margin-right: var(--pf-v5-global--spacer--sm); | |||
} | |||
|
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'm so conditioned to avoid writing custom CSS.
So my instinct here is to say that I think you could replace this div.pfext-quick-start-title-header__display-name
with :
<Flex justifyContent={{ default: 'justifyContentCenter' }}>
<Title headingLevel="h3" data-test="title" id={quickStartId}>
<QuickStartMarkdownView content={name} />
</Title>
{action}
</Flex>
And you might opt to wrap the children in a FlexItem
but i don't think that'll be 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.
agree. i'm just use to custom css breaking i try to avoid it.
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'm still concerned about the action though. since i think you can't just really put anything there and someone may try to do that.
f0fce4f
to
30e83ec
Compare
30e83ec
to
8c8bae6
Compare
ba865f6
to
ec214d9
Compare
ec214d9
to
4a1d1b9
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.
LGTM with the new changes. Seems to be failing an A11y test if you need help with that let me know.
@dlabaj thank you! I might need some help with the duplicate IDs, they look like are not par of my changes. However I had to change how ID is generated for tile, it used to take just name. Now it consumes ID as well and if that is present it uses this ID. I then changed how quickstart is activated and use just the name of quickstart (as ID can be different than name). |
7a4f46f
to
57d2953
Compare
Okay - i've discovered that the duplicate id in these docs is |
CustomCatalog is looping over the same list twice of the hardcoded |
@nicolethoen yeah I wanted to duplicate the quickstarts as an example of bookmarked items. I am starting to think about removing the custom catalog changes and let PF team to do proper examples 😞 |
@karelhala We decided to remove the asciidoc examples. The only product that uses it was kafka but that product is no longer available. While the feature to use the asciidoc is still there we are going to encourage people to use markdown instead. |
This issue is causing the Percy test to fail. patternfly/patternfly#6352. We will need a fix from core. It only affects chrome and works in firefox. I wouldn't hold up this merge to quickstart over the failing Percy test. Let me know what you think @jessiehuff @nicolethoen |
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 Tested it in firefox and it works.
🎉 This PR is included in version 5.2.0-prerelease.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…#283) * Allow sending action which is rendered next to tile title * Change action to predefined button and add an example * Fix failing A11 tests * Use meta ID if present for card IDs * fix(ascii): Remove ascii doc examples. * fix(lint): Fixed linting issue. --------- Co-authored-by: Donald Labaj <[email protected]>
…#283) * Allow sending action which is rendered next to tile title * Change action to predefined button and add an example * Fix failing A11 tests * Use meta ID if present for card IDs * fix(ascii): Remove ascii doc examples. * fix(lint): Fixed linting issue. --------- Co-authored-by: Donald Labaj <[email protected]>
Description
In our quickstarts we need to render a bookmark button that bookmarks the quickstart. In order to render said button we need to send a button with this icon to the quickstart. This PR surfaces this trough quickStartTile to the header.
Screenshot