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

Commit0ec9253

Browse files
committed
chore: updated documentation link
1 parentf5693df commit0ec9253

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

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

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

1313
describe("UserDropdown",()=>{
14+
constenv=process.env
15+
16+
beforeEach(()=>{
17+
jest.resetModules()
18+
process.env={ ...env}
19+
})
20+
21+
afterEach(()=>{
22+
process.env=env
23+
})
24+
1425
describe("when the trigger is clicked",()=>{
1526
it("opens the menu",async()=>{
1627
awaitrenderAndClick()
@@ -32,14 +43,15 @@ describe("UserDropdown", () => {
3243
})
3344

3445
it("has the correct link for the documentation item",async()=>{
46+
process.env.CODER_VERSION="v0.5.4"
3547
awaitrenderAndClick()
3648

3749
constlink=screen.getByText(Language.docsLabel).closest("a")
3850
if(!link){
3951
thrownewError("Anchor tag not found for the documentation menu item")
4052
}
4153

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

4557
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