Added API to close dashboard opened as dialog.
This commit is contained in:
parent
d7aa2e5660
commit
a0b6845bb7
@ -1436,7 +1436,7 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI
|
|||||||
title = insertVariable(title, prop + ':entityLabel', params[prop].entityLabel);
|
title = insertVariable(title, prop + ':entityLabel', params[prop].entityLabel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.dialog.open(this.embedDashboardDialogComponent, {
|
dashboard.dialogRef = this.dialog.open(this.embedDashboardDialogComponent, {
|
||||||
disableClose: true,
|
disableClose: true,
|
||||||
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
|
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
|
||||||
viewContainerRef: this.widgetContentContainer,
|
viewContainerRef: this.widgetContentContainer,
|
||||||
|
|||||||
@ -394,6 +394,13 @@ export class WidgetContext {
|
|||||||
this.widgetActions = undefined;
|
this.widgetActions = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeDialog(resultData: any = null) {
|
||||||
|
const dialogRef = this.$scope.dialogRef || this.stateController.dashboardCtrl.dashboardCtx.getDashboard().dialogRef;
|
||||||
|
if (dialogRef) {
|
||||||
|
dialogRef.close(resultData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pageLink(pageSize: number, page: number = 0, textSearch: string = null, sortOrder: SortOrder = null): PageLink {
|
pageLink(pageSize: number, page: number = 0, textSearch: string = null, sortOrder: SortOrder = null): PageLink {
|
||||||
return new PageLink(pageSize, page, textSearch, sortOrder);
|
return new PageLink(pageSize, page, textSearch, sortOrder);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import { Widget } from './widget.models';
|
|||||||
import { Timewindow } from '@shared/models/time/time.models';
|
import { Timewindow } from '@shared/models/time/time.models';
|
||||||
import { EntityAliases } from './alias.models';
|
import { EntityAliases } from './alias.models';
|
||||||
import { Filters } from '@shared/models/query/query.models';
|
import { Filters } from '@shared/models/query/query.models';
|
||||||
|
import { MatDialogRef } from '@angular/material/dialog';
|
||||||
|
|
||||||
export interface DashboardInfo extends BaseData<DashboardId>, ExportableEntity<DashboardId> {
|
export interface DashboardInfo extends BaseData<DashboardId>, ExportableEntity<DashboardId> {
|
||||||
tenantId?: TenantId;
|
tenantId?: TenantId;
|
||||||
@ -112,6 +113,7 @@ export interface DashboardConfiguration {
|
|||||||
|
|
||||||
export interface Dashboard extends DashboardInfo {
|
export interface Dashboard extends DashboardInfo {
|
||||||
configuration?: DashboardConfiguration;
|
configuration?: DashboardConfiguration;
|
||||||
|
dialogRef?: MatDialogRef<any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HomeDashboard extends Dashboard {
|
export interface HomeDashboard extends Dashboard {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user