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

3631: add gear icon to nav #3701

Merged
merged 13 commits into from
Jun 30, 2023
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ The types of changes are:

### Changed
- Moved GPC preferences slightly earlier in Fides.js lifecycle [#3561](https://github.com/ethyca/fides/pull/3561)
<<<<<<< HEAD
jpople marked this conversation as resolved.
Show resolved Hide resolved
- Moved "management" tab from nav into settings icon in top right [#3701](https://github.com/ethyca/fides/pull/3701)
=======
- Update EU PrivacyNoticeRegion codes and allow experience filtering to drop back to country filtering if region not found [#3630](https://github.com/ethyca/fides/pull/3630)
>>>>>>> main


## [2.15.0](https://github.com/ethyca/fides/compare/2.14.1...2.15.0)
Expand Down
8 changes: 8 additions & 0 deletions clients/admin-ui/src/features/common/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
MenuItem,
MenuList,
QuestionIcon,
SettingsIcon,
Stack,
Text,
UserIcon,
Expand All @@ -21,6 +22,8 @@ import { INDEX_ROUTE } from "~/constants";
import { logout, selectUser, useLogoutMutation } from "~/features/auth";
import Image from "~/features/common/Image";

import { USER_MANAGEMENT_ROUTE } from "./nav/v2/routes";

const useHeader = () => {
const { username } = useAppSelector(selectUser) ?? { username: "" };
return { username };
Expand Down Expand Up @@ -59,6 +62,11 @@ const Header: React.FC = () => {
<QuestionIcon color="gray.700" boxSize={4} />
</Button>
</Link>
<NextLink href={USER_MANAGEMENT_ROUTE} passHref>
<Button size="sm" variant="ghost">
jpople marked this conversation as resolved.
Show resolved Hide resolved
<SettingsIcon color="gray.700" boxSize={4} />
</Button>
</NextLink>
{username && (
<Menu>
<MenuButton
Expand Down
21 changes: 13 additions & 8 deletions clients/admin-ui/src/features/common/nav/v2/NavTopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ export const NavTopBar = () => {
borderColor="gray.100"
>
{nav.groups.map((group) => {
// The group links to its first child's path.
const { path } = group.children[0]!;
// "Management" is navigated to via the gear icon, so don't display it in the nav
if (group.title !== "Management") {
jpople marked this conversation as resolved.
Show resolved Hide resolved
// The group links to its first child's path.
const { path } = group.children[0]!;

const isActive = group.title === nav.active?.title;
const isActive = group.title === nav.active?.title;

return (
<NavTopBarLink key={group.title} href={path} isActive={isActive}>
{group.title}
</NavTopBarLink>
);
return (
<NavTopBarLink key={group.title} href={path} isActive={isActive}>
{group.title}
</NavTopBarLink>
);
}

return null;
})}
</Flex>
);
Expand Down
29 changes: 10 additions & 19 deletions clients/admin-ui/src/features/common/nav/v2/nav-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,8 @@ describe("configureNavGroups", () => {
children: [{ title: "Home", path: "/" }],
});

expect(navGroups[1]).toMatchObject({
title: "Privacy requests",
children: [
{ title: "Request manager", path: routes.PRIVACY_REQUESTS_ROUTE },
{
title: "Connection manager",
path: routes.DATASTORE_CONNECTION_ROUTE,
},
],
});

// NOTE: the data map should _not_ include the Plus routes (/plus/datamap, /classify-systems, etc.)
expect(navGroups[2]).toMatchObject({
expect(navGroups[1]).toMatchObject({
title: "Data map",
children: [
{ title: "View systems", path: routes.SYSTEM_ROUTE },
Expand All @@ -56,12 +45,14 @@ describe("configureNavGroups", () => {
],
});

expect(navGroups[3]).toMatchObject({
title: "Management",
expect(navGroups[2]).toMatchObject({
title: "Privacy requests",
children: [
{ title: "Users", path: routes.USER_MANAGEMENT_ROUTE },
{ title: "Taxonomy", path: routes.TAXONOMY_ROUTE },
{ title: "About Fides", path: routes.ABOUT_ROUTE },
{ title: "Request manager", path: routes.PRIVACY_REQUESTS_ROUTE },
{
title: "Connection manager",
path: routes.DATASTORE_CONNECTION_ROUTE,
},
],
});
});
Expand All @@ -79,7 +70,7 @@ describe("configureNavGroups", () => {
});

// The data map _should_ include the actual "/plus/datamap".
expect(navGroups[2]).toMatchObject({
expect(navGroups[1]).toMatchObject({
title: "Data map",
children: [
{ title: "View map", path: routes.DATAMAP_ROUTE },
Expand Down Expand Up @@ -147,7 +138,7 @@ describe("configureNavGroups", () => {
});

// The data map should _not_ include the actual "/plus/datamap".
expect(navGroups[2]).toMatchObject({
expect(navGroups[1]).toMatchObject({
title: "Data map",
children: [
{ title: "View systems", path: routes.SYSTEM_ROUTE },
Expand Down
70 changes: 35 additions & 35 deletions clients/admin-ui/src/features/common/nav/v2/nav-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,41 @@ export const NAV_CONFIG: NavConfigGroup[] = [
},
],
},
{
title: "Data map",
routes: [
{
title: "View map",
path: routes.DATAMAP_ROUTE,
requiresPlus: true,
scopes: [ScopeRegistryEnum.DATAMAP_READ],
},
{
title: "View systems",
path: routes.SYSTEM_ROUTE,
scopes: [ScopeRegistryEnum.SYSTEM_READ],
},
{
title: "Add systems",
path: routes.ADD_SYSTEMS_ROUTE,
scopes: [ScopeRegistryEnum.SYSTEM_CREATE],
},
{
title: "Manage datasets",
path: routes.DATASET_ROUTE,
scopes: [
ScopeRegistryEnum.CTL_DATASET_CREATE,
ScopeRegistryEnum.CTL_DATASET_UPDATE,
],
},
{
title: "Classify systems",
path: routes.CLASSIFY_SYSTEMS_ROUTE,
requiresPlus: true,
scopes: [ScopeRegistryEnum.SYSTEM_UPDATE], // temporary scope until we decide what to do here
},
],
},
{
title: "Privacy requests",
routes: [
Expand Down Expand Up @@ -79,41 +114,6 @@ export const NAV_CONFIG: NavConfigGroup[] = [
},
],
},
{
title: "Data map",
routes: [
{
title: "View map",
path: routes.DATAMAP_ROUTE,
requiresPlus: true,
scopes: [ScopeRegistryEnum.DATAMAP_READ],
},
{
title: "View systems",
path: routes.SYSTEM_ROUTE,
scopes: [ScopeRegistryEnum.SYSTEM_READ],
},
{
title: "Add systems",
path: routes.ADD_SYSTEMS_ROUTE,
scopes: [ScopeRegistryEnum.SYSTEM_CREATE],
},
{
title: "Manage datasets",
path: routes.DATASET_ROUTE,
scopes: [
ScopeRegistryEnum.CTL_DATASET_CREATE,
ScopeRegistryEnum.CTL_DATASET_UPDATE,
],
},
{
title: "Classify systems",
path: routes.CLASSIFY_SYSTEMS_ROUTE,
requiresPlus: true,
scopes: [ScopeRegistryEnum.SYSTEM_UPDATE], // temporary scope until we decide what to do here
},
],
},
{
title: "Management",
routes: [
Expand Down