From f1a56eba9ad52ca05cae7be21d9cb14f6ce63adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz=20Gonz=C3=A1lez?= Date: Fri, 24 Mar 2023 10:59:33 +0000 Subject: [PATCH 1/6] [web] Allow opening the Sidebar from outside By using the Sidebar.OpenButton "subcomponent". It's using a ref by now, but it's needed to research if there is a better way to do it (exploring the useImperativeHanlde[1] hook or any other technique). [1] https://react.dev/reference/react/useImperativeHandle --- web/src/components/core/Sidebar.jsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/web/src/components/core/Sidebar.jsx b/web/src/components/core/Sidebar.jsx index d182db009e..1bcefe3a8f 100644 --- a/web/src/components/core/Sidebar.jsx +++ b/web/src/components/core/Sidebar.jsx @@ -23,11 +23,15 @@ import React, { useEffect, useRef, useState } from "react"; import { Button, Text } from "@patternfly/react-core"; import { Icon, PageActions } from "~/components/layout"; +// FIXME: look for a better way to allow opening the Sidebar from outside +let openButtonRef = {}; + /** * D-Installer sidebar navigation */ -export default function Sidebar({ children }) { +const Sidebar = ({ children }) => { const [isOpen, setIsOpen] = useState(false); + openButtonRef = useRef(null); const closeButtonRef = useRef(null); const open = () => setIsOpen(true); @@ -83,6 +87,7 @@ export default function Sidebar({ children }) { <> +); + +export default Sidebar; From 7358cb0bb91aaddb0f57619369f8a3a1f50a6e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz=20Gonz=C3=A1lez?= Date: Fri, 24 Mar 2023 11:05:19 +0000 Subject: [PATCH 2/6] [web] Adapt storage page for opening sidebar from there --- web/src/components/storage/ProposalTargetSection.jsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/web/src/components/storage/ProposalTargetSection.jsx b/web/src/components/storage/ProposalTargetSection.jsx index ea3baae84a..a9e9a3b149 100644 --- a/web/src/components/storage/ProposalTargetSection.jsx +++ b/web/src/components/storage/ProposalTargetSection.jsx @@ -20,15 +20,12 @@ */ import React, { useState } from "react"; -import { useNavigate } from "react-router-dom"; -import { Button } from "@patternfly/react-core"; -import { If, Popup, Section } from "~/components/core"; +import { If, Popup, Section, Sidebar } from "~/components/core"; import { ProposalSummary, ProposalTargetForm } from "~/components/storage"; export default function ProposalTargetSection({ proposal, calculateProposal }) { const [isOpen, setIsOpen] = useState(false); - const navigate = useNavigate(); const onTargetChange = ({ candidateDevices }) => { setIsOpen(false); @@ -36,7 +33,6 @@ export default function ProposalTargetSection({ proposal, calculateProposal }) { }; const openDeviceSelector = () => setIsOpen(true); - const navigateToISCSIPage = () => navigate("/storage/iscsi"); const { availableDevices = [] } = proposal; const renderSelector = availableDevices.length > 0; @@ -60,8 +56,7 @@ export default function ProposalTargetSection({ proposal, calculateProposal }) { return (
No devices found
-
Please, configure iSCSI targets in order to find available devices for installation.
- +
Please, configure storage devices in order to make them available for installation.
); }; From 5881561d236598650dd38ee9b2f3209ade6f4513 Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Fri, 24 Mar 2023 13:29:37 +0100 Subject: [PATCH 3/6] [web] Rephrase message to open the sidebar --- web/src/components/storage/ProposalTargetSection.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/src/components/storage/ProposalTargetSection.jsx b/web/src/components/storage/ProposalTargetSection.jsx index a9e9a3b149..1e566dda45 100644 --- a/web/src/components/storage/ProposalTargetSection.jsx +++ b/web/src/components/storage/ProposalTargetSection.jsx @@ -37,6 +37,13 @@ export default function ProposalTargetSection({ proposal, calculateProposal }) { const { availableDevices = [] } = proposal; const renderSelector = availableDevices.length > 0; + // Temporary mini-component with temporary text for March prototype + const SideBarTip = () => { + return ( +
If needed, use the advanced options menu to configure access to more disks using technologies like iSCSI or DASD (when available).
+ ); + }; + const Content = () => { return ( <> @@ -48,6 +55,7 @@ export default function ProposalTargetSection({ proposal, calculateProposal }) { setIsOpen(false)} autoFocus /> + ); }; @@ -56,7 +64,7 @@ export default function ProposalTargetSection({ proposal, calculateProposal }) { return (
No devices found
-
Please, configure storage devices in order to make them available for installation.
+
); }; From 40b6850be3e07e6f35c2e9fd1b17482e88b782a4 Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Fri, 24 Mar 2023 13:43:40 +0100 Subject: [PATCH 4/6] [web] Accept DASD at cspell --- web/cspell.json | 1 + 1 file changed, 1 insertion(+) diff --git a/web/cspell.json b/web/cspell.json index df288e3e51..e15ed7a5ea 100644 --- a/web/cspell.json +++ b/web/cspell.json @@ -22,6 +22,7 @@ "autoconnect", "btrfs", "ccmp", + "dasd", "dbus", "dinstaller", "filecontent", From 01033c947e1b0d16b2a3a8c18003a63ede7b98f3 Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Fri, 24 Mar 2023 13:51:52 +0100 Subject: [PATCH 5/6] Changelog --- web/package/cockpit-d-installer.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/package/cockpit-d-installer.changes b/web/package/cockpit-d-installer.changes index b8cc11b89f..e2912fc244 100644 --- a/web/package/cockpit-d-installer.changes +++ b/web/package/cockpit-d-installer.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 24 12:50:06 UTC 2023 - Ancor Gonzalez Sosa + +- Added a tip about iSCSI and DASD configuration to the storage + page (gh#yast/d-installer#500). + ------------------------------------------------------------------- Fri Mar 24 10:39:45 UTC 2023 - Imobach Gonzalez Sosa From e9c88042df832ad6b08869cef83e159c8b94c14d Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Fri, 24 Mar 2023 14:05:05 +0100 Subject: [PATCH 6/6] [web] Simplify text in the iSCSI and DASD tip --- web/src/components/storage/ProposalTargetSection.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/storage/ProposalTargetSection.jsx b/web/src/components/storage/ProposalTargetSection.jsx index 1e566dda45..f088bba794 100644 --- a/web/src/components/storage/ProposalTargetSection.jsx +++ b/web/src/components/storage/ProposalTargetSection.jsx @@ -40,7 +40,7 @@ export default function ProposalTargetSection({ proposal, calculateProposal }) { // Temporary mini-component with temporary text for March prototype const SideBarTip = () => { return ( -
If needed, use the advanced options menu to configure access to more disks using technologies like iSCSI or DASD (when available).
+
If needed, use the advanced options menu to configure access to more disks.
); };