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 8f2bd4c306623..d00003a071b10 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 @@ -2,37 +2,22 @@ exports[`home change home route should render a link to change the default route in advanced settings if advanced settings is enabled 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -56,7 +41,7 @@ exports[`home change home route should render a link to change the default route aria-hidden="true" margin="xl" /> -
@@ -65,37 +50,22 @@ exports[`home change home route should render a link to change the default route exports[`home directories should not render directory entry when showOnHomePage is false 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -119,7 +89,7 @@ exports[`home directories should not render directory entry when showOnHomePage aria-hidden="true" margin="xl" /> -
@@ -128,37 +98,22 @@ exports[`home directories should not render directory entry when showOnHomePage exports[`home directories should render ADMIN directory entry in "Manage your data" panel 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -194,7 +149,7 @@ exports[`home directories should render ADMIN directory entry in "Manage your da aria-hidden="true" margin="xl" /> -
@@ -203,37 +158,22 @@ exports[`home directories should render ADMIN directory entry in "Manage your da exports[`home directories should render DATA directory entry in "Ingest your data" panel 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -269,7 +209,7 @@ exports[`home directories should render DATA directory entry in "Ingest your dat aria-hidden="true" margin="xl" /> -
@@ -278,37 +218,22 @@ exports[`home directories should render DATA directory entry in "Ingest your dat exports[`home directories should render solutions in the "solution section" 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -384,7 +309,7 @@ exports[`home directories should render solutions in the "solution section" 1`] aria-hidden="true" margin="xl" /> -
@@ -393,37 +318,22 @@ exports[`home directories should render solutions in the "solution section" 1`] exports[`home header render 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -447,7 +357,7 @@ exports[`home header render 1`] = ` aria-hidden="true" margin="xl" /> -
@@ -456,37 +366,22 @@ exports[`home header render 1`] = ` exports[`home header should show "Dev tools" link if console is available 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -522,7 +417,7 @@ exports[`home header should show "Dev tools" link if console is available 1`] = aria-hidden="true" margin="xl" /> -
@@ -531,37 +426,22 @@ exports[`home header should show "Dev tools" link if console is available 1`] = exports[`home header should show "Manage" link if stack management is available 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -585,7 +465,7 @@ exports[`home header should show "Manage" link if stack management is available aria-hidden="true" margin="xl" /> -
@@ -594,37 +474,22 @@ exports[`home header should show "Manage" link if stack management is available exports[`home isNewKibanaInstance should safely handle execeptions 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -648,7 +513,7 @@ exports[`home isNewKibanaInstance should safely handle execeptions 1`] = ` aria-hidden="true" margin="xl" /> -
@@ -657,37 +522,22 @@ exports[`home isNewKibanaInstance should safely handle execeptions 1`] = ` exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when there are index patterns 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -711,7 +561,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t aria-hidden="true" margin="xl" /> -
@@ -720,37 +570,22 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when there are no index patterns 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -774,7 +609,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when th aria-hidden="true" margin="xl" /> -
@@ -783,37 +618,22 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when th exports[`home should render home component 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -837,7 +657,7 @@ exports[`home should render home component 1`] = ` aria-hidden="true" margin="xl" /> -
@@ -846,37 +666,22 @@ exports[`home should render home component 1`] = ` exports[`home welcome should show the normal home page if loading fails 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -900,7 +705,7 @@ exports[`home welcome should show the normal home page if loading fails 1`] = ` aria-hidden="true" margin="xl" /> -
@@ -909,37 +714,22 @@ exports[`home welcome should show the normal home page if loading fails 1`] = ` exports[`home welcome should show the normal home page if welcome screen is disabled locally 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -963,7 +753,7 @@ exports[`home welcome should show the normal home page if welcome screen is disa aria-hidden="true" margin="xl" /> -
@@ -979,37 +769,22 @@ exports[`home welcome should show the welcome screen if enabled, and there are n exports[`home welcome stores skip welcome setting if skipped 1`] = `
-
-
- -

- -

- - } + -
-
+ } + />
@@ -1033,7 +808,7 @@ exports[`home welcome stores skip welcome setting if skipped 1`] = ` aria-hidden="true" margin="xl" /> -
diff --git a/src/plugins/home/public/application/components/__snapshots__/synopsis.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/synopsis.test.js.snap index 190985f70659d..ec192ce1eb32f 100644 --- a/src/plugins/home/public/application/components/__snapshots__/synopsis.test.js.snap +++ b/src/plugins/home/public/application/components/__snapshots__/synopsis.test.js.snap @@ -9,6 +9,7 @@ exports[`props iconType 1`] = ` href="link_to_item" icon={ - - - +
+ + + +
= ({ addBasePath, features }) => ( - - - +
+ + + +
diff --git a/src/plugins/home/public/application/components/home.js b/src/plugins/home/public/application/components/home.js index 9e8b715dee54a..e27db0cc1aff6 100644 --- a/src/plugins/home/public/application/components/home.js +++ b/src/plugins/home/public/application/components/home.js @@ -20,9 +20,9 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiTitle, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { OverviewFooter, OverviewHeader } from '../../../../../../src/plugins/kibana_react/public'; +import { PageFooter, PageHeader } from '../../../../../../src/plugins/kibana_react/public'; import { HOME_APP_BASE_PATH } from '../../../common/constants'; import { FeatureCatalogueCategory } from '../../services'; import { getServices } from '../kibana_services'; @@ -128,26 +128,13 @@ export class Home extends Component { } return ( -
-
-
- -

- -

- - } - showDevToolsLink - showManagementLink - /> -
-
+
+ } + />
{solutions.length ? ( @@ -176,7 +163,7 @@ export class Home extends Component {
); diff --git a/src/plugins/home/public/application/components/solutions_section/__snapshots__/solution_panel.test.tsx.snap b/src/plugins/home/public/application/components/solutions_section/__snapshots__/solution_panel.test.tsx.snap index ad92aac67d51b..726d3dda4e9cc 100644 --- a/src/plugins/home/public/application/components/solutions_section/__snapshots__/solution_panel.test.tsx.snap +++ b/src/plugins/home/public/application/components/solutions_section/__snapshots__/solution_panel.test.tsx.snap @@ -13,6 +13,7 @@ exports[`SolutionPanel renders the solution panel for the given solution 1`] = ` onClick={[Function]} >

diff --git a/src/plugins/home/public/application/components/solutions_section/solution_panel.tsx b/src/plugins/home/public/application/components/solutions_section/solution_panel.tsx index 9fcd62fc5dbf7..943260efb275f 100644 --- a/src/plugins/home/public/application/components/solutions_section/solution_panel.tsx +++ b/src/plugins/home/public/application/components/solutions_section/solution_panel.tsx @@ -67,7 +67,7 @@ export const SolutionPanel: FC = ({ addBasePath, solution, apps = [] }) = href={addBasePath(solution.path)} onClick={createAppNavigationHandler(solution.path)} > - + = ({ title, subtitle, iconType }) => ( className="homSolutionPanel__icon" /> - +

{title}

diff --git a/src/plugins/home/public/application/components/synopsis.js b/src/plugins/home/public/application/components/synopsis.js index fbe3bb3ed6769..0777c0db7210e 100644 --- a/src/plugins/home/public/application/components/synopsis.js +++ b/src/plugins/home/public/application/components/synopsis.js @@ -38,7 +38,7 @@ export function Synopsis({ if (iconUrl) { optionalImg = ; } else if (iconType) { - optionalImg = ; + optionalImg = ; } const classes = classNames('homSynopsis__card', { diff --git a/src/plugins/kibana_overview/public/components/_overview.scss b/src/plugins/kibana_overview/public/components/_overview.scss index 911a0346e2824..74a58122d4851 100644 --- a/src/plugins/kibana_overview/public/components/_overview.scss +++ b/src/plugins/kibana_overview/public/components/_overview.scss @@ -17,9 +17,6 @@ * under the License. */ -// Local page variables -$kbnOverviewPageWidth: 1200px; - .kbnOverviewWrapper { background-color: $euiColorEmptyShade; display: flex; @@ -27,46 +24,21 @@ $kbnOverviewPageWidth: 1200px; min-height: calc(100vh - #{$euiHeaderHeightCompensation}); } -.kbnOverviewHeader { - background-color: $euiPageBackgroundColor; - border-bottom: $euiBorderWidthThin solid $euiColorLightShade; -} - -.kbnOverviewHeader__inner { - margin: 0 auto; - max-width: $kbnOverviewPageWidth; - padding: $euiSizeXL $euiSize; -} - -// Accounting for no `flush="both"` prop on EuiButtonEmpty -.kbnOverviewHeader__actionItem .euiButtonEmpty__content { - padding-left: 0; - padding-right: 0; -} - .kbnOverviewContent { margin: 0 auto; - max-width: $kbnOverviewPageWidth; + max-width: 1200px; padding: $euiSizeXL $euiSize; width: 100%; // Ensure card heights are stretched equally when wrapped with this element .kbnRedirectCrossAppLinks { + align-items: flex-start; display: flex; flex: 1; flex-direction: column; } } -// Prevent children from rendering as flex items -.kbnOverviewGettingStarted__content { - display: block; -} - -.kbnOverviewGettingStarted__apps .euiIcon__fillSecondary { - fill: $euiColorDarkestShade; -} - .kbnOverviewApps__item { .kbnOverviewApps__group--primary & { @include euiBreakpoint('m', 'l', 'xl') { @@ -136,22 +108,9 @@ $kbnOverviewPageWidth: 1200px; } } -.kbnOverviewDataAdd__actions { - // Prevent children from rendering as flex items - display: block; - - // Accounting for no `flush="both"` prop on EuiButtonEmpty - .euiButtonEmpty__content { - padding-left: 0; - padding-right: 0; - } -} - -.kbnOverviewDataAdd__content, -.kbnOverviewDataManage__content { - & .euiIcon__fillSecondary { - fill: $euiColorDarkestShade; - } +// Accounting for no `flush="both"` prop on EuiButtonEmpty +.kbnOverviewDataAdd__actionButton { + margin-right: 0; } .kbnOverviewDataManage__item:not(:only-child) { 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 66caceb117194..42623abd79ac0 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 @@ -29,17 +29,21 @@ exports[`AddData render 1`] = ` className="kbnOverviewDataAdd__actions" grow={false} > - - - +
+ + + +
= ({ features }) => { - - - +
+ + + +
diff --git a/src/plugins/kibana_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap b/src/plugins/kibana_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap index c87583593710b..e11cf37dfc45a 100644 --- a/src/plugins/kibana_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap +++ b/src/plugins/kibana_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap @@ -11,169 +11,177 @@ exports[`GettingStarted dark mode on 1`] = ` - -

+ - -

-
- - -

- -

-
- - - - - } - layout="horizontal" - paddingSize="none" - title="Dashboard" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Discover" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Canvas" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Maps" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Machine Learning" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Graph" - titleElement="h3" - titleSize="xs" - /> - - - - - + +

+
+ + +

+ +

+
+ + - - - + + + } + layout="horizontal" + paddingSize="none" + title="Dashboard" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Discover" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Canvas" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Maps" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Machine Learning" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Graph" + titleElement="h3" + titleSize="xs" + /> + + + + + + + + + - -

+ - -

-
- - -

- -

-
- - - - - } - layout="horizontal" - paddingSize="none" - title="Dashboard" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Discover" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Canvas" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Maps" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Machine Learning" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Graph" - titleElement="h3" - titleSize="xs" - /> - - - - - + + + + + +

+ +

+
+ + - -
-
+ + + } + layout="horizontal" + paddingSize="none" + title="Dashboard" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Discover" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Canvas" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Maps" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Machine Learning" + titleElement="h3" + titleSize="xs" + /> + + + + } + layout="horizontal" + paddingSize="none" + title="Graph" + titleElement="h3" + titleSize="xs" + /> + + + + + + + + +
= ({ addBasePath, isDarkTheme, apps }) => > - -

- -

-
+
+ +

+ +

+
- + - -

- -

-
+ +

+ +

+
- + - - {apps.map(({ subtitle = '', icon, title }) => ( - - } - layout="horizontal" - paddingSize="none" - title={title} - titleElement="h3" - titleSize="xs" - /> - - ))} - + + {apps.map(({ subtitle = '', icon, title }) => ( + + } + layout="horizontal" + paddingSize="none" + title={title} + titleElement="h3" + titleSize="xs" + /> + + ))} + - + - - - - - + + + + + +
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 393309a479ec3..004dbdaaf43ee 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 @@ -2,49 +2,20 @@ exports[`Overview render 1`] = `
-
-
- - - - - - -

- -

-
-
- - } + -
-
+ } + />
@@ -267,49 +238,20 @@ exports[`Overview render 1`] = ` exports[`Overview without features 1`] = `
-
-
- - - - - - -

- -

-
-
- - } + -
-
+ } + />
@@ -532,49 +474,20 @@ exports[`Overview without features 1`] = ` exports[`Overview without solutions 1`] = `
-
-
- - - - - - -

- -

-
-
- - } + -
-
+ } + />
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 51e8c16d8313b..500fcf9f6e808 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx @@ -32,8 +32,8 @@ jest.mock('../../../../../../src/plugins/kibana_react/public', () => ({ }, }), RedirectAppLinks: jest.fn((element: JSX.Element) => element), - OverviewFooter: jest.fn().mockReturnValue(<>), - OverviewHeader: jest.fn().mockReturnValue(<>), + PageFooter: jest.fn().mockReturnValue(<>), + PageHeader: jest.fn().mockReturnValue(<>), })); afterAll(() => jest.clearAllMocks()); diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx index 60c9f7d172a71..1ebdb331f62a1 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx @@ -24,7 +24,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, - EuiIcon, EuiScreenReaderOnly, EuiSpacer, EuiTitle, @@ -35,8 +34,8 @@ import { CoreStart } from 'kibana/public'; import { RedirectAppLinks, useKibana, - OverviewFooter, - OverviewHeader, + PageFooter, + PageHeader, } from '../../../../../../src/plugins/kibana_react/public'; import { FetchResult } from '../../../../../../src/plugins/newsfeed/public'; import { @@ -127,29 +126,13 @@ export const Overview: FC = ({ newsFetchResult, solutions, features }) => const mainApps = ['dashboard', 'discover']; const remainingApps = kibanaApps.map(({ id }) => id).filter((id) => !mainApps.includes(id)); - const pageTitle = ( - - - - - - - -

- -

-
-
-
- ); - return ( -
-
-
- {isNewKibanaInstance ? pageTitle : } -
-
+
+ } + />
{isNewKibanaInstance ? ( @@ -270,7 +253,7 @@ export const Overview: FC = ({ newsFetchResult, solutions, features }) =>
); diff --git a/src/plugins/kibana_overview/public/components/synopsis/__snapshots__/synopsis.test.js.snap b/src/plugins/kibana_overview/public/components/synopsis/__snapshots__/synopsis.test.js.snap index 190985f70659d..ec192ce1eb32f 100644 --- a/src/plugins/kibana_overview/public/components/synopsis/__snapshots__/synopsis.test.js.snap +++ b/src/plugins/kibana_overview/public/components/synopsis/__snapshots__/synopsis.test.js.snap @@ -9,6 +9,7 @@ exports[`props iconType 1`] = ` href="link_to_item" icon={ ; } else if (iconType) { - optionalImg = ; + optionalImg = ; } const classes = classNames('homSynopsis__card', { diff --git a/src/plugins/kibana_react/public/index.ts b/src/plugins/kibana_react/public/index.ts index 2b555e2334691..952cf5c77c97f 100644 --- a/src/plugins/kibana_react/public/index.ts +++ b/src/plugins/kibana_react/public/index.ts @@ -20,7 +20,7 @@ export * from './code_editor'; export * from './exit_full_screen_button'; export * from './context'; -export * from './overview_page'; +export * from './page'; export * from './overlays'; export * from './ui_settings'; export * from './field_icon'; diff --git a/src/plugins/kibana_react/public/overview_page/overview_footer/__snapshots__/overview_footer.test.tsx.snap b/src/plugins/kibana_react/public/overview_page/overview_footer/__snapshots__/overview_footer.test.tsx.snap deleted file mode 100644 index 819720782cce1..0000000000000 --- a/src/plugins/kibana_react/public/overview_page/overview_footer/__snapshots__/overview_footer.test.tsx.snap +++ /dev/null @@ -1,44 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`OverviewFooter render 1`] = ` -
- - - - - - - - - - -
-`; diff --git a/src/plugins/kibana_react/public/overview_page/overview_footer/_overview_footer.scss b/src/plugins/kibana_react/public/overview_page/overview_footer/_overview_footer.scss deleted file mode 100644 index cfe2c6b441431..0000000000000 --- a/src/plugins/kibana_react/public/overview_page/overview_footer/_overview_footer.scss +++ /dev/null @@ -1,12 +0,0 @@ -.kbnOverviewFooter { - // Prevent children from rendering as flex items - .euiFlexItem { - display: block; - } - - // Accounting for no `flush="both"` prop on EuiButtonEmpty - .euiButtonEmpty__content { - padding-left: 0; - padding-right: 0; - } -} diff --git a/src/plugins/kibana_react/public/overview_page/overview_footer/index.scss b/src/plugins/kibana_react/public/overview_page/overview_footer/index.scss deleted file mode 100644 index 56909bf164757..0000000000000 --- a/src/plugins/kibana_react/public/overview_page/overview_footer/index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './overview_footer'; diff --git a/src/plugins/kibana_react/public/overview_page/overview_header/__snapshots__/overview_header.test.tsx.snap b/src/plugins/kibana_react/public/overview_page/overview_header/__snapshots__/overview_header.test.tsx.snap deleted file mode 100644 index 89308b2fff2a5..0000000000000 --- a/src/plugins/kibana_react/public/overview_page/overview_header/__snapshots__/overview_header.test.tsx.snap +++ /dev/null @@ -1,45 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`OverviewHeader render 1`] = ` - - -

- Page Title -

-
- - - - - - Add data - - - - - -
-`; diff --git a/src/plugins/kibana_react/public/overview_page/overview_header/overview_header.tsx b/src/plugins/kibana_react/public/overview_page/overview_header/overview_header.tsx deleted file mode 100644 index 3388586149ce5..0000000000000 --- a/src/plugins/kibana_react/public/overview_page/overview_header/overview_header.tsx +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React, { FC } from 'react'; -import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { CoreStart } from 'kibana/public'; -import { RedirectAppLinks, useKibana } from '../../../../../../src/plugins/kibana_react/public'; - -interface Props { - title: JSX.Element; - showDevToolsLink?: boolean; - showManagementLink?: boolean; -} - -export const OverviewHeader: FC = ({ title, showManagementLink, showDevToolsLink }) => { - const { - services: { application }, - } = useKibana(); - - const { - management: isManagementEnabled, - dev_tools: isDevToolsEnabled, - } = application.capabilities.navLinks; - - return ( - - {title} - - - - - - {i18n.translate('kibana-react.overviewHeader.addDataButtonLabel', { - defaultMessage: 'Add data', - })} - - - - - {showManagementLink && isManagementEnabled ? ( - - - - {i18n.translate('kibana-react.overviewHeader.stackManagementButtonLabel', { - defaultMessage: 'Manage', - })} - - - - ) : null} - - {showDevToolsLink && isDevToolsEnabled ? ( - - - - {i18n.translate('kibana-react.overviewHeader.devToolsButtonLabel', { - defaultMessage: 'Dev tools', - })} - - - - ) : null} - - - - ); -}; diff --git a/src/plugins/kibana_react/public/overview_page/index.ts b/src/plugins/kibana_react/public/page/index.ts similarity index 91% rename from src/plugins/kibana_react/public/overview_page/index.ts rename to src/plugins/kibana_react/public/page/index.ts index 7dc53b8640a41..33e9b66cb3790 100644 --- a/src/plugins/kibana_react/public/overview_page/index.ts +++ b/src/plugins/kibana_react/public/page/index.ts @@ -17,5 +17,5 @@ * under the License. */ -export * from './overview_footer'; -export * from './overview_header'; +export * from './page_footer'; +export * from './page_header'; diff --git a/src/plugins/kibana_react/public/page/page_footer/__snapshots__/page_footer.test.tsx.snap b/src/plugins/kibana_react/public/page/page_footer/__snapshots__/page_footer.test.tsx.snap new file mode 100644 index 0000000000000..7eb79914ae80b --- /dev/null +++ b/src/plugins/kibana_react/public/page/page_footer/__snapshots__/page_footer.test.tsx.snap @@ -0,0 +1,49 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PageFooter render 1`] = ` +
+ + +
+ + +
+ + + + + +
+
+ +
+`; diff --git a/src/plugins/kibana_react/public/page/page_footer/_page_footer.scss b/src/plugins/kibana_react/public/page/page_footer/_page_footer.scss new file mode 100644 index 0000000000000..9a9a48716e241 --- /dev/null +++ b/src/plugins/kibana_react/public/page/page_footer/_page_footer.scss @@ -0,0 +1,23 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +// Accounting for no `flush="both"` prop on EuiButtonEmpty +.pageFooter__button { + margin-right: 0; +} diff --git a/src/plugins/home/public/application/components/_manage_data.scss b/src/plugins/kibana_react/public/page/page_footer/index.scss similarity index 90% rename from src/plugins/home/public/application/components/_manage_data.scss rename to src/plugins/kibana_react/public/page/page_footer/index.scss index 389d8c8b3bf0f..b4d5a534d880a 100644 --- a/src/plugins/home/public/application/components/_manage_data.scss +++ b/src/plugins/kibana_react/public/page/page_footer/index.scss @@ -17,6 +17,4 @@ * under the License. */ -.homDataManage__content .euiIcon__fillSecondary { - fill: $euiColorDarkestShade; -} +@import './page_footer'; diff --git a/src/plugins/kibana_react/public/overview_page/overview_header/index.ts b/src/plugins/kibana_react/public/page/page_footer/index.ts similarity index 95% rename from src/plugins/kibana_react/public/overview_page/overview_header/index.ts rename to src/plugins/kibana_react/public/page/page_footer/index.ts index 9f49cbf836a2c..6256394b3f2ff 100644 --- a/src/plugins/kibana_react/public/overview_page/overview_header/index.ts +++ b/src/plugins/kibana_react/public/page/page_footer/index.ts @@ -17,4 +17,4 @@ * under the License. */ -export * from './overview_header'; +export * from './page_footer'; diff --git a/src/plugins/kibana_react/public/overview_page/overview_footer/overview_footer.test.tsx b/src/plugins/kibana_react/public/page/page_footer/page_footer.test.tsx similarity index 89% rename from src/plugins/kibana_react/public/overview_page/overview_footer/overview_footer.test.tsx rename to src/plugins/kibana_react/public/page/page_footer/page_footer.test.tsx index 4422b6fdb3545..4b5510c07cabf 100644 --- a/src/plugins/kibana_react/public/overview_page/overview_footer/overview_footer.test.tsx +++ b/src/plugins/kibana_react/public/page/page_footer/page_footer.test.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; -import { OverviewFooter } from './overview_footer'; +import { PageFooter } from './page_footer'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; jest.mock('../../../../../../src/plugins/kibana_react/public', () => ({ @@ -34,9 +34,9 @@ jest.mock('../../../../../../src/plugins/kibana_react/public', () => ({ afterEach(() => jest.clearAllMocks()); -describe('OverviewFooter', () => { +describe('PageFooter', () => { test('render', () => { - const component = shallowWithIntl(); + const component = shallowWithIntl(); expect(component).toMatchSnapshot(); }); }); diff --git a/src/plugins/kibana_react/public/overview_page/overview_footer/overview_footer.tsx b/src/plugins/kibana_react/public/page/page_footer/page_footer.tsx similarity index 68% rename from src/plugins/kibana_react/public/overview_page/overview_footer/overview_footer.tsx rename to src/plugins/kibana_react/public/page/page_footer/page_footer.tsx index 3a61eb989024a..6deb2bf0124ab 100644 --- a/src/plugins/kibana_react/public/overview_page/overview_footer/overview_footer.tsx +++ b/src/plugins/kibana_react/public/page/page_footer/page_footer.tsx @@ -35,7 +35,7 @@ interface Props { path: string; } -export const OverviewFooter: FC = ({ path }) => { +export const PageFooter: FC = ({ path }) => { const [defaultRoute, setDefaultRoute] = useUiSetting$('defaultRoute'); const { services: { @@ -51,23 +51,27 @@ export const OverviewFooter: FC = ({ path }) => { defaultRoute === path ? ( ) : ( { setDefaultRoute(path); toasts.addSuccess({ - title: i18n.translate('kibana-react.overviewFooter.changeDefaultRouteSuccessToast', { + title: i18n.translate('kibana-react.pageFooter.changeDefaultRouteSuccessToast', { defaultMessage: 'Landing page updated', }), }); @@ -75,32 +79,37 @@ export const OverviewFooter: FC = ({ path }) => { size="xs" > ); return ( -