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

Home & Kibana Overview Page Template Update #103003

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
844aab8
apply page template comp to kibana overview
MichaelMarcialis Jun 21, 2021
e412b22
apply page template comp to home page
MichaelMarcialis Jun 21, 2021
7744db2
clean up
MichaelMarcialis Jun 21, 2021
a436aad
strip null actions from array
MichaelMarcialis Jun 21, 2021
5af064c
update snapshot and remove outdated import
MichaelMarcialis Jun 22, 2021
ac2c916
fix tests and update snapshots
MichaelMarcialis Jun 22, 2021
5336fc9
update tests and snapshots
MichaelMarcialis Jun 22, 2021
c1637ba
Merge branch 'master' of github.com:elastic/kibana into home-overview…
MichaelMarcialis Jun 22, 2021
1d665ba
Switch to KibanaPageTemplate; use template=“empty”
MichaelMarcialis Jun 22, 2021
880e04d
update snapshots
MichaelMarcialis Jun 22, 2021
ae3a55b
Merge branch 'master' of github.com:elastic/kibana into home-overview…
MichaelMarcialis Jun 23, 2021
5625820
make `EuiCard` transparent
MichaelMarcialis Jun 23, 2021
6e3dbaa
updated snapshots
MichaelMarcialis Jun 23, 2021
e17a9b6
restored data-test-subj="homeApp"
MichaelMarcialis Jun 23, 2021
662401a
Merge branch 'master' of github.com:elastic/kibana into home-overview…
MichaelMarcialis Jun 23, 2021
1523a41
Merge branch 'master' of github.com:elastic/kibana into home-overview…
MichaelMarcialis Jun 24, 2021
b646cc0
Merge branch 'master' of github.com:elastic/kibana into home-overview…
MichaelMarcialis Jun 24, 2021
a47bb96
change scope of styles
MichaelMarcialis Jun 24, 2021
5f21ff0
update snapshots
MichaelMarcialis Jun 24, 2021
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
1,359 changes: 612 additions & 747 deletions src/plugins/home/public/application/components/__snapshots__/home.test.js.snap

Large diffs are not rendered by default.

16 changes: 2 additions & 14 deletions src/plugins/home/public/application/components/_home.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
@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%;
.homPageHeader--hasOverlap {
padding-bottom: ($euiSizeL * 2);
}

.homData--expanded {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.homSolutions {
margin-top: -($euiSizeXL + $euiSizeL + $euiSizeM);
margin-top: -(($euiSizeL * 2) + $euiSizeM);
}

.homSolutions__content {
Expand Down
101 changes: 49 additions & 52 deletions src/plugins/home/public/application/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiPageTemplate } from '@elastic/eui';
import { METRIC_TYPE } from '@kbn/analytics';
import { i18n } from '@kbn/i18n';
import {
overviewPageActions,
OverviewPageFooter,
OverviewPageHeader,
} from '../../../../../../src/plugins/kibana_react/public';
import { HOME_APP_BASE_PATH } from '../../../common/constants';
import { FeatureCatalogueCategory } from '../../services';
Expand Down Expand Up @@ -113,7 +113,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);
Expand All @@ -124,58 +124,55 @@ export class Home extends Component {
}

return (
<main
aria-labelledby="kbnOverviewPageHeader__title"
className="homWrapper"
data-test-subj="homeApp"
<EuiPageTemplate
MichaelMarcialis marked this conversation as resolved.
Show resolved Hide resolved
pageHeader={{
className: `homPageHeader ${solutions.length ? ' homPageHeader--hasOverlap' : null}`,
pageTitle: <FormattedMessage id="home.header.title" defaultMessage="Home" />,
rightSideItems: overviewPageActions({
addBasePath,
application,
showDevToolsLink: true,
showManagementLink: true,
}),
}}
>
<OverviewPageHeader
addBasePath={addBasePath}
overlap={solutions.length}
showDevToolsLink
showManagementLink
title={<FormattedMessage id="home.header.title" defaultMessage="Home" />}
/>

<div className="homContent">
{solutions.length ? (
<SolutionsSection
addBasePath={addBasePath}
solutions={solutions}
directories={directories}
/>
) : null}

<EuiFlexGroup
className={`homData ${
addDataFeatures.length === 1 && manageDataFeatures.length === 1
? 'homData--compressed'
: 'homData--expanded'
}`}
>
<EuiFlexItem>
<AddData addBasePath={addBasePath} features={addDataFeatures} />
</EuiFlexItem>

<EuiFlexItem>
<ManageData addBasePath={addBasePath} features={manageDataFeatures} />
</EuiFlexItem>
</EuiFlexGroup>

<EuiHorizontalRule margin="xl" aria-hidden="true" />

<OverviewPageFooter
{solutions.length ? (
<SolutionsSection
addBasePath={addBasePath}
path={HOME_APP_BASE_PATH}
onSetDefaultRoute={() => {
trackUiMetric(METRIC_TYPE.CLICK, 'set_home_as_default_route');
}}
onChangeDefaultRoute={() => {
trackUiMetric(METRIC_TYPE.CLICK, 'change_to_different_default_route');
}}
solutions={solutions}
directories={directories}
/>
</div>
</main>
) : null}

<EuiFlexGroup
className={`homData ${
addDataFeatures.length === 1 && manageDataFeatures.length === 1
? 'homData--compressed'
: 'homData--expanded'
}`}
>
<EuiFlexItem>
<AddData addBasePath={addBasePath} features={addDataFeatures} />
</EuiFlexItem>

<EuiFlexItem>
<ManageData addBasePath={addBasePath} features={manageDataFeatures} />
</EuiFlexItem>
</EuiFlexGroup>

<EuiHorizontalRule margin="xl" aria-hidden="true" />

<OverviewPageFooter
addBasePath={addBasePath}
path={HOME_APP_BASE_PATH}
onSetDefaultRoute={() => {
trackUiMetric(METRIC_TYPE.CLICK, 'set_home_as_default_route');
}}
onChangeDefaultRoute={() => {
trackUiMetric(METRIC_TYPE.CLICK, 'change_to_different_default_route');
}}
/>
</EuiPageTemplate>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
29 changes: 4 additions & 25 deletions src/plugins/kibana_overview/public/components/_overview.scss
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
@import '../../../../core/public/mixins';

.kbnOverviewWrapper {
@include kibanaFullBodyMinHeight();
background-color: $euiColorEmptyShade;
// Ensure card heights are stretched equally when wrapped with this element
.kbnRedirectCrossAppLinks {
align-items: flex-start;
display: flex;
flex: 1;
flex-direction: column;
}

.kbnOverviewContent {
margin: 0 auto;
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;
}
}

.kbnOverviewApps__item {
.kbnOverviewApps__group--primary & {
@include euiBreakpoint('m', 'l', 'xl') {
Expand Down Expand Up @@ -109,11 +93,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});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const AddData: FC<Props> = ({ addBasePath, features }) => {
<div>
<EuiButtonEmpty
className="kbnOverviewDataAdd__actionButton"
flush="left"
flush="both"
href={addBasePath('#/tutorial_directory/sampleData')}
iconType="visTable"
size="xs"
Expand Down
Loading