Skip to content

Commit ac790af

Browse files
committed
[navigation-next] Add CollapsibleNavGroupEnabled component into chrome_service.(#7093)
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
1 parent afd2e97 commit ac790af

File tree

7 files changed

+552
-26
lines changed

7 files changed

+552
-26
lines changed

src/core/public/chrome/chrome_service.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export interface StartDeps {
109109
overlays: OverlayStart;
110110
}
111111

112-
type CollapsibleNavHeaderRender = () => JSX.Element | null;
112+
export type CollapsibleNavHeaderRender = () => JSX.Element | null;
113113

114114
/** @internal */
115115
export class ChromeService {
@@ -299,6 +299,8 @@ export class ChromeService {
299299
survey={injectedMetadata.getSurvey()}
300300
collapsibleNavHeaderRender={this.collapsibleNavHeaderRender}
301301
sidecarConfig$={sidecarConfig$}
302+
navGroupsMap$={navGroup.getNavGroupsMap$()}
303+
navGroupEnabled={navGroup.getNavGroupEnabled()}
302304
/>
303305
),
304306

src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/public/chrome/ui/header/collapsible_nav.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import { HttpStart } from '../../../http';
5151
import { OnIsLockedUpdate } from './';
5252
import { createEuiListItem, createRecentNavLink, isModifiedOrPrevented } from './nav_link';
5353
import type { Logos } from '../../../../common/types';
54+
import { CollapsibleNavHeaderRender } from '../../chrome_service';
5455

5556
function getAllCategories(allCategorizedLinks: Record<string, ChromeNavLink[]>) {
5657
const allCategories = {} as Record<string, AppCategory | undefined>;
@@ -89,7 +90,7 @@ function setIsCategoryOpen(id: string, isOpen: boolean, storage: Storage) {
8990
interface Props {
9091
appId$: InternalApplicationStart['currentAppId$'];
9192
basePath: HttpStart['basePath'];
92-
collapsibleNavHeaderRender?: () => JSX.Element | null;
93+
collapsibleNavHeaderRender?: CollapsibleNavHeaderRender;
9394
id: string;
9495
isLocked: boolean;
9596
isNavOpen: boolean;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.context-nav-wrapper {
2+
background-color: $ouiCollapsibleNavBackgroundColor;
3+
4+
.full-width {
5+
width: 100%;
6+
}
7+
8+
.no-padding {
9+
padding: 0;
10+
}
11+
12+
.no-hover {
13+
&:hover {
14+
text-decoration: none;
15+
}
16+
}
17+
18+
.wrapper {
19+
overflow-y: auto;
20+
}
21+
22+
.second-navigation {
23+
border-left: $euiBorderThin;
24+
}
25+
26+
.padding-horizontal {
27+
padding-left: $ouiSize;
28+
}
29+
30+
.no-margin-top {
31+
margin-top: $ouiSize / 4;
32+
}
33+
}

0 commit comments

Comments
 (0)