mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
## Summary
Makes the shared-ux navigation the default side navigation component for
Security projects.
The old Security navigation component and the experimental flag will be
removed altogether in a separate PR.
There is no visual difference from the previous navigation:

---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
80 lines
2.4 KiB
TypeScript
80 lines
2.4 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
* 2.0.
|
|
*/
|
|
|
|
import { SECURITY_SOLUTION_OWNER } from '@kbn/cases-plugin/common';
|
|
import { AppDeepLinkId } from '@kbn/core-chrome-browser';
|
|
import { FtrProviderContext } from '../../../functional/ftr_provider_context';
|
|
|
|
export const createOneCaseBeforeDeleteAllAfter = (
|
|
getPageObject: FtrProviderContext['getPageObject'],
|
|
getService: FtrProviderContext['getService'],
|
|
owner: string
|
|
) => {
|
|
const svlCases = getService('svlCases');
|
|
|
|
before(async () => {
|
|
await createAndNavigateToCase(getPageObject, getService, owner);
|
|
});
|
|
|
|
after(async () => {
|
|
await svlCases.api.deleteAllCaseItems();
|
|
});
|
|
};
|
|
|
|
export const createOneCaseBeforeEachDeleteAllAfterEach = (
|
|
getPageObject: FtrProviderContext['getPageObject'],
|
|
getService: FtrProviderContext['getService'],
|
|
owner: string
|
|
) => {
|
|
const svlCases = getService('svlCases');
|
|
|
|
beforeEach(async () => {
|
|
await createAndNavigateToCase(getPageObject, getService, owner);
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await svlCases.api.deleteAllCaseItems();
|
|
});
|
|
};
|
|
|
|
export const createAndNavigateToCase = async (
|
|
getPageObject: FtrProviderContext['getPageObject'],
|
|
getService: FtrProviderContext['getService'],
|
|
owner: string
|
|
) => {
|
|
const cases = getService('cases');
|
|
|
|
const header = getPageObject('header');
|
|
|
|
await navigateToCasesApp(getPageObject, getService, owner);
|
|
|
|
const theCase = await cases.api.createCase({ owner });
|
|
await cases.casesTable.waitForCasesToBeListed();
|
|
await cases.casesTable.goToFirstListedCase();
|
|
await header.waitUntilLoadingHasFinished();
|
|
|
|
return theCase;
|
|
};
|
|
|
|
export const navigateToCasesApp = async (
|
|
getPageObject: FtrProviderContext['getPageObject'],
|
|
getService: FtrProviderContext['getService'],
|
|
owner: string
|
|
) => {
|
|
const common = getPageObject('common');
|
|
const svlCommonNavigation = getPageObject('svlCommonNavigation');
|
|
|
|
await common.navigateToApp('landingPage');
|
|
|
|
if (owner === SECURITY_SOLUTION_OWNER) {
|
|
await svlCommonNavigation.sidenav.clickLink({
|
|
deepLinkId: 'securitySolutionUI:cases' as AppDeepLinkId,
|
|
});
|
|
} else {
|
|
await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'observability-overview:cases' });
|
|
}
|
|
};
|