Skip to content

Commit

Permalink
[navigation-next] Add CollapsibleNavGroupEnabled component into chrom…
Browse files Browse the repository at this point in the history
…e_service.(#7093)

Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Jun 26, 2024
1 parent 1d65d78 commit 506ab61
Show file tree
Hide file tree
Showing 5 changed files with 591 additions and 26 deletions.
4 changes: 3 additions & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export interface StartDeps {
overlays: OverlayStart;
}

type CollapsibleNavHeaderRender = () => JSX.Element | null;
export type CollapsibleNavHeaderRender = () => JSX.Element | null;

export type NavGroupItemInMap = ChromeNavGroup & {
navLinks: ChromeRegistrationNavLink[];
Expand Down Expand Up @@ -349,6 +349,8 @@ export class ChromeService {
survey={injectedMetadata.getSurvey()}
collapsibleNavHeaderRender={this.collapsibleNavHeaderRender}
sidecarConfig$={sidecarConfig$}
navGroupsMap$={this.navGroupsMap$}
navGroupEnabled={this.navGroupEnabled}
/>
),

Expand Down
3 changes: 2 additions & 1 deletion src/core/public/chrome/ui/header/collapsible_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { HttpStart } from '../../../http';
import { OnIsLockedUpdate } from './';
import { createEuiListItem, createRecentNavLink, isModifiedOrPrevented } from './nav_link';
import type { Logos } from '../../../../common/types';
import { CollapsibleNavHeaderRender } from '../../chrome_service';

function getAllCategories(allCategorizedLinks: Record<string, ChromeNavLink[]>) {
const allCategories = {} as Record<string, AppCategory | undefined>;
Expand Down Expand Up @@ -89,7 +90,7 @@ function setIsCategoryOpen(id: string, isOpen: boolean, storage: Storage) {
interface Props {
appId$: InternalApplicationStart['currentAppId$'];
basePath: HttpStart['basePath'];
collapsibleNavHeaderRender?: () => JSX.Element | null;
collapsibleNavHeaderRender?: CollapsibleNavHeaderRender;
id: string;
isLocked: boolean;
isNavOpen: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.context-nav-wrapper {
background-color: $ouiCollapsibleNavBackgroundColor;

.full-width {
width: 100%;
}

.no-padding {
padding: 0;
}

.no-hover {
&:hover {
text-decoration: none;
}
}

.wrapper {
overflow-y: auto;
}

.second-navigation {
border-left: $euiBorderThin;
}
}
Loading

0 comments on commit 506ab61

Please sign in to comment.