webpack/scenes/AlternateContentSources/Create/Steps/ACSCreateFinish.js in katello-4.7.2 vs webpack/scenes/AlternateContentSources/Create/Steps/ACSCreateFinish.js in katello-4.7.3

- old
+ new

@@ -1,20 +1,28 @@ import React, { useCallback, useContext, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; +import PropTypes from 'prop-types'; import useDeepCompareEffect from 'use-deep-compare-effect'; +import { WizardContextConsumer } from '@patternfly/react-core'; import { translate as __ } from 'foremanReact/common/I18n'; import { STATUS } from 'foremanReact/constants'; import ACSCreateContext from '../ACSCreateContext'; import { selectCreateACS, selectCreateACSError, selectCreateACSStatus } from '../../ACSSelectors'; import getAlternateContentSources, { createACS } from '../../ACSActions'; import Loading from '../../../../components/Loading'; -const ACSCreateFinish = () => { +const ACSCreateFinishWrapper = () => ( + <WizardContextConsumer> + {({ activeStep }) => <ACSCreateFinish activeStep={activeStep} />} + </WizardContextConsumer> +); + +const ACSCreateFinish = ({ activeStep }) => { const { push } = useHistory(); + const currentStep = activeStep.id; const { - currentStep, setIsOpen, acsType, contentType, name, description, @@ -92,6 +100,12 @@ }, [response, status, error, push, saving, dispatch, setIsOpen]); return <Loading loadingText={__('Saving alternate content source...')} />; }; -export default ACSCreateFinish; +ACSCreateFinish.propTypes = { + activeStep: PropTypes.shape({ + id: PropTypes.number.isRequired, + }).isRequired, +}; + +export default ACSCreateFinishWrapper;