diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.test.tsx index f6adea30b019f..62ac53004a773 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.test.tsx @@ -84,6 +84,7 @@ describe('TrainedModelHealthPopover', () => { const fixButton = wrapper.find(EuiButtonEmpty).at(0); expect(fixButton.prop('iconType')).toBe('wrench'); + expect(fixButton.prop('href')).toBe('/app/ml/trained_models'); expect(fixButton.children().text()).toBe('Fix issue in Trained Models'); }); it('popover does not render fix button when model deployed', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx index a9422a65f5aaf..342d05c398878 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx @@ -25,7 +25,7 @@ import { i18n } from '@kbn/i18n'; import { InferencePipeline, TrainedModelState } from '../../../../../../common/types/pipelines'; import { CANCEL_BUTTON_LABEL, DELETE_BUTTON_LABEL } from '../../../../shared/constants'; -import { KibanaLogic } from '../../../../shared/kibana'; +import { HttpLogic } from '../../../../shared/http'; import { ML_MANAGE_TRAINED_MODELS_PATH } from '../../../routes'; import { getMLType, getModelDisplayTitle } from '../../shared/ml_inference/utils'; import { IndexNameLogic } from '../index_name_logic'; @@ -38,7 +38,7 @@ import { MLModelTypeBadge } from './ml_model_type_badge'; import { PipelinesLogic } from './pipelines_logic'; export const TrainedModelHealthPopover: React.FC = (pipeline) => { - const { navigateToUrl } = useValues(KibanaLogic); + const { http } = useValues(HttpLogic); const { indexName } = useValues(IndexNameLogic); const { ingestionMethod } = useValues(IndexViewLogic); @@ -85,11 +85,7 @@ export const TrainedModelHealthPopover: React.FC = (pipeline) flush="both" iconType="wrench" color="text" - onClick={() => { - navigateToUrl(ML_MANAGE_TRAINED_MODELS_PATH, { - shouldNotCreateHref: true, - }); - }} + href={http.basePath.prepend(ML_MANAGE_TRAINED_MODELS_PATH)} > {i18n.translate( 'xpack.enterpriseSearch.inferencePipelineCard.modelState.notDeployed.fixLink', @@ -109,12 +105,9 @@ export const TrainedModelHealthPopover: React.FC = (pipeline) flush="both" iconType="eye" color="text" - onClick={() => { - navigateToUrl( - `/app/management/ingest/ingest_pipelines/?pipeline=${pipelineName}`, - { shouldNotCreateHref: true } - ); - }} + href={http.basePath.prepend( + `/app/management/ingest/ingest_pipelines/?pipeline=${pipelineName}` + )} > {i18n.translate('xpack.enterpriseSearch.inferencePipelineCard.action.view', { defaultMessage: 'View in Stack Management',