Skip to content

Commit

Permalink
Fix observability and es navs
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Oct 18, 2023
1 parent dc6c200 commit c0e0a41
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 123 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ interface NodeDefinitionBase {
* ------------------------------- 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;
/** Add vertical space before this group */
spaceBefore?: EuiThemeSize | null;
/**
* ["group" nodes only] Property to indicate how the group should be rendered.
* - Accordion: wraps the items in an EuiAccordion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,90 +31,94 @@ const navigationTree: NavigationTreeDefinition = {
breadcrumbStatus: 'hidden',
children: [
{
title: i18n.translate('xpack.serverlessObservability.nav.logExplorer', {
defaultMessage: 'Log Explorer',
}),
link: 'observability-log-explorer',
},
{
title: i18n.translate('xpack.serverlessObservability.nav.dashboards', {
defaultMessage: 'Dashboards',
}),
link: 'dashboards',
getIsActive: ({ pathNameSerialized, prepend }) => {
return pathNameSerialized.startsWith(prepend('/app/dashboards'));
},
},
{
title: i18n.translate('xpack.serverlessObservability.nav.visualizations', {
defaultMessage: 'Visualizations',
}),
link: 'visualize',
getIsActive: ({ pathNameSerialized, prepend }) => {
return (
pathNameSerialized.startsWith(prepend('/app/visualize')) ||
pathNameSerialized.startsWith(prepend('/app/lens')) ||
pathNameSerialized.startsWith(prepend('/app/maps'))
);
},
},
{
link: 'observability-overview:alerts',
},
{
link: 'observability-overview:cases',
},
{
link: 'observability-overview:slos',
},
{
id: 'aiops',
title: 'AIOps',
accordionProps: {
arrowProps: { css: { display: 'none' } },
},
children: [
{
title: i18n.translate('xpack.serverlessObservability.nav.ml.jobs', {
defaultMessage: 'Anomaly detection',
title: i18n.translate('xpack.serverlessObservability.nav.logExplorer', {
defaultMessage: 'Log Explorer',
}),
link: 'ml:anomalyDetection',
link: 'observability-log-explorer',
},
{
title: i18n.translate('xpack.serverlessObservability.ml.logRateAnalysis', {
defaultMessage: 'Log rate analysis',
title: i18n.translate('xpack.serverlessObservability.nav.dashboards', {
defaultMessage: 'Dashboards',
}),
link: 'ml:logRateAnalysis',
link: 'dashboards',
getIsActive: ({ pathNameSerialized, prepend }) => {
return pathNameSerialized.includes(prepend('/app/ml/aiops/log_rate_analysis'));
return pathNameSerialized.startsWith(prepend('/app/dashboards'));
},
},
{
title: i18n.translate('xpack.serverlessObservability.ml.changePointDetection', {
defaultMessage: 'Change point detection',
title: i18n.translate('xpack.serverlessObservability.nav.visualizations', {
defaultMessage: 'Visualizations',
}),
link: 'ml:changePointDetections',
link: 'visualize',
getIsActive: ({ pathNameSerialized, prepend }) => {
return pathNameSerialized.includes(prepend('/app/ml/aiops/change_point_detection'));
return (
pathNameSerialized.startsWith(prepend('/app/visualize')) ||
pathNameSerialized.startsWith(prepend('/app/lens')) ||
pathNameSerialized.startsWith(prepend('/app/maps'))
);
},
},
{
title: i18n.translate('xpack.serverlessObservability.nav.ml.job.notifications', {
defaultMessage: 'Job notifications',
}),
link: 'ml:notifications',
link: 'observability-overview:alerts',
},
{
link: 'observability-overview:cases',
},
{
link: 'observability-overview:slos',
},
{
id: 'aiops',
title: 'AIOps',
renderAs: 'accordion',
accordionProps: {
arrowProps: { css: { display: 'none' } },
},
children: [
{
title: i18n.translate('xpack.serverlessObservability.nav.ml.jobs', {
defaultMessage: 'Anomaly detection',
}),
link: 'ml:anomalyDetection',
},
{
title: i18n.translate('xpack.serverlessObservability.ml.logRateAnalysis', {
defaultMessage: 'Log rate analysis',
}),
link: 'ml:logRateAnalysis',
getIsActive: ({ pathNameSerialized, prepend }) => {
return pathNameSerialized.includes(prepend('/app/ml/aiops/log_rate_analysis'));
},
},
{
title: i18n.translate('xpack.serverlessObservability.ml.changePointDetection', {
defaultMessage: 'Change point detection',
}),
link: 'ml:changePointDetections',
getIsActive: ({ pathNameSerialized, prepend }) => {
return pathNameSerialized.includes(
prepend('/app/ml/aiops/change_point_detection')
);
},
},
{
title: i18n.translate('xpack.serverlessObservability.nav.ml.job.notifications', {
defaultMessage: 'Job notifications',
}),
link: 'ml:notifications',
},
],
},
],
},
{
id: 'groups-spacer-1',
isGroupTitle: true,
},
{
id: 'apm',
title: i18n.translate('xpack.serverlessObservability.nav.applications', {
defaultMessage: 'Applications',
}),
renderAs: 'accordion',
accordionProps: {
arrowProps: { css: { display: 'none' } },
},
Expand Down Expand Up @@ -145,6 +149,7 @@ const navigationTree: NavigationTreeDefinition = {
title: i18n.translate('xpack.serverlessObservability.nav.infrastructure', {
defaultMessage: 'Infrastructure',
}),
renderAs: 'accordion',
accordionProps: {
arrowProps: { css: { display: 'none' } },
},
Expand All @@ -163,10 +168,6 @@ const navigationTree: NavigationTreeDefinition = {
},
],
},
{
id: 'groups-spacer-2',
isGroupTitle: true,
},
],
},
],
Expand All @@ -177,7 +178,6 @@ const navigationTree: NavigationTreeDefinition = {
defaultMessage: 'Get Started',
}),
link: 'observabilityOnboarding',
isGroupTitle: true,
icon: 'launch',
},
{
Expand Down
105 changes: 55 additions & 50 deletions x-pack/plugins/serverless_search/public/layout/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,69 +45,74 @@ const navigationTree: NavigationTreeDefinition = {
title: i18n.translate('xpack.serverlessSearch.nav.explore', {
defaultMessage: 'Explore',
}),
isGroupTitle: true,
},
{
link: 'discover',
},
{
link: 'dashboards',
getIsActive: ({ pathNameSerialized, prepend }) => {
return pathNameSerialized.startsWith(prepend('/app/dashboards'));
},
},
{
link: 'visualize',
title: i18n.translate('xpack.serverlessSearch.nav.visualize', {
defaultMessage: 'Visualizations',
}),
getIsActive: ({ pathNameSerialized, prepend }) => {
return (
pathNameSerialized.startsWith(prepend('/app/visualize')) ||
pathNameSerialized.startsWith(prepend('/app/lens')) ||
pathNameSerialized.startsWith(prepend('/app/maps'))
);
},
},
{
link: 'management:triggersActions',
title: i18n.translate('xpack.serverlessSearch.nav.alerts', {
defaultMessage: 'Alerts',
}),
children: [
{
link: 'discover',
},
{
link: 'dashboards',
getIsActive: ({ pathNameSerialized, prepend }) => {
return pathNameSerialized.startsWith(prepend('/app/dashboards'));
},
},
{
link: 'visualize',
title: i18n.translate('xpack.serverlessSearch.nav.visualize', {
defaultMessage: 'Visualizations',
}),
getIsActive: ({ pathNameSerialized, prepend }) => {
return (
pathNameSerialized.startsWith(prepend('/app/visualize')) ||
pathNameSerialized.startsWith(prepend('/app/lens')) ||
pathNameSerialized.startsWith(prepend('/app/maps'))
);
},
},
{
link: 'management:triggersActions',
title: i18n.translate('xpack.serverlessSearch.nav.alerts', {
defaultMessage: 'Alerts',
}),
},
],
},

{
id: 'content',
title: i18n.translate('xpack.serverlessSearch.nav.content', {
defaultMessage: 'Content',
}),
isGroupTitle: true,
},
{
title: i18n.translate('xpack.serverlessSearch.nav.content.indices', {
defaultMessage: 'Index Management',
}),
link: 'management:index_management',
breadcrumbStatus: 'hidden' /* management sub-pages set their breadcrumbs themselves */,
children: [
{
title: i18n.translate('xpack.serverlessSearch.nav.content.indices', {
defaultMessage: 'Index Management',
}),
link: 'management:index_management',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
},
{
title: i18n.translate('xpack.serverlessSearch.nav.content.pipelines', {
defaultMessage: 'Pipelines',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
},
],
},
{
title: i18n.translate('xpack.serverlessSearch.nav.content.pipelines', {
defaultMessage: 'Pipelines',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus: 'hidden' /* management sub-pages set their breadcrumbs themselves */,
},

{
id: 'security',
title: i18n.translate('xpack.serverlessSearch.nav.security', {
defaultMessage: 'Security',
}),
isGroupTitle: true,
},
{
link: 'management:api_keys',
breadcrumbStatus: 'hidden' /* management sub-pages set their breadcrumbs themselves */,
children: [
{
link: 'management:api_keys',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
},
],
},
],
},
Expand Down

0 comments on commit c0e0a41

Please sign in to comment.