diff --git a/docs/development/core/public/kibana-plugin-core-public.chromebrand.logo.md b/docs/development/core/public/kibana-plugin-core-public.chromebrand.logo.md deleted file mode 100644 index 561d9c50008b8..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromebrand.logo.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeBrand](./kibana-plugin-core-public.chromebrand.md) > [logo](./kibana-plugin-core-public.chromebrand.logo.md) - -## ChromeBrand.logo property - -Signature: - -```typescript -logo?: string; -``` diff --git a/docs/development/core/public/kibana-plugin-core-public.chromebrand.md b/docs/development/core/public/kibana-plugin-core-public.chromebrand.md deleted file mode 100644 index 21cdf6c3dee9b..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromebrand.md +++ /dev/null @@ -1,20 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeBrand](./kibana-plugin-core-public.chromebrand.md) - -## ChromeBrand interface - - -Signature: - -```typescript -export interface ChromeBrand -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [logo](./kibana-plugin-core-public.chromebrand.logo.md) | string | | -| [smallLogo](./kibana-plugin-core-public.chromebrand.smalllogo.md) | string | | - diff --git a/docs/development/core/public/kibana-plugin-core-public.chromebrand.smalllogo.md b/docs/development/core/public/kibana-plugin-core-public.chromebrand.smalllogo.md deleted file mode 100644 index 5b21e806540be..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromebrand.smalllogo.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeBrand](./kibana-plugin-core-public.chromebrand.md) > [smallLogo](./kibana-plugin-core-public.chromebrand.smalllogo.md) - -## ChromeBrand.smallLogo property - -Signature: - -```typescript -smallLogo?: string; -``` diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.addapplicationclass.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.addapplicationclass.md deleted file mode 100644 index 67e86863ad3c8..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.addapplicationclass.md +++ /dev/null @@ -1,24 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [addApplicationClass](./kibana-plugin-core-public.chromestart.addapplicationclass.md) - -## ChromeStart.addApplicationClass() method - -Add a className that should be set on the application container. - -Signature: - -```typescript -addApplicationClass(className: string): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| className | string | | - -Returns: - -`void` - diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getapplicationclasses_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getapplicationclasses_.md deleted file mode 100644 index c932d8b7f0a40..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.getapplicationclasses_.md +++ /dev/null @@ -1,17 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [getApplicationClasses$](./kibana-plugin-core-public.chromestart.getapplicationclasses_.md) - -## ChromeStart.getApplicationClasses$() method - -Get the current set of classNames that will be set on the application container. - -Signature: - -```typescript -getApplicationClasses$(): Observable; -``` -Returns: - -`Observable` - diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getbrand_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getbrand_.md deleted file mode 100644 index fa42defd6339a..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.getbrand_.md +++ /dev/null @@ -1,17 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [getBrand$](./kibana-plugin-core-public.chromestart.getbrand_.md) - -## ChromeStart.getBrand$() method - -Get an observable of the current brand information. - -Signature: - -```typescript -getBrand$(): Observable; -``` -Returns: - -`Observable` - diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.md index 2d465745c436b..7285b4a00a0ec 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.md @@ -50,20 +50,14 @@ core.chrome.setHelpExtension(elem => { | Method | Description | | --- | --- | -| [addApplicationClass(className)](./kibana-plugin-core-public.chromestart.addapplicationclass.md) | Add a className that should be set on the application container. | -| [getApplicationClasses$()](./kibana-plugin-core-public.chromestart.getapplicationclasses_.md) | Get the current set of classNames that will be set on the application container. | | [getBadge$()](./kibana-plugin-core-public.chromestart.getbadge_.md) | Get an observable of the current badge | -| [getBrand$()](./kibana-plugin-core-public.chromestart.getbrand_.md) | Get an observable of the current brand information. | | [getBreadcrumbs$()](./kibana-plugin-core-public.chromestart.getbreadcrumbs_.md) | Get an observable of the current list of breadcrumbs | | [getBreadcrumbsAppendExtension$()](./kibana-plugin-core-public.chromestart.getbreadcrumbsappendextension_.md) | Get an observable of the current extension appended to breadcrumbs | | [getCustomNavLink$()](./kibana-plugin-core-public.chromestart.getcustomnavlink_.md) | Get an observable of the current custom nav link | | [getHelpExtension$()](./kibana-plugin-core-public.chromestart.gethelpextension_.md) | Get an observable of the current custom help conttent | | [getIsNavDrawerLocked$()](./kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md) | Get an observable of the current locked state of the nav drawer. | | [getIsVisible$()](./kibana-plugin-core-public.chromestart.getisvisible_.md) | Get an observable of the current visibility state of the chrome. | -| [removeApplicationClass(className)](./kibana-plugin-core-public.chromestart.removeapplicationclass.md) | Remove a className added with addApplicationClass(). If className is unknown it is ignored. | -| [setAppTitle(appTitle)](./kibana-plugin-core-public.chromestart.setapptitle.md) | Sets the current app's title | | [setBadge(badge)](./kibana-plugin-core-public.chromestart.setbadge.md) | Override the current badge | -| [setBrand(brand)](./kibana-plugin-core-public.chromestart.setbrand.md) | Set the brand configuration. | | [setBreadcrumbs(newBreadcrumbs)](./kibana-plugin-core-public.chromestart.setbreadcrumbs.md) | Override the current set of breadcrumbs | | [setBreadcrumbsAppendExtension(breadcrumbsAppendExtension)](./kibana-plugin-core-public.chromestart.setbreadcrumbsappendextension.md) | Mount an element next to the last breadcrumb | | [setCustomNavLink(newCustomNavLink)](./kibana-plugin-core-public.chromestart.setcustomnavlink.md) | Override the current set of custom nav link | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.removeapplicationclass.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.removeapplicationclass.md deleted file mode 100644 index 5bdeec635ed44..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.removeapplicationclass.md +++ /dev/null @@ -1,24 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [removeApplicationClass](./kibana-plugin-core-public.chromestart.removeapplicationclass.md) - -## ChromeStart.removeApplicationClass() method - -Remove a className added with `addApplicationClass()`. If className is unknown it is ignored. - -Signature: - -```typescript -removeApplicationClass(className: string): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| className | string | | - -Returns: - -`void` - diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.setapptitle.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.setapptitle.md deleted file mode 100644 index f0e2db30f1891..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.setapptitle.md +++ /dev/null @@ -1,24 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [setAppTitle](./kibana-plugin-core-public.chromestart.setapptitle.md) - -## ChromeStart.setAppTitle() method - -Sets the current app's title - -Signature: - -```typescript -setAppTitle(appTitle: string): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| appTitle | string | | - -Returns: - -`void` - diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.setbrand.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.setbrand.md deleted file mode 100644 index daaa510483ae7..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.setbrand.md +++ /dev/null @@ -1,39 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [setBrand](./kibana-plugin-core-public.chromestart.setbrand.md) - -## ChromeStart.setBrand() method - -Set the brand configuration. - -Signature: - -```typescript -setBrand(brand: ChromeBrand): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| brand | ChromeBrand | | - -Returns: - -`void` - -## Remarks - -Normally the `logo` property will be rendered as the CSS background for the home link in the chrome navigation, but when the page is rendered in a small window the `smallLogo` will be used and rendered at about 45px wide. - -## Example - - -```js -chrome.setBrand({ - logo: 'url(/plugins/app/logo.png) center no-repeat' - smallLogo: 'url(/plugins/app/logo-small.png) center no-repeat' -}) - -``` - diff --git a/docs/development/core/public/kibana-plugin-core-public.md b/docs/development/core/public/kibana-plugin-core-public.md index e984fbb675e6d..59735b053adbc 100644 --- a/docs/development/core/public/kibana-plugin-core-public.md +++ b/docs/development/core/public/kibana-plugin-core-public.md @@ -42,7 +42,6 @@ The plugin integrates with the core system via lifecycle events: `setup` | [AsyncPlugin](./kibana-plugin-core-public.asyncplugin.md) | A plugin with asynchronous lifecycle methods. | | [Capabilities](./kibana-plugin-core-public.capabilities.md) | The read-only set of capabilities available for the current UI session. Capabilities are simple key-value pairs of (string, boolean), where the string denotes the capability ID, and the boolean is a flag indicating if the capability is enabled or disabled. | | [ChromeBadge](./kibana-plugin-core-public.chromebadge.md) | | -| [ChromeBrand](./kibana-plugin-core-public.chromebrand.md) | | | [ChromeDocTitle](./kibana-plugin-core-public.chromedoctitle.md) | APIs for accessing and updating the document title. | | [ChromeHelpExtension](./kibana-plugin-core-public.chromehelpextension.md) | | | [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.md) | | diff --git a/src/core/public/chrome/chrome_service.mock.ts b/src/core/public/chrome/chrome_service.mock.ts index b624084258817..5e29218250fb9 100644 --- a/src/core/public/chrome/chrome_service.mock.ts +++ b/src/core/public/chrome/chrome_service.mock.ts @@ -9,7 +9,7 @@ import { BehaviorSubject } from 'rxjs'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { DeeplyMockedKeys } from '@kbn/utility-types/jest'; -import { ChromeBadge, ChromeBrand, ChromeBreadcrumb, ChromeService, InternalChromeStart } from './'; +import { ChromeBadge, ChromeBreadcrumb, ChromeService, InternalChromeStart } from './'; const createStartContractMock = () => { const startContract: DeeplyMockedKeys = { @@ -40,14 +40,8 @@ const createStartContractMock = () => { getCenter$: jest.fn(), getRight$: jest.fn(), }, - setAppTitle: jest.fn(), - setBrand: jest.fn(), - getBrand$: jest.fn(), setIsVisible: jest.fn(), getIsVisible$: jest.fn(), - addApplicationClass: jest.fn(), - removeApplicationClass: jest.fn(), - getApplicationClasses$: jest.fn(), getBadge$: jest.fn(), setBadge: jest.fn(), getBreadcrumbs$: jest.fn(), @@ -64,9 +58,7 @@ const createStartContractMock = () => { getBodyClasses$: jest.fn(), }; startContract.navLinks.getAll.mockReturnValue([]); - startContract.getBrand$.mockReturnValue(new BehaviorSubject({} as ChromeBrand)); startContract.getIsVisible$.mockReturnValue(new BehaviorSubject(false)); - startContract.getApplicationClasses$.mockReturnValue(new BehaviorSubject(['class-name'])); startContract.getBadge$.mockReturnValue(new BehaviorSubject({} as ChromeBadge)); startContract.getBreadcrumbs$.mockReturnValue(new BehaviorSubject([{} as ChromeBreadcrumb])); startContract.getBreadcrumbsAppendExtension$.mockReturnValue(new BehaviorSubject(undefined)); diff --git a/src/core/public/chrome/chrome_service.test.ts b/src/core/public/chrome/chrome_service.test.ts index 92f5a854f6b00..8df8d76a13c46 100644 --- a/src/core/public/chrome/chrome_service.test.ts +++ b/src/core/public/chrome/chrome_service.test.ts @@ -23,8 +23,10 @@ import { getAppInfo } from '../application/utils'; class FakeApp implements App { public title = `${this.id} App`; public mount = () => () => {}; + constructor(public id: string, public chromeless?: boolean) {} } + const store = new Map(); const originalLocalStorage = window.localStorage; @@ -170,36 +172,6 @@ describe('start', () => { }); }); - describe('brand', () => { - it('updates/emits the brand as it changes', async () => { - const { chrome, service } = await start(); - const promise = chrome.getBrand$().pipe(toArray()).toPromise(); - - chrome.setBrand({ - logo: 'big logo', - smallLogo: 'not so big logo', - }); - chrome.setBrand({ - logo: 'big logo without small logo', - }); - service.stop(); - - await expect(promise).resolves.toMatchInlineSnapshot(` - Array [ - Object {}, - Object { - "logo": "big logo", - "smallLogo": "not so big logo", - }, - Object { - "logo": "big logo without small logo", - "smallLogo": undefined, - }, - ] - `); - }); - }); - describe('visibility', () => { it('emits false when no application is mounted', async () => { const { chrome, service } = await start(); @@ -289,54 +261,6 @@ describe('start', () => { }); }); - describe('application classes', () => { - it('updates/emits the application classes', async () => { - const { chrome, service } = await start(); - const promise = chrome.getApplicationClasses$().pipe(toArray()).toPromise(); - - chrome.addApplicationClass('foo'); - chrome.addApplicationClass('foo'); - chrome.addApplicationClass('bar'); - chrome.addApplicationClass('bar'); - chrome.addApplicationClass('baz'); - chrome.removeApplicationClass('bar'); - chrome.removeApplicationClass('foo'); - service.stop(); - - await expect(promise).resolves.toMatchInlineSnapshot(` - Array [ - Array [], - Array [ - "foo", - ], - Array [ - "foo", - ], - Array [ - "foo", - "bar", - ], - Array [ - "foo", - "bar", - ], - Array [ - "foo", - "bar", - "baz", - ], - Array [ - "foo", - "baz", - ], - Array [ - "baz", - ], - ] - `); - }); - }); - describe('badge', () => { it('updates/emits the current badge', async () => { const { chrome, service } = await start(); @@ -407,7 +331,9 @@ describe('start', () => { const { chrome, service } = await start(); const promise = chrome.getBreadcrumbsAppendExtension$().pipe(toArray()).toPromise(); - chrome.setBreadcrumbsAppendExtension({ content: (element) => () => {} }); + chrome.setBreadcrumbsAppendExtension({ + content: (element) => () => {}, + }); service.stop(); await expect(promise).resolves.toMatchInlineSnapshot(` @@ -521,14 +447,12 @@ describe('start', () => { describe('stop', () => { it('completes applicationClass$, getIsNavDrawerLocked, breadcrumbs$, isVisible$, and brand$ observables', async () => { const { chrome, service } = await start(); - const promise = Rx.combineLatest( - chrome.getBrand$(), - chrome.getApplicationClasses$(), + const promise = Rx.combineLatest([ chrome.getIsNavDrawerLocked$(), chrome.getBreadcrumbs$(), chrome.getIsVisible$(), - chrome.getHelpExtension$() - ).toPromise(); + chrome.getHelpExtension$(), + ]).toPromise(); service.stop(); await promise; @@ -539,14 +463,12 @@ describe('stop', () => { service.stop(); await expect( - Rx.combineLatest( - chrome.getBrand$(), - chrome.getApplicationClasses$(), + Rx.combineLatest([ chrome.getIsNavDrawerLocked$(), chrome.getBreadcrumbs$(), chrome.getIsVisible$(), - chrome.getHelpExtension$() - ).toPromise() + chrome.getHelpExtension$(), + ]).toPromise() ).resolves.toBe(undefined); }); }); diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index f1381c52ce779..5740e1739280a 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -26,7 +26,6 @@ import { ChromeRecentlyAccessed, RecentlyAccessedService } from './recently_acce import { Header } from './ui'; import { ChromeBadge, - ChromeBrand, ChromeBreadcrumb, ChromeBreadcrumbsAppendExtension, ChromeHelpExtension, @@ -105,9 +104,6 @@ export class ChromeService { }: StartDeps): Promise { this.initVisibility(application); - const appTitle$ = new BehaviorSubject('Kibana'); - const brand$ = new BehaviorSubject({}); - const applicationClasses$ = new BehaviorSubject>(new Set()); const helpExtension$ = new BehaviorSubject(undefined); const breadcrumbs$ = new BehaviorSubject([]); const breadcrumbsAppendExtension$ = new BehaviorSubject< @@ -210,7 +206,6 @@ export class ChromeService {
), - setAppTitle: (appTitle: string) => appTitle$.next(appTitle), - - getBrand$: () => brand$.pipe(takeUntil(this.stop$)), - - setBrand: (brand: ChromeBrand) => { - brand$.next( - Object.freeze({ - logo: brand.logo, - smallLogo: brand.smallLogo, - }) - ); - }, - getIsVisible$: () => this.isVisible$, setIsVisible: (isVisible: boolean) => this.isForceHidden$.next(!isVisible), - getApplicationClasses$: () => - applicationClasses$.pipe( - map((set) => [...set]), - takeUntil(this.stop$) - ), - - addApplicationClass: (className: string) => { - const update = new Set([...applicationClasses$.getValue()]); - update.add(className); - applicationClasses$.next(update); - }, - - removeApplicationClass: (className: string) => { - const update = new Set([...applicationClasses$.getValue()]); - update.delete(className); - applicationClasses$.next(update); - }, - getBadge$: () => badge$.pipe(takeUntil(this.stop$)), setBadge: (badge: ChromeBadge) => { diff --git a/src/core/public/chrome/index.ts b/src/core/public/chrome/index.ts index dd7affcdbf7cd..b1a70c1dc2b04 100644 --- a/src/core/public/chrome/index.ts +++ b/src/core/public/chrome/index.ts @@ -29,7 +29,6 @@ export type { ChromeHelpExtension, ChromeBreadcrumbsAppendExtension, ChromeBreadcrumb, - ChromeBrand, ChromeBadge, ChromeUserBanner, } from './types'; diff --git a/src/core/public/chrome/types.ts b/src/core/public/chrome/types.ts index 732236f1ba4a1..813f385fc94d2 100644 --- a/src/core/public/chrome/types.ts +++ b/src/core/public/chrome/types.ts @@ -22,12 +22,6 @@ export interface ChromeBadge { iconType?: IconType; } -/** @public */ -export interface ChromeBrand { - logo?: string; - smallLogo?: string; -} - /** @public */ export type ChromeBreadcrumb = EuiBreadcrumb; @@ -93,40 +87,6 @@ export interface ChromeStart { /** {@inheritdoc ChromeDocTitle} */ docTitle: ChromeDocTitle; - /** - * Sets the current app's title - * - * @internalRemarks - * This should be handled by the application service once it is in charge - * of mounting applications. - */ - setAppTitle(appTitle: string): void; - - /** - * Get an observable of the current brand information. - */ - getBrand$(): Observable; - - /** - * Set the brand configuration. - * - * @remarks - * Normally the `logo` property will be rendered as the - * CSS background for the home link in the chrome navigation, but when the page is - * rendered in a small window the `smallLogo` will be used and rendered at about - * 45px wide. - * - * @example - * ```js - * chrome.setBrand({ - * logo: 'url(/plugins/app/logo.png) center no-repeat' - * smallLogo: 'url(/plugins/app/logo-small.png) center no-repeat' - * }) - * ``` - * - */ - setBrand(brand: ChromeBrand): void; - /** * Get an observable of the current visibility state of the chrome. */ @@ -139,21 +99,6 @@ export interface ChromeStart { */ setIsVisible(isVisible: boolean): void; - /** - * Get the current set of classNames that will be set on the application container. - */ - getApplicationClasses$(): Observable; - - /** - * Add a className that should be set on the application container. - */ - addApplicationClass(className: string): void; - - /** - * Remove a className added with `addApplicationClass()`. If className is unknown it is ignored. - */ - removeApplicationClass(className: string): void; - /** * Get an observable of the current badge */ @@ -232,6 +177,7 @@ export interface InternalChromeStart extends ChromeStart { * @internal */ getHeaderComponent(): JSX.Element; + /** * Used only by the rendering service to retrieve the set of classNames * that will be set on the body element. diff --git a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap index d2bc11f4db877..4450533090c7f 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap @@ -9,45 +9,7 @@ exports[`Header renders 1`] = ` "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, - "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, - }, - ], + "observers": Array [], "thrownError": null, } } @@ -4713,55 +4675,6 @@ exports[`Header renders 1`] = ` + + + Kibana + + + +`; diff --git a/src/core/public/chrome/ui/header/header.tsx b/src/core/public/chrome/ui/header/header.tsx index a401195b38942..578c87411e543 100644 --- a/src/core/public/chrome/ui/header/header.tsx +++ b/src/core/public/chrome/ui/header/header.tsx @@ -52,7 +52,6 @@ export interface HeaderProps { kibanaVersion: string; application: InternalApplicationStart; headerBanner$: Observable; - appTitle$: Observable; badge$: Observable; breadcrumbs$: Observable; breadcrumbsAppendExtension$: Observable; @@ -102,9 +101,7 @@ export function Header({ const toggleCollapsibleNavRef = createRef void }>(); const className = classnames('hide-for-sharing', 'headerGlobalNav'); - const Breadcrumbs = ( - - ); + const Breadcrumbs = ; return ( <> diff --git a/src/core/public/chrome/ui/header/header_breadcrumbs.test.tsx b/src/core/public/chrome/ui/header/header_breadcrumbs.test.tsx index 26b397229d7e9..7d40bd77e2548 100644 --- a/src/core/public/chrome/ui/header/header_breadcrumbs.test.tsx +++ b/src/core/public/chrome/ui/header/header_breadcrumbs.test.tsx @@ -15,9 +15,7 @@ import { HeaderBreadcrumbs } from './header_breadcrumbs'; describe('HeaderBreadcrumbs', () => { it('renders updates to the breadcrumbs$ observable', () => { const breadcrumbs$ = new BehaviorSubject([{ text: 'First' }]); - const wrapper = mount( - - ); + const wrapper = mount(); expect(wrapper.find('.euiBreadcrumb')).toMatchSnapshot(); act(() => breadcrumbs$.next([{ text: 'First' }, { text: 'Second' }])); diff --git a/src/core/public/chrome/ui/header/header_breadcrumbs.tsx b/src/core/public/chrome/ui/header/header_breadcrumbs.tsx index 0e2bae82a3ad3..a90ceed32dcce 100644 --- a/src/core/public/chrome/ui/header/header_breadcrumbs.tsx +++ b/src/core/public/chrome/ui/header/header_breadcrumbs.tsx @@ -14,17 +14,15 @@ import { Observable } from 'rxjs'; import { ChromeBreadcrumb } from '../../types'; interface Props { - appTitle$: Observable; breadcrumbs$: Observable; } -export function HeaderBreadcrumbs({ appTitle$, breadcrumbs$ }: Props) { - const appTitle = useObservable(appTitle$, 'Kibana'); +export function HeaderBreadcrumbs({ breadcrumbs$ }: Props) { const breadcrumbs = useObservable(breadcrumbs$, []); let crumbs = breadcrumbs; - if (breadcrumbs.length === 0 && appTitle) { - crumbs = [{ text: appTitle }]; + if (breadcrumbs.length === 0) { + crumbs = [{ text: 'Kibana' }]; } crumbs = crumbs.map((breadcrumb, i) => ({ diff --git a/src/core/public/index.ts b/src/core/public/index.ts index e6e6433291873..d343a0b081fa1 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -28,7 +28,6 @@ import './index.scss'; import { ChromeBadge, - ChromeBrand, ChromeBreadcrumb, ChromeHelpExtension, ChromeHelpExtensionMenuLink, @@ -287,7 +286,6 @@ export interface CoreStart { export type { Capabilities, ChromeBadge, - ChromeBrand, ChromeBreadcrumb, ChromeHelpExtension, ChromeHelpExtensionMenuLink, diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index d3f9ce71379b7..2217b71d2f1a3 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -231,14 +231,6 @@ export interface ChromeBadge { tooltip: string; } -// @public (undocumented) -export interface ChromeBrand { - // (undocumented) - logo?: string; - // (undocumented) - smallLogo?: string; -} - // @public (undocumented) export type ChromeBreadcrumb = EuiBreadcrumb; @@ -355,11 +347,8 @@ export interface ChromeRecentlyAccessedHistoryItem { // @public export interface ChromeStart { - addApplicationClass(className: string): void; docTitle: ChromeDocTitle; - getApplicationClasses$(): Observable; getBadge$(): Observable; - getBrand$(): Observable; getBreadcrumbs$(): Observable; // Warning: (ae-forgotten-export) The symbol "ChromeBreadcrumbsAppendExtension" needs to be exported by the entry point index.d.ts getBreadcrumbsAppendExtension$(): Observable; @@ -370,10 +359,7 @@ export interface ChromeStart { navControls: ChromeNavControls; navLinks: ChromeNavLinks; recentlyAccessed: ChromeRecentlyAccessed; - removeApplicationClass(className: string): void; - setAppTitle(appTitle: string): void; setBadge(badge?: ChromeBadge): void; - setBrand(brand: ChromeBrand): void; setBreadcrumbs(newBreadcrumbs: ChromeBreadcrumb[]): void; setBreadcrumbsAppendExtension(breadcrumbsAppendExtension?: ChromeBreadcrumbsAppendExtension): void; setCustomNavLink(newCustomNavLink?: Partial): void; diff --git a/src/core/public/rendering/app_containers.test.tsx b/src/core/public/rendering/app_containers.test.tsx index 193e393f268f0..10f5f3f1c138f 100644 --- a/src/core/public/rendering/app_containers.test.tsx +++ b/src/core/public/rendering/app_containers.test.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { BehaviorSubject, of } from 'rxjs'; +import { BehaviorSubject } from 'rxjs'; import { act } from 'react-dom/test-utils'; import { mount } from 'enzyme'; import React from 'react'; @@ -17,11 +17,7 @@ describe('AppWrapper', () => { it('toggles the `hidden-chrome` class depending on the chrome visibility state', () => { const chromeVisible$ = new BehaviorSubject(true); - const component = mount( - - app-content - - ); + const component = mount(app-content); expect(component.getDOMNode()).toMatchInlineSnapshot(`
{
`); }); - - it('adds classes supplied by chrome', () => { - const chromeVisible$ = new BehaviorSubject(true); - const appClasses$ = new BehaviorSubject([]); - - const component = mount( - - app-content - - ); - expect(component.getDOMNode()).toMatchInlineSnapshot(` -
- app-content -
- `); - - act(() => appClasses$.next(['classA', 'classB'])); - component.update(); - expect(component.getDOMNode()).toMatchInlineSnapshot(` -
- app-content -
- `); - - act(() => appClasses$.next(['classC'])); - component.update(); - expect(component.getDOMNode()).toMatchInlineSnapshot(` -
- app-content -
- `); - - act(() => appClasses$.next([])); - component.update(); - expect(component.getDOMNode()).toMatchInlineSnapshot(` -
- app-content -
- `); - }); }); diff --git a/src/core/public/rendering/app_containers.tsx b/src/core/public/rendering/app_containers.tsx index 64d64d2caad75..2a8e944205910 100644 --- a/src/core/public/rendering/app_containers.tsx +++ b/src/core/public/rendering/app_containers.tsx @@ -14,18 +14,10 @@ import { APP_WRAPPER_CLASS } from '../../utils'; export const AppWrapper: React.FunctionComponent<{ chromeVisible$: Observable; - classes$: Observable; -}> = ({ chromeVisible$, classes$, children }) => { +}> = ({ chromeVisible$, children }) => { const visible = useObservable(chromeVisible$); - const classes = useObservable(classes$, ['']); return ( -
+
{children}
); diff --git a/src/core/public/rendering/rendering_service.test.tsx b/src/core/public/rendering/rendering_service.test.tsx index d9eb764fc9f0d..bdca628b295c6 100644 --- a/src/core/public/rendering/rendering_service.test.tsx +++ b/src/core/public/rendering/rendering_service.test.tsx @@ -13,7 +13,7 @@ import { RenderingService } from './rendering_service'; import { applicationServiceMock } from '../application/application_service.mock'; import { chromeServiceMock } from '../chrome/chrome_service.mock'; import { overlayServiceMock } from '../overlays/overlay_service.mock'; -import { BehaviorSubject, of } from 'rxjs'; +import { BehaviorSubject } from 'rxjs'; describe('RenderingService#start', () => { let application: ReturnType; @@ -28,7 +28,6 @@ describe('RenderingService#start', () => { chrome = chromeServiceMock.createStartContract(); chrome.getHeaderComponent.mockReturnValue(
Hello chrome!
); - chrome.getApplicationClasses$.mockReturnValue(of([])); overlays = overlayServiceMock.createStartContract(); overlays.banners.getComponent.mockReturnValue(
I'm a banner!
); @@ -78,26 +77,6 @@ describe('RenderingService#start', () => { expect(appWrapper.className).toEqual('kbnAppWrapper'); }); - it('adds the application classes to the AppWrapper', () => { - const applicationClasses$ = new BehaviorSubject([]); - const isVisible$ = new BehaviorSubject(true); - chrome.getIsVisible$.mockReturnValue(isVisible$); - chrome.getApplicationClasses$.mockReturnValue(applicationClasses$); - startService(); - - const appContainer = targetDomElement.querySelector('div.kbnAppWrapper')!; - expect(appContainer.className).toEqual('kbnAppWrapper'); - - act(() => applicationClasses$.next(['classA', 'classB'])); - expect(appContainer.className).toEqual('kbnAppWrapper classA classB'); - - act(() => applicationClasses$.next(['classC'])); - expect(appContainer.className).toEqual('kbnAppWrapper classC'); - - act(() => applicationClasses$.next([])); - expect(appContainer.className).toEqual('kbnAppWrapper'); - }); - it('contains wrapper divs', () => { startService(); expect(targetDomElement.querySelector('div.kbnAppWrapper')).toBeDefined(); diff --git a/src/core/public/rendering/rendering_service.tsx b/src/core/public/rendering/rendering_service.tsx index 1dfb4259d7d70..d3f91851370d5 100644 --- a/src/core/public/rendering/rendering_service.tsx +++ b/src/core/public/rendering/rendering_service.tsx @@ -56,10 +56,7 @@ export class RenderingService {
{bannerComponent}
{/* The App Wrapper outside of the fixed headers that accepts custom class names from apps */} - + {/* Affixes a div to restrict the position of charts tooltip to the visible viewport minus the header */}