From e26120b2cdf3c29e2c57492e9bd76323b03d807c Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Mon, 18 Nov 2019 11:16:17 +0100 Subject: [PATCH] undeprecates openFlyout/openModal & remove direct subservice access from overlayService --- ...bana-plugin-public.overlaystart.flyouts.md | 12 ------- .../kibana-plugin-public.overlaystart.md | 2 -- ...ibana-plugin-public.overlaystart.modals.md | 12 ------- ...a-plugin-public.overlaystart.openflyout.md | 4 --- ...na-plugin-public.overlaystart.openmodal.md | 4 --- .../public/overlays/overlay_service.mock.ts | 10 ++---- src/core/public/overlays/overlay_service.ts | 16 ++------- src/core/public/public.api.md | 8 +---- .../query_bar_input.test.tsx.snap | 36 ------------------- 9 files changed, 5 insertions(+), 99 deletions(-) delete mode 100644 docs/development/core/public/kibana-plugin-public.overlaystart.flyouts.md delete mode 100644 docs/development/core/public/kibana-plugin-public.overlaystart.modals.md diff --git a/docs/development/core/public/kibana-plugin-public.overlaystart.flyouts.md b/docs/development/core/public/kibana-plugin-public.overlaystart.flyouts.md deleted file mode 100644 index f6109ea4a501b8..00000000000000 --- a/docs/development/core/public/kibana-plugin-public.overlaystart.flyouts.md +++ /dev/null @@ -1,12 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [OverlayStart](./kibana-plugin-public.overlaystart.md) > [flyouts](./kibana-plugin-public.overlaystart.flyouts.md) - -## OverlayStart.flyouts property - - -Signature: - -```typescript -flyouts: OverlayFlyoutStart; -``` diff --git a/docs/development/core/public/kibana-plugin-public.overlaystart.md b/docs/development/core/public/kibana-plugin-public.overlaystart.md index 0db4e7b915c842..8b6f11bd819f83 100644 --- a/docs/development/core/public/kibana-plugin-public.overlaystart.md +++ b/docs/development/core/public/kibana-plugin-public.overlaystart.md @@ -16,8 +16,6 @@ export interface OverlayStart | Property | Type | Description | | --- | --- | --- | | [banners](./kibana-plugin-public.overlaystart.banners.md) | OverlayBannersStart | [OverlayBannersStart](./kibana-plugin-public.overlaybannersstart.md) | -| [flyouts](./kibana-plugin-public.overlaystart.flyouts.md) | OverlayFlyoutStart | | -| [modals](./kibana-plugin-public.overlaystart.modals.md) | OverlayModalStart | | | [openFlyout](./kibana-plugin-public.overlaystart.openflyout.md) | OverlayFlyoutStart['open'] | | | [openModal](./kibana-plugin-public.overlaystart.openmodal.md) | OverlayModalStart['open'] | | diff --git a/docs/development/core/public/kibana-plugin-public.overlaystart.modals.md b/docs/development/core/public/kibana-plugin-public.overlaystart.modals.md deleted file mode 100644 index 5ed0b8aa262e4e..00000000000000 --- a/docs/development/core/public/kibana-plugin-public.overlaystart.modals.md +++ /dev/null @@ -1,12 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [OverlayStart](./kibana-plugin-public.overlaystart.md) > [modals](./kibana-plugin-public.overlaystart.modals.md) - -## OverlayStart.modals property - - -Signature: - -```typescript -modals: OverlayModalStart; -``` diff --git a/docs/development/core/public/kibana-plugin-public.overlaystart.openflyout.md b/docs/development/core/public/kibana-plugin-public.overlaystart.openflyout.md index fb9fc52c6d9a15..ad3351fb4d098b 100644 --- a/docs/development/core/public/kibana-plugin-public.overlaystart.openflyout.md +++ b/docs/development/core/public/kibana-plugin-public.overlaystart.openflyout.md @@ -4,10 +4,6 @@ ## OverlayStart.openFlyout property -> Warning: This API is now obsolete. -> -> Use [OverlayStart.flyouts](./kibana-plugin-public.overlaystart.flyouts.md) instead -> Signature: diff --git a/docs/development/core/public/kibana-plugin-public.overlaystart.openmodal.md b/docs/development/core/public/kibana-plugin-public.overlaystart.openmodal.md index c3b3cbee32e1fe..2c983d6151f4ca 100644 --- a/docs/development/core/public/kibana-plugin-public.overlaystart.openmodal.md +++ b/docs/development/core/public/kibana-plugin-public.overlaystart.openmodal.md @@ -4,10 +4,6 @@ ## OverlayStart.openModal property -> Warning: This API is now obsolete. -> -> Use [OverlayStart.modals](./kibana-plugin-public.overlaystart.modals.md) instead -> Signature: diff --git a/src/core/public/overlays/overlay_service.mock.ts b/src/core/public/overlays/overlay_service.mock.ts index 283e6abd88c0f3..2937ec89bfc744 100644 --- a/src/core/public/overlays/overlay_service.mock.ts +++ b/src/core/public/overlays/overlay_service.mock.ts @@ -23,16 +23,10 @@ import { overlayModalServiceMock } from './modal/modal_service.mock'; const createStartContractMock = () => { const startContract: DeeplyMockedKeys = { - openFlyout: jest.fn(), - openModal: jest.fn(), + openFlyout: overlayFlyoutServiceMock.createStartContract().open, + openModal: overlayModalServiceMock.createStartContract().open, banners: overlayBannersServiceMock.createStartContract(), - flyouts: overlayFlyoutServiceMock.createStartContract(), - modals: overlayModalServiceMock.createStartContract(), }; - startContract.openModal.mockReturnValue({ - close: jest.fn(), - onClose: Promise.resolve(), - }); return startContract; }; diff --git a/src/core/public/overlays/overlay_service.ts b/src/core/public/overlays/overlay_service.ts index 75eea8f0c41066..82fe753d6f2834 100644 --- a/src/core/public/overlays/overlay_service.ts +++ b/src/core/public/overlays/overlay_service.ts @@ -48,9 +48,6 @@ export class OverlayService { return { banners, - flyouts, - modals, - openFlyout: flyouts.open.bind(flyouts), openModal: modals.open.bind(modals), }; @@ -61,17 +58,8 @@ export class OverlayService { export interface OverlayStart { /** {@link OverlayBannersStart} */ banners: OverlayBannersStart; - /** {@link OverlayModalStart} */ - modals: OverlayModalStart; - /** {@link OverlayFlyoutStart} */ - flyouts: OverlayFlyoutStart; - - /** - * @deprecated Use {@link OverlayStart.flyouts} instead - */ + /** {@link OverlayFlyoutStart#open} */ openFlyout: OverlayFlyoutStart['open']; - /** - * @deprecated Use {@link OverlayStart.modals} instead - */ + /** {@link OverlayModalStart#open} */ openModal: OverlayModalStart['open']; } diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index db1e564de5bc7c..782cb4e712a171 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -658,18 +658,12 @@ export interface OverlayStart { // (undocumented) banners: OverlayBannersStart; // Warning: (ae-forgotten-export) The symbol "OverlayFlyoutStart" needs to be exported by the entry point index.d.ts - // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "OverlayFlyoutStart" // // (undocumented) - flyouts: OverlayFlyoutStart; + openFlyout: OverlayFlyoutStart['open']; // Warning: (ae-forgotten-export) The symbol "OverlayModalStart" needs to be exported by the entry point index.d.ts - // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "OverlayModalStart" // // (undocumented) - modals: OverlayModalStart; - // @deprecated (undocumented) - openFlyout: OverlayFlyoutStart['open']; - // @deprecated (undocumented) openModal: OverlayModalStart['open']; } diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/__snapshots__/query_bar_input.test.tsx.snap b/src/legacy/core_plugins/data/public/query/query_bar/components/__snapshots__/query_bar_input.test.tsx.snap index 7eca9a652e6748..5dc8702411783d 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/__snapshots__/query_bar_input.test.tsx.snap +++ b/src/legacy/core_plugins/data/public/query/query_bar/components/__snapshots__/query_bar_input.test.tsx.snap @@ -289,12 +289,6 @@ exports[`QueryBarInput Should disable autoFocus on EuiFieldText when disableAuto "remove": [MockFunction], "replace": [MockFunction], }, - "flyouts": Object { - "open": [MockFunction], - }, - "modals": Object { - "open": [MockFunction], - }, "openFlyout": [MockFunction], "openModal": [MockFunction], }, @@ -858,12 +852,6 @@ exports[`QueryBarInput Should disable autoFocus on EuiFieldText when disableAuto "remove": [MockFunction], "replace": [MockFunction], }, - "flyouts": Object { - "open": [MockFunction], - }, - "modals": Object { - "open": [MockFunction], - }, "openFlyout": [MockFunction], "openModal": [MockFunction], }, @@ -1415,12 +1403,6 @@ exports[`QueryBarInput Should pass the query language to the language switcher 1 "remove": [MockFunction], "replace": [MockFunction], }, - "flyouts": Object { - "open": [MockFunction], - }, - "modals": Object { - "open": [MockFunction], - }, "openFlyout": [MockFunction], "openModal": [MockFunction], }, @@ -1981,12 +1963,6 @@ exports[`QueryBarInput Should pass the query language to the language switcher 1 "remove": [MockFunction], "replace": [MockFunction], }, - "flyouts": Object { - "open": [MockFunction], - }, - "modals": Object { - "open": [MockFunction], - }, "openFlyout": [MockFunction], "openModal": [MockFunction], }, @@ -2538,12 +2514,6 @@ exports[`QueryBarInput Should render the given query 1`] = ` "remove": [MockFunction], "replace": [MockFunction], }, - "flyouts": Object { - "open": [MockFunction], - }, - "modals": Object { - "open": [MockFunction], - }, "openFlyout": [MockFunction], "openModal": [MockFunction], }, @@ -3104,12 +3074,6 @@ exports[`QueryBarInput Should render the given query 1`] = ` "remove": [MockFunction], "replace": [MockFunction], }, - "flyouts": Object { - "open": [MockFunction], - }, - "modals": Object { - "open": [MockFunction], - }, "openFlyout": [MockFunction], "openModal": [MockFunction], },