diff --git a/pdb-js/src/app/dashboard-page/dashboard-page.component.html b/pdb-js/src/app/dashboard-page/dashboard-page.component.html index 7f4d85e..126ef14 100644 --- a/pdb-js/src/app/dashboard-page/dashboard-page.component.html +++ b/pdb-js/src/app/dashboard-page/dashboard-page.component.html @@ -17,6 +17,9 @@ font-weight: bold; color: #333; } + .no-break { + white-space: nowrap; + }
@@ -49,11 +52,14 @@ Description {{element.description}} - - - - - + diff --git a/pdb-js/src/app/dashboard-page/dashboard-page.component.ts b/pdb-js/src/app/dashboard-page/dashboard-page.component.ts index c211392..9831b76 100644 --- a/pdb-js/src/app/dashboard-page/dashboard-page.component.ts +++ b/pdb-js/src/app/dashboard-page/dashboard-page.component.ts @@ -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, {