From ee016c4812e0981b9b4ee85f0be902d4a23a1335 Mon Sep 17 00:00:00 2001 From: Jones Ogolo <47540149+Jay-Topher@users.noreply.github.com> Date: Fri, 24 Nov 2023 13:39:27 +0100 Subject: [PATCH] fix: update dashboard to network discovery url (#5220) --- .../with-users/dashboard/dashboard.spec.ts | 4 +-- cypress/e2e/with-users/machines/list.spec.ts | 4 +-- sitespeed.io/login.js | 2 +- src/app/Routes.test.tsx | 4 +-- src/app/Routes.tsx | 14 +++++++-- .../components/AppSideNavigation/constants.ts | 2 +- src/app/base/side-panel-context.tsx | 12 ++++---- src/app/base/urls.ts | 4 +-- src/app/dashboard/urls.ts | 6 ---- .../DashboardConfigurationSubnetForm/index.ts | 1 - .../views/DashboardConfigurationForm/index.ts | 1 - .../dashboard/views/DashboardHeader/index.ts | 1 - .../IntroSection/IntroSection.test.tsx | 6 ++-- src/app/intro/hooks.test.tsx | 2 +- src/app/intro/hooks.ts | 6 +--- src/app/intro/views/Intro.test.tsx | 2 +- .../MaasIntroSuccess.test.tsx | 4 +-- .../intro/views/UserIntro/UserIntro.test.tsx | 4 +-- src/app/networkDiscovery/urls.ts | 8 +++++ .../DiscoveriesFilterAccordion.test.tsx | 0 .../DiscoveriesFilterAccordion.tsx | 0 .../DiscoveriesFilterAccordion/index.ts | 0 .../DiscoveriesList/DiscoveriesList.test.tsx | 2 +- .../views/DiscoveriesList/DiscoveriesList.tsx | 2 +- .../views/DiscoveriesList/_index.scss | 0 .../views/DiscoveriesList/index.ts | 0 .../DiscoveryAddForm.test.tsx | 16 +++++----- .../DiscoveryAddForm/DiscoveryAddForm.tsx | 0 .../DiscoveryAddFormFields.test.tsx | 12 ++++---- .../DiscoveryAddFormFields.tsx | 0 .../DiscoveryAddFormFields/index.ts | 0 .../views/DiscoveryAddForm/index.ts | 0 .../views/DiscoveryAddForm/types.ts | 0 .../views/NetworkDiscovery.test.tsx} | 30 +++++++++---------- .../views/NetworkDiscovery.tsx} | 25 +++++++++------- .../NetworkDiscoveryConfigurationForm.tsx} | 8 ++--- ...DiscoveryConfigurationSubnetForm.test.tsx} | 18 +++++------ ...tworkDiscoveryConfigurationSubnetForm.tsx} | 4 +-- .../index.ts | 1 + .../index.ts | 1 + .../ClearAllForm/ClearAllForm.test.tsx | 8 ++--- .../ClearAllForm/ClearAllForm.tsx | 0 .../ClearAllForm/index.ts | 0 .../NetworkDiscoveryHeader.test.tsx} | 30 +++++++++++-------- .../NetworkDiscoveryHeader.tsx} | 16 +++++----- .../views/NetworkDiscoveryHeader/index.ts | 1 + .../views/constants.ts | 6 ++-- .../components/MapSubnet/MapSubnet.tsx | 4 +-- src/scss/index.scss | 4 +-- 49 files changed, 144 insertions(+), 131 deletions(-) delete mode 100644 src/app/dashboard/urls.ts delete mode 100644 src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/index.ts delete mode 100644 src/app/dashboard/views/DashboardConfigurationForm/index.ts delete mode 100644 src/app/dashboard/views/DashboardHeader/index.ts create mode 100644 src/app/networkDiscovery/urls.ts rename src/app/{dashboard => networkDiscovery}/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.test.tsx (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.tsx (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveriesList/DiscoveriesFilterAccordion/index.ts (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveriesList/DiscoveriesList.test.tsx (99%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveriesList/DiscoveriesList.tsx (99%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveriesList/_index.scss (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveriesList/index.ts (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveryAddForm/DiscoveryAddForm.test.tsx (96%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveryAddForm/DiscoveryAddForm.tsx (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.test.tsx (95%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.tsx (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveryAddForm/DiscoveryAddFormFields/index.ts (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveryAddForm/index.ts (100%) rename src/app/{dashboard => networkDiscovery}/views/DiscoveryAddForm/types.ts (100%) rename src/app/{dashboard/views/Dashboard.test.tsx => networkDiscovery/views/NetworkDiscovery.test.tsx} (71%) rename src/app/{dashboard/views/Dashboard.tsx => networkDiscovery/views/NetworkDiscovery.tsx} (71%) rename src/app/{dashboard/views/DashboardConfigurationForm/DashboardConfigurationForm.tsx => networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationForm.tsx} (55%) rename src/app/{dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/DashboardConfigurationSubnetForm.test.tsx => networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/NetworkDiscoveryConfigurationSubnetForm.test.tsx} (86%) rename src/app/{dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/DashboardConfigurationSubnetForm.tsx => networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/NetworkDiscoveryConfigurationSubnetForm.tsx} (97%) create mode 100644 src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/index.ts create mode 100644 src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/index.ts rename src/app/{dashboard/views/DashboardHeader => networkDiscovery/views/NetworkDiscoveryHeader}/ClearAllForm/ClearAllForm.test.tsx (95%) rename src/app/{dashboard/views/DashboardHeader => networkDiscovery/views/NetworkDiscoveryHeader}/ClearAllForm/ClearAllForm.tsx (100%) rename src/app/{dashboard/views/DashboardHeader => networkDiscovery/views/NetworkDiscoveryHeader}/ClearAllForm/index.ts (100%) rename src/app/{dashboard/views/DashboardHeader/DashboardHeader.test.tsx => networkDiscovery/views/NetworkDiscoveryHeader/NetworkDiscoveryHeader.test.tsx} (69%) rename src/app/{dashboard/views/DashboardHeader/DashboardHeader.tsx => networkDiscovery/views/NetworkDiscoveryHeader/NetworkDiscoveryHeader.tsx} (76%) create mode 100644 src/app/networkDiscovery/views/NetworkDiscoveryHeader/index.ts rename src/app/{dashboard => networkDiscovery}/views/constants.ts (53%) diff --git a/cypress/e2e/with-users/dashboard/dashboard.spec.ts b/cypress/e2e/with-users/dashboard/dashboard.spec.ts index fbaef229d9..8ecab9a900 100644 --- a/cypress/e2e/with-users/dashboard/dashboard.spec.ts +++ b/cypress/e2e/with-users/dashboard/dashboard.spec.ts @@ -1,9 +1,9 @@ import { generateMAASURL } from "../../utils"; -context("Dashboard", () => { +context("Network Discovery", () => { beforeEach(() => { cy.login(); - cy.visit(generateMAASURL("/dashboard")); + cy.visit(generateMAASURL("/network-discovery")); }); it("renders the correct heading", () => { diff --git a/cypress/e2e/with-users/machines/list.spec.ts b/cypress/e2e/with-users/machines/list.spec.ts index d9ed28723b..975c052176 100644 --- a/cypress/e2e/with-users/machines/list.spec.ts +++ b/cypress/e2e/with-users/machines/list.spec.ts @@ -64,8 +64,8 @@ context("Machine listing", () => { }); it("replaces the URL when selecting filters", () => { - // visit the dashboard first to have a page to go back to - const intialPage = generateMAASURL("/dashboard"); + // visit network discovery first to have a page to go back to + const intialPage = generateMAASURL("/network-discovery"); cy.visit(intialPage); cy.visit(generateMAASURL("/machines")); diff --git a/sitespeed.io/login.js b/sitespeed.io/login.js index 22f5a72fe1..484edaab48 100644 --- a/sitespeed.io/login.js +++ b/sitespeed.io/login.js @@ -13,7 +13,7 @@ module.exports = async function (context, commands) { name: "skipintro", value: "true", }); - await commands.navigate(constructURL(context, "/dashboard")); + await commands.navigate(constructURL(context, "/network-discovery")); await commands.wait.bySelector("input[name='username']", TIMEOUT); await commands.addText.byName("admin", "username"); await commands.addText.byName("test", "password"); diff --git a/src/app/Routes.test.tsx b/src/app/Routes.test.tsx index 96c281a28c..181700b4cb 100644 --- a/src/app/Routes.test.tsx +++ b/src/app/Routes.test.tsx @@ -113,8 +113,8 @@ const routes: { title: string; path: string }[] = [ path: urls.zones.details({ id: 1 }), }, { - title: "Dashboard", - path: urls.dashboard.index, + title: "Network Discovery", + path: urls.networkDiscovery.index, }, ]; diff --git a/src/app/Routes.tsx b/src/app/Routes.tsx index 178080f1e3..8d6db4061b 100644 --- a/src/app/Routes.tsx +++ b/src/app/Routes.tsx @@ -6,7 +6,6 @@ import urls from "app/base/urls"; import NotFound from "app/base/views/NotFound"; import ControllerDetails from "app/controllers/views/ControllerDetails"; import ControllerList from "app/controllers/views/ControllerList"; -import Dashboard from "app/dashboard/views/Dashboard"; import DeviceDetails from "app/devices/views/DeviceDetails"; import DeviceList from "app/devices/views/DeviceList"; import DomainDetails from "app/domains/views/DomainDetails"; @@ -16,6 +15,7 @@ import Intro from "app/intro/views/Intro"; import KVM from "app/kvm/views/KVM"; import MachineDetails from "app/machines/views/MachineDetails"; import Machines from "app/machines/views/Machines"; +import NetworkDiscovery from "app/networkDiscovery/views/NetworkDiscovery"; import Pools from "app/pools/views/Pools"; import Preferences from "app/preferences/views/Preferences"; import Settings from "app/settings/views/Settings"; @@ -58,10 +58,18 @@ const Routes = (): JSX.Element => ( - + } - path={`${urls.dashboard.index}/*`} + path={`${urls.networkDiscovery.index}/*`} + /> + } + path={urls.networkDiscovery.legacyIndex} + /> + } + path={urls.networkDiscovery.legacyConfiguration} /> { , { state } ); - expect(history.location.pathname).toBe(urls.dashboard.index); + expect(history.location.pathname).toBe(urls.machines.index); }); - it("redirects to the dashboard for admins", () => { + it("redirects to the machine list for admins", () => { state.user = userStateFactory({ auth: authStateFactory({ user: userFactory({ completed_intro: true, is_superuser: true }), @@ -69,7 +69,7 @@ describe("IntroSection", () => { Intro content, { route: "/intro/user", state } ); - expect(window.location.pathname).toBe(urls.dashboard.index); + expect(window.location.pathname).toBe(urls.machines.index); }); it("redirects to the machine list for non-admins", () => { diff --git a/src/app/intro/hooks.test.tsx b/src/app/intro/hooks.test.tsx index 91086dcdb2..2c1fffca61 100644 --- a/src/app/intro/hooks.test.tsx +++ b/src/app/intro/hooks.test.tsx @@ -47,7 +47,7 @@ describe("hooks", () => { const { result } = renderHook(() => useExitURL(), { wrapper: generateWrapper(store), }); - expect(result.current).toBe(urls.dashboard.index); + expect(result.current).toBe(urls.machines.index); }); it("gets the exit URL for a non-admin", () => { diff --git a/src/app/intro/hooks.ts b/src/app/intro/hooks.ts index 378d8c7478..d3934faaaa 100644 --- a/src/app/intro/hooks.ts +++ b/src/app/intro/hooks.ts @@ -1,13 +1,9 @@ -import { useSelector } from "react-redux"; - import urls from "app/base/urls"; -import authSelectors from "app/store/auth/selectors"; /** * Get the URL to redirect to when the intro closes. * @returns The URL to redirect to. */ export const useExitURL = (): string => { - const authUser = useSelector(authSelectors.get); - return authUser?.is_superuser ? urls.dashboard.index : urls.machines.index; + return urls.machines.index; }; diff --git a/src/app/intro/views/Intro.test.tsx b/src/app/intro/views/Intro.test.tsx index a4ec3de55a..870fb4d8b1 100644 --- a/src/app/intro/views/Intro.test.tsx +++ b/src/app/intro/views/Intro.test.tsx @@ -67,7 +67,7 @@ describe("Intro", () => { route: "/intro", state, }); - expect(window.location.pathname).toBe(urls.dashboard.index); + expect(window.location.pathname).toBe(urls.machines.index); }); it("returns to the start when loading the user intro and the main intro is incomplete", () => { diff --git a/src/app/intro/views/MaasIntroSuccess/MaasIntroSuccess.test.tsx b/src/app/intro/views/MaasIntroSuccess/MaasIntroSuccess.test.tsx index 3f95e82ad3..b0f6d70c96 100644 --- a/src/app/intro/views/MaasIntroSuccess/MaasIntroSuccess.test.tsx +++ b/src/app/intro/views/MaasIntroSuccess/MaasIntroSuccess.test.tsx @@ -57,7 +57,7 @@ describe("MaasIntroSuccess", () => { ).toHaveProperty("href", `http://example.com${urls.intro.user}`); }); - it("links to the dashboard if an admin that has completed the user intro", () => { + it("links to the machine list if an admin that has completed the user intro", () => { state.user.auth = authStateFactory({ user: userFactory({ completed_intro: true, is_superuser: true }), }); @@ -67,7 +67,7 @@ describe("MaasIntroSuccess", () => { }); expect( screen.getByRole("link", { name: MaasIntroSuccessLabels.FinishSetup }) - ).toHaveProperty("href", `http://example.com${urls.dashboard.index}`); + ).toHaveProperty("href", `http://example.com${urls.machines.index}`); }); it("links to the machine list if a non-admin that has completed the user intro", () => { diff --git a/src/app/intro/views/UserIntro/UserIntro.test.tsx b/src/app/intro/views/UserIntro/UserIntro.test.tsx index 18223db2c7..7867dbe59d 100644 --- a/src/app/intro/views/UserIntro/UserIntro.test.tsx +++ b/src/app/intro/views/UserIntro/UserIntro.test.tsx @@ -77,7 +77,7 @@ describe("UserIntro", () => { route: "/intro/user", state, }); - expect(window.location.pathname).toBe(urls.dashboard.index); + expect(window.location.pathname).toBe(urls.machines.index); }); it("disables the continue button if there are no ssh keys", () => { @@ -153,7 +153,7 @@ describe("UserIntro", () => { route: "/intro/user", state, }); - expect(window.location.pathname).toBe(urls.dashboard.index); + expect(window.location.pathname).toBe(urls.machines.index); }); it("can skip the user setup", async () => { diff --git a/src/app/networkDiscovery/urls.ts b/src/app/networkDiscovery/urls.ts new file mode 100644 index 0000000000..b4a97fff8a --- /dev/null +++ b/src/app/networkDiscovery/urls.ts @@ -0,0 +1,8 @@ +const urls = { + configuration: "/network-discovery/configuration", + index: "/network-discovery", + legacyIndex: "/dashboard", + legacyConfiguration: "/dashboard/configuration", +}; + +export default urls; diff --git a/src/app/dashboard/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.test.tsx b/src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.test.tsx similarity index 100% rename from src/app/dashboard/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.test.tsx rename to src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.test.tsx diff --git a/src/app/dashboard/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.tsx b/src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.tsx similarity index 100% rename from src/app/dashboard/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.tsx rename to src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesFilterAccordion/DiscoveriesFilterAccordion.tsx diff --git a/src/app/dashboard/views/DiscoveriesList/DiscoveriesFilterAccordion/index.ts b/src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesFilterAccordion/index.ts similarity index 100% rename from src/app/dashboard/views/DiscoveriesList/DiscoveriesFilterAccordion/index.ts rename to src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesFilterAccordion/index.ts diff --git a/src/app/dashboard/views/DiscoveriesList/DiscoveriesList.test.tsx b/src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesList.test.tsx similarity index 99% rename from src/app/dashboard/views/DiscoveriesList/DiscoveriesList.test.tsx rename to src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesList.test.tsx index 2fbae16682..4b8f5608ab 100644 --- a/src/app/dashboard/views/DiscoveriesList/DiscoveriesList.test.tsx +++ b/src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesList.test.tsx @@ -37,7 +37,7 @@ import { } from "testing/utils"; const mockStore = configureStore(); -const route = "/dashboard"; +const route = "/network-discovery"; describe("DiscoveriesList", () => { let state: RootState; diff --git a/src/app/dashboard/views/DiscoveriesList/DiscoveriesList.tsx b/src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesList.tsx similarity index 99% rename from src/app/dashboard/views/DiscoveriesList/DiscoveriesList.tsx rename to src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesList.tsx index 4a44cc7363..29100706d8 100644 --- a/src/app/dashboard/views/DiscoveriesList/DiscoveriesList.tsx +++ b/src/app/networkDiscovery/views/DiscoveriesList/DiscoveriesList.tsx @@ -192,7 +192,7 @@ const DiscoveriesList = (): JSX.Element => { const saving = useSelector(discoverySelectors.saving); const saved = useSelector(discoverySelectors.saved); - useWindowTitle("Dashboard"); + useWindowTitle("Network Discovery"); useFetchActions([discoveryActions.fetch]); diff --git a/src/app/dashboard/views/DiscoveriesList/_index.scss b/src/app/networkDiscovery/views/DiscoveriesList/_index.scss similarity index 100% rename from src/app/dashboard/views/DiscoveriesList/_index.scss rename to src/app/networkDiscovery/views/DiscoveriesList/_index.scss diff --git a/src/app/dashboard/views/DiscoveriesList/index.ts b/src/app/networkDiscovery/views/DiscoveriesList/index.ts similarity index 100% rename from src/app/dashboard/views/DiscoveriesList/index.ts rename to src/app/networkDiscovery/views/DiscoveriesList/index.ts diff --git a/src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddForm.test.tsx b/src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddForm.test.tsx similarity index 96% rename from src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddForm.test.tsx rename to src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddForm.test.tsx index 06504e21a3..4404b217ba 100644 --- a/src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddForm.test.tsx +++ b/src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddForm.test.tsx @@ -139,7 +139,7 @@ describe("DiscoveryAddForm", () => { const store = mockStore(state); renderWithBrowserRouter( , - { route: "/dashboard", store } + { route: "/network-discovery", store } ); const expectedActions = [ "device/fetch", @@ -164,7 +164,7 @@ describe("DiscoveryAddForm", () => { const store = mockStore(state); renderWithBrowserRouter( , - { route: "/dashboard", store } + { route: "/network-discovery", store } ); expect(screen.getByText("Loading")).toBeInTheDocument(); }); @@ -173,7 +173,7 @@ describe("DiscoveryAddForm", () => { // Render the form with default state. const { rerender } = renderWithBrowserRouter( , - { route: "/dashboard", state } + { route: "/network-discovery", state } ); const error = "Name is invalid"; // Change the device state to included the errors (as if it has changed via an API response). @@ -192,7 +192,7 @@ describe("DiscoveryAddForm", () => { const store = mockStore(state); renderWithBrowserRouter( , - { route: "/dashboard", store } + { route: "/network-discovery", store } ); await userEvent.selectOptions( @@ -251,7 +251,7 @@ describe("DiscoveryAddForm", () => { const store = mockStore(state); renderWithBrowserRouter( , - { route: "/dashboard", store } + { route: "/network-discovery", store } ); await userEvent.selectOptions( @@ -310,7 +310,7 @@ describe("DiscoveryAddForm", () => { const store = mockStore(state); renderWithBrowserRouter( , - { route: "/dashboard", store } + { route: "/network-discovery", store } ); await userEvent.click( @@ -329,7 +329,7 @@ describe("DiscoveryAddForm", () => { const store = mockStore(state); renderWithBrowserRouter( , - { route: "/dashboard", store } + { route: "/network-discovery", store } ); await userEvent.clear( @@ -353,7 +353,7 @@ describe("DiscoveryAddForm", () => { const store = mockStore(state); const { rerender } = renderWithBrowserRouter( , - { route: "/dashboard", store } + { route: "/network-discovery", store } ); await userEvent.selectOptions( diff --git a/src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddForm.tsx b/src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddForm.tsx similarity index 100% rename from src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddForm.tsx rename to src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddForm.tsx diff --git a/src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.test.tsx b/src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.test.tsx similarity index 95% rename from src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.test.tsx rename to src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.test.tsx index 3ed683fcd2..f292913fd6 100644 --- a/src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.test.tsx +++ b/src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.test.tsx @@ -46,7 +46,7 @@ describe("DiscoveryAddFormFields", () => { setDeviceType={jest.fn()} /> , - { route: "/dashboard", state } + { route: "/network-discovery", state } ); expect( screen.getByRole("combobox", { @@ -88,7 +88,7 @@ describe("DiscoveryAddFormFields", () => { setDeviceType={jest.fn()} /> , - { route: "/dashboard", state } + { route: "/network-discovery", state } ); expect( screen.queryByRole("combobox", { @@ -128,7 +128,7 @@ describe("DiscoveryAddFormFields", () => { setDeviceType={jest.fn()} /> , - { route: "/dashboard", state } + { route: "/network-discovery", state } ); const ipAssignment = screen.getByRole("combobox", { @@ -152,7 +152,7 @@ describe("DiscoveryAddFormFields", () => { setDeviceType={jest.fn()} /> , - { route: "/dashboard", state } + { route: "/network-discovery", state } ); const ipAssignment = screen.getByRole("combobox", { @@ -186,7 +186,7 @@ describe("DiscoveryAddFormFields", () => { setDeviceType={setDeviceType} /> , - { route: "/dashboard", state } + { route: "/network-discovery", state } ); await userEvent.selectOptions( screen.getByRole("combobox", { name: DiscoveryAddFormFieldsLabels.Type }), @@ -223,7 +223,7 @@ describe("DiscoveryAddFormFields", () => { setDeviceType={jest.fn()} /> , - { route: "/dashboard", state } + { route: "/network-discovery", state } ); await userEvent.selectOptions( screen.getByRole("combobox", { diff --git a/src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.tsx b/src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.tsx similarity index 100% rename from src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.tsx rename to src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddFormFields/DiscoveryAddFormFields.tsx diff --git a/src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddFormFields/index.ts b/src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddFormFields/index.ts similarity index 100% rename from src/app/dashboard/views/DiscoveryAddForm/DiscoveryAddFormFields/index.ts rename to src/app/networkDiscovery/views/DiscoveryAddForm/DiscoveryAddFormFields/index.ts diff --git a/src/app/dashboard/views/DiscoveryAddForm/index.ts b/src/app/networkDiscovery/views/DiscoveryAddForm/index.ts similarity index 100% rename from src/app/dashboard/views/DiscoveryAddForm/index.ts rename to src/app/networkDiscovery/views/DiscoveryAddForm/index.ts diff --git a/src/app/dashboard/views/DiscoveryAddForm/types.ts b/src/app/networkDiscovery/views/DiscoveryAddForm/types.ts similarity index 100% rename from src/app/dashboard/views/DiscoveryAddForm/types.ts rename to src/app/networkDiscovery/views/DiscoveryAddForm/types.ts diff --git a/src/app/dashboard/views/Dashboard.test.tsx b/src/app/networkDiscovery/views/NetworkDiscovery.test.tsx similarity index 71% rename from src/app/dashboard/views/Dashboard.test.tsx rename to src/app/networkDiscovery/views/NetworkDiscovery.test.tsx index 5c8ac2f4cb..479458cc4a 100644 --- a/src/app/dashboard/views/Dashboard.test.tsx +++ b/src/app/networkDiscovery/views/NetworkDiscovery.test.tsx @@ -1,6 +1,6 @@ -import Dashboard, { Label } from "./Dashboard"; -import { Label as DashboardConfigurationFormLabel } from "./DashboardConfigurationForm/DashboardConfigurationForm"; import { Labels as DiscoveriesListLabel } from "./DiscoveriesList/DiscoveriesList"; +import NetworkDiscovery, { Label } from "./NetworkDiscovery"; +import { Label as NetworkDiscoveryConfigurationFormLabel } from "./NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationForm"; import urls from "app/base/urls"; import { Label as NotFoundLabel } from "app/base/views/NotFound/NotFound"; @@ -15,7 +15,7 @@ import { } from "testing/factories"; import { screen, renderWithBrowserRouter } from "testing/utils"; -describe("Dashboard", () => { +describe("NetworkDiscovery", () => { let state: RootState; beforeEach(() => { @@ -32,22 +32,22 @@ describe("Dashboard", () => { [ { label: DiscoveriesListLabel.DiscoveriesList, - path: urls.dashboard.index, + path: urls.networkDiscovery.index, }, { - label: DashboardConfigurationFormLabel.Title, - path: urls.dashboard.configuration, + label: NetworkDiscoveryConfigurationFormLabel.Title, + path: urls.networkDiscovery.configuration, }, { label: NotFoundLabel.Title, - path: `${urls.dashboard.index}/not/a/path`, + path: `${urls.networkDiscovery.index}/not/a/path`, }, ].forEach(({ label, path }) => { it(`Displays: ${label} at: ${path}`, () => { - renderWithBrowserRouter(, { + renderWithBrowserRouter(, { route: path, state, - routePattern: `${urls.dashboard.index}/*`, + routePattern: `${urls.networkDiscovery.index}/*`, }); expect(screen.getByLabelText(label)).toBeInTheDocument(); }); @@ -57,8 +57,8 @@ describe("Dashboard", () => { state.config = configStateFactory({ items: [{ name: ConfigNames.NETWORK_DISCOVERY, value: "disabled" }], }); - renderWithBrowserRouter(, { - route: urls.dashboard.index, + renderWithBrowserRouter(, { + route: urls.networkDiscovery.index, state, }); expect(screen.getByText(Label.Disabled)).toBeInTheDocument(); @@ -68,8 +68,8 @@ describe("Dashboard", () => { state.config = configStateFactory({ items: [{ name: ConfigNames.NETWORK_DISCOVERY, value: "enabled" }], }); - renderWithBrowserRouter(, { - route: urls.dashboard.index, + renderWithBrowserRouter(, { + route: urls.networkDiscovery.index, state, }); expect(screen.queryByText(Label.Disabled)).not.toBeInTheDocument(); @@ -79,8 +79,8 @@ describe("Dashboard", () => { state.user.auth = authStateFactory({ user: userFactory({ is_superuser: false }), }); - renderWithBrowserRouter(, { - route: urls.dashboard.index, + renderWithBrowserRouter(, { + route: urls.networkDiscovery.index, state, }); expect(screen.getByText(Label.Permissions)).toBeInTheDocument(); diff --git a/src/app/dashboard/views/Dashboard.tsx b/src/app/networkDiscovery/views/NetworkDiscovery.tsx similarity index 71% rename from src/app/dashboard/views/Dashboard.tsx rename to src/app/networkDiscovery/views/NetworkDiscovery.tsx index 6be6ceef74..cfef956324 100644 --- a/src/app/dashboard/views/Dashboard.tsx +++ b/src/app/networkDiscovery/views/NetworkDiscovery.tsx @@ -2,11 +2,11 @@ import { Notification } from "@canonical/react-components"; import { useSelector } from "react-redux"; import { Route, Routes } from "react-router-dom-v5-compat"; -import DashboardConfigurationForm from "./DashboardConfigurationForm"; -import DashboardHeader from "./DashboardHeader"; -import ClearAllForm from "./DashboardHeader/ClearAllForm"; import DiscoveriesList from "./DiscoveriesList"; -import { DashboardSidePanelViews } from "./constants"; +import NetworkDiscoveryConfigurationForm from "./NetworkDiscoveryConfigurationForm"; +import NetworkDiscoveryHeader from "./NetworkDiscoveryHeader"; +import ClearAllForm from "./NetworkDiscoveryHeader/ClearAllForm"; +import { NetworkDiscoverySidePanelViews } from "./constants"; import PageContent from "app/base/components/PageContent"; import SectionHeader from "app/base/components/SectionHeader"; @@ -22,7 +22,7 @@ export enum Label { Permissions = "You do not have permission to view this page.", } -const Dashboard = (): JSX.Element => { +const NetworkDiscovery = (): JSX.Element => { const networkDiscovery = useSelector(configSelectors.networkDiscovery); const isAdmin = useSelector(authSelectors.isAdmin); const { sidePanelContent, setSidePanelContent } = useSidePanel(); @@ -40,7 +40,8 @@ const Dashboard = (): JSX.Element => { let content: JSX.Element | null = null; if ( - sidePanelContent?.view === DashboardSidePanelViews.CLEAR_ALL_DISCOVERIES + sidePanelContent?.view === + NetworkDiscoverySidePanelViews.CLEAR_ALL_DISCOVERIES ) { content = ( { ); } - const base = urls.dashboard.index; + const base = urls.networkDiscovery.index; return ( } + header={ + + } sidePanelContent={content} sidePanelTitle="Clear all discoveries" > @@ -64,8 +67,8 @@ const Dashboard = (): JSX.Element => { } path="/" /> } - path={getRelativeRoute(urls.dashboard.configuration, base)} + element={} + path={getRelativeRoute(urls.networkDiscovery.configuration, base)} /> } path="*" /> @@ -73,4 +76,4 @@ const Dashboard = (): JSX.Element => { ); }; -export default Dashboard; +export default NetworkDiscovery; diff --git a/src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationForm.tsx b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationForm.tsx similarity index 55% rename from src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationForm.tsx rename to src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationForm.tsx index d872412022..1b704191cb 100644 --- a/src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationForm.tsx +++ b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationForm.tsx @@ -1,4 +1,4 @@ -import DashboardConfigurationSubnetForm from "./DashboardConfigurationSubnetForm"; +import NetworkDiscoveryConfigurationSubnetForm from "./NetworkDiscoveryConfigurationSubnetForm"; import { useWindowTitle } from "app/base/hooks"; import NetworkDiscoveryForm from "app/settings/views/Network/NetworkDiscoveryForm"; @@ -7,15 +7,15 @@ export enum Label { Title = "Dashboard configuration", } -const DashboardConfigurationForm = (): JSX.Element => { +const NetworkDiscoveryConfigurationForm = (): JSX.Element => { useWindowTitle(Label.Title); return (
- +
); }; -export default DashboardConfigurationForm; +export default NetworkDiscoveryConfigurationForm; diff --git a/src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/DashboardConfigurationSubnetForm.test.tsx b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/NetworkDiscoveryConfigurationSubnetForm.test.tsx similarity index 86% rename from src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/DashboardConfigurationSubnetForm.test.tsx rename to src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/NetworkDiscoveryConfigurationSubnetForm.test.tsx index 8f734634d9..9340417c5c 100644 --- a/src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/DashboardConfigurationSubnetForm.test.tsx +++ b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/NetworkDiscoveryConfigurationSubnetForm.test.tsx @@ -1,8 +1,8 @@ import configureStore from "redux-mock-store"; -import DashboardConfigurationSubnetForm, { +import NetworkDiscoveryConfigurationSubnetForm, { Labels as SubnetFormLabels, -} from "./DashboardConfigurationSubnetForm"; +} from "./NetworkDiscoveryConfigurationSubnetForm"; import { ConfigNames, NetworkDiscovery } from "app/store/config/types"; import type { RootState } from "app/store/root/types"; @@ -19,12 +19,12 @@ import { userEvent, screen, renderWithBrowserRouter } from "testing/utils"; const mockStore = configureStore(); -describe("DashboardConfigurationSubnetForm", () => { +describe("NetworkDiscoveryConfigurationSubnetForm", () => { it("displays a spinner if subnets have not loaded", () => { const state = rootStateFactory({ subnet: subnetStateFactory({ loaded: false }), }); - renderWithBrowserRouter(, { + renderWithBrowserRouter(, { state, }); @@ -35,7 +35,7 @@ describe("DashboardConfigurationSubnetForm", () => { const state = rootStateFactory({ fabric: fabricStateFactory({ loaded: false }), }); - renderWithBrowserRouter(, { + renderWithBrowserRouter(, { state, }); @@ -47,7 +47,7 @@ describe("DashboardConfigurationSubnetForm", () => { fabric: fabricStateFactory({ loaded: true }), subnet: subnetStateFactory({ loaded: true }), }); - renderWithBrowserRouter(, { + renderWithBrowserRouter(, { state, }); @@ -69,7 +69,7 @@ describe("DashboardConfigurationSubnetForm", () => { fabric: fabricStateFactory({ loaded: true }), subnet: subnetStateFactory({ items: [subnetFactory()], loaded: true }), }); - renderWithBrowserRouter(, { + renderWithBrowserRouter(, { state, }); @@ -87,7 +87,7 @@ describe("DashboardConfigurationSubnetForm", () => { fabric: fabricStateFactory({ items: [fabric], loaded: true }), subnet: subnetStateFactory({ items: [subnet], loaded: true }), }); - renderWithBrowserRouter(, { + renderWithBrowserRouter(, { state, }); @@ -113,7 +113,7 @@ describe("DashboardConfigurationSubnetForm", () => { subnet: subnetStateFactory({ items: subnets, loaded: true }), }); const store = mockStore(state); - renderWithBrowserRouter(, { + renderWithBrowserRouter(, { store, }); diff --git a/src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/DashboardConfigurationSubnetForm.tsx b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/NetworkDiscoveryConfigurationSubnetForm.tsx similarity index 97% rename from src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/DashboardConfigurationSubnetForm.tsx rename to src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/NetworkDiscoveryConfigurationSubnetForm.tsx index c3f51acecd..5f213f2469 100644 --- a/src/app/dashboard/views/DashboardConfigurationForm/DashboardConfigurationSubnetForm/DashboardConfigurationSubnetForm.tsx +++ b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/NetworkDiscoveryConfigurationSubnetForm.tsx @@ -24,7 +24,7 @@ export enum Labels { FormLabel = "Subnet mapping form", } -const DashboardConfigurationSubnetForm = (): JSX.Element => { +const NetworkDiscoveryConfigurationSubnetForm = (): JSX.Element => { const dispatch = useDispatch(); const subnets = useSelector(subnetSelectors.all); const fabrics = useSelector(fabricSelectors.all); @@ -126,4 +126,4 @@ const DashboardConfigurationSubnetForm = (): JSX.Element => { ); }; -export default DashboardConfigurationSubnetForm; +export default NetworkDiscoveryConfigurationSubnetForm; diff --git a/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/index.ts b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/index.ts new file mode 100644 index 0000000000..efcbb2f202 --- /dev/null +++ b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/NetworkDiscoveryConfigurationSubnetForm/index.ts @@ -0,0 +1 @@ +export { default } from "./NetworkDiscoveryConfigurationSubnetForm"; diff --git a/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/index.ts b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/index.ts new file mode 100644 index 0000000000..4a575c858e --- /dev/null +++ b/src/app/networkDiscovery/views/NetworkDiscoveryConfigurationForm/index.ts @@ -0,0 +1 @@ +export { default } from "./NetworkDiscoveryConfigurationForm"; diff --git a/src/app/dashboard/views/DashboardHeader/ClearAllForm/ClearAllForm.test.tsx b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/ClearAllForm/ClearAllForm.test.tsx similarity index 95% rename from src/app/dashboard/views/DashboardHeader/ClearAllForm/ClearAllForm.test.tsx rename to src/app/networkDiscovery/views/NetworkDiscoveryHeader/ClearAllForm/ClearAllForm.test.tsx index f94b1f4fb9..3ca4db193b 100644 --- a/src/app/dashboard/views/DashboardHeader/ClearAllForm/ClearAllForm.test.tsx +++ b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/ClearAllForm/ClearAllForm.test.tsx @@ -57,7 +57,7 @@ describe("ClearAllForm", () => { ], }); renderWithBrowserRouter(, { - route: "/dashboard", + route: "/network-discovery", state, }); expect(screen.getByTestId("enabled-message")).toBeInTheDocument(); @@ -73,7 +73,7 @@ describe("ClearAllForm", () => { ], }); renderWithBrowserRouter(, { - route: "/dashboard", + route: "/network-discovery", state, }); expect(screen.getByTestId("disabled-message")).toBeInTheDocument(); @@ -82,7 +82,7 @@ describe("ClearAllForm", () => { it("dispatches an action to clear the discoveries", async () => { const store = mockStore(state); renderWithBrowserRouter(, { - route: "/dashboard", + route: "/network-discovery", store, }); await userEvent.click( @@ -98,7 +98,7 @@ describe("ClearAllForm", () => { const store = mockStore(state); renderWithBrowserRouter(, { - route: "/dashboard", + route: "/network-discovery", store, }); diff --git a/src/app/dashboard/views/DashboardHeader/ClearAllForm/ClearAllForm.tsx b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/ClearAllForm/ClearAllForm.tsx similarity index 100% rename from src/app/dashboard/views/DashboardHeader/ClearAllForm/ClearAllForm.tsx rename to src/app/networkDiscovery/views/NetworkDiscoveryHeader/ClearAllForm/ClearAllForm.tsx diff --git a/src/app/dashboard/views/DashboardHeader/ClearAllForm/index.ts b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/ClearAllForm/index.ts similarity index 100% rename from src/app/dashboard/views/DashboardHeader/ClearAllForm/index.ts rename to src/app/networkDiscovery/views/NetworkDiscoveryHeader/ClearAllForm/index.ts diff --git a/src/app/dashboard/views/DashboardHeader/DashboardHeader.test.tsx b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/NetworkDiscoveryHeader.test.tsx similarity index 69% rename from src/app/dashboard/views/DashboardHeader/DashboardHeader.test.tsx rename to src/app/networkDiscovery/views/NetworkDiscoveryHeader/NetworkDiscoveryHeader.test.tsx index 1e842f6f5f..17c8cc7310 100644 --- a/src/app/dashboard/views/DashboardHeader/DashboardHeader.test.tsx +++ b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/NetworkDiscoveryHeader.test.tsx @@ -1,8 +1,8 @@ import configureStore from "redux-mock-store"; -import DashboardHeader, { - Labels as DashboardHeaderLabels, -} from "./DashboardHeader"; +import NetworkDiscoveryHeader, { + Labels as NetworkDiscoveryHeaderLabels, +} from "./NetworkDiscoveryHeader"; import urls from "app/base/urls"; import type { RootState } from "app/store/root/types"; @@ -15,7 +15,7 @@ import { screen, renderWithBrowserRouter, userEvent } from "testing/utils"; const mockStore = configureStore(); -describe("DashboardHeader", () => { +describe("NetworkDiscoveryHeader", () => { let state: RootState; beforeEach(() => { @@ -36,9 +36,9 @@ describe("DashboardHeader", () => { it("displays the discovery count in the header", () => { renderWithBrowserRouter( - , + , { - route: "/dashboard", + route: "/network-discovery", state, } ); @@ -47,20 +47,22 @@ describe("DashboardHeader", () => { expect(indexLink).toBeInTheDocument(); expect(indexLink).toHaveProperty( "href", - `http://example.com${urls.dashboard.index}` + `http://example.com${urls.networkDiscovery.index}` ); }); it("has a button to clear discoveries", () => { renderWithBrowserRouter( - , + , { - route: "/dashboard", + route: "/network-discovery", state, } ); expect( - screen.getByRole("button", { name: DashboardHeaderLabels.ClearAll }) + screen.getByRole("button", { + name: NetworkDiscoveryHeaderLabels.ClearAll, + }) ).toBeInTheDocument(); }); @@ -68,15 +70,17 @@ describe("DashboardHeader", () => { const store = mockStore(state); const setSidePanelContent = jest.fn(); renderWithBrowserRouter( - , + , { - route: "/dashboard", + route: "/network-discovery", store, } ); await userEvent.click( - screen.getByRole("button", { name: DashboardHeaderLabels.ClearAll }) + screen.getByRole("button", { + name: NetworkDiscoveryHeaderLabels.ClearAll, + }) ); expect(setSidePanelContent).toHaveBeenCalledWith({ view: ["", "clearAllDiscoveries"], diff --git a/src/app/dashboard/views/DashboardHeader/DashboardHeader.tsx b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/NetworkDiscoveryHeader.tsx similarity index 76% rename from src/app/dashboard/views/DashboardHeader/DashboardHeader.tsx rename to src/app/networkDiscovery/views/NetworkDiscoveryHeader/NetworkDiscoveryHeader.tsx index e5d6563073..f04ca1dbf7 100644 --- a/src/app/dashboard/views/DashboardHeader/DashboardHeader.tsx +++ b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/NetworkDiscoveryHeader.tsx @@ -4,7 +4,7 @@ import { useSelector } from "react-redux"; import { useLocation } from "react-router-dom"; import { Link } from "react-router-dom-v5-compat"; -import { DashboardSidePanelViews } from "../constants"; +import { NetworkDiscoverySidePanelViews } from "../constants"; import SectionHeader from "app/base/components/SectionHeader"; import { useFetchActions } from "app/base/hooks"; @@ -17,7 +17,7 @@ export enum Labels { ClearAll = "Clear all discoveries", } -const DashboardHeader = ({ +const NetworkDiscoveryHeader = ({ setSidePanelContent, }: { setSidePanelContent: SetSidePanelContent; @@ -35,7 +35,7 @@ const DashboardHeader = ({ key="clear-all" onClick={() => setSidePanelContent({ - view: DashboardSidePanelViews.CLEAR_ALL_DISCOVERIES, + view: NetworkDiscoverySidePanelViews.CLEAR_ALL_DISCOVERIES, }) } > @@ -48,16 +48,16 @@ const DashboardHeader = ({ buttons={buttons} tabLinks={[ { - active: location.pathname === urls.dashboard.index, + active: location.pathname === urls.networkDiscovery.index, component: Link, label: pluralize("discovery", discoveries.length, true), - to: urls.dashboard.index, + to: urls.networkDiscovery.index, }, { - active: location.pathname === urls.dashboard.configuration, + active: location.pathname === urls.networkDiscovery.configuration, component: Link, label: "Configuration", - to: urls.dashboard.configuration, + to: urls.networkDiscovery.configuration, }, ]} title="Network discovery" @@ -65,4 +65,4 @@ const DashboardHeader = ({ ); }; -export default DashboardHeader; +export default NetworkDiscoveryHeader; diff --git a/src/app/networkDiscovery/views/NetworkDiscoveryHeader/index.ts b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/index.ts new file mode 100644 index 0000000000..789529eaf7 --- /dev/null +++ b/src/app/networkDiscovery/views/NetworkDiscoveryHeader/index.ts @@ -0,0 +1 @@ +export { default } from "./NetworkDiscoveryHeader"; diff --git a/src/app/dashboard/views/constants.ts b/src/app/networkDiscovery/views/constants.ts similarity index 53% rename from src/app/dashboard/views/constants.ts rename to src/app/networkDiscovery/views/constants.ts index 770034a04e..83ff2c1d67 100644 --- a/src/app/dashboard/views/constants.ts +++ b/src/app/networkDiscovery/views/constants.ts @@ -2,10 +2,10 @@ import type { ValueOf } from "@canonical/react-components"; import type { SidePanelContent } from "app/base/types"; -export const DashboardSidePanelViews = { +export const NetworkDiscoverySidePanelViews = { CLEAR_ALL_DISCOVERIES: ["", "clearAllDiscoveries"], } as const; -export type DashboardSidePanelContent = SidePanelContent< - ValueOf +export type NetworkDiscoverySidePanelContent = SidePanelContent< + ValueOf >; diff --git a/src/app/subnets/views/SubnetDetails/SubnetDetailsHeader/SubnetActionForms/components/MapSubnet/MapSubnet.tsx b/src/app/subnets/views/SubnetDetails/SubnetDetailsHeader/SubnetActionForms/components/MapSubnet/MapSubnet.tsx index aa1b32870c..6d9b6a816a 100644 --- a/src/app/subnets/views/SubnetDetails/SubnetDetailsHeader/SubnetActionForms/components/MapSubnet/MapSubnet.tsx +++ b/src/app/subnets/views/SubnetDetails/SubnetDetailsHeader/SubnetActionForms/components/MapSubnet/MapSubnet.tsx @@ -62,8 +62,8 @@ export const MapSubnet = ({ {isIPv4 ? ( <> You will start mapping your subnet. Go to the{" "} - dashboard to see the discovered - items. + dashboard to see the + discovered items. ) : ( diff --git a/src/scss/index.scss b/src/scss/index.scss index aad92c6286..9474a153b0 100644 --- a/src/scss/index.scss +++ b/src/scss/index.scss @@ -233,8 +233,8 @@ @include SettingsBackLink; @include VMsTable; -// Dashboard -@import "~app/dashboard/views/DiscoveriesList"; +// Network Discovery +@import "~app/networkDiscovery/views/DiscoveriesList"; @include DiscoveriesList; // machines