Browse Source

Add new widgetContext field currentUser

pull/2684/head
Igor Kulikov 7 years ago
parent
commit
6a47f022ac
  1. 10
      ui-ngx/src/app/modules/home/models/widget-component.models.ts

10
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;

Loading…
Cancel
Save