edit name and description on dashboard page
This commit is contained in:
@@ -12,7 +12,7 @@ import { NewDashboardComponent } from './new-dashboard/new-dashboard.component';
|
||||
})
|
||||
export class DashboardPageComponent implements OnInit {
|
||||
|
||||
displayedColumns: string[] = [/*'icon',*/ 'name', 'description','delete'];
|
||||
displayedColumns: string[] = [/*'icon',*/ 'name', 'description','actions'];
|
||||
dataSource: Dashboard[] = [];
|
||||
loading = true;
|
||||
error = "";
|
||||
@@ -54,6 +54,31 @@ export class DashboardPageComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
edit(dashboard: Dashboard) {
|
||||
const dialogRef = this.dialog.open(NewDashboardComponent, {
|
||||
data: {name: dashboard.name, description: dashboard.description},
|
||||
hasBackdrop: true
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe((result?: DashboardCreationData) => {
|
||||
|
||||
if (result) {
|
||||
dashboard.name = result.name;
|
||||
dashboard.description = result.description;
|
||||
this.dashboardService.saveDashboard(dashboard).subscribe({
|
||||
'error': () => {
|
||||
this.snackBar.open("server made a boo boo", "", {
|
||||
duration:5000
|
||||
})
|
||||
},
|
||||
complete: () => {
|
||||
this.refreshTable()
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
delete(dashboard: Dashboard){
|
||||
|
||||
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
|
||||
Reference in New Issue
Block a user