diff --git a/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap
index b949fa7995d30..153438b34eb47 100644
--- a/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap
+++ b/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap
@@ -1,819 +1,707 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`home change home route should render a link to change the default route in advanced settings if advanced settings is enabled 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home directories should not render directory entry when showOnHomePage is false 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home directories should render ADMIN directory entry in "Manage your data" panel 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home directories should render DATA directory entry in "Ingest your data" panel 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home directories should render solutions in the "solution section" 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
+ }
+ }
+ template="empty"
+>
+
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home header render 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home header should show "Dev tools" link if console is available 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home header should show "Manage" link if stack management is available 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home isNewKibanaInstance should safely handle execeptions 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when there are index patterns 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when there are no index patterns 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home should render home component 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home welcome should show the normal home page if loading fails 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home welcome should show the normal home page if welcome screen is disabled locally 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
exports[`home welcome should show the welcome screen if enabled, and there are no index patterns defined 1`] = `
@@ -824,53 +712,45 @@ exports[`home welcome should show the welcome screen if enabled, and there are n
`;
exports[`home welcome stores skip welcome setting if skipped 1`] = `
-
-
+ />,
+ "rightSideItems": Array [],
}
- />
-
-
+
+
+
+
+
+
+
+
+
+
`;
diff --git a/src/plugins/home/public/application/components/_home.scss b/src/plugins/home/public/application/components/_home.scss
index 913e1511a6314..34643433d6112 100644
--- a/src/plugins/home/public/application/components/_home.scss
+++ b/src/plugins/home/public/application/components/_home.scss
@@ -1,19 +1,3 @@
-@import '../../../../../core/public/mixins';
-
-.homWrapper {
- @include kibanaFullBodyMinHeight();
- background-color: $euiColorEmptyShade;
- display: flex;
- flex-direction: column;
-}
-
-.homContent {
- margin: 0 auto;
- max-width: 1200px;
- padding: $euiSizeXL $euiSize;
- width: 100%;
-}
-
.homData--expanded {
flex-direction: column;
diff --git a/src/plugins/home/public/application/components/_solutions_section.scss b/src/plugins/home/public/application/components/_solutions_section.scss
index a808d83916c2d..965447f689f98 100644
--- a/src/plugins/home/public/application/components/_solutions_section.scss
+++ b/src/plugins/home/public/application/components/_solutions_section.scss
@@ -1,7 +1,3 @@
-.homSolutions {
- margin-top: -($euiSizeXL + $euiSizeL + $euiSizeM);
-}
-
.homSolutions__content {
min-height: $euiSize * 16;
diff --git a/src/plugins/home/public/application/components/home.js b/src/plugins/home/public/application/components/home.js
index 3c1ba8eea22ca..fdaaeef01f47a 100644
--- a/src/plugins/home/public/application/components/home.js
+++ b/src/plugins/home/public/application/components/home.js
@@ -13,8 +13,9 @@ import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule } from '@elastic/eui';
import { METRIC_TYPE } from '@kbn/analytics';
import { i18n } from '@kbn/i18n';
import {
+ KibanaPageTemplate,
+ overviewPageActions,
OverviewPageFooter,
- OverviewPageHeader,
} from '../../../../../../src/plugins/kibana_react/public';
import { HOME_APP_BASE_PATH } from '../../../common/constants';
import { FeatureCatalogueCategory } from '../../services';
@@ -113,7 +114,7 @@ export class Home extends Component {
renderNormal() {
const { addBasePath, solutions, directories } = this.props;
- const { trackUiMetric } = getServices();
+ const { application, trackUiMetric } = getServices();
const devTools = this.findDirectoryById('console');
const addDataFeatures = this.getFeaturesByCategory(FeatureCatalogueCategory.DATA);
const manageDataFeatures = this.getFeaturesByCategory(FeatureCatalogueCategory.ADMIN);
@@ -124,58 +125,56 @@ export class Home extends Component {
}
return (
- ,
+ rightSideItems: overviewPageActions({
+ addBasePath,
+ application,
+ showDevToolsLink: true,
+ showManagementLink: true,
+ }),
+ }}
+ template="empty"
>
- }
- />
-
-
- {solutions.length ? (
-
- ) : null}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{
- trackUiMetric(METRIC_TYPE.CLICK, 'set_home_as_default_route');
- }}
- onChangeDefaultRoute={() => {
- trackUiMetric(METRIC_TYPE.CLICK, 'change_to_different_default_route');
- }}
+ solutions={solutions}
+ directories={directories}
/>
-
-
+ ) : null}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ trackUiMetric(METRIC_TYPE.CLICK, 'set_home_as_default_route');
+ }}
+ onChangeDefaultRoute={() => {
+ trackUiMetric(METRIC_TYPE.CLICK, 'change_to_different_default_route');
+ }}
+ />
+
);
}
diff --git a/src/plugins/home/public/application/components/home.test.js b/src/plugins/home/public/application/components/home.test.js
index 2fe74c8778c0f..fb5ebca5275cc 100644
--- a/src/plugins/home/public/application/components/home.test.js
+++ b/src/plugins/home/public/application/components/home.test.js
@@ -25,8 +25,8 @@ jest.mock('../kibana_services', () => ({
}));
jest.mock('../../../../../../src/plugins/kibana_react/public', () => ({
+ overviewPageActions: jest.fn().mockReturnValue([]),
OverviewPageFooter: jest.fn().mockReturnValue(<>>),
- OverviewPageHeader: jest.fn().mockReturnValue(<>>),
}));
describe('home', () => {
diff --git a/src/plugins/kibana_overview/public/components/_overview.scss b/src/plugins/kibana_overview/public/components/_overview.scss
index 12e2d9cd921ec..89f2b6272a4b8 100644
--- a/src/plugins/kibana_overview/public/components/_overview.scss
+++ b/src/plugins/kibana_overview/public/components/_overview.scss
@@ -1,18 +1,5 @@
-@import '../../../../core/public/mixins';
-
-.kbnOverviewWrapper {
- @include kibanaFullBodyMinHeight();
- background-color: $euiColorEmptyShade;
- display: flex;
- flex-direction: column;
-}
-
-.kbnOverviewContent {
- margin: 0 auto;
- max-width: 1200px;
- padding: $euiSizeXL $euiSize;
- width: 100%;
-
+.kbnOverviewApps__item,
+.kbnOverviewMore__item {
// Ensure card heights are stretched equally when wrapped with this element
.kbnRedirectCrossAppLinks {
align-items: flex-start;
@@ -109,11 +96,6 @@
}
}
-// Accounting for no `flush="both"` prop on EuiButtonEmpty
-.kbnOverviewDataAdd__actionButton {
- margin-right: 0;
-}
-
.kbnOverviewDataManage__item:not(:only-child) {
@include euiBreakpoint('m', 'l', 'xl') {
flex: 0 0 calc(50% - #{$euiSizeM * 2});
diff --git a/src/plugins/kibana_overview/public/components/add_data/__snapshots__/add_data.test.tsx.snap b/src/plugins/kibana_overview/public/components/add_data/__snapshots__/add_data.test.tsx.snap
index 25538d2eda287..fb32d2814c0fe 100644
--- a/src/plugins/kibana_overview/public/components/add_data/__snapshots__/add_data.test.tsx.snap
+++ b/src/plugins/kibana_overview/public/components/add_data/__snapshots__/add_data.test.tsx.snap
@@ -32,7 +32,7 @@ exports[`AddData render 1`] = `
= ({ addBasePath, features }) => {
= ({ addBasePath, isDarkTheme, apps }) =>
}
layout="horizontal"
paddingSize="none"
diff --git a/src/plugins/kibana_overview/public/components/overview/__snapshots__/overview.test.tsx.snap b/src/plugins/kibana_overview/public/components/overview/__snapshots__/overview.test.tsx.snap
index 2e7dc9a7ddc60..a32e27050fad1 100644
--- a/src/plugins/kibana_overview/public/components/overview/__snapshots__/overview.test.tsx.snap
+++ b/src/plugins/kibana_overview/public/components/overview/__snapshots__/overview.test.tsx.snap
@@ -1,10 +1,234 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Overview render 1`] = `
-,
+ "rightSideItems": Array [],
+ }
+ }
+ template="empty"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ image="/plugins/kibanaOverview/assets/solutions_kibana_2x.png"
+ onClick={[Function]}
+ title="Kibana"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/kibanaOverview/assets/solutions_solution_2_2x.png"
+ onClick={[Function]}
+ title="Solution two"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/kibanaOverview/assets/solutions_solution_3_2x.png"
+ onClick={[Function]}
+ title="Solution three"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/kibanaOverview/assets/solutions_solution_4_2x.png"
+ onClick={[Function]}
+ title="Solution four"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+
+
+
+`;
+
+exports[`Overview without features 1`] = `
+
+ />,
+ "rightSideItems": Array [],
}
+ }
+ template="empty"
+>
+
+
-
-
-
-
+
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+ }
+ image="/plugins/kibanaOverview/assets/solutions_kibana_2x.png"
+ onClick={[Function]}
+ title="Kibana"
+ titleElement="h3"
+ titleSize="xs"
/>
-
-
-
-
+
+
-
-
-
- }
- image="/plugins/kibanaOverview/assets/solutions_kibana_2x.png"
- onClick={[Function]}
- title="Kibana"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/kibanaOverview/assets/solutions_solution_2_2x.png"
- onClick={[Function]}
- title="Solution two"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/kibanaOverview/assets/solutions_solution_3_2x.png"
- onClick={[Function]}
- title="Solution three"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/kibanaOverview/assets/solutions_solution_4_2x.png"
- onClick={[Function]}
- title="Solution four"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
-
-
-
-
-
-`;
-
-exports[`Overview without features 1`] = `
-
+
+
+ }
+ image="/plugins/kibanaOverview/assets/solutions_solution_2_2x.png"
+ onClick={[Function]}
+ title="Solution two"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/kibanaOverview/assets/solutions_solution_3_2x.png"
+ onClick={[Function]}
+ title="Solution three"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/kibanaOverview/assets/solutions_solution_4_2x.png"
+ onClick={[Function]}
+ title="Solution four"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+
+
+
+`;
+
+exports[`Overview without solutions 1`] = `
+
+ />,
+ "rightSideItems": Array [],
}
+ }
+ template="empty"
+>
+
+
-
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- image="/plugins/kibanaOverview/assets/solutions_kibana_2x.png"
- onClick={[Function]}
- title="Kibana"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/kibanaOverview/assets/solutions_solution_2_2x.png"
- onClick={[Function]}
- title="Solution two"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/kibanaOverview/assets/solutions_solution_3_2x.png"
- onClick={[Function]}
- title="Solution three"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/kibanaOverview/assets/solutions_solution_4_2x.png"
- onClick={[Function]}
- title="Solution four"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
-
-
-
-
-
-`;
-
-exports[`Overview without solutions 1`] = `
-
+
+
+
+
+
+
+
+
- }
+ onChangeDefaultRoute={[Function]}
+ onSetDefaultRoute={[Function]}
+ path="/app/kibana_overview"
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
`;
diff --git a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx
index 6f97b04a6fdf1..9d260469625ad 100644
--- a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx
+++ b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx
@@ -21,8 +21,8 @@ jest.mock('../../../../../../src/plugins/kibana_react/public', () => ({
},
}),
RedirectAppLinks: jest.fn((element: JSX.Element) => element),
+ overviewPageActions: jest.fn().mockReturnValue([]),
OverviewPageFooter: jest.fn().mockReturnValue(<>>),
- OverviewPageHeader: jest.fn().mockReturnValue(<>>),
}));
jest.mock('../../lib/ui_metric', () => ({
diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx
index 68c52b0395591..9bba923371f64 100644
--- a/src/plugins/kibana_overview/public/components/overview/overview.tsx
+++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx
@@ -23,8 +23,9 @@ import { CoreStart } from 'kibana/public';
import {
RedirectAppLinks,
useKibana,
+ KibanaPageTemplate,
+ overviewPageActions,
OverviewPageFooter,
- OverviewPageHeader,
} from '../../../../../../src/plugins/kibana_react/public';
import { FetchResult } from '../../../../../../src/plugins/newsfeed/public';
import {
@@ -116,147 +117,149 @@ export const Overview: FC = ({ newsFetchResult, solutions, features }) =>
const remainingApps = kibanaApps.map(({ id }) => id).filter((id) => !mainApps.includes(id));
return (
-
- }
- />
-
-
- {isNewKibanaInstance ? (
-
- ) : (
- <>
-
-
-
-
-
-
-
- {mainApps.length ? (
- <>
-
- {mainApps.map(renderAppCard)}
-
-
-
- >
- ) : null}
+ ,
+ rightSideItems: overviewPageActions({
+ addBasePath,
+ application,
+ hidden: isNewKibanaInstance,
+ }),
+ }}
+ template="empty"
+ >
+ {isNewKibanaInstance ? (
+
+ ) : (
+ <>
+
+
+
+
+
+
- {remainingApps.length ? (
+ {mainApps.length ? (
+ <>
- {remainingApps.map(renderAppCard)}
+ {mainApps.map(renderAppCard)}
- ) : null}
-
-
+
+ >
+ ) : null}
-
- {newsFetchResult && newsFetchResult.feedItems.length ? (
-
-
-
- ) : null}
+ {remainingApps.length ? (
+
+ {remainingApps.map(renderAppCard)}
+
+ ) : null}
+
-
- {solutions.length ? (
-
-
-
-
-
-
+
+
+
+ {newsFetchResult && newsFetchResult.feedItems.length ? (
+
+
+
+ ) : null}
-
+
+ {solutions.length ? (
+
+
+
+
+
+
-
- {solutions.map(({ id, title, description, icon, path }) => (
-
-
-
- }
- image={addBasePath(getSolutionGraphicURL(snakeCase(id)))}
- title={title}
- titleElement="h3"
- titleSize="xs"
- onClick={() => {
- trackUiMetric(METRIC_TYPE.CLICK, `solution_panel_${id}`);
- }}
- />
-
-
- ))}
-
-
- ) : (
-
-
-
-
+
-
-
-
+
+ {solutions.map(({ id, title, description, icon, path }) => (
+
+
+
+ }
+ image={addBasePath(getSolutionGraphicURL(snakeCase(id)))}
+ title={title}
+ titleElement="h3"
+ titleSize="xs"
+ onClick={() => {
+ trackUiMetric(METRIC_TYPE.CLICK, `solution_panel_${id}`);
+ }}
+ />
+
+
+ ))}
- )}
-
-
- >
- )}
+
+ ) : (
+
+
+
+
-
+
+
+
+
+ )}
+
+
+ >
+ )}
-
{
- trackUiMetric(METRIC_TYPE.CLICK, 'set_kibana_overview_as_default_route');
- }}
- onChangeDefaultRoute={() => {
- trackUiMetric(METRIC_TYPE.CLICK, 'change_to_different_default_route');
- }}
- />
-
-
+
+
+ {
+ trackUiMetric(METRIC_TYPE.CLICK, 'set_kibana_overview_as_default_route');
+ }}
+ onChangeDefaultRoute={() => {
+ trackUiMetric(METRIC_TYPE.CLICK, 'change_to_different_default_route');
+ }}
+ />
+
);
};
diff --git a/src/plugins/kibana_react/public/overview_page/index.ts b/src/plugins/kibana_react/public/overview_page/index.ts
index cd4e9f6befc63..73b35f4d97a37 100644
--- a/src/plugins/kibana_react/public/overview_page/index.ts
+++ b/src/plugins/kibana_react/public/overview_page/index.ts
@@ -6,5 +6,5 @@
* Side Public License, v 1.
*/
+export * from './overview_page_actions';
export * from './overview_page_footer';
-export * from './overview_page_header';
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_actions/__snapshots__/overview_page_actions.test.tsx.snap b/src/plugins/kibana_react/public/overview_page/overview_page_actions/__snapshots__/overview_page_actions.test.tsx.snap
new file mode 100644
index 0000000000000..10910f8b87b12
--- /dev/null
+++ b/src/plugins/kibana_react/public/overview_page/overview_page_actions/__snapshots__/overview_page_actions.test.tsx.snap
@@ -0,0 +1,101 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`overviewPageActions all buttons 1`] = `
+Array [
+
+
+ Add data
+
+ ,
+
+
+ Manage
+
+ ,
+
+
+ Dev tools
+
+ ,
+]
+`;
+
+exports[`overviewPageActions no buttons 1`] = `Array []`;
+
+exports[`overviewPageActions only add data button 1`] = `
+Array [
+
+
+ Add data
+
+ ,
+]
+`;
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_header/index.ts b/src/plugins/kibana_react/public/overview_page/overview_page_actions/index.ts
similarity index 89%
rename from src/plugins/kibana_react/public/overview_page/overview_page_header/index.ts
rename to src/plugins/kibana_react/public/overview_page/overview_page_actions/index.ts
index 7017068afd460..8684d6a8ca4e4 100644
--- a/src/plugins/kibana_react/public/overview_page/overview_page_header/index.ts
+++ b/src/plugins/kibana_react/public/overview_page/overview_page_actions/index.ts
@@ -6,4 +6,4 @@
* Side Public License, v 1.
*/
-export * from './overview_page_header';
+export * from './overview_page_actions';
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.test.tsx b/src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.test.tsx
new file mode 100644
index 0000000000000..f324d56196144
--- /dev/null
+++ b/src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.test.tsx
@@ -0,0 +1,51 @@
+/*
+ * 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 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { overviewPageActions } from './overview_page_actions';
+import { ApplicationStart } from 'kibana/public';
+
+jest.mock('../../app_links', () => ({
+ RedirectAppLinks: jest.fn((element: JSX.Element) => element),
+}));
+
+afterAll(() => jest.clearAllMocks());
+
+const addBasePathMock = jest.fn((path: string) => (path ? path : 'path'));
+
+const applicationStartMock = ({
+ capabilities: { navLinks: { management: true, dev_tools: true } },
+} as unknown) as ApplicationStart;
+
+describe('overviewPageActions', () => {
+ test('only add data button', () => {
+ const array = overviewPageActions({
+ addBasePath: addBasePathMock,
+ application: applicationStartMock,
+ });
+ expect(array).toMatchSnapshot();
+ });
+
+ test('all buttons', () => {
+ const array = overviewPageActions({
+ addBasePath: addBasePathMock,
+ application: applicationStartMock,
+ showDevToolsLink: true,
+ showManagementLink: true,
+ });
+ expect(array).toMatchSnapshot();
+ });
+
+ test('no buttons', () => {
+ const array = overviewPageActions({
+ addBasePath: addBasePathMock,
+ application: applicationStartMock,
+ hidden: true,
+ });
+ expect(array).toMatchSnapshot();
+ });
+});
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.tsx b/src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.tsx
new file mode 100644
index 0000000000000..c3f0acd059494
--- /dev/null
+++ b/src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.tsx
@@ -0,0 +1,88 @@
+/*
+ * 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 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import React from 'react';
+import { EuiButtonEmpty } from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import { ApplicationStart } from 'kibana/public';
+import { RedirectAppLinks } from '../../app_links';
+
+interface Props {
+ addBasePath: (path: string) => string;
+ application: ApplicationStart;
+ hidden?: boolean;
+ showDevToolsLink?: boolean;
+ showManagementLink?: boolean;
+}
+
+export const overviewPageActions = ({
+ addBasePath,
+ application,
+ hidden,
+ showDevToolsLink,
+ showManagementLink,
+}: Props) => {
+ const {
+ management: isManagementEnabled,
+ dev_tools: isDevToolsEnabled,
+ } = application.capabilities.navLinks;
+
+ const actionAddData = (
+
+
+ {i18n.translate('kibana-react.kbnOverviewPageHeader.addDataButtonLabel', {
+ defaultMessage: 'Add data',
+ })}
+
+
+ );
+
+ const actionStackManagement =
+ showManagementLink && isManagementEnabled ? (
+
+
+ {i18n.translate('kibana-react.kbnOverviewPageHeader.stackManagementButtonLabel', {
+ defaultMessage: 'Manage',
+ })}
+
+
+ ) : null;
+
+ const actionDevTools =
+ showDevToolsLink && isDevToolsEnabled ? (
+
+
+ {i18n.translate('kibana-react.kbnOverviewPageHeader.devToolsButtonLabel', {
+ defaultMessage: 'Dev tools',
+ })}
+
+
+ ) : null;
+
+ const actions = [actionAddData, actionStackManagement, actionDevTools];
+
+ return !hidden ? actions.filter((obj) => obj) : [];
+};
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_header/__snapshots__/overview_page_header.test.tsx.snap b/src/plugins/kibana_react/public/overview_page/overview_page_header/__snapshots__/overview_page_header.test.tsx.snap
deleted file mode 100644
index 61faefb600191..0000000000000
--- a/src/plugins/kibana_react/public/overview_page/overview_page_header/__snapshots__/overview_page_header.test.tsx.snap
+++ /dev/null
@@ -1,69 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`OverviewPageHeader render 1`] = `
-
-`;
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_header/_overview_page_header.scss b/src/plugins/kibana_react/public/overview_page/overview_page_header/_overview_page_header.scss
deleted file mode 100644
index 80087195e7dbd..0000000000000
--- a/src/plugins/kibana_react/public/overview_page/overview_page_header/_overview_page_header.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-.kbnOverviewPageHeader {
- background-color: $euiPageBackgroundColor;
- border-bottom: $euiBorderWidthThin solid $euiColorLightShade;
-}
-
-.kbnOverviewPageHeader__inner {
- margin: 0 auto;
- max-width: 1200px;
- padding: $euiSizeXL $euiSize;
-
- .kbnOverviewPageHeader--hasOverlap & {
- padding-bottom: $euiSizeXL + $euiSizeL;
- }
-}
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_header/index.scss b/src/plugins/kibana_react/public/overview_page/overview_page_header/index.scss
deleted file mode 100644
index 3e8fcc537736a..0000000000000
--- a/src/plugins/kibana_react/public/overview_page/overview_page_header/index.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import './overview_page_header';
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_header/overview_page_header.test.tsx b/src/plugins/kibana_react/public/overview_page/overview_page_header/overview_page_header.test.tsx
deleted file mode 100644
index f339bed58bb49..0000000000000
--- a/src/plugins/kibana_react/public/overview_page/overview_page_header/overview_page_header.test.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-import React from 'react';
-import { OverviewPageHeader } from './overview_page_header';
-import { shallowWithIntl } from '@kbn/test/jest';
-
-jest.mock('../../app_links', () => ({
- RedirectAppLinks: jest.fn((element: JSX.Element) => element),
-}));
-
-jest.mock('../../context', () => ({
- useKibana: jest.fn().mockReturnValue({
- services: {
- application: { capabilities: { navLinks: { management: true, dev_tools: true } } },
- notifications: { toast: { addSuccess: jest.fn() } },
- },
- }),
-}));
-
-afterAll(() => jest.clearAllMocks());
-
-const mockTitle = 'Page Title';
-const addBasePathMock = jest.fn((path: string) => (path ? path : 'path'));
-
-describe('OverviewPageHeader', () => {
- test('render', () => {
- const component = shallowWithIntl(
-
- );
- expect(component).toMatchSnapshot();
- });
-});
diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_header/overview_page_header.tsx b/src/plugins/kibana_react/public/overview_page/overview_page_header/overview_page_header.tsx
deleted file mode 100644
index cba1e093dedf3..0000000000000
--- a/src/plugins/kibana_react/public/overview_page/overview_page_header/overview_page_header.tsx
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-import React, { FC } from 'react';
-import {
- EuiButtonEmpty,
- EuiFlexGroup,
- EuiFlexItem,
- EuiIcon,
- EuiTitle,
- IconType,
-} from '@elastic/eui';
-import { i18n } from '@kbn/i18n';
-import { CoreStart } from 'kibana/public';
-import { RedirectAppLinks } from '../../app_links';
-import { useKibana } from '../../context';
-
-import './index.scss';
-
-interface Props {
- hideToolbar?: boolean;
- iconType?: IconType;
- overlap?: boolean;
- showDevToolsLink?: boolean;
- showManagementLink?: boolean;
- title: JSX.Element | string;
- addBasePath: (path: string) => string;
-}
-
-export const OverviewPageHeader: FC = ({
- hideToolbar,
- iconType,
- overlap,
- showDevToolsLink,
- showManagementLink,
- title,
- addBasePath,
-}) => {
- const {
- services: { application },
- } = useKibana();
-
- const {
- management: isManagementEnabled,
- dev_tools: isDevToolsEnabled,
- } = application.capabilities.navLinks;
-
- return (
-
-
-
-
-
- {iconType && (
-
-
-
- )}
-
-
-
-
-
-
-
-
-
- {!hideToolbar && (
-
-
-
-
-
- {i18n.translate('kibana-react.kbnOverviewPageHeader.addDataButtonLabel', {
- defaultMessage: 'Add data',
- })}
-
-
-
-
- {showManagementLink && isManagementEnabled ? (
-
-
-
- {i18n.translate(
- 'kibana-react.kbnOverviewPageHeader.stackManagementButtonLabel',
- {
- defaultMessage: 'Manage',
- }
- )}
-
-
-
- ) : null}
-
- {showDevToolsLink && isDevToolsEnabled ? (
-
-
-
- {i18n.translate('kibana-react.kbnOverviewPageHeader.devToolsButtonLabel', {
- defaultMessage: 'Dev tools',
- })}
-
-
-
- ) : null}
-
-
- )}
-
-
-
- );
-};