From 447b287434708264d9a59c5151c59c354628e936 Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Thu, 19 Dec 2024 08:47:24 +0100 Subject: [PATCH] Registration - Show warning for Pull provider --- .../RegistrationExtension/RexPull.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/webpack/react_app/components/RegistrationExtension/RexPull.js b/webpack/react_app/components/RegistrationExtension/RexPull.js index 8ab558299..e2cd460b8 100644 --- a/webpack/react_app/components/RegistrationExtension/RexPull.js +++ b/webpack/react_app/components/RegistrationExtension/RexPull.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { translate as __ } from 'foremanReact/common/I18n'; import LabelIcon from 'foremanReact/components/common/LabelIcon'; +import { Alert } from 'patternfly-react'; import { FormGroup, @@ -23,6 +24,24 @@ const options = (value = '') => { ); }; +const showPullWarning = (defaultValue, currentValue) => { + if (currentValue === 'false') { + return; + } + + if (defaultValue === true || currentValue === 'true') { + return ( +
+ + {__( + 'Please make sure that the Smart Proxy is configured correctly for the Pull provider.' + )} + +
+ ); + } +}; + const RexPull = ({ isLoading, onChange, pluginValues, configParams }) => ( ( {/* eslint-disable-next-line camelcase */ options(configParams?.host_registration_remote_execution_pull)} + {showPullWarning( + configParams?.host_registration_remote_execution_pull, + pluginValues?.setupRemoteExecutionPull + )} );