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

[Serverless nav] Handle groups and vertical space #169251

Merged
merged 16 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 change: 1 addition & 0 deletions packages/core/chrome/core-chrome-browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ export type {
NodeDefinition,
NodeDefinitionWithChildren,
NodeRenderAs,
EuiThemeSize,
} from './src';
1 change: 1 addition & 0 deletions packages/core/chrome/core-chrome-browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ export type {
NodeDefinition,
NodeDefinitionWithChildren,
RenderAs as NodeRenderAs,
EuiThemeSize,
} from './project_navigation';
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import type { ComponentType } from 'react';
import type { Location } from 'history';
import { EuiAccordionProps, IconType } from '@elastic/eui';
import type { EuiAccordionProps, EuiThemeSizes, IconType } from '@elastic/eui';
import type { AppId as DevToolsApp, DeepLinkId as DevToolsLink } from '@kbn/deeplinks-devtools';
import type {
AppId as AnalyticsApp,
Expand Down Expand Up @@ -53,6 +53,8 @@ export type SideNavNodeStatus = 'hidden' | 'visible';

export type RenderAs = 'block' | 'accordion' | 'panelOpener' | 'item';

export type EuiThemeSize = Exclude<typeof EuiThemeSizes[number], 'base' | 'xxs' | 'xxxl' | 'xxxxl'>;

export type GetIsActiveFn = (params: {
/** The current path name including the basePath + hash value but **without** any query params */
pathNameSerialized: string;
Expand Down Expand Up @@ -93,16 +95,15 @@ interface NodeDefinitionBase {
* Optional function to get the active state. This function is called whenever the location changes.
*/
getIsActive?: GetIsActiveFn;
/**
* Add vertical space before this node
*/
spaceBefore?: EuiThemeSize | null;
/**
* ----------------------------------------------------------------------------------------------
* ------------------------------- GROUP NODES ONLY PROPS ---------------------------------------
* ----------------------------------------------------------------------------------------------
*/
/**
* ["group" nodes only] Optional flag to indicate if the node must be treated as a group title.
* Can not be used with `children`
*/
isGroupTitle?: boolean;
/**
* ["group" nodes only] Property to indicate how the group should be rendered.
* - Accordion: wraps the items in an EuiAccordion
Expand Down
1 change: 1 addition & 0 deletions packages/default-nav/analytics/default_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const defaultNavigation: AnalyticsNodeDefinition = {
defaultMessage: 'Data exploration',
}),
icon: 'stats',
renderAs: 'accordion',
children: [
{
link: 'discover',
Expand Down
1 change: 1 addition & 0 deletions packages/default-nav/devtools/default_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const defaultNavigation: DevToolsNodeDefinition = {
}),
id: 'rootNav:devtools',
icon: 'editorCodeBlock',
renderAs: 'accordion',
children: [
{
link: 'dev_tools:console',
Expand Down
7 changes: 7 additions & 0 deletions packages/default-nav/management/default_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const defaultNavigation: ManagementNodeDefinition = {
defaultMessage: 'Management',
}),
icon: 'gear',
renderAs: 'accordion',
children: [
{
link: 'monitoring',
Expand All @@ -36,6 +37,7 @@ export const defaultNavigation: ManagementNodeDefinition = {
title: i18n.translate('defaultNavigation.management.integrationManagement', {
defaultMessage: 'Integration management',
}),
renderAs: 'accordion',
children: [
{
link: 'integrations',
Expand All @@ -53,12 +55,14 @@ export const defaultNavigation: ManagementNodeDefinition = {
title: i18n.translate('defaultNavigation.management.stackManagement', {
defaultMessage: 'Stack management',
}),
renderAs: 'accordion',
children: [
{
id: 'ingest',
title: i18n.translate('defaultNavigation.management.ingest', {
defaultMessage: 'Ingest',
}),
renderAs: 'accordion',
children: [
{
link: 'management:ingest_pipelines',
Expand All @@ -73,6 +77,7 @@ export const defaultNavigation: ManagementNodeDefinition = {
title: i18n.translate('defaultNavigation.management.stackManagementData', {
defaultMessage: 'Data',
}),
renderAs: 'accordion',
children: [
{
link: 'management:index_management',
Expand All @@ -87,6 +92,7 @@ export const defaultNavigation: ManagementNodeDefinition = {
title: i18n.translate('defaultNavigation.management.alertAndInsights', {
defaultMessage: 'Alerts and insights',
}),
renderAs: 'accordion',
children: [
{
// Rules
Expand All @@ -108,6 +114,7 @@ export const defaultNavigation: ManagementNodeDefinition = {
{
id: 'kibana',
title: 'Kibana',
renderAs: 'accordion',
children: [
{
link: 'management:dataViews',
Expand Down
5 changes: 5 additions & 0 deletions packages/default-nav/ml/default_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const defaultNavigation: MlNodeDefinition = {
defaultMessage: 'Anomaly Detection',
}),
id: 'anomaly_detection',
renderAs: 'accordion',
children: [
{
title: i18n.translate('defaultNavigation.ml.jobs', {
Expand All @@ -61,6 +62,7 @@ export const defaultNavigation: MlNodeDefinition = {
title: i18n.translate('defaultNavigation.ml.dataFrameAnalytics', {
defaultMessage: 'Data Frame Analytics',
}),
renderAs: 'accordion',
children: [
{
title: 'Jobs',
Expand All @@ -79,6 +81,7 @@ export const defaultNavigation: MlNodeDefinition = {
title: i18n.translate('defaultNavigation.ml.modelManagement', {
defaultMessage: 'Model Management',
}),
renderAs: 'accordion',
children: [
{
link: 'ml:nodesOverview',
Expand All @@ -93,6 +96,7 @@ export const defaultNavigation: MlNodeDefinition = {
title: i18n.translate('defaultNavigation.ml.dataVisualizer', {
defaultMessage: 'Data Visualizer',
}),
renderAs: 'accordion',
children: [
{
title: i18n.translate('defaultNavigation.ml.file', {
Expand All @@ -119,6 +123,7 @@ export const defaultNavigation: MlNodeDefinition = {
title: i18n.translate('defaultNavigation.ml.aiopsLabs', {
defaultMessage: 'AIOps labs',
}),
renderAs: 'accordion',
children: [
{
link: 'ml:logRateAnalysis',
Expand Down

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

Loading
Loading