mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Dashboard] Change Inspector on dashboard to use push flyout (#207750)
## Summary This PR changes the inspector flyout to be a push flyout and highlights the panel which is inspected.  Closes: #148993
This commit is contained in:
parent
d00d867382
commit
3e5505fad7
3 changed files with 12 additions and 1 deletions
|
@ -15,6 +15,7 @@ import {
|
|||
getTitle,
|
||||
PublishesTitle,
|
||||
HasParentApi,
|
||||
apiHasUniqueId,
|
||||
} from '@kbn/presentation-publishing';
|
||||
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
|
||||
import { ACTION_INSPECT_PANEL } from './constants';
|
||||
|
@ -62,6 +63,7 @@ export class InspectPanelAction implements Action<EmbeddableApiContext> {
|
|||
});
|
||||
const session = inspector.open(adapters, {
|
||||
title: panelTitle,
|
||||
flyoutType: 'push',
|
||||
options: {
|
||||
fileName: panelTitle,
|
||||
},
|
||||
|
@ -71,6 +73,12 @@ export class InspectPanelAction implements Action<EmbeddableApiContext> {
|
|||
});
|
||||
|
||||
// send the overlay ref to the parent API if it is capable of tracking overlays
|
||||
if (tracksOverlays(embeddable.parentApi)) embeddable.parentApi?.openOverlay(session);
|
||||
if (tracksOverlays(embeddable.parentApi)) {
|
||||
const openOverlayOptions = apiHasUniqueId(embeddable)
|
||||
? { focusedPanelId: embeddable.uuid }
|
||||
: undefined;
|
||||
|
||||
embeddable.parentApi?.openOverlay(session, openOverlayOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,7 @@ export class InspectorPublicPlugin implements Plugin<Setup, Start> {
|
|||
{
|
||||
'data-test-subj': 'inspectorPanel',
|
||||
closeButtonProps: { 'aria-label': closeButtonLabel },
|
||||
type: options.flyoutType,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
import { OverlayRef } from '@kbn/core/public';
|
||||
import { EuiFlyoutProps } from '@elastic/eui';
|
||||
import { Adapters } from '../common';
|
||||
|
||||
/**
|
||||
|
@ -60,6 +61,7 @@ export interface InspectorViewDescription {
|
|||
export interface InspectorOptions {
|
||||
title?: string;
|
||||
options?: unknown;
|
||||
flyoutType?: EuiFlyoutProps['type'];
|
||||
}
|
||||
|
||||
export type InspectorSession = OverlayRef;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue