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 all 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,344 changes: 612 additions & 732 deletions src/plugins/home/public/application/components/__snapshots__/home.test.js.snap

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions src/plugins/home/public/application/components/_home.scss
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.homSolutions {
margin-top: -($euiSizeXL + $euiSizeL + $euiSizeM);
}

.homSolutions__content {
min-height: $euiSize * 16;

Expand Down
99 changes: 49 additions & 50 deletions src/plugins/home/public/application/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand All @@ -124,58 +125,56 @@ export class Home extends Component {
}

return (
<main
aria-labelledby="kbnOverviewPageHeader__title"
className="homWrapper"
<KibanaPageTemplate
data-test-subj="homeApp"
pageHeader={{
pageTitle: <FormattedMessage id="home.header.title" defaultMessage="Home" />,
rightSideItems: overviewPageActions({
addBasePath,
application,
showDevToolsLink: true,
showManagementLink: true,
}),
}}
template="empty"
>
<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');
}}
/>
</KibanaPageTemplate>
);
}

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
22 changes: 2 additions & 20 deletions src/plugins/kibana_overview/public/components/_overview.scss
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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});
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

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 @@ -74,7 +74,7 @@ export const GettingStarted: FC<Props> = ({ addBasePath, isDarkTheme, apps }) =>
<EuiFlexItem key={title}>
<EuiCard
description={subtitle}
display="plain"
display="transparent"
icon={<EuiIcon color="text" size="l" type={icon} />}
layout="horizontal"
paddingSize="none"
Expand Down
Loading