Browse Source

UI: Fix linter error in notification

pull/7911/head
Vladyslav_Prykhodko 4 years ago
parent
commit
1610cc143b
  1. 2
      ui-ngx/src/app/modules/home/components/notification/notification-bell.component.ts
  2. 2
      ui-ngx/src/app/modules/home/components/notification/show-notification-popover.component.ts
  3. 2
      ui-ngx/src/app/modules/home/pages/notification-center/inbox-table/inbox-notification-dialog.component.ts
  4. 3
      ui-ngx/src/app/modules/home/pages/notification-center/notification-center.component.ts
  5. 4
      ui-ngx/src/app/modules/home/pages/notification-center/notification-table/inbox-table-config.ts
  6. 10
      ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts
  7. 4
      ui-ngx/src/app/modules/home/pages/notification-center/notification-table/rule-table-config.ts
  8. 2
      ui-ngx/src/app/modules/home/pages/notification-center/notification-table/targets-table-config.ts
  9. 4
      ui-ngx/src/app/modules/home/pages/notification-center/notification-table/template-table-config.ts
  10. 2
      ui-ngx/src/app/modules/home/pages/notification-center/request-table/notification-request-error-dialog.component.ts
  11. 2
      ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.componet.ts
  12. 5
      ui-ngx/src/app/modules/home/pages/notification-center/rule-table/escalations.component.ts
  13. 4
      ui-ngx/src/app/modules/home/pages/notification-center/rule-table/rule-notification-dialog.component.ts
  14. 17
      ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.ts
  15. 1
      ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.ts
  16. 4
      ui-ngx/src/app/shared/components/entity/entity-list.component.ts
  17. 2
      ui-ngx/src/app/shared/components/string-items-list.component.ts
  18. 2
      ui-ngx/src/app/shared/components/time/timeinterval.component.ts
  19. 30
      ui-ngx/src/app/shared/decorators/coerce-boolean.ts
  20. 15
      ui-ngx/src/app/shared/models/notification.models.ts
  21. 8
      ui-ngx/src/app/shared/models/websocket/notification-ws.models.ts

2
ui-ngx/src/app/modules/home/components/notification/notification-bell.component.ts

@ -66,7 +66,7 @@ export class NotificationBellComponent implements OnDestroy {
if (value) { if (value) {
this.initSubscription(); this.initSubscription();
} }
}) });
} }
ngOnDestroy() { ngOnDestroy() {

2
ui-ngx/src/app/modules/home/components/notification/show-notification-popover.component.ts

@ -95,7 +95,7 @@ export class ShowNotificationPopoverComponent extends PageComponent implements O
this.router.navigateByUrl(this.router.createUrlTree(['notification-center'])).then(() => {}); this.router.navigateByUrl(this.router.createUrlTree(['notification-center'])).then(() => {});
} }
trackById (index: number, item: NotificationRequest): string { trackById(index: number, item: NotificationRequest): string {
return item.id.id; return item.id.id;
} }
} }

2
ui-ngx/src/app/modules/home/pages/notification-center/inbox-table/inbox-notification-dialog.component.ts

@ -45,6 +45,6 @@ export class InboxNotificationDialogComponent extends DialogComponent<InboxNotif
} }
markAsRead(id: string) { markAsRead(id: string) {
this.dialogRef.close(id) this.dialogRef.close(id);
} }
} }

3
ui-ngx/src/app/modules/home/pages/notification-center/notification-center.component.ts

@ -64,7 +64,8 @@ export class NotificationCenterComponent extends PageComponent {
} }
sendNotification($event: Event) { sendNotification($event: Event) {
this.notificationRequestTable.entityTableConfig.onEntityAction({event: $event, action: this.requestTab.isActive ? 'add' : 'add-without-update', entity: null}); this.notificationRequestTable.entityTableConfig
.onEntityAction({event: $event, action: this.requestTab.isActive ? 'add' : 'add-without-update', entity: null});
} }
public isTenantAdmin(): boolean { public isTenantAdmin(): boolean {

4
ui-ngx/src/app/modules/home/pages/notification-center/notification-table/inbox-table-config.ts

@ -57,9 +57,9 @@ export class InboxTableConfig extends EntityTableConfig<Notification> {
this.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC}; this.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
this.handleRowClick = ($event, notification) => { this.handleRowClick = ($event, notification) => {
this.showNotification($event, notification) this.showNotification($event, notification);
return true; return true;
} };
this.componentsData = { this.componentsData = {
unreadOnly: true unreadOnly: true

10
ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts

@ -72,7 +72,6 @@ export class RequestTableConfig extends EntityTableConfig<NotificationRequest, P
this.onEntityAction = action => this.onRequestAction(action); this.onEntityAction = action => this.onRequestAction(action);
this.handleRowClick = (event, entity) => { this.handleRowClick = (event, entity) => {
const path = (event as any).path || (event.composedPath && event.composedPath());
if ((event.target as HTMLElement).getElementsByClassName('stats').length || (event.target as HTMLElement).className === 'stats') { if ((event.target as HTMLElement).getElementsByClassName('stats').length || (event.target as HTMLElement).className === 'stats') {
this.openStatsErrorDialog(event, entity); this.openStatsErrorDialog(event, entity);
} }
@ -145,7 +144,8 @@ export class RequestTableConfig extends EntityTableConfig<NotificationRequest, P
backgroundColor = 'rgba(212, 125, 24, 0.08)'; backgroundColor = 'rgba(212, 125, 24, 0.08)';
break; break;
} }
return `<div style="border-radius: 12px; height: 24px; line-height: 24px; padding: 0 10px; width: fit-content; background-color: ${backgroundColor}"> return `<div style="border-radius: 12px; height: 24px; line-height: 24px; padding: 0 10px;
width: fit-content; background-color: ${backgroundColor}">
${this.translate.instant(translateKey)} ${this.translate.instant(translateKey)}
</div>`; </div>`;
} }
@ -154,10 +154,10 @@ export class RequestTableConfig extends EntityTableConfig<NotificationRequest, P
let countError = 0; let countError = 0;
Object.keys(stats.errors).forEach(method => countError += Object.keys(stats.errors[method]).length); Object.keys(stats.errors).forEach(method => countError += Object.keys(stats.errors[method]).length);
if (countError === 0) { if (countError === 0) {
return '' return '';
} }
return `<div style="border-radius: 12px; height: 24px; line-height: 24px; padding: 0 10px; width: max-content; background-color: #D12730; return `<div style="border-radius: 12px; height: 24px; line-height: 24px; padding: 0 10px; width: max-content;
color: #fff; font-weight: 500; margin-left: 8px" class="stats"> background-color: #D12730; color: #fff; font-weight: 500; margin-left: 8px" class="stats">
${countError} ${this.translate.instant('notification.fails')} > ${countError} ${this.translate.instant('notification.fails')} >
</div>`; </div>`;
} }

4
ui-ngx/src/app/modules/home/pages/notification-center/notification-table/rule-table-config.ts

@ -60,9 +60,9 @@ export class RuleTableConfig extends EntityTableConfig<NotificationRule> {
this.defaultSortOrder = {property: 'name', direction: Direction.ASC}; this.defaultSortOrder = {property: 'name', direction: Direction.ASC};
this.handleRowClick = ($event, rule) => { this.handleRowClick = ($event, rule) => {
this.editRule($event, rule) this.editRule($event, rule);
return true; return true;
} };
this.columns.push( this.columns.push(
new EntityTableColumn<NotificationRule>('name', 'notification.rule-name', '30%'), new EntityTableColumn<NotificationRule>('name', 'notification.rule-name', '30%'),

2
ui-ngx/src/app/modules/home/pages/notification-center/notification-table/targets-table-config.ts

@ -65,7 +65,7 @@ export class TargetsTableConfig extends EntityTableConfig<NotificationTarget> {
this.handleRowClick = ($event, target) => { this.handleRowClick = ($event, target) => {
this.editTarget($event, target); this.editTarget($event, target);
return true; return true;
} };
this.columns.push( this.columns.push(
new EntityTableColumn<NotificationTarget>('name', 'notification.notification-target', '20%'), new EntityTableColumn<NotificationTarget>('name', 'notification.notification-target', '20%'),

4
ui-ngx/src/app/modules/home/pages/notification-center/notification-table/template-table-config.ts

@ -63,9 +63,9 @@ export class TemplateTableConfig extends EntityTableConfig<NotificationTemplate>
this.defaultSortOrder = {property: 'notificationType', direction: Direction.ASC}; this.defaultSortOrder = {property: 'notificationType', direction: Direction.ASC};
this.handleRowClick = ($event, template) => { this.handleRowClick = ($event, template) => {
this.editTemplate($event, template) this.editTemplate($event, template);
return true; return true;
} };
this.columns.push( this.columns.push(
new EntityTableColumn<NotificationTemplate>('notificationType', 'notification.type', '15%', new EntityTableColumn<NotificationTemplate>('notificationType', 'notification.type', '15%',

2
ui-ngx/src/app/modules/home/pages/notification-center/request-table/notification-request-error-dialog.component.ts

@ -33,7 +33,7 @@ export interface NotificationRequestErrorDialogData {
}) })
export class NotificationRequestErrorDialogComponent extends DialogComponent<NotificationRequestErrorDialogComponent, void> { export class NotificationRequestErrorDialogComponent extends DialogComponent<NotificationRequestErrorDialogComponent, void> {
errorStats: { [key in NotificationDeliveryMethod]: {[key in string]: string}}; errorStats: { [key in NotificationDeliveryMethod]: {[errorKey in string]: string}};
notificationDeliveryMethodErrorTranslateMap = new Map<NotificationDeliveryMethod, string>([ notificationDeliveryMethodErrorTranslateMap = new Map<NotificationDeliveryMethod, string>([
[NotificationDeliveryMethod.WEB, 'notification.delivery-method-type.web-failed-sent'], [NotificationDeliveryMethod.WEB, 'notification.delivery-method-type.web-failed-sent'],

2
ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.componet.ts

@ -99,7 +99,7 @@ export class RequestNotificationDialogComponent extends
}) })
}); });
this.notificationRequestForm.get('template.name').setValue(guid()) this.notificationRequestForm.get('template.name').setValue(guid());
this.notificationRequestForm.get('useTemplate').valueChanges.pipe( this.notificationRequestForm.get('useTemplate').valueChanges.pipe(
takeUntil(this.destroy$) takeUntil(this.destroy$)

5
ui-ngx/src/app/modules/home/pages/notification-center/rule-table/escalations.component.ts

@ -14,7 +14,7 @@
/// limitations under the License. /// limitations under the License.
/// ///
import { Component, forwardRef, Input, OnDestroy } from '@angular/core'; import { Component, forwardRef, Input, OnDestroy, OnInit } from '@angular/core';
import { import {
AbstractControl, AbstractControl,
ControlValueAccessor, ControlValueAccessor,
@ -51,7 +51,7 @@ import { coerceBoolean } from '@shared/decorators/coerce-boolean';
} }
] ]
}) })
export class EscalationsComponent implements ControlValueAccessor, Validator, OnDestroy { export class EscalationsComponent implements ControlValueAccessor, Validator, OnInit, OnDestroy {
escalationsFormGroup: FormGroup; escalationsFormGroup: FormGroup;
@ -107,6 +107,7 @@ export class EscalationsComponent implements ControlValueAccessor, Validator, On
writeValue(escalations: {[key: string]: Array<string>} | null): void { writeValue(escalations: {[key: string]: Array<string>} | null): void {
const escalationParse: Array<NonConfirmedNotificationEscalation> = []; const escalationParse: Array<NonConfirmedNotificationEscalation> = [];
// eslint-disable-next-line guard-for-in
for (const escalation in escalations) { for (const escalation in escalations) {
escalationParse.push({delayInSec: Number(escalation) * 1000, targets: escalations[escalation]}); escalationParse.push({delayInSec: Number(escalation) * 1000, targets: escalations[escalation]});
} }

4
ui-ngx/src/app/modules/home/pages/notification-center/rule-table/rule-notification-dialog.component.ts

@ -165,13 +165,13 @@ export class RuleNotificationDialogComponent extends
this.ruleNotificationForm.get('recipientsConfig.escalationTable').valueChanges.pipe( this.ruleNotificationForm.get('recipientsConfig.escalationTable').valueChanges.pipe(
takeUntil(this.destroy$) takeUntil(this.destroy$)
).subscribe(value => { ).subscribe(() => {
if (this.countRecipientsChainConfig() > 1) { if (this.countRecipientsChainConfig() > 1) {
this.alarmTemplateForm.get('triggerConfig.clearRule').enable({emitEvent: false}); this.alarmTemplateForm.get('triggerConfig.clearRule').enable({emitEvent: false});
} else { } else {
this.alarmTemplateForm.get('triggerConfig.clearRule').disable({emitEvent: false}); this.alarmTemplateForm.get('triggerConfig.clearRule').disable({emitEvent: false});
} }
}) });
this.alarmTemplateForm = this.fb.group({ this.alarmTemplateForm = this.fb.group({
triggerConfig: this.fb.group({ triggerConfig: this.fb.group({

17
ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.ts

@ -64,7 +64,7 @@ export class TemplateAutocompleteComponent implements ControlValueAccessor, OnIn
@Input() @Input()
@coerceBoolean() @coerceBoolean()
allowCreate: boolean = false; allowCreate = false;
@Input() @Input()
@ -155,19 +155,22 @@ export class TemplateAutocompleteComponent implements ControlValueAccessor, OnIn
writeValue(value: EntityId | null): void { writeValue(value: EntityId | null): void {
this.searchText = ''; this.searchText = '';
if (value != null) { if (value != null) {
this.notificationService.getNotificationTemplateById(value.id, {ignoreLoading: true, ignoreErrors: true}).subscribe( this.notificationService.getNotificationTemplateById(value.id, {
(entity) => { ignoreLoading: true,
ignoreErrors: true
}).subscribe({
next: (entity) => {
this.modelValue = entity.id; this.modelValue = entity.id;
this.selectTemplateFormGroup.get('templateName').patchValue(entity, {emitEvent: false}); this.selectTemplateFormGroup.get('templateName').patchValue(entity, {emitEvent: false});
}, },
() => { error: () => {
this.modelValue = null; this.modelValue = null;
this.selectTemplateFormGroup.get('templateName').patchValue('', {emitEvent: false}); this.selectTemplateFormGroup.get('templateName').patchValue('', {emitEvent: false});
if (value !== null) { if (value !== null) {
this.propagateChange(this.modelValue); this.propagateChange(this.modelValue);
} }
} }
); });
} else { } else {
this.modelValue = null; this.modelValue = null;
this.selectTemplateFormGroup.get('templateName').patchValue('', {emitEvent: false}); this.selectTemplateFormGroup.get('templateName').patchValue('', {emitEvent: false});
@ -229,9 +232,7 @@ export class TemplateAutocompleteComponent implements ControlValueAccessor, OnIn
}); });
return this.notificationService.getNotificationTemplates(pageLink, this.notificationTypes, {ignoreLoading: true}).pipe( return this.notificationService.getNotificationTemplates(pageLink, this.notificationTypes, {ignoreLoading: true}).pipe(
catchError(() => of(emptyPageData<NotificationTemplate>())), catchError(() => of(emptyPageData<NotificationTemplate>())),
map(pageData => { map(pageData => pageData.data)
return pageData.data;
})
); );
} }

1
ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.ts

@ -99,6 +99,7 @@ export class TemplateNotificationDialogComponent
} }
this.templateNotificationForm.reset({}, {emitEvent: false}); this.templateNotificationForm.reset({}, {emitEvent: false});
this.templateNotificationForm.patchValue(this.templateNotification, {emitEvent: false}); this.templateNotificationForm.patchValue(this.templateNotification, {emitEvent: false});
// eslint-disable-next-line guard-for-in
for (const method in this.templateNotification.configuration.deliveryMethodsTemplates) { for (const method in this.templateNotification.configuration.deliveryMethodsTemplates) {
this.deliveryMethodFormsMap.get(NotificationDeliveryMethod[method]) this.deliveryMethodFormsMap.get(NotificationDeliveryMethod[method])
.patchValue(this.templateNotification.configuration.deliveryMethodsTemplates[method]); .patchValue(this.templateNotification.configuration.deliveryMethodsTemplates[method]);

4
ui-ngx/src/app/shared/components/entity/entity-list.component.ts

@ -90,10 +90,10 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV
disabled: boolean; disabled: boolean;
@Input() @Input()
subscriptSizing: SubscriptSizing = 'fixed' subscriptSizing: SubscriptSizing = 'fixed';
@Input() @Input()
hint: string hint: string;
@ViewChild('entityInput') entityInput: ElementRef<HTMLInputElement>; @ViewChild('entityInput') entityInput: ElementRef<HTMLInputElement>;
@ViewChild('entityAutocomplete') matAutocomplete: MatAutocomplete; @ViewChild('entityAutocomplete') matAutocomplete: MatAutocomplete;

2
ui-ngx/src/app/shared/components/string-items-list.component.ts

@ -77,7 +77,7 @@ export class StringItemsListComponent implements ControlValueAccessor{
@Input() @Input()
@coerceBoolean() @coerceBoolean()
editable: boolean = false editable = false;
private propagateChange = (v: any) => { }; private propagateChange = (v: any) => { };

2
ui-ngx/src/app/shared/components/time/timeinterval.component.ts

@ -72,7 +72,7 @@ export class TimeintervalComponent implements OnInit, ControlValueAccessor {
@Input() @Input()
@coerceBoolean() @coerceBoolean()
disabledAdvanced = false disabledAdvanced = false;
@Output() hideFlagChange = new EventEmitter<boolean>(); @Output() hideFlagChange = new EventEmitter<boolean>();

30
ui-ngx/src/app/shared/decorators/coerce-boolean.ts

@ -16,21 +16,19 @@
import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { coerceBooleanProperty } from '@angular/cdk/coercion';
export function coerceBoolean() { export const coerceBoolean = () => (target: any, key: string): void => {
return function (target: any, key: string): void { const getter = function() {
const getter = function () { return this['__' + key];
return this['__' + key]; };
};
const setter = function (next: any) {
this['__' + key] = coerceBooleanProperty(next);
};
Object.defineProperty(target, key, { const setter = function(next: any) {
get: getter, this['__' + key] = coerceBooleanProperty(next);
set: setter,
enumerable: true,
configurable: true,
});
}; };
}
Object.defineProperty(target, key, {
get: getter,
set: setter,
enumerable: true,
configurable: true,
});
};

15
ui-ngx/src/app/shared/models/notification.models.ts

@ -74,7 +74,7 @@ export interface NotificationRequestPreview {
export interface NotificationRequestStats { export interface NotificationRequestStats {
sent: Map<NotificationDeliveryMethod, any>; sent: Map<NotificationDeliveryMethod, any>;
errors: { [key in NotificationDeliveryMethod]: {[key in string]: string}}; errors: { [key in NotificationDeliveryMethod]: {[errorKey in string]: string}};
processedRecipients: Map<NotificationDeliveryMethod, Set<UserId>>; processedRecipients: Map<NotificationDeliveryMethod, Set<UserId>>;
} }
@ -109,8 +109,9 @@ export interface NotificationRule extends Omit<BaseData<NotificationRuleId>, 'la
additionalConfig: {description: string}; additionalConfig: {description: string};
} }
export type NotificationRuleTriggerConfig = Partial<AlarmNotificationRuleTriggerConfig & DeviceInactivityNotificationRuleTriggerConfig & EntityActionNotificationRuleTriggerConfig & AlarmCommentNotificationRuleTriggerConfig & AlarmAssignmentNotificationRuleTriggerConfig & export type NotificationRuleTriggerConfig = Partial<AlarmNotificationRuleTriggerConfig & DeviceInactivityNotificationRuleTriggerConfig &
RuleEngineLifecycleEventNotificationRuleTriggerConfig> EntityActionNotificationRuleTriggerConfig & AlarmCommentNotificationRuleTriggerConfig & AlarmAssignmentNotificationRuleTriggerConfig &
RuleEngineLifecycleEventNotificationRuleTriggerConfig>;
export interface AlarmNotificationRuleTriggerConfig { export interface AlarmNotificationRuleTriggerConfig {
alarmTypes?: Array<string>; alarmTypes?: Array<string>;
@ -120,7 +121,7 @@ export interface AlarmNotificationRuleTriggerConfig {
} }
interface ClearRule { interface ClearRule {
alarmStatuses: Array<AlarmSearchStatus> alarmStatuses: Array<AlarmSearchStatus>;
} }
export interface DeviceInactivityNotificationRuleTriggerConfig { export interface DeviceInactivityNotificationRuleTriggerConfig {
@ -169,7 +170,7 @@ export const ComponentLifecycleEventTranslationMap = new Map<ComponentLifecycleE
[ComponentLifecycleEvent.STARTED, 'event.started'], [ComponentLifecycleEvent.STARTED, 'event.started'],
[ComponentLifecycleEvent.UPDATED, 'event.updated'], [ComponentLifecycleEvent.UPDATED, 'event.updated'],
[ComponentLifecycleEvent.STOPPED, 'event.stopped'] [ComponentLifecycleEvent.STOPPED, 'event.stopped']
]) ]);
export enum AlarmAction { export enum AlarmAction {
CREATED = 'CREATED', CREATED = 'CREATED',
@ -183,7 +184,7 @@ export const AlarmActionTranslationMap = new Map<AlarmAction, string>([
[AlarmAction.SEVERITY_CHANGED, 'notification.notify-alarm-action.severity-changed'], [AlarmAction.SEVERITY_CHANGED, 'notification.notify-alarm-action.severity-changed'],
[AlarmAction.ACKNOWLEDGED, 'notification.notify-alarm-action.acknowledged'], [AlarmAction.ACKNOWLEDGED, 'notification.notify-alarm-action.acknowledged'],
[AlarmAction.CLEARED, 'notification.notify-alarm-action.cleared'] [AlarmAction.CLEARED, 'notification.notify-alarm-action.cleared']
]) ]);
export enum AlarmAssignmentAction { export enum AlarmAssignmentAction {
ASSIGNED = 'ASSIGNED', ASSIGNED = 'ASSIGNED',
@ -193,7 +194,7 @@ export enum AlarmAssignmentAction {
export const AlarmAssignmentActionTranslationMap = new Map<AlarmAssignmentAction, string>([ export const AlarmAssignmentActionTranslationMap = new Map<AlarmAssignmentAction, string>([
[AlarmAssignmentAction.ASSIGNED, 'notification.notify-alarm-action.assigned'], [AlarmAssignmentAction.ASSIGNED, 'notification.notify-alarm-action.assigned'],
[AlarmAssignmentAction.UNASSIGNED, 'notification.notify-alarm-action.unassigned'] [AlarmAssignmentAction.UNASSIGNED, 'notification.notify-alarm-action.unassigned']
]) ]);
export interface NotificationRuleRecipientConfig { export interface NotificationRuleRecipientConfig {
targets?: Array<string>; targets?: Array<string>;

8
ui-ngx/src/app/shared/models/websocket/notification-ws.models.ts

@ -186,15 +186,15 @@ export interface NotificationsUpdateMsg extends CmdUpdateMsg {
export type WebsocketNotificationMsg = NotificationCountUpdateMsg | NotificationsUpdateMsg; export type WebsocketNotificationMsg = NotificationCountUpdateMsg | NotificationsUpdateMsg;
export function isNotificationCountUpdateMsg(message: WebsocketNotificationMsg): message is NotificationCountUpdateMsg { export const isNotificationCountUpdateMsg = (message: WebsocketNotificationMsg): message is NotificationCountUpdateMsg => {
const updateMsg = (message as CmdUpdateMsg); const updateMsg = (message as CmdUpdateMsg);
return updateMsg.cmdId !== undefined && updateMsg.cmdUpdateType === CmdUpdateType.NOTIFICATIONS_COUNT; return updateMsg.cmdId !== undefined && updateMsg.cmdUpdateType === CmdUpdateType.NOTIFICATIONS_COUNT;
} };
export function isNotificationsUpdateMsg(message: WebsocketNotificationMsg): message is NotificationsUpdateMsg { export const isNotificationsUpdateMsg = (message: WebsocketNotificationMsg): message is NotificationsUpdateMsg => {
const updateMsg = (message as CmdUpdateMsg); const updateMsg = (message as CmdUpdateMsg);
return updateMsg.cmdId !== undefined && updateMsg.cmdUpdateType === CmdUpdateType.NOTIFICATIONS; return updateMsg.cmdId !== undefined && updateMsg.cmdUpdateType === CmdUpdateType.NOTIFICATIONS;
} };
export class NotificationPluginCmdWrapper implements CmdWrapper { export class NotificationPluginCmdWrapper implements CmdWrapper {

Loading…
Cancel
Save