diff --git a/webpack/components/OpenscapRemediationWizard/ViewSelectedHostsLink.js b/webpack/components/OpenscapRemediationWizard/ViewSelectedHostsLink.js index 31593d2c..ed0cfda6 100644 --- a/webpack/components/OpenscapRemediationWizard/ViewSelectedHostsLink.js +++ b/webpack/components/OpenscapRemediationWizard/ViewSelectedHostsLink.js @@ -6,7 +6,7 @@ import { Button } from '@patternfly/react-core'; import { translate as __ } from 'foremanReact/common/I18n'; import { foremanUrl } from 'foremanReact/common/helpers'; -import { getHostsPageUrl } from 'foremanReact/Root/Context/ForemanContext'; +import { useForemanHostsPageUrl } from 'foremanReact/Root/Context/ForemanContext'; const ViewSelectedHostsLink = ({ hostIdsParam, @@ -14,7 +14,7 @@ const ViewSelectedHostsLink = ({ defaultFailedHostsSearch, }) => { const search = isAllHostsSelected ? defaultFailedHostsSearch : hostIdsParam; - const url = foremanUrl(`${getHostsPageUrl(false)}?search=${search}`); + const url = foremanUrl(`${useForemanHostsPageUrl()}?search=${search}`); return ( ), isSorted: true, weight: 50, diff --git a/webpack/components/OpenscapRemediationWizard/steps/ReviewRemediation.js b/webpack/components/OpenscapRemediationWizard/steps/ReviewRemediation.js index afbda9d3..3c1c24f2 100644 --- a/webpack/components/OpenscapRemediationWizard/steps/ReviewRemediation.js +++ b/webpack/components/OpenscapRemediationWizard/steps/ReviewRemediation.js @@ -16,12 +16,15 @@ import { ExternalLinkSquareAltIcon } from '@patternfly/react-icons'; import { translate as __ } from 'foremanReact/common/I18n'; import { foremanUrl } from 'foremanReact/common/helpers'; -import { getHostsPageUrl } from 'foremanReact/Root/Context/ForemanContext'; +import { + useForemanHostsPageUrl, + useForemanHostDetailsPageUrl, +} from 'foremanReact/Root/Context/ForemanContext'; import OpenscapRemediationWizardContext from '../OpenscapRemediationWizardContext'; import WizardHeader from '../WizardHeader'; import ViewSelectedHostsLink from '../ViewSelectedHostsLink'; -import { HOSTS_PATH, FAIL_RULE_SEARCH } from '../constants'; +import { FAIL_RULE_SEARCH } from '../constants'; import { findFixBySnippet } from '../helpers'; import './ReviewRemediation.scss'; @@ -120,7 +123,7 @@ const ReviewRemediation = () => { iconPosition="right" target="_blank" component="a" - href={foremanUrl(`${getHostsPageUrl(true)}/${hostName}`)} + href={foremanUrl(`${useForemanHostDetailsPageUrl()}${hostName}`)} > {hostName} {' '} @@ -133,7 +136,7 @@ const ReviewRemediation = () => { target="_blank" component="a" href={foremanUrl( - `${HOSTS_PATH}/?search=${FAIL_RULE_SEARCH} = ${source}` + `${useForemanHostsPageUrl()}?search=${FAIL_RULE_SEARCH} = ${source}` )} > {__('Other hosts failing this rule')}