|
|
|
@ -28,38 +28,38 @@ import { |
|
|
|
TriggerType, |
|
|
|
TriggerTypeTranslationMap |
|
|
|
} from '@shared/models/notification.models'; |
|
|
|
import { Component, Inject, OnDestroy, ViewChild } from '@angular/core'; |
|
|
|
import { DialogComponent } from '@shared/components/dialog.component'; |
|
|
|
import { Store } from '@ngrx/store'; |
|
|
|
import { AppState } from '@core/core.state'; |
|
|
|
import { Router } from '@angular/router'; |
|
|
|
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; |
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
|
|
import { NotificationService } from '@core/http/notification.service'; |
|
|
|
import { EntityType } from '@shared/models/entity-type.models'; |
|
|
|
import { deepClone, deepTrim, isDefined } from '@core/utils'; |
|
|
|
import { Observable, Subject } from 'rxjs'; |
|
|
|
import { map, takeUntil } from 'rxjs/operators'; |
|
|
|
import { StepperOrientation, StepperSelectionEvent } from '@angular/cdk/stepper'; |
|
|
|
import { MatStepper } from '@angular/material/stepper'; |
|
|
|
import { MediaBreakpoints } from '@shared/models/constants'; |
|
|
|
import { BreakpointObserver } from '@angular/cdk/layout'; |
|
|
|
import {Component, Inject, OnDestroy, ViewChild} from '@angular/core'; |
|
|
|
import {DialogComponent} from '@shared/components/dialog.component'; |
|
|
|
import {Store} from '@ngrx/store'; |
|
|
|
import {AppState} from '@core/core.state'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material/dialog'; |
|
|
|
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
|
|
|
import {NotificationService} from '@core/http/notification.service'; |
|
|
|
import {EntityType} from '@shared/models/entity-type.models'; |
|
|
|
import {deepClone, deepTrim, isDefined} from '@core/utils'; |
|
|
|
import {Observable, Subject} from 'rxjs'; |
|
|
|
import {map, takeUntil} from 'rxjs/operators'; |
|
|
|
import {StepperOrientation, StepperSelectionEvent} from '@angular/cdk/stepper'; |
|
|
|
import {MatStepper} from '@angular/material/stepper'; |
|
|
|
import {MediaBreakpoints} from '@shared/models/constants'; |
|
|
|
import {BreakpointObserver} from '@angular/cdk/layout'; |
|
|
|
import { |
|
|
|
AlarmSearchStatus, |
|
|
|
alarmSearchStatusTranslations, |
|
|
|
AlarmSeverity, |
|
|
|
alarmSeverityTranslations |
|
|
|
} from '@shared/models/alarm.models'; |
|
|
|
import { TranslateService } from '@ngx-translate/core'; |
|
|
|
import {TranslateService} from '@ngx-translate/core'; |
|
|
|
import { |
|
|
|
RecipientNotificationDialogComponent, |
|
|
|
RecipientNotificationDialogData |
|
|
|
} from '@home/pages/notification/recipient/recipient-notification-dialog.component'; |
|
|
|
import { MatButton } from '@angular/material/button'; |
|
|
|
import { AuthState } from '@core/auth/auth.models'; |
|
|
|
import { getCurrentAuthState } from '@core/auth/auth.selectors'; |
|
|
|
import { AuthUser } from '@shared/models/user.model'; |
|
|
|
import { Authority } from '@shared/models/authority.enum'; |
|
|
|
import {MatButton} from '@angular/material/button'; |
|
|
|
import {AuthState} from '@core/auth/auth.models'; |
|
|
|
import {getCurrentAuthState} from '@core/auth/auth.selectors'; |
|
|
|
import {AuthUser} from '@shared/models/user.model'; |
|
|
|
import {Authority} from '@shared/models/authority.enum'; |
|
|
|
import { |
|
|
|
ApiFeature, |
|
|
|
ApiFeatureTranslationMap, |
|
|
|
@ -95,6 +95,7 @@ export class RuleNotificationDialogComponent extends |
|
|
|
entitiesLimitTemplateForm: FormGroup; |
|
|
|
apiUsageLimitTemplateForm: FormGroup; |
|
|
|
newPlatformVersionTemplateForm: FormGroup; |
|
|
|
rateLimitsTemplateForm: FormGroup; |
|
|
|
|
|
|
|
triggerType = TriggerType; |
|
|
|
triggerTypes: TriggerType[]; |
|
|
|
@ -302,6 +303,12 @@ export class RuleNotificationDialogComponent extends |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
this.rateLimitsTemplateForm = this.fb.group({ |
|
|
|
triggerConfig: this.fb.group({ |
|
|
|
|
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
this.triggerTypeFormsMap = new Map<TriggerType, FormGroup>([ |
|
|
|
[TriggerType.ALARM, this.alarmTemplateForm], |
|
|
|
[TriggerType.ALARM_COMMENT, this.alarmCommentTemplateForm], |
|
|
|
@ -311,7 +318,8 @@ export class RuleNotificationDialogComponent extends |
|
|
|
[TriggerType.RULE_ENGINE_COMPONENT_LIFECYCLE_EVENT, this.ruleEngineEventsTemplateForm], |
|
|
|
[TriggerType.ENTITIES_LIMIT, this.entitiesLimitTemplateForm], |
|
|
|
[TriggerType.API_USAGE_LIMIT, this.apiUsageLimitTemplateForm], |
|
|
|
[TriggerType.NEW_PLATFORM_VERSION, this.newPlatformVersionTemplateForm] |
|
|
|
[TriggerType.NEW_PLATFORM_VERSION, this.newPlatformVersionTemplateForm], |
|
|
|
[TriggerType.RATE_LIMITS, this.rateLimitsTemplateForm] |
|
|
|
]); |
|
|
|
|
|
|
|
if (data.isAdd || data.isCopy) { |
|
|
|
@ -447,6 +455,7 @@ export class RuleNotificationDialogComponent extends |
|
|
|
TriggerType.ENTITIES_LIMIT, |
|
|
|
TriggerType.API_USAGE_LIMIT, |
|
|
|
TriggerType.NEW_PLATFORM_VERSION, |
|
|
|
TriggerType.RATE_LIMITS |
|
|
|
]); |
|
|
|
|
|
|
|
if (this.isSysAdmin()) { |
|
|
|
|