webpack/scenes/AlternateContentSources/Create/Steps/ACSCreateFinish.js in katello-4.6.2.1 vs webpack/scenes/AlternateContentSources/Create/Steps/ACSCreateFinish.js in katello-4.7.0.rc1
- old
+ new
@@ -4,11 +4,11 @@
import useDeepCompareEffect from 'use-deep-compare-effect';
import { translate as __ } from 'foremanReact/common/I18n';
import { STATUS } from 'foremanReact/constants';
import ACSCreateContext from '../ACSCreateContext';
import { selectCreateACS, selectCreateACSError, selectCreateACSStatus } from '../../ACSSelectors';
-import { createACS } from '../../ACSActions';
+import getAlternateContentSources, { createACS } from '../../ACSActions';
import Loading from '../../../../components/Loading';
const ACSCreateFinish = () => {
const { push } = useHistory();
const {
@@ -19,29 +19,30 @@
name,
description,
smartProxies,
url,
subpaths,
+ useHttpProxies,
verifySSL,
authentication,
sslCert,
sslKey,
username,
password,
caCert,
productIds,
} = useContext(ACSCreateContext);
const dispatch = useDispatch();
- const response = useSelector(state => selectCreateACS(state));
- const status = useSelector(state => selectCreateACSStatus(state));
- const error = useSelector(state => selectCreateACSError(state));
+ const response = useSelector(state => selectCreateACS(state, name));
+ const status = useSelector(state => selectCreateACSStatus(state, name));
+ const error = useSelector(state => selectCreateACSError(state, name));
const [createACSDispatched, setCreateACSDispatched] = useState(false);
const [saving, setSaving] = useState(true);
const acsTypeParams = useCallback((params, type) => {
let acsParams = params;
- if (type === 'custom') {
+ if (type === 'custom' || type === 'rhui') {
acsParams = {
base_url: url, verify_ssl: verifySSL, ssl_ca_cert_id: caCert, ...acsParams,
};
if (subpaths !== '') {
acsParams = { subpaths: subpaths.split(','), ...acsParams };
@@ -58,31 +59,32 @@
setCreateACSDispatched(true);
let params = {
name,
description,
smart_proxy_names: smartProxies,
+ use_http_proxies: useHttpProxies,
content_type: contentType,
alternate_content_source_type: acsType,
};
params = acsTypeParams(params, acsType);
if (authentication === 'content_credentials') {
params = { ssl_client_cert_id: sslCert, ssl_client_key_id: sslKey, ...params };
}
if (authentication === 'manual') {
params = { upstream_username: username, upstream_password: password, ...params };
}
- dispatch(createACS(params));
+ dispatch(createACS(params, name, () => { dispatch(getAlternateContentSources()); }));
}
}, [dispatch, createACSDispatched, setCreateACSDispatched,
acsType, authentication, name, description, url, subpaths,
- smartProxies, contentType, verifySSL, caCert, sslCert, sslKey,
+ smartProxies, contentType, useHttpProxies, verifySSL, caCert, sslCert, sslKey,
username, password, currentStep, acsTypeParams]);
useDeepCompareEffect(() => {
const { id } = response;
if (id && status === STATUS.RESOLVED && saving) {
setSaving(false);
- push(`/labs/alternate_content_sources/${id}/details`);
+ window.location.assign(`/alternate_content_sources/${id}/details`);
setIsOpen(false);
} else if (status === STATUS.ERROR) {
setSaving(false);
setIsOpen(false);
}