Skip to content

Commit

Permalink
Redesigns home page
Browse files Browse the repository at this point in the history
Adds auto scroll to advanced setting provided in the URL hash

Registered plugins to feature catalogue to be displayed on home page

Rearrange add data section

Fix solution panel conditional rendering

Removed extraneous import

Remmoved environment update from observability plugin

Registrered features to feature catalog for ingest manager, ml, and index lifecycle management

Fixed import

Added max width to Kibana solution card

Fixed feature id

Fixed enterprise search link

Updated solutions logos

Fixed beta label on ingest manager card

Fixed logos

Cleaned up CSS

Change home route redirects user to advanced settings

Conditionally renders default route advanced setting link

Restored app search logo

Hides graph description on home page on basic license

Style home page header and other misc design tweaks (#72481)
  • Loading branch information
cqliu1 committed Jul 21, 2020
1 parent c3bd7ae commit 50dfd3e
Show file tree
Hide file tree
Showing 48 changed files with 1,181 additions and 599 deletions.
2 changes: 1 addition & 1 deletion src/plugins/advanced_settings/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "kibana",
"server": true,
"ui": true,
"requiredPlugins": ["management"],
"requiredPlugins": ["management", "home"],
"requiredBundles": ["kibanaReact"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ export class AdvancedSettingsComponent extends Component<
filteredSettings: this.mapSettings(Query.execute(query, this.settings)),
});
});

// scrolls to setting provided in the URL hash
const { hash } = window.location;
if (hash !== '') {
setTimeout(() => {
const id = hash.replace('#', '');
const element = document.getElementById(id);
if (element) {
element.scrollIntoView();
window.scrollBy(0, -48); // offsets scroll by height of the global nav
}
}, 0);
}
}

componentWillUnmount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ export class Field extends PureComponent<FieldProps> {

return (
<EuiDescribedFormGroup
id={id}
className={className}
title={this.renderTitle(setting)}
description={this.renderDescription(setting)}
Expand Down
17 changes: 16 additions & 1 deletion src/plugins/advanced_settings/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
import { i18n } from '@kbn/i18n';
import { CoreSetup, Plugin } from 'kibana/public';
import { FeatureCatalogueCategory } from '../../home/public';
import { ComponentRegistry } from './component_registry';
import { AdvancedSettingsSetup, AdvancedSettingsStart, AdvancedSettingsPluginSetup } from './types';

Expand All @@ -29,7 +30,7 @@ const title = i18n.translate('advancedSettings.advancedSettingsLabel', {

export class AdvancedSettingsPlugin
implements Plugin<AdvancedSettingsSetup, AdvancedSettingsStart, AdvancedSettingsPluginSetup> {
public setup(core: CoreSetup, { management }: AdvancedSettingsPluginSetup) {
public setup(core: CoreSetup, { management, home }: AdvancedSettingsPluginSetup) {
const kibanaSection = management.sections.section.kibana;

kibanaSection.registerApp({
Expand All @@ -44,6 +45,20 @@ export class AdvancedSettingsPlugin
},
});

if (home) {
home.featureCatalogue.register({
id: 'advanced_settings',
title,
description: i18n.translate('xpack.advancedSettings.featureCatalogueTitle', {
defaultMessage: 'Customize your Kibana experience',
}),
icon: 'gear', // TODO: Do we want to use this icon here?
path: '/app/management/kibana/settings',
showOnHomePage: true,
category: FeatureCatalogueCategory.ADMIN,
});
}

return {
component: component.setup,
};
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/advanced_settings/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/

import { ComponentRegistry } from './component_registry';
import { HomePublicPluginSetup } from '../../home/public';

import { ManagementSetup } from '../../management/public';

export interface AdvancedSettingsSetup {
Expand All @@ -29,6 +31,7 @@ export interface AdvancedSettingsStart {

export interface AdvancedSettingsPluginSetup {
management: ManagementSetup;
home?: HomePublicPluginSetup;
}

export { ComponentRegistry };
21 changes: 21 additions & 0 deletions src/plugins/home/common/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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.
*/

export const PLUGIN_ID = 'home';
export const HOME_APP_BASE_PATH = `/app/${PLUGIN_ID}`;
63 changes: 4 additions & 59 deletions src/plugins/home/public/application/components/_add_data.scss
Original file line number Diff line number Diff line change
@@ -1,63 +1,8 @@
.homAddData__card {
border: none;
box-shadow: none;
}

.homAddData__cardDivider {
position: relative;

&:after {
position: absolute;
content: '';
width: 1px;
right: -$euiSizeS;
top: 0;
bottom: 0;
background: $euiBorderColor;
}
}

.homAddData__icon {
width: $euiSizeXL * 2;
height: $euiSizeXL * 2;
}

.homAddData__footerItem--highlight {
background-color: tintOrShade($euiColorPrimary, 90%, 70%);
padding: $euiSize;
}

.homAddData__footerItem {
.homAddData__image {
text-align: center;
}

.homAddData__logo {
margin-left: $euiSize;
}

@include euiBreakpoint('xs', 's') {
.homeAddData__flexGroup {
flex-wrap: wrap;
}
}

@include euiBreakpoint('xs', 's', 'm') {
.homAddDat__flexTablet {
flex-direction: column;
}

.homAddData__cardDivider:after {
display: none;
}

.homAddData__cardDivider {
flex-grow: 0 !important;
flex-basis: 100% !important;
}
}

@include euiBreakpoint('l', 'xl') {
.homeAddData__flexGroup {
flex-wrap: nowrap;
.euiImage__img {
max-height: $euiSize * 16; // too tall if only two "Add data" features are enabled
width: auto;
}
}
29 changes: 29 additions & 0 deletions src/plugins/home/public/application/components/_home.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
// Local page vars
$homePageHeaderHeight: $euiSize * 8;
$homePageWidth: 1200px;

.homPageHeader {
height: $homePageHeaderHeight;
margin: 0 auto;
max-width: $homePageWidth;
padding: $euiSizeXL $euiSize 0;
}

.homPageContainer {
min-height: calc(100vh - #{$homePageHeaderHeight});
background-color: $euiColorEmptyShade;
border-top: 1px solid $euiColorLightShade;
}

.homPage {
display: flex;
max-width: $homePageWidth;
margin: 0 auto;
padding: 0 $euiSize $euiSizeXL;
background-color: transparent;
}

.homHome__synopsisItem {
max-width: 50%;
}

@include euiBreakpoint('xs', 's', 'm') {
.homHome__synopsisItem {
flex-basis: 100% !important;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/home/public/application/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@import 'add_data';
@import 'home';
@import 'sample_data_set_cards';
@import 'solutions_panel';
@import 'synopsis';
@import 'welcome';

Expand Down
100 changes: 100 additions & 0 deletions src/plugins/home/public/application/components/_solutions_panel.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.homSolutionsPanel {
margin-top: -$euiSizeXL;
min-height: $euiSize*16;
display: flex;

.homSolutionsPanel--restrictHalfWidth {
max-width: 50%;
}

.homSolutionsPanel__solutionPanel {
display: flex;
align-items: stretch;

.homSolutionsPanel__solutionTitle {
padding: $euiSize;

.euiToken {
padding: $euiSizeS;
}
}

.homSolutionsPanel__CTA {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
padding: $euiSize;
}
}

.homSolutionsPanel__header {
border-radius: $euiBorderRadius 0 0 $euiBorderRadius;
color: $euiColorEmptyShade;

img {
position: absolute;
width: auto;
}
}

.homSolutionsPanel__enterpriseSearch {
.homSolutionsPanel__enterpriseSearchHeader {
background-color: #017d73;

.homSolutionsPanel__enterpriseSearchTopLeftImage img {
top: $euiSizeS;
left: 0;
height: $euiSizeXL;
}

.homSolutionsPanel__enterpriseSearchBottomRightImage img {
right: $euiSizeS;
bottom: $euiSizeS;
height: $euiSizeXL;
}
}
}

.homSolutionsPanel__observability {
.homSolutionsPanel__observabilityHeader {
background-color: #c42373;

.homSolutionsPanel__observabilityTopRightImage img {
top: $euiSizeS;
right: $euiSizeS;
height: $euiSizeXL;
}
}
}

.homSolutionsPanel__securitySolution {
.homSolutionsPanel__securitySolutionHeader {
background-color: #343741;

.homSolutionsPanel__securitySolutionTopLeftImage img {
top: $euiSizeS;
left: $euiSizeS;
height: $euiSizeXXL;
}
}
}

.homSolutionsPanel__kibana {
.homSolutionsPanel__kibanaHeader {
background-color: #006bb4;

.homSolutionsPanel__kibanaTopLeftImage img {
top: 0;
left: 0;
height: $euiSizeXXL * 4;
}

.homSolutionsPanel__kibanaBottomRightImage img {
right: 0;
bottom: 0;
height: $euiSizeXXL * 4;
}
}
}
}
4 changes: 4 additions & 0 deletions src/plugins/home/public/application/components/_synopsis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
box-shadow: none;
}

.homSynopsis__cardTitle {
display: flex;
}

// SASSTODO: Fix in EUI
.euiCard__content {
padding-top: 0 !important;
Expand Down
Loading

0 comments on commit 50dfd3e

Please sign in to comment.