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

New nav #64018

Merged
merged 54 commits into from
May 6, 2020
Merged

New nav #64018

Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
3aaeefe
Fix height calc to use correct EUI variable
MichaelMarcialis Apr 21, 2020
b315034
collapsible nav
Apr 23, 2020
23eeebc
fixing PR feedback
Apr 23, 2020
90e537b
updated category public api
Apr 23, 2020
ebfa324
fixing first few tests
Apr 23, 2020
84b3f2b
undoing visualize->visualization library naming
Apr 24, 2020
91fcde6
move recently viewed to the top
Apr 24, 2020
b35eacc
hotfix apps sometimes displaying a scrollbar
Apr 24, 2020
811cde3
fix euiBottomBar width calculation
Apr 24, 2020
7b8a016
translation file fix
Apr 24, 2020
ea92cd7
displaying links without a category
Apr 24, 2020
2875a35
more test fixed
Apr 24, 2020
affb4d9
Merge remote-tracking branch 'upstream/master' into new-nav
Apr 24, 2020
d1259c5
Revert "fix euiBottomBar width calculation"
Apr 27, 2020
2f3a1cf
better todo naming
Apr 27, 2020
aec8305
safely migrate bottomBar width to new nav widths
Apr 27, 2020
27531e6
addressing feedback from @pgayvallet
Apr 27, 2020
86fb664
fix visualization full screen issues
Apr 27, 2020
bbb0a33
fixing more tests
Apr 27, 2020
04fea87
fixing painless lab bottombar popover
Apr 28, 2020
9591a6f
pass onclick to nav items without category
Apr 28, 2020
9568d18
documenting category id and getNavType
Apr 28, 2020
31eec3e
Merge remote-tracking branch 'upstream/master' into new-nav
Apr 28, 2020
7c16e3a
fixing more tests
Apr 28, 2020
1f84027
fixing width overflow with legacy nav
MichaelMarcialis Apr 28, 2020
21e6255
additional test fixes
Apr 29, 2020
4891ee9
updating EUI to 22.3.1
Apr 29, 2020
421e687
fixing more tests...
Apr 29, 2020
1cc0fb5
fixing jest + a11y tests
Apr 30, 2020
283d9d0
fixing more jest + a11y tests
Apr 30, 2020
216cac8
Merge remote-tracking branch 'upstream/master' into new-nav
Apr 30, 2020
975b08c
Merge branch 'master' into new-nav
elasticmachine Apr 30, 2020
4bc97a7
Merge branch 'master' into new-nav
elasticmachine Apr 30, 2020
86f7830
Merge branch 'master' into new-nav
elasticmachine Apr 30, 2020
797dfa9
jest + a11y tests fixes
Apr 30, 2020
757df00
fixing plugin categories
Apr 30, 2020
dbb49a0
Merge remote-tracking branch 'upstream/master' into new-nav
Apr 30, 2020
b612739
fixing the last remaining tests, I hope
Apr 30, 2020
bf1b6ee
fixing discvoer test failure
May 1, 2020
1fe8bb9
implementing PR feedback and adding basic test coverage
May 5, 2020
08d83d5
Merge remote-tracking branch 'upstream/master' into new-nav
May 5, 2020
db25a51
fixing schema failure
May 5, 2020
7c61b6c
fixing canvas category type
May 5, 2020
d7f1ba1
Merge remote-tracking branch 'upstream/master' into new-nav
May 5, 2020
ca23f13
Merge remote-tracking branch 'upstream/master' into new-nav
May 5, 2020
2d57e30
Merge remote-tracking branch 'upstream/master' into new-nav
May 5, 2020
96bf7c0
attempting to fix a merge conflict
May 5, 2020
5dbc9c8
fixing react types because yarn is having a hard time
May 5, 2020
153cf49
Merge remote-tracking branch 'upstream/master' into new-nav
May 5, 2020
a947add
Merge remote-tracking branch 'upstream/master' into new-nav
May 5, 2020
485a4ee
fix DEFAULT_APP_CATEGORIES import
May 5, 2020
02dac24
update public api
May 6, 2020
4690a2f
Merge remote-tracking branch 'upstream/master' into new-nav
May 6, 2020
9c98447
Merge remote-tracking branch 'upstream/master' into new-nav
May 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ into the document when displaying it.
`metrics:max_buckets`:: The maximum numbers of buckets that a single
data source can return. This might arise when the user selects a
short interval (for example, 1s) for a long time period (1 year).
`pageNavigation`:: The style of navigation menu for Kibana.
Choices are Legacy, the legacy style where every plugin is represented in the nav,
and Modern, a new format that bundles related plugins together in flyaway nested navigation.
`query:allowLeadingWildcards`:: Allows a wildcard (*) as the first character
in a query clause. Only applies when experimental query features are
enabled in the query bar. To disallow leading wildcards in Lucene queries,
Expand Down
6 changes: 6 additions & 0 deletions src/core/public/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@
overflow-x: hidden;
min-width: 100%;
min-height: 100%;

// TODO remove when EUI is updated
// Patch from eui#3386 or v23.2.0
&.euiBody--headerIsFixed {
padding-top: 49px;
}
}
5 changes: 4 additions & 1 deletion src/core/public/chrome/chrome_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
ChromeBreadcrumb,
ChromeService,
InternalChromeStart,
} from './chrome_service';
NavType,
} from './';

const createStartContractMock = () => {
const startContract: DeeplyMockedKeys<InternalChromeStart> = {
Expand Down Expand Up @@ -72,6 +73,7 @@ const createStartContractMock = () => {
setHelpExtension: jest.fn(),
setHelpSupportUrl: jest.fn(),
getIsNavDrawerLocked$: jest.fn(),
getNavType$: jest.fn(),
};
startContract.navLinks.getAll.mockReturnValue([]);
startContract.getBrand$.mockReturnValue(new BehaviorSubject({} as ChromeBrand));
Expand All @@ -81,6 +83,7 @@ const createStartContractMock = () => {
startContract.getBreadcrumbs$.mockReturnValue(new BehaviorSubject([{} as ChromeBreadcrumb]));
startContract.getHelpExtension$.mockReturnValue(new BehaviorSubject(undefined));
startContract.getIsNavDrawerLocked$.mockReturnValue(new BehaviorSubject(false));
startContract.getNavType$.mockReturnValue(new BehaviorSubject('modern' as NavType));
return startContract;
};

Expand Down
15 changes: 15 additions & 0 deletions src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { DocLinksStart } from '../doc_links';
import { ChromeHelpExtensionMenuLink } from './ui/header/header_help_menu';
import { KIBANA_ASK_ELASTIC_LINK } from './constants';
import { IUiSettingsClient } from '../ui_settings';
import { NavType } from './ui/header';
export { ChromeNavControls, ChromeRecentlyAccessed, ChromeDocTitle };

const IS_LOCKED_KEY = 'core.chrome.isLocked';
Expand Down Expand Up @@ -165,6 +166,10 @@ export class ChromeService {

const getIsNavDrawerLocked$ = isNavDrawerLocked$.pipe(takeUntil(this.stop$));

// TODO #64541
// Can delete
const getNavType$ = uiSettings.get$('pageNavigation').pipe(takeUntil(this.stop$));

if (!this.params.browserSupportsCsp && injectedMetadata.getCspConfig().warnLegacyBrowsers) {
notifications.toasts.addWarning(
i18n.translate('core.chrome.legacyBrowserWarning', {
Expand Down Expand Up @@ -202,6 +207,7 @@ export class ChromeService {
navControlsRight$={navControls.getRight$()}
onIsLockedUpdate={setIsNavDrawerLocked}
isLocked$={getIsNavDrawerLocked$}
navType$={getNavType$}
/>
</React.Fragment>
),
Expand Down Expand Up @@ -262,6 +268,8 @@ export class ChromeService {
setHelpSupportUrl: (url: string) => helpSupportUrl$.next(url),

getIsNavDrawerLocked$: () => getIsNavDrawerLocked$,

getNavType$: () => getNavType$,
};
}

Expand Down Expand Up @@ -408,6 +416,13 @@ export interface ChromeStart {
* Get an observable of the current locked state of the nav drawer.
*/
getIsNavDrawerLocked$(): Observable<boolean>;

/**
* Get the navigation type
* TODO #64541
* Can delete
*/
getNavType$(): Observable<NavType>;
}

/** @internal */
Expand Down
1 change: 1 addition & 0 deletions src/core/public/chrome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export {
ChromeHelpExtensionMenuDocumentationLink,
ChromeHelpExtensionMenuGitHubLink,
} from './ui/header/header_help_menu';
export { NavType } from './ui';
export { ChromeNavLink, ChromeNavLinks, ChromeNavLinkUpdateableFields } from './nav_links';
export { ChromeRecentlyAccessed, ChromeRecentlyAccessedHistoryItem } from './recently_accessed';
export { ChromeNavControl, ChromeNavControls } from './nav_controls';
Expand Down
16 changes: 12 additions & 4 deletions src/core/public/chrome/ui/header/_index.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
@import '@elastic/eui/src/components/header/variables';
@import '@elastic/eui/src/components/nav_drawer/variables';

.chrHeaderWrapper {
// TODO #64541
// Delete this block
.chrHeaderWrapper:not(.headerWrapper) {
width: 100%;
position: fixed;
top: 0;
z-index: 10;
}

.chrHeaderWrapper ~ .app-wrapper:not(.hidden-chrome) {
// TODO #64541
// Delete this block
.chrHeaderWrapper:not(.headerWrapper) ~ .app-wrapper:not(.hidden-chrome) {
top: $euiHeaderChildSize;
left: $euiHeaderChildSize;

Expand All @@ -30,14 +34,18 @@
}

// Mobile header is smaller
// TODO #64541
// Delete this block
@include euiBreakpoint('xs', 's') {
.chrHeaderWrapper ~ .app-wrapper:not(.hidden-chrome) {
.chrHeaderWrapper:not(.headerWrapper) ~ .app-wrapper:not(.hidden-chrome) {
left: 0;
}
}

// TODO #64541
// Delete this block
@include euiBreakpoint('xl') {
.chrHeaderWrapper--navIsLocked {
.chrHeaderWrapper--navIsLocked:not(.headerWrapper) {
~ .app-wrapper:not(.hidden-chrome) {
// Shrink the content from the left so it's no longer overlapped by the nav drawer (ALWAYS)
left: $euiNavDrawerWidthExpanded !important; // sass-lint:disable-line no-important
Expand Down
Loading