fix adding of plots
This commit is contained in:
@@ -143,7 +143,9 @@ export class DashboardComponent implements OnInit {
|
||||
this.dialog.open(AddTextDialogComponent,{
|
||||
width: '600px'
|
||||
}).afterClosed().subscribe((text: string) => {
|
||||
this.dashboard!.texts.push(new TextWidget(crypto.randomUUID(),'MEDIUM', text));
|
||||
const widget = new TextWidget(crypto.randomUUID(),'MEDIUM', text);
|
||||
this.dashboard!.texts.push(widget);
|
||||
this.dashboard!.arrangement[0].push(widget.id);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -151,8 +153,14 @@ export class DashboardComponent implements OnInit {
|
||||
this.dialog.open(AddPlotDialogComponent,{
|
||||
width: 'calc(100% - 1em)',
|
||||
height: 'calc(100% - 1em)'
|
||||
}).afterClosed().subscribe((config: PlotConfig) => {
|
||||
this.dashboard!.plots.push(new PlotWidget(crypto.randomUUID(), 'MEDIUM', config));
|
||||
}).afterClosed().subscribe((config: PlotConfig | "") => {
|
||||
if (config != "" && config.query.length > 0) {
|
||||
const widget = new PlotWidget(crypto.randomUUID(), 'MEDIUM', config);
|
||||
this.dashboard!.plots.push(widget);
|
||||
this.dashboard!.arrangement[0].push(widget.id);
|
||||
this.plotWidgetRenderData.push(new PlotWidgetRenderData(widget));
|
||||
this.loadImages(this.plotWidgetRenderData.length-1, this.plotWidgetRenderData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user