webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js in katello-4.7.6 vs webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js in katello-4.8.0.rc1
- old
+ new
@@ -14,20 +14,12 @@
const AcsUrlPaths = () => {
const {
acsType, url, setUrl, subpaths, setSubpaths,
} = useContext(ACSCreateContext);
+ const urlValidated = (url === '' || isValidUrl(url, acsType)) ? 'default' : 'error';
const subPathValidated = areSubPathsValid(subpaths) ? 'default' : 'error';
- const [urlValidated, setUrlValidated] = React.useState('default');
- const handleUrlChange = (newUrl, _event) => {
- setUrl(newUrl);
- if (isValidUrl(newUrl, acsType)) {
- setUrlValidated('success');
- } else {
- setUrlValidated('error');
- }
- };
const baseURLplaceholder = acsType === 'rhui' ?
'https://rhui-server.example.com/pulp/content' :
'http:// or https://';
const helperTextInvalid = acsType === 'rhui' ?
@@ -55,15 +47,16 @@
>
<TextInput
isRequired
type="url"
id="acs_base_url_field"
+ ouiaId="acs_base_url_field"
name="acs_base_url_field"
aria-label="acs_base_url_field"
placeholder={baseURLplaceholder}
value={url}
validated={urlValidated}
- onChange={handleUrlChange}
+ onChange={value => setUrl(value)}
/>
</FormGroup>
{acsType === 'rhui' &&
<>
{__('On the RHUA Instance, check the available repositories.')}