Skip to content

Commit fc67c6e

Browse files
authored
fix: remove unused pages from Admin dropdown (org and settings) (coder#1788)
* Delete Orgs Page * Delete Admin Settings page
1 parent 8f0a5a8 commit fc67c6e

File tree

5 files changed

+0
-66
lines changed

5 files changed

+0
-66
lines changed

site/src/AppRouter.tsx

-18
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import { NotFoundPage } from "./pages/404Page/404Page"
88
import { CliAuthenticationPage } from "./pages/CliAuthPage/CliAuthPage"
99
import { HealthzPage } from "./pages/HealthzPage/HealthzPage"
1010
import { LoginPage } from "./pages/LoginPage/LoginPage"
11-
import { OrgsPage } from "./pages/OrgsPage/OrgsPage"
12-
import { SettingsPage } from "./pages/SettingsPage/SettingsPage"
1311
import { AccountPage } from "./pages/SettingsPages/AccountPage/AccountPage"
1412
import { SSHKeysPage } from "./pages/SettingsPages/SSHKeysPage/SSHKeysPage"
1513
import { TemplatePage } from "./pages/TemplatePage/TemplatePage"
@@ -134,22 +132,6 @@ export const AppRouter: React.FC = () => (
134132
}
135133
/>
136134
</Route>
137-
<Route
138-
path="orgs"
139-
element={
140-
<AuthAndFrame>
141-
<OrgsPage />
142-
</AuthAndFrame>
143-
}
144-
/>
145-
<Route
146-
path="settings"
147-
element={
148-
<AuthAndFrame>
149-
<SettingsPage />
150-
</AuthAndFrame>
151-
}
152-
/>
153135

154136
<Route path="settings" element={<SettingsLayout />}>
155137
<Route path="account" element={<AccountPage />} />

site/src/components/AdminDropdown/AdminDropdown.test.tsx

-20
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ describe("AdminDropdown", () => {
1414
it("opens the menu", async () => {
1515
await renderAndClick()
1616
expect(screen.getByText(Language.usersLabel)).toBeDefined()
17-
expect(screen.getByText(Language.orgsLabel)).toBeDefined()
18-
expect(screen.getByText(Language.settingsLabel)).toBeDefined()
1917
})
2018
})
2119

@@ -27,22 +25,4 @@ describe("AdminDropdown", () => {
2725

2826
expect(history.location.pathname).toEqual("/users")
2927
})
30-
31-
it("links to the orgs page", async () => {
32-
await renderAndClick()
33-
34-
const usersLink = screen.getByText(Language.orgsLabel).closest("a")
35-
usersLink?.click()
36-
37-
expect(history.location.pathname).toEqual("/orgs")
38-
})
39-
40-
it("links to the settings page", async () => {
41-
await renderAndClick()
42-
43-
const usersLink = screen.getByText(Language.settingsLabel).closest("a")
44-
usersLink?.click()
45-
46-
expect(history.location.pathname).toEqual("/settings")
47-
})
4828
})

site/src/components/AdminDropdown/AdminDropdown.tsx

-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import ListItem from "@material-ui/core/ListItem"
22
import ListItemText from "@material-ui/core/ListItemText"
33
import { fade, makeStyles, Theme } from "@material-ui/core/styles"
4-
import AdminIcon from "@material-ui/icons/SettingsOutlined"
54
import React, { useState } from "react"
65
import { navHeight } from "../../theme/constants"
76
import { BorderedMenu } from "../BorderedMenu/BorderedMenu"
87
import { BorderedMenuRow } from "../BorderedMenuRow/BorderedMenuRow"
98
import { CloseDropdown, OpenDropdown } from "../DropdownArrows/DropdownArrows"
10-
import { BuildingIcon } from "../Icons/BuildingIcon"
119
import { UsersOutlinedIcon } from "../Icons/UsersOutlinedIcon"
1210

1311
export const Language = {
1412
menuTitle: "Admin",
1513
usersLabel: "Users",
1614
usersDescription: "Manage users, roles, and permissions.",
17-
orgsLabel: "Organizations",
18-
orgsDescription: "Manage organizations.",
19-
settingsLabel: "Settings",
20-
settingsDescription: "Configure authentication and more.",
2115
}
2216

2317
const entries = [
@@ -27,18 +21,6 @@ const entries = [
2721
path: "/users",
2822
Icon: UsersOutlinedIcon,
2923
},
30-
{
31-
label: Language.orgsLabel,
32-
description: Language.orgsDescription,
33-
path: "/orgs",
34-
Icon: BuildingIcon,
35-
},
36-
{
37-
label: Language.settingsLabel,
38-
description: Language.settingsDescription,
39-
path: "/settings",
40-
Icon: AdminIcon,
41-
},
4224
]
4325

4426
export const AdminDropdown: React.FC = () => {

site/src/pages/OrgsPage/OrgsPage.tsx

-5
This file was deleted.

site/src/pages/SettingsPage/SettingsPage.tsx

-5
This file was deleted.

0 commit comments

Comments
 (0)