From 6f3b5827b5609924d29f058ed5562b9ae9e2439a Mon Sep 17 00:00:00 2001 From: saarikabhasi Date: Thu, 17 Oct 2024 23:49:16 -0400 Subject: [PATCH] clean ups --- .../index_actions_context_menu.js | 3 ++- .../public/application/services/routing.ts | 6 ++---- x-pack/plugins/search_indices/public/plugin.ts | 10 +++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js index aacb5f3f2aa82..02f4767cea72d 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js @@ -89,7 +89,8 @@ export class IndexActionsContextMenu extends Component { extensionsService, application, http, - history + history, + IndexDetailsSection.Overview ); }, }); diff --git a/x-pack/plugins/index_management/public/application/services/routing.ts b/x-pack/plugins/index_management/public/application/services/routing.ts index 34d1b024eb023..1ebf347b088b4 100644 --- a/x-pack/plugins/index_management/public/application/services/routing.ts +++ b/x-pack/plugins/index_management/public/application/services/routing.ts @@ -92,11 +92,9 @@ export const navigateToIndexDetailsPage = ( tabId?: IndexDetailsSection ) => { if (!extensionsService.indexDetailsPageRoute) { - history.push( - getIndexDetailsLink(indexName, indicesListURLParams, IndexDetailsSection.Overview) - ); + history.push(getIndexDetailsLink(indexName, indicesListURLParams, tabId)); } else { const route = extensionsService.indexDetailsPageRoute.renderRoute(indexName, tabId); - application.navigateToUrl(http.basePath.prepend(`${route}`)); + application.navigateToUrl(http.basePath.prepend(route)); } }; diff --git a/x-pack/plugins/search_indices/public/plugin.ts b/x-pack/plugins/search_indices/public/plugin.ts index 856cd3c0f8755..9a3f0fcf9bb80 100644 --- a/x-pack/plugins/search_indices/public/plugin.ts +++ b/x-pack/plugins/search_indices/public/plugin.ts @@ -90,12 +90,12 @@ export class SearchIndicesPlugin if (this.pluginEnabled) { indexManagement?.extensionsService.setIndexDetailsPageRoute({ renderRoute: (indexName, detailsTabId) => { - const route = `/app/elasticsearch/indices/index_details/${indexName}` - if(detailsTabId && Object.values(SearchIndexDetailsTabs).includes(detailsTabId)){ - return `${route}/${detailsTabId}` + const route = `/app/elasticsearch/indices/index_details/${indexName}`; + const tabIds:string[] = Object.values(SearchIndexDetailsTabs) + if (detailsTabId && tabIds.includes(detailsTabId)) { + return `${route}/${detailsTabId}`; } - return route - + return route; }, }); }