|
|
@@ -22,7 +22,7 @@ import { map, tap } from 'rxjs/operators';
|
|
|
})
|
|
|
export class DashboardComponent implements OnInit {
|
|
|
widgetLayout: WidgetLayout | undefined;
|
|
|
- availableWidgetIds$: Observable<string[]>;
|
|
|
+ availableWidgets$: Observable<Array<{ id: string; config: DashboardWidgetConfig }>>;
|
|
|
private readonly deletionMarker = '__delete__';
|
|
|
private setTitle = titleSetter();
|
|
|
constructor(
|
|
|
@@ -33,10 +33,10 @@ export class DashboardComponent implements OnInit {
|
|
|
) {}
|
|
|
|
|
|
ngOnInit() {
|
|
|
- this.availableWidgetIds$ = this.dataService.client.userStatus().stream$.pipe(
|
|
|
+ this.availableWidgets$ = this.dataService.client.userStatus().stream$.pipe(
|
|
|
map(({ userStatus }) => userStatus.permissions),
|
|
|
- map(permissions => this.dashboardWidgetService.getAvailableIds(permissions)),
|
|
|
- tap(ids => (this.widgetLayout = this.initLayout(ids))),
|
|
|
+ map(permissions => this.dashboardWidgetService.getAvailableWidgets(permissions)),
|
|
|
+ tap(widgets => (this.widgetLayout = this.initLayout(widgets.map(w => w.id)))),
|
|
|
);
|
|
|
this.setTitle('breadcrumb.dashboard');
|
|
|
}
|