From 7df349942119e5fd7e2a199f5246df203a9f3c9d Mon Sep 17 00:00:00 2001 From: balsa-asanovic Date: Fri, 11 Aug 2023 00:39:26 +0200 Subject: [PATCH 1/3] Form now scrolls up if warning is shown --- .../components/storage/iscsi/DiscoverForm.jsx | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/web/src/components/storage/iscsi/DiscoverForm.jsx b/web/src/components/storage/iscsi/DiscoverForm.jsx index e52618d99e..825c7afaaa 100644 --- a/web/src/components/storage/iscsi/DiscoverForm.jsx +++ b/web/src/components/storage/iscsi/DiscoverForm.jsx @@ -19,7 +19,7 @@ * find current contact information at www.suse.com. */ -import React, { useEffect, useState } from "react"; +import React, { useEffect, useRef, useState } from "react"; import { Alert, Form, FormGroup, @@ -46,11 +46,21 @@ export default function DiscoverForm({ onSubmit: onSubmitProp, onCancel }) { const [isLoading, setIsLoading] = useState(false); const [isFailed, setIsFailed] = useState(false); const [isValidAuth, setIsValidAuth] = useState(true); + const alertRef = useRef(null); useEffect(() => { setData(savedData); }, [setData, savedData]); + useEffect(() => { + // Scroll the alert into view + if (isFailed) + alertRef.current.scrollIntoView({ + behavior: "smooth", + block: "start" + }); + }); + const updateData = (key, value) => setData({ ...data, [key]: value }); const onAddressChange = v => updateData("address", v); const onPortChange = v => updateData("port", v); @@ -89,9 +99,15 @@ export default function DiscoverForm({ onSubmit: onSubmitProp, onCancel }) {
{ isFailed && - -

Make sure you provide the correct values

-
} +
+ +

Make sure you provide the correct values

+
+
} Date: Sat, 12 Aug 2023 13:36:42 +0200 Subject: [PATCH 2/3] Added shor desc to the changes file --- web/package/cockpit-agama.changes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/package/cockpit-agama.changes b/web/package/cockpit-agama.changes index 791086ffdd..c48119c63b 100644 --- a/web/package/cockpit-agama.changes +++ b/web/package/cockpit-agama.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Aug 12 11:35:12 UTC 2023 - Balsa Asanovic + +- Added scroll up functionality to the discover iSCSI form when + the warning shows up after the submit action. + (gh#openSUSE/agama#468). + ------------------------------------------------------------------- Wed Aug 2 18:59:16 UTC 2023 - Balsa Asanovic From 22433526631f6519e9cc2a2f53af65f6a7ff7b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Sat, 12 Aug 2023 12:41:19 +0100 Subject: [PATCH 3/3] Remove a dot in the changes entry --- web/package/cockpit-agama.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/package/cockpit-agama.changes b/web/package/cockpit-agama.changes index c48119c63b..25a4e92db1 100644 --- a/web/package/cockpit-agama.changes +++ b/web/package/cockpit-agama.changes @@ -2,7 +2,7 @@ Sat Aug 12 11:35:12 UTC 2023 - Balsa Asanovic - Added scroll up functionality to the discover iSCSI form when - the warning shows up after the submit action. + the warning shows up after the submit action (gh#openSUSE/agama#468). -------------------------------------------------------------------