Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Onboarding] Stack - update index management breadcrumbs #209599

Open
wants to merge 53 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
60b517a
update index management breadcrumb
saarikabhasi Jan 24, 2025
858d4d5
add index name for stack solution nav
saarikabhasi Jan 28, 2025
2ce55e3
fix serverless version breadcrumb
saarikabhasi Jan 31, 2025
e47735c
clean up
saarikabhasi Jan 31, 2025
42e6684
update FTR
saarikabhasi Feb 4, 2025
6cf92e2
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Feb 4, 2025
82b297c
fix ci & clean up
saarikabhasi Feb 4, 2025
2e22912
fix conflicts
saarikabhasi Feb 4, 2025
d61d6ba
revert unintended change
saarikabhasi Feb 4, 2025
4816549
Clean ups
saarikabhasi Feb 4, 2025
950958c
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Feb 4, 2025
fa25cc6
remove indexName
saarikabhasi Feb 4, 2025
59d38f9
Merge branch 'onboarding/update-breadcrumbs-indexmanagement' of githu…
saarikabhasi Feb 4, 2025
c6b44b7
Merge branch 'main' into onboarding/update-breadcrumbs-indexmanagement
saarikabhasi Feb 5, 2025
2c60095
fix ci error
saarikabhasi Feb 5, 2025
c5798f1
Merge branch 'onboarding/update-breadcrumbs-indexmanagement' of githu…
saarikabhasi Feb 5, 2025
0972fc7
address feedback and update FTR tests navigate to details page
saarikabhasi Feb 6, 2025
0d998b6
move index management to separate file & fix ci
saarikabhasi Feb 6, 2025
5e0e326
move index management tests from classic nav to index mgmt file
saarikabhasi Feb 6, 2025
ed10b5b
Merge branch 'main' into onboarding/update-breadcrumbs-indexmanagement
saarikabhasi Feb 6, 2025
7c815fc
add new variable to the setBreadcrumb
saarikabhasi Feb 9, 2025
791100a
Merge branch 'onboarding/update-breadcrumbs-indexmanagement' of githu…
saarikabhasi Feb 10, 2025
50b2744
update i18n_check
saarikabhasi Feb 11, 2025
8732bca
Merge branch 'main' into onboarding/update-breadcrumbs-indexmanagement
saarikabhasi Feb 11, 2025
0f4ea73
update FTR for search_sidenav
saarikabhasi Feb 11, 2025
e5db3a6
Revert "update i18n_check"
saarikabhasi Feb 26, 2025
d02b185
Merge branch 'main' of github.com:elastic/kibana into onboarding/upda…
saarikabhasi Feb 26, 2025
85a0292
initial commit use index management to search_indices
saarikabhasi Feb 21, 2025
331dd2c
add deeplinks, update nav tree, update search_indices plugin
saarikabhasi Feb 23, 2025
914504b
fix breadcrumbs to work for serverless & stack
saarikabhasi Feb 25, 2025
d10e94a
delete unused files, clean up types
saarikabhasi Feb 25, 2025
4b38e69
fix breadcrumbs for serverless search
saarikabhasi Feb 25, 2025
c07063d
fix tests
saarikabhasi Feb 26, 2025
e8cfe17
fix types & eslint
saarikabhasi Feb 27, 2025
d8b1abb
remove unrelated changes
saarikabhasi Feb 27, 2025
0a84fed
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Feb 27, 2025
1d428ca
remove commented lines from solution_nav ftr
saarikabhasi Feb 27, 2025
b5ed052
fix ftrs for failing kibana CI
saarikabhasi Feb 27, 2025
3c08dc0
[CI] Auto-commit changed files from 'node scripts/telemetry_check'
kibanamachine Feb 27, 2025
27e157e
fix FTR search side nav
saarikabhasi Feb 28, 2025
5c959d8
Merge branch 'onboarding/update-breadcrumbs-indexmanagement' of githu…
saarikabhasi Feb 28, 2025
e601ab1
Merge branch 'main' into onboarding/update-breadcrumbs-indexmanagement
saarikabhasi Feb 28, 2025
8c53c2e
fix unmount index management app
saarikabhasi Mar 3, 2025
37fa6a1
Merge branch 'onboarding/update-breadcrumbs-indexmanagement' of githu…
saarikabhasi Mar 3, 2025
bc98ff9
Merge branch 'main' into onboarding/update-breadcrumbs-indexmanagement
saarikabhasi Mar 3, 2025
511b5de
clean up
saarikabhasi Mar 3, 2025
b799e10
FTR: add breadcrumbs check for stack
saarikabhasi Mar 3, 2025
4b12666
Merge branch 'onboarding/update-breadcrumbs-indexmanagement' of githu…
saarikabhasi Mar 3, 2025
d6871b8
Merge branch 'main' into onboarding/update-breadcrumbs-indexmanagement
saarikabhasi Mar 4, 2025
8dd3104
create subset type of ManagementAppMountParams
saarikabhasi Mar 5, 2025
31b8741
Merge branch 'onboarding/update-breadcrumbs-indexmanagement' of githu…
saarikabhasi Mar 5, 2025
0c79895
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Mar 5, 2025
069e381
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Mar 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/platform/plugins/shared/management/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,17 @@ export class ManagementPlugin
const [, ...trailingBreadcrumbs] = newBreadcrumbs;
deps.serverless.setBreadcrumbs(trailingBreadcrumbs);
} else {
coreStart.chrome.setBreadcrumbs(newBreadcrumbs, {
project: { value: newBreadcrumbs, absolute: true },
coreStart.chrome.getActiveSolutionNavId$().subscribe((activeSolutionId) => {
if (activeSolutionId === 'es') {
const [, ...trailingBreadcrumbs] = newBreadcrumbs;
coreStart.chrome.setBreadcrumbs(trailingBreadcrumbs, {
project: { value: trailingBreadcrumbs, absolute: true },
});
} else {
coreStart.chrome.setBreadcrumbs(newBreadcrumbs, {
project: { value: newBreadcrumbs, absolute: true },
});
}
});
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,34 @@ import React, { useEffect } from 'react';
import { RouteComponentProps } from 'react-router-dom';

import { ScopedHistory } from '@kbn/core/public';
import useObservable from 'react-use/lib/useObservable';
import { APP_WRAPPER_CLASS, useExecutionContext } from '../../../../shared_imports';
import { breadcrumbService, IndexManagementBreadcrumb } from '../../../services/breadcrumbs';
import { useAppContext } from '../../../app_context';
import { IndexTable } from './index_table';

export const IndexList: React.FunctionComponent<RouteComponentProps> = ({ history }) => {
const {
core: { executionContext },
core: { executionContext, chrome },
plugins: { cloud },
} = useAppContext();

useExecutionContext(executionContext, {
type: 'application',
page: 'indexManagementIndicesTab',
});

const activeSolutionId = useObservable(chrome.getActiveSolutionNavId$());
useEffect(() => {
breadcrumbService.setBreadcrumbs(IndexManagementBreadcrumb.indices);
}, []);
if (cloud?.isServerlessEnabled) {
breadcrumbService.setBreadcrumbs(IndexManagementBreadcrumb.indices);
} else {
if (activeSolutionId === 'es') {
breadcrumbService.setBreadcrumbs(IndexManagementBreadcrumb.indicesList);
} else {
breadcrumbService.setBreadcrumbs(IndexManagementBreadcrumb.indices);
}
}
}, [activeSolutionId, cloud]);

return (
<div className={`${APP_WRAPPER_CLASS} im-snapshotTestSubject`} data-test-subj="indicesList">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export enum IndexManagementBreadcrumb {
*/
enrichPolicies = 'enrichPolicies',
enrichPoliciesCreate = 'enrichPoliciesCreate',

content = 'content',
indicesList = 'indicesList',
}

class BreadcrumbService {
Expand All @@ -56,7 +59,14 @@ class BreadcrumbService {

public setup(setBreadcrumbsHandler: SetBreadcrumbs): void {
this.setBreadcrumbsHandler = setBreadcrumbsHandler;

this.breadcrumbs.content = [
{
text: i18n.translate('xpack.idxMgmt.breadcrumb.contentLabel', {
defaultMessage: 'Content',
}),
href: ``,
},
];
this.breadcrumbs.home = [
{
text: i18n.translate('xpack.idxMgmt.breadcrumb.homeLabel', {
Expand Down Expand Up @@ -194,6 +204,16 @@ class BreadcrumbService {
href: `/enrich_policies/create`,
},
];
this.breadcrumbs.indicesList = [
...this.breadcrumbs.content,
...this.breadcrumbs.home,
{
text: i18n.translate('xpack.idxMgmt.breadcrumb.indicesListLabel', {
defaultMessage: 'Indices',
}),
href: `/indices`,
},
];
}

public setBreadcrumbs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Section } from '../../../common/constants';
import type { IndexDetailsTabId } from '../../../common/constants';
import { ExtensionsService } from '../../services/extensions_service';
import { IndexDetailsSection } from '../../../common/constants';
import { breadcrumbService, IndexManagementBreadcrumb } from './breadcrumbs';

export const getTemplateListLink = () => `/templates`;

Expand Down Expand Up @@ -108,5 +109,6 @@ export const navigateToIndexDetailsPage = (
} else {
const route = extensionsService.indexDetailsPageRoute.renderRoute(indexName, tabId);
application.navigateToUrl(http.basePath.prepend(route));
breadcrumbService.setBreadcrumbs(IndexManagementBreadcrumb.indicesList, { text: indexName });
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ export function IndexManagementPageProvider({ getService }: FtrProviderContext)
) {
await testSubjects.click(tab);
},
async expectBreadcrumbNavigationToHaveBreadcrumbName(breadcrumbName: string) {
await testSubjects.existOrFail('euiBreadcrumb');
expect(await testSubjects.getVisibleText('breadcrumb first')).to.contain(
'Stack Management'
);
expect(await testSubjects.getVisibleText('breadcrumb last')).to.contain(breadcrumbName);
},
},
async clickCreateIndexButton() {
await testSubjects.click('createIndexButton');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export function SearchIndexDetailPageProvider({ getService }: FtrProviderContext
});
},

async expectBreadcrumbNavigationWithIndexName(indexName: string) {
async expectIndexNametoBeInBreadcrumbs(indexName: string) {
await testSubjects.existOrFail('euiBreadcrumb');
expect(await testSubjects.getVisibleText('breadcrumb last')).to.contain(indexName);
},
Expand Down
25 changes: 14 additions & 11 deletions x-pack/test/functional/page_objects/search_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { FtrProviderContext } from '../ftr_provider_context';

export function SearchNavigationProvider({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const { common, indexManagement, header } = getPageObjects([
'common',
'indexManagement',
'header',
]);
const { common, indexManagement, header, solutionNavigation, searchIndexDetailsPage } =
getPageObjects([
'common',
'indexManagement',
'header',
'solutionNavigation',
'searchIndexDetailsPage',
]);
const testSubjects = getService('testSubjects');

return {
Expand All @@ -35,12 +37,13 @@ export function SearchNavigationProvider({ getService, getPageObjects }: FtrProv
}
});
},
async navigateToIndexDetailPage(indexName: string) {
await retry.tryForTime(60 * 1000, async () => {
await common.navigateToApp(`elasticsearch/indices/index_details/${indexName}`, {
shouldLoginIfPrompted: false,
});

async navigateToIndexDetailPage() {
await solutionNavigation.sidenav.expectLinkExists({ text: 'Index Management' });
await solutionNavigation.sidenav.clickLink({
deepLinkId: 'management:index_management',
});
await searchIndexDetailsPage.openIndicesDetailFromIndexManagementIndicesListTable(0);
await testSubjects.existOrFail('searchIndicesDetailsPage', { timeout: 2000 });
},
async navigateToInferenceManagementPage(expectRedirect: boolean = false) {
Expand Down
Loading