mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 03:01:21 -04:00
Fixed iframe filtering by not re-creating embed settings on URL change (#95997)
This commit is contained in:
parent
37e2aa3b9c
commit
3b3ad0ecaf
1 changed files with 5 additions and 5 deletions
|
@ -84,6 +84,7 @@ export async function mountApp({
|
||||||
|
|
||||||
const spacesApi = pluginsStart.spacesOss?.isSpacesAvailable ? pluginsStart.spacesOss : undefined;
|
const spacesApi = pluginsStart.spacesOss?.isSpacesAvailable ? pluginsStart.spacesOss : undefined;
|
||||||
const activeSpaceId = spacesApi && (await spacesApi.activeSpace$.pipe(first()).toPromise())?.id;
|
const activeSpaceId = spacesApi && (await spacesApi.activeSpace$.pipe(first()).toPromise())?.id;
|
||||||
|
let globalEmbedSettings: DashboardEmbedSettings | undefined;
|
||||||
|
|
||||||
const dashboardServices: DashboardAppServices = {
|
const dashboardServices: DashboardAppServices = {
|
||||||
navigation,
|
navigation,
|
||||||
|
@ -149,9 +150,6 @@ export async function mountApp({
|
||||||
const getDashboardEmbedSettings = (
|
const getDashboardEmbedSettings = (
|
||||||
routeParams: ParsedQuery<string>
|
routeParams: ParsedQuery<string>
|
||||||
): DashboardEmbedSettings | undefined => {
|
): DashboardEmbedSettings | undefined => {
|
||||||
if (!routeParams.embed) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
forceShowTopNavMenu: Boolean(routeParams[dashboardUrlParams.showTopMenu]),
|
forceShowTopNavMenu: Boolean(routeParams[dashboardUrlParams.showTopMenu]),
|
||||||
forceShowQueryInput: Boolean(routeParams[dashboardUrlParams.showQueryInput]),
|
forceShowQueryInput: Boolean(routeParams[dashboardUrlParams.showQueryInput]),
|
||||||
|
@ -162,11 +160,13 @@ export async function mountApp({
|
||||||
|
|
||||||
const renderDashboard = (routeProps: RouteComponentProps<{ id?: string }>) => {
|
const renderDashboard = (routeProps: RouteComponentProps<{ id?: string }>) => {
|
||||||
const routeParams = parse(routeProps.history.location.search);
|
const routeParams = parse(routeProps.history.location.search);
|
||||||
const embedSettings = getDashboardEmbedSettings(routeParams);
|
if (routeParams.embed && !globalEmbedSettings) {
|
||||||
|
globalEmbedSettings = getDashboardEmbedSettings(routeParams);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<DashboardApp
|
<DashboardApp
|
||||||
history={routeProps.history}
|
history={routeProps.history}
|
||||||
embedSettings={embedSettings}
|
embedSettings={globalEmbedSettings}
|
||||||
savedDashboardId={routeProps.match.params.id}
|
savedDashboardId={routeProps.match.params.id}
|
||||||
redirectTo={(props: RedirectToProps) => redirect(routeProps, props)}
|
redirectTo={(props: RedirectToProps) => redirect(routeProps, props)}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue