diff --git a/__test__/projects/projectNavigator.test.ts b/__test__/projects/projectNavigator.test.ts index 66a80099..9e601d2c 100644 --- a/__test__/projects/projectNavigator.test.ts +++ b/__test__/projects/projectNavigator.test.ts @@ -12,8 +12,7 @@ test("It navigates to first specification when changing version", async () => { specifications: [{ id: "baz.yml", name: "baz.yml", - url: "https://example.com/baz.yml", - editURL: "https://example.com/edit/baz.yml" + url: "https://example.com/baz.yml" }] }, { id: "hello", @@ -21,8 +20,7 @@ test("It navigates to first specification when changing version", async () => { specifications: [{ id: "world.yml", name: "world.yml", - url: "https://example.com/world.yml", - editURL: "https://example.com/edit/world.yml" + url: "https://example.com/world.yml" }] }] }, @@ -34,8 +32,7 @@ test("It navigates to first specification when changing version", async () => { specification: { id: "baz.yml", name: "baz.yml", - url: "https://example.com/baz.yml", - editURL: "https://example.com/edit/baz.yml" + url: "https://example.com/baz.yml" } } let pushedPath: string | undefined @@ -60,8 +57,7 @@ test("It navigates when selecting specification", async () => { specifications: [{ id: "hello.yml", name: "hello.yml", - url: "https://example.com/hello.yml", - editURL: "https://example.com/edit/hello.yml" + url: "https://example.com/hello.yml" }] }] }, @@ -71,15 +67,13 @@ test("It navigates when selecting specification", async () => { specifications: [{ id: "hello.yml", name: "hello.yml", - url: "https://example.com/hello.yml", - editURL: "https://example.com/edit/hello.yml" + url: "https://example.com/hello.yml" }] }, specification: { id: "baz.yml", name: "baz.yml", - url: "https://example.com/baz.yml", - editURL: "https://example.com/edit/baz.yml" + url: "https://example.com/baz.yml" } } let pushedPath: string | undefined @@ -111,8 +105,7 @@ test("It navigates even when new specification could not be found", async () => specification: { id: "baz.yml", name: "baz.yml", - url: "https://example.com/baz.yml", - editURL: "https://example.com/edit/baz.yml" + url: "https://example.com/baz.yml" } } let pushedPath: string | undefined @@ -137,13 +130,11 @@ test("It finds a specification with the same name when changing version", async specifications: [{ id: "hello.yml", name: "hello.yml", - url: "https://example.com/hello.yml", - editURL: "https://example.com/edit/hello.yml" + url: "https://example.com/hello.yml" }, { id: "earth.yml", name: "earth.yml", - url: "https://example.com/earth.yml", - editURL: "https://example.com/edit/earth.yml" + url: "https://example.com/earth.yml" }] }, { id: "baz", @@ -151,23 +142,19 @@ test("It finds a specification with the same name when changing version", async specifications: [{ id: "moon.yml", name: "moon.yml", - url: "https://example.com/moon.yml", - editURL: "https://example.com/edit/moon.yml" + url: "https://example.com/moon.yml" }, { id: "saturn.yml", name: "saturn.yml", - url: "https://example.com/saturn.yml", - editURL: "https://example.com/edit/saturn.yml" + url: "https://example.com/saturn.yml" }, { id: "earth.yml", name: "earth.yml", - url: "https://example.com/earth.yml", - editURL: "https://example.com/edit/earth.yml" + url: "https://example.com/earth.yml" }, { id: "jupiter.yml", name: "jupiter.yml", - url: "https://example.com/jupiter.yml", - editURL: "https://example.com/edit/jupiter.yml" + url: "https://example.com/jupiter.yml" }] }] }, @@ -179,8 +166,7 @@ test("It finds a specification with the same name when changing version", async specification: { id: "earth.yml", name: "earth.yml", - url: "https://example.com/earth.yml", - editURL: "https://example.com/edit/earth.yml" + url: "https://example.com/earth.yml" } } let pushedPath: string | undefined diff --git a/src/common/SidebarContainer.tsx b/src/common/SidebarContainer.tsx index 3b08b0df..985b8c70 100644 --- a/src/common/SidebarContainer.tsx +++ b/src/common/SidebarContainer.tsx @@ -2,6 +2,7 @@ import dynamic from "next/dynamic" import { ReactNode } from "react" import Image from "next/image" import { Box, Stack } from "@mui/material" +import { useTheme } from "@mui/material/styles" import { useSessionStorage } from "usehooks-ts" import ClientSidebarContainer from "./client/SidebarContainer" import SidebarContent from "./SidebarContent" @@ -18,6 +19,7 @@ const SidebarContainer: React.FC = ({ toolbarTrailing }) => { const [open, setOpen] = useSessionStorage("isDrawerOpen", true) + const theme = useTheme() return ( = ({ {toolbarTrailing} diff --git a/src/features/projects/data/GitHubProjectRepository.ts b/src/features/projects/data/GitHubProjectRepository.ts index f3c38017..9b378375 100644 --- a/src/features/projects/data/GitHubProjectRepository.ts +++ b/src/features/projects/data/GitHubProjectRepository.ts @@ -102,7 +102,8 @@ export default class GitHubProjectRepository implements IProjectRepository { return e.specifications.length > 0 }), @@ -172,7 +173,8 @@ export default class GitHubProjectRepository implements IProjectRepository( - {project.name} + {project.displayName || project.name} } /> diff --git a/src/features/projects/view/ProjectsPageTrailingToolbarItem.tsx b/src/features/projects/view/ProjectsPageTrailingToolbarItem.tsx index c923edc0..b6f7537f 100644 --- a/src/features/projects/view/ProjectsPageTrailingToolbarItem.tsx +++ b/src/features/projects/view/ProjectsPageTrailingToolbarItem.tsx @@ -1,4 +1,4 @@ -import { Stack, IconButton } from "@mui/material" +import { Stack, IconButton, Typography, Link } from "@mui/material" import { ProjectPageStateContainer, ProjectPageState } from "../domain/ProjectPageState" import VersionSelector from "./docs/VersionSelector" import SpecificationSelector from "./docs/SpecificationSelector" @@ -18,12 +18,30 @@ const ProjectsPageTrailingToolbarItem = ( switch (stateContainer.state) { case ProjectPageState.HAS_SELECTION: return ( - + + {stateContainer.selection!.version.url && + + {stateContainer.selection!.project.name} + + } + {!stateContainer.selection!.version.url && + + {stateContainer.selection!.project.name} + + } + / + /