From 4980bcda7f4e9722b7c93c98009700fac075af59 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 11:33:43 +0100 Subject: [PATCH 1/6] web: do not preselect a product --- .../product/ProductSelectionPage.jsx | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/web/src/components/product/ProductSelectionPage.jsx b/web/src/components/product/ProductSelectionPage.jsx index 13b0c0a595..735339e076 100644 --- a/web/src/components/product/ProductSelectionPage.jsx +++ b/web/src/components/product/ProductSelectionPage.jsx @@ -46,7 +46,7 @@ function ProductSelectionPage() { const navigate = useNavigate(); const { manager, product } = useInstallerClient(); const { products, selectedProduct } = useProduct(); - const [nextProduct, setNextProduct] = useState(selectedProduct || products[0]); + const [nextProduct, setNextProduct] = useState(selectedProduct); const onSubmit = async (e) => { e.preventDefault(); @@ -72,6 +72,8 @@ function ProductSelectionPage() { ); }; + const isSelectionDisabled = !nextProduct || (nextProduct === selectedProduct); + return ( <> @@ -96,19 +98,15 @@ function ProductSelectionPage() { ))} - - - {selectedProduct && } - - - - {_("Select")} - - + + {selectedProduct && } + + {_("Select")} + From 14ba857af1d914bee16887552fac394c8787814e 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 11:34:01 +0100 Subject: [PATCH 2/6] web: add layout to product progress --- .../product/ProductSelectionProgress.jsx | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/web/src/components/product/ProductSelectionProgress.jsx b/web/src/components/product/ProductSelectionProgress.jsx index cd3b3e5cff..2255db976d 100644 --- a/web/src/components/product/ProductSelectionProgress.jsx +++ b/web/src/components/product/ProductSelectionProgress.jsx @@ -30,6 +30,7 @@ import { import { _ } from "~/i18n"; import { Center } from "~/components/layout"; +import SimpleLayout from "~/SimpleLayout"; import { useCancellablePromise } from "~/utils"; import { useInstallerClient } from "~/context/installer"; import { useProduct } from "~/context/product"; @@ -136,26 +137,28 @@ function ProductSelectionProgress() { }, [cancellablePromise, setSoftwareProgress, software]); return ( -
- - - - - -

- {_("Configuring the product, please wait ...")} -

- -
-
-
-
-
-
+ +
+ + + + + +

+ {_("Configuring the product, please wait ...")} +

+ +
+
+
+
+
+
+
); } 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 3/6] 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] } ] } From 55fa98815f233cceec023b26a254eaf8dae4594c 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:08:47 +0100 Subject: [PATCH 4/6] web: fix scope --- web/src/components/overview/OverviewPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/overview/OverviewPage.jsx b/web/src/components/overview/OverviewPage.jsx index 68fcefb86e..29ea0a91bb 100644 --- a/web/src/components/overview/OverviewPage.jsx +++ b/web/src/components/overview/OverviewPage.jsx @@ -43,7 +43,7 @@ import SoftwareSection from "./SoftwareSection"; import { _ } from "~/i18n"; const SCOPE_HEADERS = { - user: _("Users"), + users: _("Users"), storage: _("Storage"), software: _("Software") }; From 7af5751a4d0e78bfdd59c575f4b9e8b82589ea59 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:58:10 +0100 Subject: [PATCH 5/6] web: show installer options --- web/src/components/product/ProductSelectionProgress.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/product/ProductSelectionProgress.jsx b/web/src/components/product/ProductSelectionProgress.jsx index 2255db976d..f6cf185ecb 100644 --- a/web/src/components/product/ProductSelectionProgress.jsx +++ b/web/src/components/product/ProductSelectionProgress.jsx @@ -137,7 +137,7 @@ function ProductSelectionProgress() { }, [cancellablePromise, setSoftwareProgress, software]); return ( - +
From 127bb7ab33700e50209a139a8bd04cc0f380474d 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:58:35 +0100 Subject: [PATCH 6/6] web: fix software overview --- .../components/overview/SoftwareSection.jsx | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/web/src/components/overview/SoftwareSection.jsx b/web/src/components/overview/SoftwareSection.jsx index 0390de8f1b..69b7d9664c 100644 --- a/web/src/components/overview/SoftwareSection.jsx +++ b/web/src/components/overview/SoftwareSection.jsx @@ -54,23 +54,37 @@ export default function SoftwareSection() { return; } - // TRANSLATORS: %s will be replaced with the installation size, example: - // "5GiB". - const [msg1, msg2] = _("The installation will take %s including:").split("%s"); + const TextWithoutList = () => { + return ( + <> + {_("The installation will take")} {proposal.size} + + ); + }; + + const TextWithList = () => { + // TRANSLATORS: %s will be replaced with the installation size, example: "5GiB". + const [msg1, msg2] = _("The installation will take %s including:").split("%s"); + return ( + <> + + {msg1} + {proposal.size} + {msg2} + + + {selectedPatterns.map(p => ( + {p.summary} + ))} + + + ); + }; return ( {_("Software")} - - {msg1} - {`${proposal.size}`} - {msg2} - - - {selectedPatterns.map(p => ( - {p.summary} - ))} - + {selectedPatterns.length ? : } ); }