From 0138c367afbdb4a2e014b436337374d74c161a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Wed, 17 Jul 2024 10:49:18 +0100 Subject: [PATCH 1/2] fix(web): handle the 'no patterns' scenario --- web/src/components/software/SoftwarePage.jsx | 44 +++++++++++++------- web/src/components/software/UsedSize.jsx | 2 +- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/web/src/components/software/SoftwarePage.jsx b/web/src/components/software/SoftwarePage.jsx index 3ae0c40f6c..001daf5927 100644 --- a/web/src/components/software/SoftwarePage.jsx +++ b/web/src/components/software/SoftwarePage.jsx @@ -100,6 +100,32 @@ const SelectedPatternsList = ({ patterns }) => { ); }; +const SelectedPatterns = ({ patterns }) => ( + + {_("Change selection")} + + } + > + + + + +); + +const NoPatterns = () => ( + + +

+ {_( + "This product does not allow to select software patterns during installation. However, you can add additional software once the installation is finished.", + )} +

+
+
+); // FIXME: move build patterns to utils /** @@ -132,7 +158,7 @@ function SoftwarePage() { }, [client.software, patterns]); useEffect(() => { - if (patterns.length !== 0) return; + if (!isLoading) return; const loadPatterns = async () => { const patterns = await cancellablePromise(client.software.getPatterns()); @@ -143,7 +169,7 @@ function SoftwarePage() { }; loadPatterns(); - }, [client.software, patterns, cancellablePromise]); + }, [client.software, patterns, cancellablePromise, isLoading]); if (status === BUSY || isLoading) { ; @@ -161,20 +187,8 @@ function SoftwarePage() { - - {_("Change selection")} - - } - > - - - - + {patterns.length === 0 ? : } - diff --git a/web/src/components/software/UsedSize.jsx b/web/src/components/software/UsedSize.jsx index 499ec1369c..490d8a9684 100644 --- a/web/src/components/software/UsedSize.jsx +++ b/web/src/components/software/UsedSize.jsx @@ -34,7 +34,7 @@ export default function UsedSize({ size }) { return ( -

{_("This space includes the base system and the selected software patterns.")}

+

{_("This space includes the base system and the selected software patterns, if any.")}

); } From 9da5e6246975f9376cbf96344df060ceea885807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Wed, 17 Jul 2024 10:54:27 +0100 Subject: [PATCH 2/2] doc(web): update the changes file --- web/package/agama-web-ui.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/package/agama-web-ui.changes b/web/package/agama-web-ui.changes index 5cabeb09fe..9bbd0fac95 100644 --- a/web/package/agama-web-ui.changes +++ b/web/package/agama-web-ui.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 17 09:52:36 UTC 2024 - Imobach Gonzalez Sosa + +- Handle the case where there are not user selectable patterns + (gh#openSUSE/agama#1472). + ------------------------------------------------------------------- Fri Jul 12 10:41:28 UTC 2024 - David Diaz