Skip to content

Commit 5111143

Browse files
[SECURITY] Redirect app/security to app/security/overview (#70005) (#70067)
* redirect app/security to app/security/overview * missing re-naming initialization * add unit test for intialization value of indicesExists Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent 305a720 commit 5111143

4 files changed

Lines changed: 35 additions & 15 deletions

File tree

x-pack/plugins/security_solution/public/common/containers/source/index.test.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ jest.mock('../../utils/apollo_context', () => ({
1717
}));
1818

1919
describe('Index Fields & Browser Fields', () => {
20+
test('At initialization the value of indicesExists should be true', async () => {
21+
const { result, waitForNextUpdate } = renderHook(() => useWithSource());
22+
const initialResult = result.current;
23+
24+
await waitForNextUpdate();
25+
26+
return expect(initialResult).toEqual({
27+
browserFields: {},
28+
errorMessage: null,
29+
indexPattern: {
30+
fields: [],
31+
title: 'apm-*-transaction*,auditbeat-*,endgame-*,filebeat-*,packetbeat-*,winlogbeat-*',
32+
},
33+
indicesExist: true,
34+
loading: true,
35+
});
36+
});
37+
2038
test('returns memoized value', async () => {
2139
const { result, waitForNextUpdate, rerender } = renderHook(() => useWithSource());
2240
await waitForNextUpdate();

x-pack/plugins/security_solution/public/common/containers/source/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const useWithSource = (sourceId = 'default', indexToAdd?: string[] | null
102102
browserFields: EMPTY_BROWSER_FIELDS,
103103
errorMessage: null,
104104
indexPattern: getIndexFields(defaultIndex.join(), []),
105-
indicesExist: undefined,
105+
indicesExist: indicesExistOrDataTemporarilyUnavailable(undefined),
106106
loading: false,
107107
});
108108

x-pack/plugins/security_solution/public/common/translations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import { i18n } from '@kbn/i18n';
88

99
export const EMPTY_TITLE = i18n.translate('xpack.securitySolution.pages.common.emptyTitle', {
10-
defaultMessage: 'Welcome to SIEM. Let’s get you started.',
10+
defaultMessage: 'Welcome to Security Solution. Let’s get you started.',
1111
});
1212

1313
export const EMPTY_MESSAGE = i18n.translate('xpack.securitySolution.pages.common.emptyMessage', {
1414
defaultMessage:
15-
'To begin using security information and event management (SIEM), you’ll need to add SIEM-related data, in Elastic Common Schema (ECS) format, to the Elastic Stack. An easy way to get started is by installing and configuring our data shippers, called Beats. Let’s do that now!',
15+
'To begin using security information and event management (Security Solution), you’ll need to add security solution related data, in Elastic Common Schema (ECS) format, to the Elastic Stack. An easy way to get started is by installing and configuring our data shippers, called Beats. Let’s do that now!',
1616
});
1717

1818
export const EMPTY_ACTION_PRIMARY = i18n.translate(

x-pack/plugins/security_solution/public/plugin.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
PluginInitializerContext,
1717
Plugin as IPlugin,
1818
DEFAULT_APP_CATEGORIES,
19+
AppNavLinkStatus,
1920
} from '../../../../src/core/public';
2021
import { Storage } from '../../../../src/plugins/kibana_utils/public';
2122
import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public';
@@ -35,6 +36,7 @@ import {
3536
APP_CASES_PATH,
3637
SHOW_ENDPOINT_ALERTS_NAV,
3738
APP_ENDPOINT_ALERTS_PATH,
39+
APP_PATH,
3840
} from '../common/constants';
3941
import { ConfigureEndpointDatasource } from './management/pages/policy/view/ingest_manager_integration/configure_datasource';
4042

@@ -86,18 +88,18 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
8688
return { coreStart, startPlugins, services, store: this.store, storage };
8789
};
8890

89-
// Waiting for https://github.com/elastic/kibana/issues/69110
90-
// core.application.register({
91-
// id: APP_ID,
92-
// title: 'Security',
93-
// appRoute: APP_PATH,
94-
// navLinkStatus: AppNavLinkStatus.hidden,
95-
// mount: async (params: AppMountParameters) => {
96-
// const [{ application }] = await core.getStartServices();
97-
// application.navigateToApp(`${APP_ID}:${SecurityPageName.overview}`, { replace: true });
98-
// return () => true;
99-
// },
100-
// });
91+
core.application.register({
92+
exactRoute: true,
93+
id: APP_ID,
94+
title: 'Security',
95+
appRoute: APP_PATH,
96+
navLinkStatus: AppNavLinkStatus.hidden,
97+
mount: async (params: AppMountParameters) => {
98+
const [{ application }] = await core.getStartServices();
99+
application.navigateToApp(`${APP_ID}:${SecurityPageName.overview}`, { replace: true });
100+
return () => true;
101+
},
102+
});
101103

102104
core.application.register({
103105
id: `${APP_ID}:${SecurityPageName.overview}`,

0 commit comments

Comments
 (0)