From 750eeb06bb84a6e670678782ba903ed51cdff02e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Iv=C3=A1n=20L=C3=B3pez=20Gonz=C3=A1lez?= Date: Thu, 13 Jun 2024 12:05:13 +0100 Subject: [PATCH] web: fix product routes --- .../product/ProductSelectionPage.jsx | 76 +++++++++---------- web/src/components/product/routes.js | 32 +------- web/src/router.js | 19 +---- 3 files changed, 44 insertions(+), 83 deletions(-) diff --git a/web/src/components/product/ProductSelectionPage.jsx b/web/src/components/product/ProductSelectionPage.jsx index 735339e076..ecbde0b74a 100644 --- a/web/src/components/product/ProductSelectionPage.jsx +++ b/web/src/components/product/ProductSelectionPage.jsx @@ -23,7 +23,7 @@ import React, { useState } from "react"; import { useNavigate } from "react-router-dom"; import { Card, CardBody, - Flex, FlexItem, + Flex, Form, Grid, GridItem, Radio @@ -75,45 +75,41 @@ function ProductSelectionPage() { const isSelectionDisabled = !nextProduct || (nextProduct === selectedProduct); return ( - <> - -
-
- - {products.map((product, index) => ( - - - - {product.name}} - body={product.description} - isChecked={nextProduct === product} - onChange={() => setNextProduct(product)} - /> - - - - ))} - - - {selectedProduct && } - - {_("Select")} - - - - -
-
-
- +
+
+ + {products.map((product, index) => ( + + + + {product.name}} + body={product.description} + isChecked={nextProduct === product} + onChange={() => setNextProduct(product)} + /> + + + + ))} + + + {selectedProduct && } + + {_("Select")} + + + + +
+
); } diff --git a/web/src/components/product/routes.js b/web/src/components/product/routes.js index f01c84add6..902e25dbcc 100644 --- a/web/src/components/product/routes.js +++ b/web/src/components/product/routes.js @@ -20,37 +20,13 @@ */ import React from "react"; -import { Page } from "~/components/core"; import ProductSelectionPage from "./ProductSelectionPage"; -import ProductRegistrationPage from "./ProductRegistrationPage"; -import { _ } from "~/i18n"; -const registerRoute = { - path: "/product/register", - element: , - handle: { - name: _("Product registration"), - icon: "inventory_2", - hidden: true - }, - children: [ - { - index: true, - element: - } - ] -}; - -const selectionRoute = { - path: "/product/select", - element: , - handle: { - name: _("Product selection"), - icon: "inventory_2" - } +const productsRoute = { + path: "/products", + element: }; export { - registerRoute, - selectionRoute, + productsRoute }; diff --git a/web/src/router.js b/web/src/router.js index f2c91b5fd5..b3c4c2c86e 100644 --- a/web/src/router.js +++ b/web/src/router.js @@ -25,20 +25,16 @@ import App from "~/App"; import Protected from "~/Protected"; import MainLayout from "~/MainLayout"; import SimpleLayout from "./SimpleLayout"; -import { Page, LoginPage } from "~/components/core"; +import { LoginPage } from "~/components/core"; import { OverviewPage } from "~/components/overview"; -import { ProductRegistrationPage, ProductSelectionPage } from "~/components/product"; import { _ } from "~/i18n"; import overviewRoutes from "~/components/overview/routes"; import l10nRoutes from "~/components/l10n/routes"; import networkRoutes from "~/components/network/routes"; +import { productsRoute } from "~/components/product/routes"; import storageRoutes from "~/components/storage/routes"; import softwareRoutes from "~/components/software/routes"; import usersRoutes from "~/components/users/routes"; -import { - registerRoute as productRegistrationRoute, - selectionRoute as productSelectionRoute -} from "~/components/product/routes"; const rootRoutes = [ overviewRoutes, @@ -46,8 +42,7 @@ const rootRoutes = [ networkRoutes, storageRoutes, softwareRoutes, - usersRoutes, - productRegistrationRoute + usersRoutes ]; const protectedRoutes = [ @@ -67,13 +62,7 @@ const protectedRoutes = [ }, { element: , - children: [ - { - path: "products", - element: - }, - productSelectionRoute - ] + children: [productsRoute] } ] }