Skip to content

fix: remove unused pages from Admin dropdown (org and settings) #1788

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

Merged
merged 2 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions site/src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { NotFoundPage } from "./pages/404Page/404Page"
import { CliAuthenticationPage } from "./pages/CliAuthPage/CliAuthPage"
import { HealthzPage } from "./pages/HealthzPage/HealthzPage"
import { LoginPage } from "./pages/LoginPage/LoginPage"
import { OrgsPage } from "./pages/OrgsPage/OrgsPage"
import { SettingsPage } from "./pages/SettingsPage/SettingsPage"
import { AccountPage } from "./pages/SettingsPages/AccountPage/AccountPage"
import { SSHKeysPage } from "./pages/SettingsPages/SSHKeysPage/SSHKeysPage"
import { TemplatePage } from "./pages/TemplatePage/TemplatePage"
Expand Down Expand Up @@ -134,22 +132,6 @@ export const AppRouter: React.FC = () => (
}
/>
</Route>
<Route
path="orgs"
element={
<AuthAndFrame>
<OrgsPage />
</AuthAndFrame>
}
/>
<Route
path="settings"
element={
<AuthAndFrame>
<SettingsPage />
</AuthAndFrame>
}
/>

<Route path="settings" element={<SettingsLayout />}>
<Route path="account" element={<AccountPage />} />
Expand Down
20 changes: 0 additions & 20 deletions site/src/components/AdminDropdown/AdminDropdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ describe("AdminDropdown", () => {
it("opens the menu", async () => {
await renderAndClick()
expect(screen.getByText(Language.usersLabel)).toBeDefined()
expect(screen.getByText(Language.orgsLabel)).toBeDefined()
expect(screen.getByText(Language.settingsLabel)).toBeDefined()
})
})

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

expect(history.location.pathname).toEqual("/users")
})

it("links to the orgs page", async () => {
await renderAndClick()

const usersLink = screen.getByText(Language.orgsLabel).closest("a")
usersLink?.click()

expect(history.location.pathname).toEqual("/orgs")
})

it("links to the settings page", async () => {
await renderAndClick()

const usersLink = screen.getByText(Language.settingsLabel).closest("a")
usersLink?.click()

expect(history.location.pathname).toEqual("/settings")
})
})
18 changes: 0 additions & 18 deletions site/src/components/AdminDropdown/AdminDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import ListItem from "@material-ui/core/ListItem"
import ListItemText from "@material-ui/core/ListItemText"
import { fade, makeStyles, Theme } from "@material-ui/core/styles"
import AdminIcon from "@material-ui/icons/SettingsOutlined"
import React, { useState } from "react"
import { navHeight } from "../../theme/constants"
import { BorderedMenu } from "../BorderedMenu/BorderedMenu"
import { BorderedMenuRow } from "../BorderedMenuRow/BorderedMenuRow"
import { CloseDropdown, OpenDropdown } from "../DropdownArrows/DropdownArrows"
import { BuildingIcon } from "../Icons/BuildingIcon"
import { UsersOutlinedIcon } from "../Icons/UsersOutlinedIcon"

export const Language = {
menuTitle: "Admin",
usersLabel: "Users",
usersDescription: "Manage users, roles, and permissions.",
orgsLabel: "Organizations",
orgsDescription: "Manage organizations.",
settingsLabel: "Settings",
settingsDescription: "Configure authentication and more.",
}

const entries = [
Expand All @@ -27,18 +21,6 @@ const entries = [
path: "/users",
Icon: UsersOutlinedIcon,
},
{
label: Language.orgsLabel,
description: Language.orgsDescription,
path: "/orgs",
Icon: BuildingIcon,
},
{
label: Language.settingsLabel,
description: Language.settingsDescription,
path: "/settings",
Icon: AdminIcon,
},
]

export const AdminDropdown: React.FC = () => {
Expand Down
5 changes: 0 additions & 5 deletions site/src/pages/OrgsPage/OrgsPage.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions site/src/pages/SettingsPage/SettingsPage.tsx

This file was deleted.