Skip to content
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

Polish Admin UI header & navigation #2897

Merged
merged 4 commits into from
Mar 22, 2023
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ The types of changes are:
* Improved standard layout for large width screens and polished misc. pages [#2869](https://github.com/ethyca/fides/pull/2869)
* Deprecated adding scopes to users directly; you can only add roles. [#2848](https://github.com/ethyca/fides/pull/2848/files)
* Changed About Fides page to say "Fides Core Version:" over "Version". [#2899](https://github.com/ethyca/fides/pull/2899)
* Polish Admin UI header & navigation [#2897](https://github.com/ethyca/fides/pull/2897)

### Fixed
* Restricted Contributors from being able to create Owners [#2888](https://github.com/ethyca/fides/pull/2888)


## [2.9.1](https://github.com/ethyca/fides/compare/2.9.0...2.9.1)

### Added
Expand Down
14 changes: 7 additions & 7 deletions clients/admin-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/admin-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@fidesui/components": "^0.2.2",
"@fidesui/components": "^0.3.0",
"@fidesui/react": "^0.0.21",
"@fontsource/inter": "^4.5.4",
"@monaco-editor/react": "^4.4.5",
Expand Down
102 changes: 48 additions & 54 deletions clients/admin-ui/src/features/common/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import NextLink from "next/link";
import React from "react";
import { useDispatch, useSelector } from "react-redux";

import logoImage from "~/../public/logo.svg";
import { INDEX_ROUTE } from "~/constants";
import { logout, selectUser, useLogoutMutation } from "~/features/auth";
import Image from "~/features/common/Image";
Expand All @@ -37,63 +38,56 @@ const Header: React.FC = () => {
};

return (
<header>
<Flex
bg="gray.50"
width="100%"
py={3}
px={10}
justifyContent="space-between"
alignItems="center"
>
<NextLink href={INDEX_ROUTE} passHref>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<Link display="flex">
<Image src="/logo.svg" width={83} height={26} alt="Fides Logo" />
</Link>
</NextLink>
<Flex alignItems="center">
{username ? (
<Menu>
<MenuButton
as={Button}
size="sm"
variant="ghost"
data-testid="header-menu-button"
>
<UserIcon color="gray.700" />
</MenuButton>
<MenuList shadow="xl">
<Stack px={3} py={2} spacing={1}>
<Text fontWeight="medium">{username}</Text>
</Stack>
<Flex
as="header"
height={12}
width="100%"
paddingX={10}
flexShrink={0}
justifyContent="space-between"
alignItems="center"
backgroundColor="gray.50"
>
<NextLink href={INDEX_ROUTE} passHref>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<Link display="flex">
<Image src={logoImage} width={83} height={26} alt="Fides Logo" />
</Link>
</NextLink>
<Flex alignItems="center">
<Link href="https://ethyca.github.io/fides/" isExternal>
<Button size="sm" variant="ghost">
<QuestionIcon color="gray.700" boxSize={4} />
</Button>
</Link>
{username && (
<Menu>
<MenuButton
as={Button}
size="sm"
variant="ghost"
data-testid="header-menu-button"
>
<UserIcon color="gray.700" />
</MenuButton>
<MenuList shadow="xl">
<Stack px={3} py={2} spacing={1}>
<Text fontWeight="medium">{username}</Text>
</Stack>

<MenuDivider />
<MenuItem
_focus={{ color: "complimentary.500", bg: "gray.100" }}
onClick={handleLogout}
data-testid="header-menu-sign-out"
>
Sign out
</MenuItem>
</MenuList>
</Menu>
) : (
<>
<QuestionIcon boxSize={5} />
<Link
href="https://ethyca.github.io/fides/"
isExternal
color="gray.700"
fontWeight="400"
<MenuDivider />
<MenuItem
_focus={{ color: "complimentary.500", bg: "gray.100" }}
onClick={handleLogout}
data-testid="header-menu-sign-out"
>
Get help (Fides community)
</Link>
</>
)}
</Flex>
Sign out
</MenuItem>
</MenuList>
</Menu>
)}
</Flex>
</header>
</Flex>
);
};

Expand Down
7 changes: 4 additions & 3 deletions clients/admin-ui/src/features/common/nav/v2/NavTopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ export const NavTopBar = () => {
return (
<Flex
as="nav"
height={12}
paddingX={10}
gap={1}
px={10}
py={2}
flexShrink={0}
alignItems="center"
borderBottom="1px"
borderTop="1px"
borderColor="gray.100"
>
{nav.groups.map((group) => {
Expand Down