Skip to content

Commit

Permalink
Fix back path for adding systems
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonking committed Jan 11, 2024
1 parent 6e30e06 commit 20126f5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
5 changes: 2 additions & 3 deletions clients/admin-ui/src/pages/add-systems/manual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { useRouter } from "next/router";
import React, { useMemo } from "react";

import { useAppSelector } from "~/app/hooks";
import { useSystemOrDatamapRoute } from "~/features/common/hooks/useSystemOrDatamapRoute";
import Layout from "~/features/common/Layout";
import BackButton from "~/features/common/nav/v2/BackButton";
import { ADD_SYSTEMS_ROUTE } from "~/features/common/nav/v2/routes";
import ConnectionTypeLogo from "~/features/datastore-connections/ConnectionTypeLogo";
import { selectLockedForGVL } from "~/features/system/dictionary-form/dict-suggestion.slice";
import GVLNotice from "~/features/system/GVLNotice";
Expand All @@ -26,7 +26,6 @@ const Header = ({ connector }: { connector?: ConnectionSystemTypeMap }) => (
);

const NewManualSystem: NextPage = () => {
const { systemOrDatamapRoute } = useSystemOrDatamapRoute();
const router = useRouter();
const { connectorType } = router.query;

Expand All @@ -45,7 +44,7 @@ const NewManualSystem: NextPage = () => {

return (
<Layout title="Describe your system">
<BackButton backPath={systemOrDatamapRoute} />
<BackButton backPath={ADD_SYSTEMS_ROUTE} />
<Header connector={connector} />

{lockedForGVL ? <GVLNotice /> : null}
Expand Down
38 changes: 17 additions & 21 deletions clients/admin-ui/src/pages/add-systems/multiple.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Box, Heading, Link, Text } from "@fidesui/react";
import type { NextPage } from "next";

import { useSystemOrDatamapRoute } from "~/features/common/hooks/useSystemOrDatamapRoute";
import Layout from "~/features/common/Layout";
import BackButton from "~/features/common/nav/v2/BackButton";
import {
ADD_SYSTEMS_MANUAL_ROUTE,
ADD_SYSTEMS_ROUTE,
DATAMAP_ROUTE,
} from "~/features/common/nav/v2/routes";
import { AddMultipleSystems } from "~/features/system/add-multiple-systems/AddMultipleSystems";
Expand All @@ -21,25 +21,21 @@ const Header = () => (
</Box>
);

const AddMultipleSystemsPage: NextPage = () => {
const { systemOrDatamapRoute } = useSystemOrDatamapRoute();

return (
<Layout title="Describe your system">
<BackButton backPath={systemOrDatamapRoute} />
<Header />
<Box w={{ base: "100%", md: "75%" }}>
<Text fontSize="sm" mb={8}>
{DESCRIBE_SYSTEM_COPY}
<Link href={ADD_SYSTEMS_MANUAL_ROUTE} color="complimentary.500">
{" "}
click here.{" "}
</Link>
</Text>
</Box>
<AddMultipleSystems redirectRoute={DATAMAP_ROUTE} />
</Layout>
);
};
const AddMultipleSystemsPage: NextPage = () => (
<Layout title="Describe your system">
<BackButton backPath={ADD_SYSTEMS_ROUTE} />
<Header />
<Box w={{ base: "100%", md: "75%" }}>
<Text fontSize="sm" mb={8}>
{DESCRIBE_SYSTEM_COPY}
<Link href={ADD_SYSTEMS_MANUAL_ROUTE} color="complimentary.500">
{" "}
click here.{" "}
</Link>
</Text>
</Box>
<AddMultipleSystems redirectRoute={DATAMAP_ROUTE} />
</Layout>
);

export default AddMultipleSystemsPage;

0 comments on commit 20126f5

Please sign in to comment.