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(version-select): handle multipart basePath #468

Merged
merged 4 commits into from
Dec 17, 2021

Conversation

thiskevinwang
Copy link
Contributor

@thiskevinwang thiskevinwang commented Dec 17, 2021

  • feat(version-select): handle multipart basePath
  • chore: changeset

🎟️ -
πŸ” https://react-components-git-kevin-version-select-basepath-hashicorp.vercel.app/components/versionselect


Description

Describe this pull request: what is it aiming to achieve? What should someone reviewing this PR know? If this PR includes visual changes, consider including before / after screenshots, or an animated gif showing interactions.

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.

@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2021

πŸ¦‹ Changeset detected

Latest commit: 9ab5697

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

This PR includes changesets to release 2 packages
Name Type
@hashicorp/react-docs-page Minor
@hashicorp/react-version-select 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

@vercel
Copy link

vercel bot commented Dec 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

πŸ” Inspect: https://vercel.com/hashicorp/react-components/Hmyodn7KpQbHSqN3RL4diVGfENVb
βœ… Preview: https://react-components-git-kevin-version-select-basepath-hashicorp.vercel.app

Comment on lines -7 to -19
_Note:_ `VersionSelect` uses `next/router`. Interacting with it in **this playground**
will navigate you to non-existant pages.

<LiveComponent>{`<VersionSelect
versions={[
{ name: "latest", label: "latest" },
{ name: "v0.5.1", label: "v0.5.1" },
{ name: "v0.4.0", label: "v0.4.0" },
]}
/>`}</LiveComponent>

With Next.js router debugger

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this since VersionSelect without a NextRouterDebugger wrapper is not usable in a playground setting


describe('getVersionFromPath', () => {
it('should return the version if it is present', () => {
{
const path =
'https://waypointproject.io/docs/v10.2.4-canary.6/waypoint-hcl/variables/deploy'
'https://waypointproject.io/docs/v10.2.x/waypoint-hcl/variables/deploy'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simplifying our test case β€” we shouldn't have v10.2.4-canary.6 as the version for the forseeable future

@thiskevinwang thiskevinwang added the release:canary Triggers a canary release for commits to this pull request label Dec 17, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2021

πŸ“¦ Canary Packages Published

Latest commit: 9ab5697

Published 2 packages

@hashicorp/react-docs-page@14.13.0-canary-20211117191239

npm install @hashicorp/react-docs-page@canary

@hashicorp/react-version-select@0.3.0-canary-20211117191239

npm install @hashicorp/react-version-select@canary

@@ -89,3 +93,29 @@ describe('removeVersionFromPath', () => {
)
})
})

describe('getTargetPath', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a test case here with a non-nested base path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added!

Copy link
Contributor

@BRKalow BRKalow left a comment

Choose a reason for hiding this comment

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

πŸ‘

@thiskevinwang thiskevinwang merged commit 22a02a4 into main Dec 17, 2021
@thiskevinwang thiskevinwang deleted the kevin/version-select-basepath branch December 17, 2021 20:44
@github-actions github-actions bot mentioned this pull request Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:canary Triggers a canary release for commits to this pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants