From 8afec439c1b2356ad0951ca19925031d2f62a1a8 Mon Sep 17 00:00:00 2001 From: cchaos Date: Wed, 23 Jun 2021 11:53:39 -0400 Subject: [PATCH 01/26] Updating Solution nav to use new props of EuiSideNav # Conflicts: # src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx --- .../solution_nav/solution_nav.tsx | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx b/src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx index bd9ee8eb4d0e8..46573bff54941 100644 --- a/src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx +++ b/src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx @@ -10,14 +10,14 @@ import './solution_nav.scss'; import React, { FunctionComponent, useState } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiTitle, EuiSideNav, EuiSideNavProps, htmlIdGenerator } from '@elastic/eui'; +import { EuiSideNav, EuiSideNavProps } from '@elastic/eui'; import { KibanaPageTemplateSolutionNavAvatar, KibanaPageTemplateSolutionNavAvatarProps, } from './solution_nav_avatar'; -export type KibanaPageTemplateSolutionNavProps = Partial> & { +export type KibanaPageTemplateSolutionNavProps = Partial & { /** * Name of the solution, i.e. "Observability" */ @@ -50,25 +50,18 @@ export const KibanaPageTemplateSolutionNav: FunctionComponent; } - /** - * Create the required title. - * a11y: Since the heading can't be nested inside ` @@ -2057,6 +2065,7 @@ exports[`CollapsibleNav renders the default nav 1`] = ` "serverBasePath": "/test", } } + button={ - -
- -
-
-
- -
- -
-

- No recently viewed items -

-
-
-
-
-
-
-
-
-
- - - - -
-
- -
- - -
-
- -
    - - - - Undock navigation - - , - } - } - color="subdued" - data-test-subj="collapsible-nav-lock" - iconType="lock" - label="Undock navigation" - onClick={[Function]} - size="xs" - > -
  • - -
  • -
    -
-
-
-
-
-
-
-
- - + , - } + - - - - - - + + } + closeNav={[Function]} + customNavLink$={ + BehaviorSubject { + "_isScalar": false, + "_value": Object { + "baseUrl": "", + "href": "", + "id": "cloud-deployment-link", + "title": "Manage cloud deployment", + "url": "", + }, + "closed": false, + "hasError": false, + "isStopped": false, + "observers": Array [ + Subscriber { + "_parentOrParents": null, + "_subscriptions": Array [ + SubjectSubscription { + "_parentOrParents": [Circular], + "_subscriptions": null, + "closed": false, + "subject": [Circular], + "subscriber": [Circular], + }, + ], "closed": false, - "subject": [Circular], - "subscriber": [Circular], + "destination": SafeSubscriber { + "_complete": undefined, + "_context": [Circular], + "_error": undefined, + "_next": [Function], + "_parentOrParents": null, + "_parentSubscriber": [Circular], + "_subscriptions": null, + "closed": false, + "destination": Object { + "closed": true, + "complete": [Function], + "error": [Function], + "next": [Function], + }, + "isStopped": false, + "syncErrorThrowable": false, + "syncErrorThrown": false, + "syncErrorValue": null, + }, + "isStopped": false, + "syncErrorThrowable": true, + "syncErrorThrown": false, + "syncErrorValue": null, }, ], - "closed": false, - "destination": SafeSubscriber { - "_complete": undefined, - "_context": [Circular], - "_error": undefined, - "_next": [Function], - "_parentOrParents": null, - "_parentSubscriber": [Circular], - "_subscriptions": null, - "closed": false, - "destination": Object { - "closed": true, - "complete": [Function], - "error": [Function], - "next": [Function], + "thrownError": null, + } + } + homeHref="/" + id="mockId" + isLocked={true} + isNavOpen={false} + navLinks$={ + BehaviorSubject { + "_isScalar": false, + "_value": Array [ + Object { + "baseUrl": "", + "href": "", + "id": "kibana", + "title": "kibana", + "url": "", }, - "isStopped": false, - "syncErrorThrowable": false, - "syncErrorThrown": false, - "syncErrorValue": null, - }, - "isStopped": false, - "syncErrorThrowable": true, - "syncErrorThrown": false, - "syncErrorValue": null, - }, - ], - "thrownError": null, - } - } - side="left" - /> - - - - - - - - - - - -
- -
- -
- -
- -
- -
- - - - - - + + + + + +
-
- -
- -
    - -
  • - -
  • -
    -
-
-
-
-
- - -
-
- -
    - - - - Undock navigation - - , - } - } - color="subdued" - data-test-subj="collapsible-nav-lock" - iconType="lock" - label="Undock navigation" - onClick={[Function]} - size="xs" - > -
  • - -
  • -
    -
-
-
-
-
-
-
- - - - - + data-test-subj="headerAppActionMenu" + /> + +
+ + +
+ + + `; diff --git a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx index 460770744d53a..e69ac65b59850 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx @@ -56,6 +56,7 @@ function mockProps() { navigateToApp: () => Promise.resolve(), navigateToUrl: () => Promise.resolve(), customNavLink$: new BehaviorSubject(undefined), + button: