forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overlay core service (elastic#34261) (elastic#34717)
* Move ui/flyout to overlay core service * Remove onClose in parameter (use FlyoutSession instead) * Fix tests * Remove old inspector tests * Proper TODO message * Convert flyout service to class * Use correct i18n * Resolving weird merge conflicts * Fix panel plugin test * Change new platform access * Add more tests * Remove commented tests * Revert test fix (core is actually not fixed yet) * Fix tests * Expose onClose as Observable * Use jest.doMock * Fix typos * Core start() -> setup() * Remove @extends EventEmitter docs * Refactor and test flyoutservice * Fix comments: promise -> observable * Fix tests * Explicitly define OverlaySetup * Fix OverlaySetup type signature * Update Core API review file and docs * Remove redudant if case * Change FlyoutRef.onClose into a promise * Remove redundante cleanup * Use promise.finally * Remove targetDomElement from openFlyout() There's no need to support multiple targetDomElements per FlyoutService and the current implementation handled this use case incorrectly. Instead of adding complexity to try to support it, remove this from the function signature. * Fix + test to ensure child components are unmounted when a new flyover is displayed * Wrap flyover in i18n Context component * TSlint -> ESlint + test improvements
- Loading branch information
Showing
29 changed files
with
602 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
docs/development/core/public/kibana-plugin-public.coresetup.overlays.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [overlays](./kibana-plugin-public.coresetup.overlays.md) | ||
|
||
## CoreSetup.overlays property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
overlays: OverlaySetup; | ||
``` |
15 changes: 15 additions & 0 deletions
15
docs/development/core/public/kibana-plugin-public.flyoutref.close.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [FlyoutRef](./kibana-plugin-public.flyoutref.md) > [close](./kibana-plugin-public.flyoutref.close.md) | ||
|
||
## FlyoutRef.close() method | ||
|
||
Closes the referenced flyout if it's still open which in turn will resolve the `onClose` Promise. If the flyout had already been closed this method does nothing. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
close(): Promise<void>; | ||
``` | ||
<b>Returns:</b> | ||
|
||
`Promise<void>` | ||
|
24 changes: 24 additions & 0 deletions
24
docs/development/core/public/kibana-plugin-public.flyoutref.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [FlyoutRef](./kibana-plugin-public.flyoutref.md) | ||
|
||
## FlyoutRef class | ||
|
||
A FlyoutRef is a reference to an opened flyout panel. It offers methods to close the flyout panel again. If you open a flyout panel you should make sure you call `close()` when it should be closed. Since a flyout could also be closed by a user or from another flyout being opened, you must bind to the `onClose` Promise on the FlyoutRef instance. The Promise will resolve whenever the flyout was closed at which point you should discard the FlyoutRef. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare class FlyoutRef | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [onClose](./kibana-plugin-public.flyoutref.onclose.md) | | <code>Promise<void></code> | An Promise that will resolve once this flyout is closed.<!-- -->Flyouts can close from user interaction, calling <code>close()</code> on the flyout reference or another call to <code>openFlyout()</code> replacing your flyout. | | ||
|
||
## Methods | ||
|
||
| Method | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [close()](./kibana-plugin-public.flyoutref.close.md) | | Closes the referenced flyout if it's still open which in turn will resolve the <code>onClose</code> Promise. If the flyout had already been closed this method does nothing. | | ||
|
13 changes: 13 additions & 0 deletions
13
docs/development/core/public/kibana-plugin-public.flyoutref.onclose.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [FlyoutRef](./kibana-plugin-public.flyoutref.md) > [onClose](./kibana-plugin-public.flyoutref.onclose.md) | ||
|
||
## FlyoutRef.onClose property | ||
|
||
An Promise that will resolve once this flyout is closed. | ||
|
||
Flyouts can close from user interaction, calling `close()` on the flyout reference or another call to `openFlyout()` replacing your flyout. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
readonly onClose: Promise<void>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
docs/development/core/public/kibana-plugin-public.overlaysetup.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [OverlaySetup](./kibana-plugin-public.overlaysetup.md) | ||
|
||
## OverlaySetup interface | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface OverlaySetup | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [openFlyout](./kibana-plugin-public.overlaysetup.openflyout.md) | <code>(flyoutChildren: React.ReactNode, flyoutProps?: {`<p/>` closeButtonAriaLabel?: string;`<p/>` 'data-test-subj'?: string;`<p/>` }) => FlyoutRef</code> | | | ||
|
12 changes: 12 additions & 0 deletions
12
docs/development/core/public/kibana-plugin-public.overlaysetup.openflyout.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [OverlaySetup](./kibana-plugin-public.overlaysetup.md) > [openFlyout](./kibana-plugin-public.overlaysetup.openflyout.md) | ||
|
||
## OverlaySetup.openFlyout property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
openFlyout: (flyoutChildren: React.ReactNode, flyoutProps?: { | ||
closeButtonAriaLabel?: string; | ||
'data-test-subj'?: string; | ||
}) => FlyoutRef; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.