From 6c9964305c194b7c30e84135c80e0d8f1d1d08f7 Mon Sep 17 00:00:00 2001 From: Jeet Viramgama Date: Wed, 5 Jul 2023 20:02:13 +0530 Subject: [PATCH] fix(admin-ui): react component lift up to parent --- .../app/routes/Apps/Gluu/GluuTimeoutModal.js | 46 +++++++++++++++++++ admin-ui/app/utils/ApiKeyRedirect.js | 9 ---- admin-ui/app/utils/AppAuthProvider.js | 22 ++++++--- 3 files changed, 61 insertions(+), 16 deletions(-) create mode 100644 admin-ui/app/routes/Apps/Gluu/GluuTimeoutModal.js diff --git a/admin-ui/app/routes/Apps/Gluu/GluuTimeoutModal.js b/admin-ui/app/routes/Apps/Gluu/GluuTimeoutModal.js new file mode 100644 index 000000000..1ef0fc68a --- /dev/null +++ b/admin-ui/app/routes/Apps/Gluu/GluuTimeoutModal.js @@ -0,0 +1,46 @@ +import React from 'react' + +const GluuTimeoutModal = ({ message = '', description = '' }) => { + return ( +
+ +

{message}

+

+ +
+ ) +} + +export default GluuTimeoutModal diff --git a/admin-ui/app/utils/ApiKeyRedirect.js b/admin-ui/app/utils/ApiKeyRedirect.js index af05b6701..3ade363c4 100644 --- a/admin-ui/app/utils/ApiKeyRedirect.js +++ b/admin-ui/app/utils/ApiKeyRedirect.js @@ -61,15 +61,6 @@ function ApiKeyRedirect({ /> )} - {isTimeout && ( - - )} - {roleNotFound && ( state.licenseReducer) const { config, userinfo, userinfo_jwt, token, backendIsUp } = useSelector( - (state) => state.authReducer, + (state) => state.authReducer ) const { islicenseCheckResultLoaded, isLicenseActivationResultLoaded, isLicenseValid, - isConfigValid + isConfigValid, } = useSelector((state) => state.licenseReducer) useEffect(() => { dispatch(checkLicenseConfigValid()) dispatch(getOAuth2Config()) }, []) - + useEffect(() => { - if(isConfigValid) { + if (isConfigValid) { dispatch(checkLicensePresent()) } }, [isConfigValid]) @@ -126,8 +126,16 @@ export default function AppAuthProvider(props) { return ( + {isTimeout && ( + + )} {showContent && props.children} - {!showContent &&( + {!showContent && (