enable save button only if dashboard is dirty
This commit is contained in:
@@ -18,6 +18,8 @@ export class DashboardComponent implements OnInit {
|
||||
|
||||
dashboard?: Dashboard = undefined;
|
||||
|
||||
pristineDashboardJSON?: string = undefined;
|
||||
|
||||
error = "";
|
||||
|
||||
plotWidgetRenderData: PlotWidgetRenderData[] = [];
|
||||
@@ -34,6 +36,7 @@ export class DashboardComponent implements OnInit {
|
||||
this.service.getDashboard(<string>this.route.snapshot.paramMap.get("id")).subscribe({
|
||||
'next':(dashboard: Dashboard) => {
|
||||
this.dashboard = dashboard;
|
||||
this.pristineDashboardJSON = JSON.stringify(dashboard);
|
||||
this.repairArrangement();
|
||||
|
||||
dashboard.plots.forEach(p => {
|
||||
@@ -54,6 +57,10 @@ export class DashboardComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
isDirty() {
|
||||
return this.pristineDashboardJSON !== JSON.stringify(this.dashboard);
|
||||
}
|
||||
|
||||
loadImages(index: number, plotWidgetQueue: PlotWidgetRenderData[]) {
|
||||
|
||||
if (index < plotWidgetQueue.length){
|
||||
@@ -161,6 +168,7 @@ export class DashboardComponent implements OnInit {
|
||||
duration: 5000,
|
||||
verticalPosition: 'top'
|
||||
});
|
||||
this.pristineDashboardJSON = JSON.stringify(this.dashboard);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user