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

feat(docs-page): consolidate version-select into docs-page, add projectName prop #650

Merged
merged 7 commits into from
Jul 15, 2022

Conversation

BRKalow
Copy link
Contributor

@BRKalow BRKalow commented Jul 15, 2022

🎟️ Asana Task
πŸ” Preview Link


Description

To support clearly displaying versions for a specific sub-project, adds a projectName prop to DocsPage which will get passed down to VersionSelect. Also consolidates the source of react-version-select into react-docs-page as we're only using it there.

Screen Shot 2022-07-15 at 10 43 22 AM

PR Checklist πŸš€

Items in this checklist may not may not apply to your PR, but please consider each item carefully.

  • Add Asana and Preview links above.
  • Conduct thorough self-review.
  • Add or update tests as appropriate.
  • Conduct reasonable cross browser testing for both compatibility and responsive behavior (We have a Sauce Labs account for this, if you don't have access, just ask!).
  • Conduct reasonable accessibility review (use the WAS as a guide or an axe browser plugin until we establish more formal checks).
  • Identify (in the description above) and document (add Asana tasks on this board) any technical debt that you're aware of, but are not addressing as part of this PR.

@vercel
Copy link

vercel bot commented Jul 15, 2022

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated
react-components βœ… Ready (Inspect) Visit Preview Jul 15, 2022 at 4:52PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Jul 15, 2022

πŸ¦‹ Changeset detected

Latest commit: 8dc6f59

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hashicorp/react-docs-page Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@thiskevinwang thiskevinwang left a comment

Choose a reason for hiding this comment

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

I approve! Thank you for taking on the consolidation that I never did ❀️ .

Just one concern about the projectName prop name and the usage with string interpolation.

Curious if you think the ${projectName} Version string interpolation is potentially limiting to us, in the event that say Design Team wants some copy that doesn't end with " Version"

Regardless, LGTM.

@@ -11,14 +11,20 @@ import {
interface Props {
versions: { label: string; name: string }[]
basePath: string
projectName?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

2 cents: maybe a label prop to entirely override the label text is a more flexible prop?

Copy link
Contributor

Choose a reason for hiding this comment

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

But I guess the prop needing to be drilled down several levels make that a bit more involved of a change to get right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. I had opted for this approach as I didn't feel we needed the full flexibility, but maybe it's not super clear what the prop is actually doing on usage πŸ’­

Do you have a preference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry missed your comment!

Just one concern about the projectName prop name and the usage with string interpolation.

Curious if you think the ${projectName} Version string interpolation is potentially limiting to us, in the event that say Design Team wants some copy that doesn't end with " Version"

I think if design wants something else it would be consistent across projects, in which case it felt better to enforce it in the component than to have to update all usages / implementations.

@BRKalow BRKalow merged commit c9719e1 into main Jul 15, 2022
@BRKalow BRKalow deleted the brk.feat/project-name-version-select branch July 15, 2022 19:21
@hashibot-web hashibot-web mentioned this pull request Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants