Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8e6d3c

Browse files
authored
chore: updated documentation link (#1387)
* chore: updated documentation link* PR feedback
1 parentf93804a commite8e6d3c

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

‎site/src/components/UserDropdown/UserDropdown.test.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ const renderAndClick = async (props: Partial<UserDropdownProps> = {}) => {
1111
}
1212

1313
describe("UserDropdown",()=>{
14+
constenv=process.env
15+
16+
// REMARK: copying process.env so we don't mutate that object or encounter conflicts between tests
17+
beforeEach(()=>{
18+
process.env={ ...env}
19+
})
20+
21+
// REMARK: restoring process.env
22+
afterEach(()=>{
23+
process.env=env
24+
})
25+
1426
describe("when the trigger is clicked",()=>{
1527
it("opens the menu",async()=>{
1628
awaitrenderAndClick()
@@ -32,14 +44,15 @@ describe("UserDropdown", () => {
3244
})
3345

3446
it("has the correct link for the documentation item",async()=>{
47+
process.env.CODER_VERSION="v0.5.4"
3548
awaitrenderAndClick()
3649

3750
constlink=screen.getByText(Language.docsLabel).closest("a")
3851
if(!link){
3952
thrownewError("Anchor tag not found for the documentation menu item")
4053
}
4154

42-
expect(link.getAttribute("href")).toBe("https://coder.com/docs")
55+
expect(link.getAttribute("href")).toBe(`https://github.com/coder/coder/tree/${process.env.CODER_VERSION}/docs`)
4356
})
4457

4558
it("has the correct link for the account item",async()=>{

‎site/src/components/UserDropdown/UsersDropdown.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ export const UserDropdown: React.FC<UserDropdownProps> = ({ user, onSignOut }: U
7777
</MenuItem>
7878
</Link>
7979

80-
<ahref="https://coder.com/docs"target="_blank"rel="noreferrer"className={styles.link}>
80+
<a
81+
href={`https://github.com/coder/coder/tree/${process.env.CODER_VERSION}/docs`}
82+
target="_blank"
83+
rel="noreferrer"
84+
className={styles.link}
85+
>
8186
<MenuItemclassName={styles.menuItem}onClick={onPopoverClose}>
8287
<ListItemIconclassName={styles.icon}>
8388
<DocsIcon/>

‎site/webpack.common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import { Configuration, EnvironmentPlugin } from "webpack"
1313
*/
1414
constenvironmentPlugin=newEnvironmentPlugin({
1515
INSPECT_XSTATE:"",
16+
CODER_VERSION:"main",
1617
})
1718
console.info(`--- Setting INSPECT_XSTATE to '${process.env.INSPECT_XSTATE||""}'`)
19+
console.info(`--- Setting CODER_VERSION to '${process.env.CODER_VERSION||"main"}'`)
1820
console.info(`--- Setting NODE_ENV to '${process.env.NODE_ENV||""}'`)
1921

2022
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp