From c520b562e40f5a083fb67fe6d5c62647e984a296 Mon Sep 17 00:00:00 2001 From: balsa-asanovic Date: Sat, 18 Nov 2023 22:23:04 +0100 Subject: [PATCH 01/65] removed IssuesLink from App.jsx --- web/src/App.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/src/App.jsx b/web/src/App.jsx index 4099afcd10..614f26fc6f 100644 --- a/web/src/App.jsx +++ b/web/src/App.jsx @@ -33,7 +33,6 @@ import { DBusError, Disclosure, Installation, - IssuesLink, LogsButton, ShowLogButton, ShowTerminalButton, @@ -106,7 +105,6 @@ function App() { <>
- From 47d04f4b5c74db9b6d1485e3901189a1c15aafba Mon Sep 17 00:00:00 2001 From: balsa-asanovic Date: Thu, 23 Nov 2023 00:29:18 +0100 Subject: [PATCH 02/65] added class for highlighting --- web/src/assets/styles/utilities.scss | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web/src/assets/styles/utilities.scss b/web/src/assets/styles/utilities.scss index 1f84016877..517aea8b34 100644 --- a/web/src/assets/styles/utilities.scss +++ b/web/src/assets/styles/utilities.scss @@ -164,3 +164,17 @@ .cursor-pointer { cursor: pointer; } + +@keyframes fadeHighlight { + from { + background-color: yellow; + } + + to { + background-color: transparent; + } +} + +.highlighted { + animation: fadeHighlight 2s ease forwards; +} From 65b2ccb1ef30764c8e29ddf21c34a01312ded2c4 Mon Sep 17 00:00:00 2001 From: balsa-asanovic Date: Thu, 23 Nov 2023 00:33:44 +0100 Subject: [PATCH 03/65] added warning button to siderbar Also removed notification mark --- web/src/components/core/Sidebar.jsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/web/src/components/core/Sidebar.jsx b/web/src/components/core/Sidebar.jsx index 4c385ff7e2..9b28596c40 100644 --- a/web/src/components/core/Sidebar.jsx +++ b/web/src/components/core/Sidebar.jsx @@ -22,7 +22,7 @@ import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react"; import { Button, Text } from "@patternfly/react-core"; import { Icon, AppActions } from "~/components/layout"; -import { If, NotificationMark } from "~/components/core"; +import { If, IssuesPage } from "~/components/core"; import { useNotification } from "~/context/notification"; import useNodeSiblings from "~/hooks/useNodeSiblings"; import { _ } from "~/i18n"; @@ -40,6 +40,7 @@ export default function Sidebar ({ children }) { const closeButtonRef = useRef(null); const [notification] = useNotification(); const [addAttribute, removeAttribute] = useNodeSiblings(asideRef.current); + const [showWarningPopup, setShowWarningPopup] = useState(false); /** * Set siblings as not interactive and not discoverable @@ -129,6 +130,17 @@ export default function Sidebar ({ children }) { return ( <> + } + onClick={() => setShowWarningPopup(prev => !prev)} + /> + } + /> + {showWarningPopup && setShowWarningPopup(false)} />} +
); From e5e85bc77c5b878615e8930181e1206ab438b539 Mon Sep 17 00:00:00 2001 From: balsa-asanovic Date: Thu, 23 Nov 2023 01:09:58 +0100 Subject: [PATCH 08/65] typo correction in prop naming --- web/src/components/core/IssuesPage.jsx | 26 ++++++++++---------- web/src/components/core/ValidationErrors.jsx | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web/src/components/core/IssuesPage.jsx b/web/src/components/core/IssuesPage.jsx index 5d9c44fd1a..2d7ee678a9 100644 --- a/web/src/components/core/IssuesPage.jsx +++ b/web/src/components/core/IssuesPage.jsx @@ -77,9 +77,9 @@ const IssueItems = ({ issues = [] }) => { * * @param {object} props * @param {import ("~/client/issues").ClientsIssues} props.issues - * @param {string} [props.sectionHighLight] - A string which indicites which issues section should be highlighted. + * @param {string} [props.sectionHighlight] - A string which indicites which issues section should be highlighted. */ -const IssuesSections = ({ issues, sectionHighLight = "" }) => { +const IssuesSections = ({ issues, sectionHighlight = "" }) => { const productIssues = issues.product || []; const storageIssues = issues.storage || []; const softwareIssues = issues.software || []; @@ -89,7 +89,7 @@ const IssuesSections = ({ issues, sectionHighLight = "" }) => { useEffect(() => { let selectedRef; - switch (sectionHighLight) { + switch (sectionHighlight) { case 'Product': selectedRef = productSectionRef; break; @@ -106,7 +106,7 @@ const IssuesSections = ({ issues, sectionHighLight = "" }) => { if (selectedRef && selectedRef.current) { selectedRef.current.scrollIntoView({ behavior: 'smooth' }); } - }, [sectionHighLight]); + }, [sectionHighlight]); return ( <> @@ -118,7 +118,7 @@ const IssuesSections = ({ issues, sectionHighLight = "" }) => { key="product-issues" title={_("Product")} icon="inventory_2" - className={sectionHighLight === "Product" ? "highlighted" : ""} + className={sectionHighlight === "Product" ? "highlighted" : ""} > @@ -133,7 +133,7 @@ const IssuesSections = ({ issues, sectionHighLight = "" }) => { key="storage-issues" title={_("Storage")} icon="hard_drive" - className={sectionHighLight === "Storage" ? "highlighted" : ""} + className={sectionHighlight === "Storage" ? "highlighted" : ""} > @@ -148,7 +148,7 @@ const IssuesSections = ({ issues, sectionHighLight = "" }) => { key="software-issues" title={_("Software")} icon="apps" - className={sectionHighLight === "Software" ? "highlighted" : ""} + className={sectionHighlight === "Software" ? "highlighted" : ""} > @@ -165,9 +165,9 @@ const IssuesSections = ({ issues, sectionHighLight = "" }) => { * * @param {object} props * @param {import ("~/client").Issues} props.issues - * @param {string} [props.sectionHighLight] - A string which indicites which issues section should be highlighted. + * @param {string} [props.sectionHighlight] - A string which indicites which issues section should be highlighted. */ -const IssuesContent = ({ issues, sectionHighLight = "" }) => { +const IssuesContent = ({ issues, sectionHighlight = "" }) => { const NoIssues = () => { return ( @@ -184,7 +184,7 @@ const IssuesContent = ({ issues, sectionHighLight = "" }) => { } - else={} + else={} /> ); }; @@ -202,9 +202,9 @@ const IssuesContent = ({ issues, sectionHighLight = "" }) => { * * @param {object} props * @param {function} props.close - A function to call when the close action is triggered. - * @param {string} [props.sectionHighLight] - A string which indicites which issues section should be highlighted. + * @param {string} [props.sectionHighlight] - A string which indicites which issues section should be highlighted. */ -export default function IssuesPage({ close, sectionHighLight = "" }) { +export default function IssuesPage({ close, sectionHighlight = "" }) { const [isLoading, setIsLoading] = useState(true); const [issues, setIssues] = useState(); const client = useInstallerClient(); @@ -231,7 +231,7 @@ export default function IssuesPage({ close, sectionHighLight = "" }) { } - else={} + else={} /> {_("Close")} diff --git a/web/src/components/core/ValidationErrors.jsx b/web/src/components/core/ValidationErrors.jsx index 4035371a03..68c36d92a4 100644 --- a/web/src/components/core/ValidationErrors.jsx +++ b/web/src/components/core/ValidationErrors.jsx @@ -75,7 +75,7 @@ const ValidationErrors = ({ errors, sectionName = "" }) => { {showIssuesPopUp && setshowIssuesPopUp(false)} - sectionHighLight={sectionName} + sectionHighlight={sectionName} />} From dfdfd9dd49708d0c68d47a311bdaf0885e7e1cdc Mon Sep 17 00:00:00 2001 From: balsa-asanovic Date: Thu, 7 Dec 2023 22:29:55 +0100 Subject: [PATCH 09/65] changed name of comp IssuesPage to IssuesDialog --- service/Gemfile.lock | 6 +++--- web/po/cs.po | 2 +- web/po/de.po | 2 +- web/po/es.po | 2 +- web/po/fr.po | 2 +- web/po/ja.po | 2 +- web/po/mk.po | 2 +- web/po/nl.po | 2 +- web/po/pt_BR.po | 2 +- web/po/ru.po | 2 +- web/po/sv.po | 2 +- web/po/uk.po | 2 +- .../core/{IssuesPage.jsx => IssuesDialog.jsx} | 2 +- .../{IssuesPage.test.jsx => IssuesDialog.test.jsx} | 10 +++++----- web/src/components/core/Sidebar.jsx | 4 ++-- web/src/components/core/ValidationErrors.jsx | 4 ++-- web/src/components/core/index.js | 2 +- web/src/index.js | 4 ++-- 18 files changed, 27 insertions(+), 27 deletions(-) rename web/src/components/core/{IssuesPage.jsx => IssuesDialog.jsx} (98%) rename web/src/components/core/{IssuesPage.test.jsx => IssuesDialog.test.jsx} (91%) diff --git a/service/Gemfile.lock b/service/Gemfile.lock index 89fdf2541e..bcabea2723 100644 --- a/service/Gemfile.lock +++ b/service/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - agama (3) + agama (0) cfa (~> 1.0.2) cfa_grub2 (~> 2.0.0) cheetah (~> 1.0.0) @@ -26,13 +26,13 @@ GEM docile (1.4.0) eventmachine (1.2.7) fast_gettext (2.2.0) - mini_portile2 (2.8.4) + mini_portile2 (2.8.5) nokogiri (1.13.10) mini_portile2 (~> 2.8.0) racc (~> 1.4) packaging_rake_tasks (1.5.1) rake - racc (1.7.1) + racc (1.7.3) rake (13.0.6) rexml (3.2.6) rspec (3.11.0) diff --git a/web/po/cs.po b/web/po/cs.po index 18fa976e5f..2fab4003a5 100644 --- a/web/po/cs.po +++ b/web/po/cs.po @@ -193,7 +193,7 @@ msgstr "" msgid "There are new issues" msgstr "" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "" diff --git a/web/po/de.po b/web/po/de.po index ca1e44c6e6..5f8984f931 100644 --- a/web/po/de.po +++ b/web/po/de.po @@ -190,7 +190,7 @@ msgstr "" msgid "There are new issues" msgstr "" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "" diff --git a/web/po/es.po b/web/po/es.po index 63dcfe787e..68445986f1 100644 --- a/web/po/es.po +++ b/web/po/es.po @@ -207,7 +207,7 @@ msgstr "Mostrar los problemas" msgid "There are new issues" msgstr "Hay nuevos problemas" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "No se encontraron problemas. Todo parece estar bien." diff --git a/web/po/fr.po b/web/po/fr.po index e24bf389ea..fbc2a7f2fe 100644 --- a/web/po/fr.po +++ b/web/po/fr.po @@ -207,7 +207,7 @@ msgstr "Montrer les problèmes" msgid "There are new issues" msgstr "Il y a de nouveaux problèmes" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "Aucun problème n'a été détecté. Tout semble correct." diff --git a/web/po/ja.po b/web/po/ja.po index 26db6fb39b..2c34eb152f 100644 --- a/web/po/ja.po +++ b/web/po/ja.po @@ -204,7 +204,7 @@ msgstr "問題点の表示" msgid "There are new issues" msgstr "新しい問題点があります" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "" "問題点は見つかりませんでした。インストールに支障はないものと思われます。" diff --git a/web/po/mk.po b/web/po/mk.po index 80184f36df..1451b54ed2 100644 --- a/web/po/mk.po +++ b/web/po/mk.po @@ -197,7 +197,7 @@ msgstr "" msgid "There are new issues" msgstr "" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "" diff --git a/web/po/nl.po b/web/po/nl.po index 928ac4d54c..8adbb4a948 100644 --- a/web/po/nl.po +++ b/web/po/nl.po @@ -203,7 +203,7 @@ msgstr "Toon issues" msgid "There are new issues" msgstr "Er zijn nieuwe issues" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "Geen issues gevonden. Alles ziet er ok uit." diff --git a/web/po/pt_BR.po b/web/po/pt_BR.po index 56fee82352..8b0b9944e3 100644 --- a/web/po/pt_BR.po +++ b/web/po/pt_BR.po @@ -192,7 +192,7 @@ msgstr "" msgid "There are new issues" msgstr "" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "" diff --git a/web/po/ru.po b/web/po/ru.po index 2aa9dd8489..c93403fb6b 100644 --- a/web/po/ru.po +++ b/web/po/ru.po @@ -207,7 +207,7 @@ msgstr "Показать ошибки" msgid "There are new issues" msgstr "Есть новые ошибки" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "Проблем не обнаружено. Все выглядит нормально." diff --git a/web/po/sv.po b/web/po/sv.po index db664c6e06..c0b1d5702a 100644 --- a/web/po/sv.po +++ b/web/po/sv.po @@ -205,7 +205,7 @@ msgstr "Visa problem" msgid "There are new issues" msgstr "Det finns nya problem" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "Inga problem hittades. Allt ser ok ut." diff --git a/web/po/uk.po b/web/po/uk.po index 6c0254a32e..e93399c2ca 100644 --- a/web/po/uk.po +++ b/web/po/uk.po @@ -193,7 +193,7 @@ msgstr "" msgid "There are new issues" msgstr "" -#: src/components/core/IssuesPage.jsx:115 +#: src/components/core/IssuesDialog.jsx:115 msgid "No issues found. Everything looks ok." msgstr "" diff --git a/web/src/components/core/IssuesPage.jsx b/web/src/components/core/IssuesDialog.jsx similarity index 98% rename from web/src/components/core/IssuesPage.jsx rename to web/src/components/core/IssuesDialog.jsx index 2d7ee678a9..94c23ef3cd 100644 --- a/web/src/components/core/IssuesPage.jsx +++ b/web/src/components/core/IssuesDialog.jsx @@ -204,7 +204,7 @@ const IssuesContent = ({ issues, sectionHighlight = "" }) => { * @param {function} props.close - A function to call when the close action is triggered. * @param {string} [props.sectionHighlight] - A string which indicites which issues section should be highlighted. */ -export default function IssuesPage({ close, sectionHighlight = "" }) { +export default function IssuesDialog({ close, sectionHighlight = "" }) { const [isLoading, setIsLoading] = useState(true); const [issues, setIssues] = useState(); const client = useInstallerClient(); diff --git a/web/src/components/core/IssuesPage.test.jsx b/web/src/components/core/IssuesDialog.test.jsx similarity index 91% rename from web/src/components/core/IssuesPage.test.jsx rename to web/src/components/core/IssuesDialog.test.jsx index 97badf900d..5abf7d6d56 100644 --- a/web/src/components/core/IssuesPage.test.jsx +++ b/web/src/components/core/IssuesDialog.test.jsx @@ -23,7 +23,7 @@ import React from "react"; import { act, screen, waitFor, within } from "@testing-library/react"; import { installerRender, createCallbackMock, withNotificationProvider } from "~/test-utils"; import { createClient } from "~/client"; -import { IssuesPage } from "~/components/core"; +import { IssuesDialog } from "~/components/core"; jest.mock("~/client"); @@ -62,14 +62,14 @@ beforeEach(() => { }); it("loads the issues", async () => { - installerRender(withNotificationProvider()); + installerRender(withNotificationProvider()); screen.getAllByText(/PFSkeleton/); await screen.findByText(/storage issue 1/); }); it("renders sections with issues", async () => { - installerRender(withNotificationProvider()); + installerRender(withNotificationProvider()); await waitFor(() => expect(screen.queryByText("Product")).not.toBeInTheDocument()); @@ -87,7 +87,7 @@ describe("if there are not issues", () => { }); it("renders a success message", async () => { - installerRender(withNotificationProvider()); + installerRender(withNotificationProvider()); await screen.findByText(/No issues found/); }); @@ -98,7 +98,7 @@ describe("if the issues change", () => { const [mockFunction, callbacks] = createCallbackMock(); mockOnIssuesChange = mockFunction; - installerRender(withNotificationProvider()); + installerRender(withNotificationProvider()); await screen.findByText("Storage"); diff --git a/web/src/components/core/Sidebar.jsx b/web/src/components/core/Sidebar.jsx index 9b28596c40..9e3e99970a 100644 --- a/web/src/components/core/Sidebar.jsx +++ b/web/src/components/core/Sidebar.jsx @@ -22,7 +22,7 @@ import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react"; import { Button, Text } from "@patternfly/react-core"; import { Icon, AppActions } from "~/components/layout"; -import { If, IssuesPage } from "~/components/core"; +import { If, IssuesDialog } from "~/components/core"; import { useNotification } from "~/context/notification"; import useNodeSiblings from "~/hooks/useNodeSiblings"; import { _ } from "~/i18n"; @@ -152,7 +152,7 @@ export default function Sidebar ({ children }) { - {showWarningPopup && setShowWarningPopup(false)} />} + {showWarningPopup && setShowWarningPopup(false)} />}