diff --git a/web/package/agama-web-ui.changes b/web/package/agama-web-ui.changes index d5b43ad4c..6d54648b2 100644 --- a/web/package/agama-web-ui.changes +++ b/web/package/agama-web-ui.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 11 09:46:02 UTC 2024 - Imobach Gonzalez Sosa + +- Workaround the "not found" problem in the products selection page + (gh#agama-project/agama#1666). + ------------------------------------------------------------------- Thu Oct 10 17:55:34 UTC 2024 - Victorhck diff --git a/web/src/components/product/ProductSelectionPage.test.tsx b/web/src/components/product/ProductSelectionPage.test.tsx index da9ccdaca..4209e2da5 100644 --- a/web/src/components/product/ProductSelectionPage.test.tsx +++ b/web/src/components/product/ProductSelectionPage.test.tsx @@ -73,6 +73,6 @@ describe("when the user chooses a product but hits the cancel button", () => { await user.click(productOption); await user.click(cancelButton); expect(mockConfigMutation).not.toHaveBeenCalled(); - expect(mockNavigateFn).toHaveBeenCalledWith(-1); + expect(mockNavigateFn).toHaveBeenCalledWith("/"); }); }); diff --git a/web/src/components/product/ProductSelectionPage.tsx b/web/src/components/product/ProductSelectionPage.tsx index 63bbd76ac..05560f0fe 100644 --- a/web/src/components/product/ProductSelectionPage.tsx +++ b/web/src/components/product/ProductSelectionPage.tsx @@ -34,6 +34,7 @@ import { Split, Stack, FormGroup, + Button, } from "@patternfly/react-core"; import { Page } from "~/components/core"; import { Center } from "~/components/layout"; @@ -42,6 +43,7 @@ import styles from "@patternfly/react-styles/css/utilities/Text/text"; import { slugify } from "~/utils"; import { sprintf } from "sprintf-js"; import { _ } from "~/i18n"; +import { useNavigate } from "react-router-dom"; const ResponsiveGridItem = ({ children }) => ( @@ -82,6 +84,15 @@ const Option = ({ product, isChecked, onChange }) => { ); }; +const BackLink = () => { + const navigate = useNavigate(); + return ( + + ); +}; + function ProductSelectionPage() { const setConfig = useConfigMutation(); const { products, selectedProduct } = useProduct({ suspense: true }); @@ -120,7 +131,7 @@ function ProductSelectionPage() { - {selectedProduct && !isLoading && {_("Cancel")}} + {selectedProduct && !isLoading && }