From 829dc96e78b2d5396b5a1a0cd05f9b4ee4f100fb Mon Sep 17 00:00:00 2001 From: Katerina Koukiou Date: Tue, 18 Jul 2023 09:46:18 +0200 Subject: [PATCH] webui: allow critical errors also in the first load of the application Previously the critical error screen would also appear if there was already one successful render. --- ui/webui/src/components/app.jsx | 103 ++++++++++++++++---------------- ui/webui/test/check-basic | 4 ++ 2 files changed, 57 insertions(+), 50 deletions(-) diff --git a/ui/webui/src/components/app.jsx b/ui/webui/src/components/app.jsx index cbd66cec578..e5b2a2e5b93 100644 --- a/ui/webui/src/components/app.jsx +++ b/ui/webui/src/components/app.jsx @@ -105,7 +105,7 @@ export const Application = () => { }; // Postpone rendering anything until we read the dbus address and the default configuration - if (!address || !conf || !beta || !prettyName || !storeInitilized) { + if (!criticalError && (!address || !conf || !beta || !prettyName || !storeInitilized)) { console.debug("Loading initial data..."); return null; } @@ -116,59 +116,62 @@ export const Application = () => { const title = cockpit.format("$0 installation", prettyName); const page = ( - - } - groupProps={{ - sticky: "top" - }} - > - {Object.keys(notifications).length > 0 && - - {Object.keys(notifications).map(idx => { - const notification = notifications[idx]; - const newNotifications = { ...notifications }; - delete newNotifications[notification.index]; - - return ( - setNotifications(newNotifications)} - /> - } - key={notification.index}> - {notification.message} - - ); - })} - } - - - setIsHelpExpanded(false)} - title={title} - storageData={state.storage} - localizationData={state.localization} - dispatch={dispatch} - conf={conf} - /> - - - + criticalError + ? + : ( + + } + groupProps={{ + sticky: "top" + }} + > + {Object.keys(notifications).length > 0 && + + {Object.keys(notifications).map(idx => { + const notification = notifications[idx]; + const newNotifications = { ...notifications }; + delete newNotifications[notification.index]; + + return ( + setNotifications(newNotifications)} + /> + } + key={notification.index}> + {notification.message} + + ); + })} + } + + + setIsHelpExpanded(false)} + title={title} + storageData={state.storage} + localizationData={state.localization} + dispatch={dispatch} + conf={conf} + /> + + + + ) ); return ( - {criticalError && } /run/anaconda/bus.address") b.wait_visible("#critical-error-modal") + # Errors should persist across page reloads (same as having the error prior the first page load) + b.reload() + b.wait_visible("#critical-error-modal") + # Exit installer b.click("#critical-error-modal .pf-c-button.pf-m-secondary") m.wait_poweroff()