Skip to content

Conversation

@nicolethoen
Copy link
Collaborator

@nicolethoen nicolethoen commented May 23, 2023

Closes #3370
Closes #3371
Closes #3467
Closes #3489

Implements designs from design issue patternfly/patternfly-design#1239

Note: I need to add some frontmatter metadata to a number of core/react to make banners appear at the top of some deprecated tabs. This PR is meant to enable the displaying of labels/banners, and still requires some follow up work in other repos.

@patternfly-build
Copy link
Collaborator

patternfly-build commented May 23, 2023

Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolethoen this looks great! Just two small things to address...

  • The design calls for an 8px spacing between the nav names and the labels. Looks like you have more than that.

Screenshot 2023-05-23 at 3 26 56 PM

Copy link

@lboehling lboehling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @nicolethoen! I also noted the two changes @mcarrano just mentioned above, but other than that this looks great!

@nicolethoen
Copy link
Collaborator Author

  • Can we mark these examples as deprecated and remove the word "legacy?"

I've made a note to update these when I make the corresponding changes in core/react as follow up as soon as this merges.

@nicolethoen nicolethoen requested review from lboehling and mcarrano May 23, 2023 20:52
mcarrano
mcarrano previously approved these changes May 24, 2023
Copy link
Member

@mcarrano mcarrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks @nicolethoen !

lboehling
lboehling previously approved these changes May 24, 2023
Copy link

@lboehling lboehling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!!

</Tooltip>
)}
{isDeprecated && (
<Tooltip content="Deprecated components are available for use but are no longer being maintained or enhanced.">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a Surge issue not updating from a previous commit, but I'm seeing slightly different tooltip messages for these three items (Beta, Demo, Deprecated)

Screenshot 2023-05-24 at 4 55 25 PM

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! i'll fix that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - the text in my screenshot above actually maps to the tooltip in mdx.js, but curious if this text should match or maybe live in a single variable somewhere that can be referenced?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made them match. We don't right now have like a constants or strings file. Maybe that's something else we can clean up to add when we clean up the docs-framework in the future.

You can find the <Link to={newImplementationLink}>updated implementation here</Link>.
</React.Fragment>
)}
To learn more about the process, visit our <Link to="/get-started/about#major-release-cadence">about page</Link>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI there's currently no space between sentences

Screenshot 2023-05-24 at 5 02 37 PM

}) => {
const isDeprecated = sources.some(source => source.source === "react-deprecated") && !sources.some(source => source.source === "react");
const isBeta = sources.some(source => source.beta)
const isDemo = sources.some(source => source.source === "react-demos" || source.source === "html-demos") && !sources.some(source => source.source === "react" || source.source === "html");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something we're guilty of throughout docs-framework are these PF-specific hard coded values. Now that the docs-framework is a package used outside just the PF website build we should try to allow these to be customized by the user whenever possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this is widespread throughout the package, this works for now but noting for possible future cleanup effort.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah and i'm not sure if I can programmatically determine that a deprecated label can be added to the Example title without some sort of data being manually stored in the component-data. That was going to be my fall back, but this felt like less maintenance for now.

{(deprecated || source === 'react-deprecated') && (
<InlineAlert title="Deprecated feature" variant="warning">
This implementation has been deprecated in favor of a newer implementation, and is no longer getting maintained or enhanced.
{newImplementationLink && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not parsing newImplementationLink from the markdown anywhere currently so there's no way to trigger this code. We'd need to add

newImplementationLink: frontmatter.newImplementationLink || false

where we're defining pageData in mdx.js (similar to your added code for deprecated, beta, and demo).

@evwilkin
Copy link
Member

@nicolethoen a few callouts, mostly nits that could be resolved in follow-up issues if needed other than the newImplementationLink question

Copy link
Member

@evwilkin evwilkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@evwilkin evwilkin merged commit 010a0e0 into patternfly:v5 May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants