From 395bbe437dc9c480ce094892bd035eb290ad2217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz=20Gonz=C3=A1lez?= Date: Wed, 8 Jan 2025 15:05:36 +0000 Subject: [PATCH 1/2] fix(web): use product ID instead of generated slug The product selection page was using a dynamically generated slug based on the product name. Since each product already has a unique ID, it is more reliable and efficient to use it instead of generating a new one. --- web/src/components/product/ProductSelectionPage.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web/src/components/product/ProductSelectionPage.tsx b/web/src/components/product/ProductSelectionPage.tsx index aa5d918f64..a4ac2009dd 100644 --- a/web/src/components/product/ProductSelectionPage.tsx +++ b/web/src/components/product/ProductSelectionPage.tsx @@ -39,7 +39,6 @@ import { Center } from "~/components/layout"; import { useConfigMutation, useProduct } from "~/queries/software"; import pfTextStyles from "@patternfly/react-styles/css/utilities/Text/text"; import pfRadioStyles from "@patternfly/react-styles/css/components/Radio/radio"; -import { slugify } from "~/utils"; import { sprintf } from "sprintf-js"; import { _ } from "~/i18n"; import { useNavigate } from "react-router-dom"; @@ -51,8 +50,7 @@ const ResponsiveGridItem = ({ children }) => ( ); const Option = ({ product, isChecked, onChange }) => { - const id = slugify(product.name); - const detailsId = `${id}-details`; + const detailsId = `${product.id}-details`; const logoSrc = `assets/logos/${product.icon}`; // TRANSLATORS: %s will be replaced by a product name. E.g., "openSUSE Tumbleweed" const logoAltText = sprintf(_("%s logo"), product.name); @@ -63,7 +61,7 @@ const Option = ({ product, isChecked, onChange }) => { { {logoAltText}