Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade EUI to 13.6.0 #43916

Merged
merged 12 commits into from
Aug 27, 2019
12 changes: 11 additions & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class ChromeService {
const appTitle$ = new BehaviorSubject<string>('Kibana');
const brand$ = new BehaviorSubject<ChromeBrand>({});
const isVisible$ = new BehaviorSubject(true);
const isLocked$ = new BehaviorSubject(false);
const isCollapsed$ = new BehaviorSubject(!!localStorage.getItem(IS_COLLAPSED_KEY));
const applicationClasses$ = new BehaviorSubject<Set<string>>(new Set());
const helpExtension$ = new BehaviorSubject<ChromeHelpExtension | undefined>(undefined);
Expand All @@ -122,6 +123,14 @@ export class ChromeService {
);
}

const BASE_SELECTOR = 'header-global-wrapper';
isLocked$.subscribe(isLocked => {
const el = document.querySelector(`.${BASE_SELECTOR}`);
if (el) {
el.classList.toggle(`${BASE_SELECTOR}--navIsLocked`, isLocked);
}
});
thompsongl marked this conversation as resolved.
Show resolved Hide resolved

return {
navControls,
navLinks,
Expand All @@ -131,7 +140,7 @@ export class ChromeService {
<React.Fragment>
<LoadingIndicator loadingCount$={http.getLoadingCount$()} />

<div className="header-global-wrapper hide-for-sharing" data-test-subj="headerGlobalNav">
<div className={`${BASE_SELECTOR} hide-for-sharing`} data-test-subj="headerGlobalNav">
<Header
appTitle$={appTitle$.pipe(takeUntil(this.stop$))}
badge$={badge$.pipe(takeUntil(this.stop$))}
Expand All @@ -150,6 +159,7 @@ export class ChromeService {
recentlyAccessed$={recentlyAccessed.get$()}
navControlsLeft$={navControls.getLeft$()}
navControlsRight$={navControls.getRight$()}
onIsLockedUpdate={(isLocked: boolean) => isLocked$.next(isLocked)}
/>
</div>
</React.Fragment>
Expand Down
8 changes: 7 additions & 1 deletion src/core/public/chrome/ui/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ interface Props {
navControlsRight$: Rx.Observable<readonly ChromeNavControl[]>;
intl: InjectedIntl;
basePath: HttpStart['basePath'];
onIsLockedUpdate?: (isLocked: boolean) => void;
}

interface State {
Expand Down Expand Up @@ -268,6 +269,7 @@ class HeaderUI extends Component<Props, State> {
intl,
kibanaDocLink,
kibanaVersion,
onIsLockedUpdate,
} = this.props;
const {
appTitle,
Expand Down Expand Up @@ -355,7 +357,11 @@ class HeaderUI extends Component<Props, State> {
</EuiHeaderSection>
</EuiHeader>

<EuiNavDrawer ref={this.navDrawerRef} data-test-subj="navDrawer">
<EuiNavDrawer
ref={this.navDrawerRef}
data-test-subj="navDrawer"
onIsLockedUpdate={onIsLockedUpdate}
>
<EuiNavDrawerGroup listItems={recentLinksArray} />
<EuiHorizontalRule margin="none" />
<EuiNavDrawerGroup data-test-subj="navDrawerAppsMenu" listItems={navLinksArray} />
Expand Down