Skip to content

Commit

Permalink
Registration - Show warning for Pull provider
Browse files Browse the repository at this point in the history
  • Loading branch information
stejskalleos committed Dec 19, 2024
1 parent 7a10d39 commit 447b287
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions webpack/react_app/components/RegistrationExtension/RexPull.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -23,6 +24,24 @@ const options = (value = '') => {
);
};

const showPullWarning = (defaultValue, currentValue) => {
if (currentValue === 'false') {
return;
}

if (defaultValue === true || currentValue === 'true') {
return (

Check failure on line 33 in webpack/react_app/components/RegistrationExtension/RexPull.js

View workflow job for this annotation

GitHub Actions / test_js (14)

Arrow function expected no return value
<div style={{ marginTop: '1em' }}>
<Alert type="warning">
{__(
'Please make sure that the Smart Proxy is configured correctly for the Pull provider.'
)}
</Alert>
</div>
);
}
};

const RexPull = ({ isLoading, onChange, pluginValues, configParams }) => (
<FormGroup
label={__('REX pull mode')}
Expand All @@ -48,6 +67,10 @@ const RexPull = ({ isLoading, onChange, pluginValues, configParams }) => (
{/* eslint-disable-next-line camelcase */
options(configParams?.host_registration_remote_execution_pull)}
</FormSelect>
{showPullWarning(
configParams?.host_registration_remote_execution_pull,

Check failure on line 71 in webpack/react_app/components/RegistrationExtension/RexPull.js

View workflow job for this annotation

GitHub Actions / test_js (14)

Identifier 'host_registration_remote_execution_pull' is not in camel case
pluginValues?.setupRemoteExecutionPull
)}
</FormGroup>
);

Expand Down

0 comments on commit 447b287

Please sign in to comment.