Skip to content

Commit

Permalink
Update switcher design as new commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankeairns committed Feb 21, 2024
1 parent 2c3e924 commit 6fff1d6
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { EuiContextMenuItem, EuiContextMenuPanel } from '@elastic/eui';
import { EuiListGroup, EuiListGroupItem, EuiTitle, EuiSpacer, EuiLink } from '@elastic/eui';
import React from 'react';
import { i18n } from '@kbn/i18n';
import type { ChromeProjectBreadcrumb, Workflows } from '@kbn/core-chrome-browser';
Expand All @@ -19,24 +19,30 @@ export const getWorkspaceSwitcherBreadCrumb = ({
}): ChromeProjectBreadcrumb => {
return {
text: i18n.translate('core.ui.primaryNav.cloud.workflowLabel', {
defaultMessage: 'Workflow',
defaultMessage: 'My Kibana deployment',
}),
popoverContent: (
<EuiContextMenuPanel
size="s"
items={Object.values(workflows).map(({ id, title, icon = 'gear' }) => (
<EuiContextMenuItem
key={id}
icon={icon as string}
onClick={() => {
onWorkflowChange(id);
}}
>
{title}
</EuiContextMenuItem>
))}
/>
<>
<EuiTitle size="xxs">
<h3>Solution view</h3>
</EuiTitle>
<EuiSpacer size="s" />
<EuiListGroup bordered size="s">
{Object.values(workflows).map(({ id, title, icon = 'gear' }) => [
<EuiListGroupItem
key={id}
label={title}
iconType={icon as string}
onClick={() => {
onWorkflowChange(id);
}}
/>,
])}
</EuiListGroup>
<EuiSpacer size="m" />
<EuiLink href="">View all deployments</EuiLink>
</>
),
popoverProps: { panelPaddingSize: 'none', zIndex: 6000 },
popoverProps: { panelPaddingSize: 'm', zIndex: 6000 },
};
};
222 changes: 183 additions & 39 deletions src/plugins/navigation/public/workflows/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ const navigationTree: NavigationTreeDefinition = {
{
type: 'navGroup',
id: 'search_project_nav',
title: 'Elasticsearch',
title: 'Search',
icon: 'logoElasticsearch',
defaultIsCollapsed: false,
isCollapsible: false,
breadcrumbStatus: 'hidden',
children: [
{
id: 'search_getting_started',
title: i18n.translate('navigation.nav.gettingStarted', {
defaultMessage: 'Home',
}),
link: 'dev_tools:console',
getIsActive: ({ pathNameSerialized, prepend }) => {
return pathNameSerialized.startsWith(prepend('/app/home'));
},
},
{
id: 'dev_tools',
title: i18n.translate('navigation.nav.search.devTools', {
Expand All @@ -41,7 +51,7 @@ const navigationTree: NavigationTreeDefinition = {
{
id: 'explore',
title: i18n.translate('navigation.nav.explore', {
defaultMessage: 'Explore',
defaultMessage: 'Kibana',
}),
children: [
{
Expand All @@ -66,12 +76,6 @@ const navigationTree: NavigationTreeDefinition = {
);
},
},
{
link: 'management:triggersActions',
title: i18n.translate('navigation.nav.alerts', {
defaultMessage: 'Alerts',
}),
},
],
},
{
Expand All @@ -82,29 +86,171 @@ const navigationTree: NavigationTreeDefinition = {
children: [
{
title: i18n.translate('navigation.nav.content.indices', {
defaultMessage: 'Index Management',
defaultMessage: 'Indices',
}),
link: 'management:index_management',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'accordion',
children: [
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'search-github',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'accordion',
children: [
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Overview',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'item',
},
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Documents',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'item',
},
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Index Mappings',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'item',
},
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Pipelines',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'item',
},
],
},
],
},
{
title: i18n.translate('navigation.nav.content.indices', {
defaultMessage: 'Connectors',
}),
link: 'management:triggersActionsConnectors',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
},
{
title: i18n.translate('navigation.nav.content.indices', {
defaultMessage: 'Web crawlers',
}),
link: 'management:triggersActionsConnectors',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
},
],
},
{
id: 'apps',
title: i18n.translate('navigation.nav.apps', {
defaultMessage: 'Applications',
}),
children: [
{
title: i18n.translate('navigation.nav.content.indices', {
defaultMessage: 'AI playground',
}),
link: 'management:api_keys',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
},
{
title: i18n.translate('navigation.nav.content.indices', {
defaultMessage: 'Search applications',
}),
link: 'management:index_management',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'accordion',
children: [
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Test',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'accordion',
children: [
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Docs explorer',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'item',
},
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Content',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'item',
},
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Connect',
}),
link: 'management:ingest_pipelines',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
renderAs: 'item',
},
],
},
],
},
{
title: i18n.translate('navigation.nav.content.pipelines', {
defaultMessage: 'Pipelines',
title: i18n.translate('navigation.nav.content.indices', {
defaultMessage: 'Behavioral analytics',
}),
link: 'management:ingest_pipelines',
link: 'management:api_keys',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
},
],
},
{
id: 'security',
title: i18n.translate('navigation.nav.security', {
defaultMessage: 'Security',
id: 'entsearch',
title: i18n.translate('navigation.nav.entsearch', {
defaultMessage: 'Enterprise Search',
}),
children: [
{
title: i18n.translate('navigation.nav.content.indices', {
defaultMessage: 'App Search',
}),
link: 'management:api_keys',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
},
{
title: i18n.translate('navigation.nav.content.indices', {
defaultMessage: 'Workplace Search',
}),
link: 'management:api_keys',
breadcrumbStatus:
'hidden' /* management sub-pages set their breadcrumbs themselves */,
Expand All @@ -115,15 +261,6 @@ const navigationTree: NavigationTreeDefinition = {
},
],
footer: [
{
type: 'navItem',
id: 'search_getting_started',
title: i18n.translate('navigation.nav.gettingStarted', {
defaultMessage: 'Get started',
}),
icon: 'launch',
link: 'home',
},
{
type: 'navGroup',
id: 'project_settings_project_nav',
Expand All @@ -133,11 +270,18 @@ const navigationTree: NavigationTreeDefinition = {
icon: 'gear',
breadcrumbStatus: 'hidden',
children: [
{
title: i18n.translate('navigation.nav.projectSettings', {
defaultMessage: 'Trained models',
}),
link: 'fleet',
},
{
link: 'management',
title: i18n.translate('navigation.nav.mngt', {
defaultMessage: 'Stack Management',
}),
spaceBefore: null,
renderAs: 'panelOpener',
children: [
{
Expand Down Expand Up @@ -199,21 +343,21 @@ const navigationTree: NavigationTreeDefinition = {
},
],
},
{
id: 'cloudLinkDeployment',
cloudLink: 'deployment',
title: i18n.translate('navigation.nav.performance', {
defaultMessage: 'Performance',
}),
},
{
id: 'cloudLinkUserAndRoles',
cloudLink: 'userAndRoles',
},
{
id: 'cloudLinkBilling',
cloudLink: 'billingAndSub',
},
// {
// id: 'cloudLinkDeployment',
// cloudLink: 'deployment',
// title: i18n.translate('navigation.nav.performance', {
// defaultMessage: 'Performance',
// }),
// },
// {
// id: 'cloudLinkUserAndRoles',
// cloudLink: 'userAndRoles',
// },
// {
// id: 'cloudLinkBilling',
// cloudLink: 'billingAndSub',
// },
],
},
],
Expand Down

0 comments on commit 6fff1d6

Please sign in to comment.