From 4883fb7408227db0eec4e02e7f03e7ade1adf4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz=20Gonz=C3=A1lez?= Date: Tue, 13 Jun 2023 16:02:51 +0100 Subject: [PATCH] [web] Drop heigh prop from Popup component For reverting behavior introduced at 8b8de4c49770d5408b439842311c41a064f00e6c. Now we think that having scroll in Popups when there is room from them to grow is worst than a dialog changing its size for adapting to the content changes. --- web/src/components/core/Popup.jsx | 5 ----- web/src/components/network/IpSettingsForm.jsx | 2 +- web/src/components/network/WifiSelector.jsx | 2 +- web/src/components/storage/ProposalVolumes.jsx | 2 +- web/src/components/storage/iscsi/DiscoverForm.jsx | 2 +- web/src/components/storage/iscsi/EditNodeForm.jsx | 2 +- web/src/components/storage/iscsi/InitiatorForm.jsx | 2 +- web/src/components/storage/iscsi/LoginForm.jsx | 2 +- web/src/components/users/FirstUser.jsx | 2 +- 9 files changed, 8 insertions(+), 13 deletions(-) diff --git a/web/src/components/core/Popup.jsx b/web/src/components/core/Popup.jsx index 451ef617e4..05b3c75200 100644 --- a/web/src/components/core/Popup.jsx +++ b/web/src/components/core/Popup.jsx @@ -189,7 +189,6 @@ const AncillaryAction = ({ children, ...props }) => ( * @param {boolean} [props.isOpen=false] - whether the popup is displayed or not * @param {boolean} [props.showClose=false] - whether the popup should include a "X" action for closing it * @param {string} [props.variant="small"] - the popup size, based on Pf4/Modal `variant` prop - * @param {string} [props.height="auto"] - the popup height, "auto", "medium", "large" * @param {React.ReactNode} props.children - the popup content and actions * @param {object} [pf4ModalProps] - PF4/Modal props, See {@link https://www.patternfly.org/v4/components/modal#props} * @@ -198,13 +197,10 @@ const Popup = ({ isOpen = false, showClose = false, variant = "small", - height = "auto", children, - className, ...pf4ModalProps }) => { const [actions, content] = partition(React.Children.toArray(children), child => child.type === Actions); - const classesNames = [className, `${height}-modal-popup`].filter(c => c !== "").join(" "); useLayoutEffect(() => { /** @@ -241,7 +237,6 @@ const Popup = ({ showClose={showClose} variant={variant} actions={actions} - className={classesNames} > { content } diff --git a/web/src/components/network/IpSettingsForm.jsx b/web/src/components/network/IpSettingsForm.jsx index 1a9a086a32..44753ec22c 100644 --- a/web/src/components/network/IpSettingsForm.jsx +++ b/web/src/components/network/IpSettingsForm.jsx @@ -123,7 +123,7 @@ export default function IpSettingsForm({ connection, onClose }) { }; return ( - +
+ { - + + { isFailed && diff --git a/web/src/components/storage/iscsi/EditNodeForm.jsx b/web/src/components/storage/iscsi/EditNodeForm.jsx index 2ca8ec0f83..8d68e72f88 100644 --- a/web/src/components/storage/iscsi/EditNodeForm.jsx +++ b/web/src/components/storage/iscsi/EditNodeForm.jsx @@ -44,7 +44,7 @@ export default function EditNodeForm({ node, onSubmit: onSubmitProp, onCancel }) const id = "iscsiEditNode"; return ( - + + + { isFailed && diff --git a/web/src/components/users/FirstUser.jsx b/web/src/components/users/FirstUser.jsx index a65882ebe9..ecbf5a3f4b 100644 --- a/web/src/components/users/FirstUser.jsx +++ b/web/src/components/users/FirstUser.jsx @@ -186,7 +186,7 @@ export default function FirstUser() { { isUserDefined ? : } { /* TODO: Extract this form to a component, if possible */ } { isFormOpen && - + accept("createUser", e)}> { showErrors() &&