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 cab1a06055087..23c2384c6f51c 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 @@ -77,7 +77,6 @@ describe('InferencePipelineCard', () => { 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 875a910ba922d..a0ea08e36d4b3 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 { HttpLogic } from '../../../../shared/http'; +import { KibanaLogic } from '../../../../shared/kibana'; 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 { http } = useValues(HttpLogic); + const { navigateToUrl } = useValues(KibanaLogic); const { indexName } = useValues(IndexNameLogic); const { ingestionMethod } = useValues(IndexViewLogic); @@ -85,7 +85,11 @@ export const TrainedModelHealthPopover: React.FC = (pipeline) flush="both" iconType="wrench" color="text" - href={http.basePath.prepend(ML_MANAGE_TRAINED_MODELS_PATH)} + onClick={() => { + navigateToUrl(ML_MANAGE_TRAINED_MODELS_PATH, { + shouldNotCreateHref: true, + }); + }} > {i18n.translate( 'xpack.enterpriseSearch.inferencePipelineCard.modelState.notDeployed.fixLink', @@ -105,9 +109,12 @@ export const TrainedModelHealthPopover: React.FC = (pipeline) flush="both" iconType="eye" color="text" - href={http.basePath.prepend( - `/app/management/ingest/ingest_pipelines/?pipeline=${pipelineName}` - )} + onClick={() => { + navigateToUrl( + `/app/management/ingest/ingest_pipelines/?pipeline=${pipelineName}`, + { shouldNotCreateHref: true } + ); + }} > {i18n.translate('xpack.enterpriseSearch.inferencePipelineCard.action.view', { defaultMessage: 'View in Stack Management',