-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
π¦ Changeset detectedLatest commit: 9ab5697 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
This pull request is being automatically deployed with Vercel (learn more). π Inspect: https://vercel.com/hashicorp/react-components/Hmyodn7KpQbHSqN3RL4diVGfENVb |
_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 | ||
|
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.
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' |
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.
Simplifying our test case β we shouldn't have v10.2.4-canary.6
as the version for the forseeable future
π¦ Canary Packages PublishedLatest commit: 9ab5697 Published 2 packages@hashicorp/react-docs-page@14.13.0-canary-20211117191239
@hashicorp/react-version-select@0.3.0-canary-20211117191239
|
@@ -89,3 +93,29 @@ describe('removeVersionFromPath', () => { | |||
) | |||
}) | |||
}) | |||
|
|||
describe('getTargetPath', () => { |
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.
Should we add a test case here with a non-nested base path?
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.
added!
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.
π
ποΈ -
π 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.