kibana/x-pack/plugins/observability/public/toggle_overview_link_in_nav.tsx
Cauê Marcondes 386c7b501c
[Observability] landing page always being displayed (#71494)
* hides overview item when no other obs plugin is available.

* reverting tests changes

* reverting tests changes

* adding overview to observability tests
2020-07-14 16:32:28 +02:00

15 lines
628 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { CoreStart } from 'kibana/public';
export function toggleOverviewLinkInNav(core: CoreStart) {
const { apm, logs, metrics, uptime } = core.application.capabilities.navLinks;
const someVisible = Object.values({ apm, logs, metrics, uptime }).some((visible) => visible);
if (!someVisible) {
core.chrome.navLinks.update('observability-overview', { hidden: true });
}
}