From 6a47f022ace01cf71b78f15b52809051cd358609 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Tue, 28 Apr 2020 14:58:21 +0300 Subject: [PATCH] Add new widgetContext field currentUser --- .../app/modules/home/models/widget-component.models.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui-ngx/src/app/modules/home/models/widget-component.models.ts b/ui-ngx/src/app/modules/home/models/widget-component.models.ts index 30dea45d6b..1c371dc830 100644 --- a/ui-ngx/src/app/modules/home/models/widget-component.models.ts +++ b/ui-ngx/src/app/modules/home/models/widget-component.models.ts @@ -58,6 +58,8 @@ import { NotificationVerticalPosition } from '@core/notification/notification.models'; import { ActionNotificationShow } from '@core/notification/notification.actions'; +import { AuthUser } from '@shared/models/user.model'; +import { getCurrentAuthUser } from '@core/auth/auth.selectors'; export interface IWidgetAction { name: string; @@ -116,6 +118,14 @@ export class WidgetContext { this.changeDetectorValue = cd; } + get currentUser(): AuthUser { + if (this.store) { + return getCurrentAuthUser(this.store); + } else { + return null; + } + } + private changeDetectorValue: ChangeDetectorRef; inited = false;