[Stateful sidenav] Put recently accessed in footer for all solutions (#184298)

This commit is contained in:
Sébastien Loix 2024-05-28 17:00:04 +01:00 committed by GitHub
parent 04d132f886
commit 4f2f30f52d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View file

@ -19,7 +19,6 @@ const icon = 'logoObservability';
const navTree: NavigationTreeDefinition = {
body: [
{ type: 'recentlyAccessed' },
{
type: 'navGroup',
id: 'observability_project_nav',
@ -232,6 +231,7 @@ const navTree: NavigationTreeDefinition = {
},
],
footer: [
{ type: 'recentlyAccessed' },
{
type: 'navItem',
title: i18n.translate('navigation.obltNav.getStarted', {

View file

@ -80,7 +80,6 @@ export const getNavigationTreeDefinition = ({
map(({ indices, searchApps, collections }) => {
const navTree: NavigationTreeDefinition = {
body: [
{ type: 'recentlyAccessed' },
{
breadcrumbStatus: 'hidden',
children: [
@ -242,6 +241,7 @@ export const getNavigationTreeDefinition = ({
},
],
footer: [
{ type: 'recentlyAccessed' },
{
breadcrumbStatus: 'hidden',
children: [

View file

@ -28,9 +28,12 @@ export const initSideNavigation = async (services: Services) => {
const essNavigationTree$ = navigationTree$.pipe(
map((navigationTree) =>
produce(navigationTree, (draft) => {
if (draft.footer) {
draft.footer.unshift({ type: 'recentlyAccessed' });
}
const footerGroup: GroupDefinition | undefined = draft.footer?.find(
({ type }) => type === 'navGroup'
) as GroupDefinition;
(node): node is GroupDefinition => node.type === 'navGroup'
);
const management = footerGroup?.children.find((child) => child.link === 'management');
if (management) {
management.renderAs = 'panelOpener';