Browse Source

UI: Set max time for scheduling notification 7 days

pull/8046/head
Vladyslav_Prykhodko 4 years ago
parent
commit
93fe447c47
  1. 2
      ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html
  2. 6
      ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.componet.ts
  3. 4
      ui-ngx/src/app/modules/home/pages/notification-center/rule-table/escalation-form.component.html
  4. 4
      ui-ngx/src/app/modules/home/pages/notification-center/rule-table/rule-notification-dialog.component.ts
  5. 13
      ui-ngx/src/app/shared/components/time/timeinterval.component.ts

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

@ -63,7 +63,7 @@
<mat-label translate>notification.time</mat-label> <mat-label translate>notification.time</mat-label>
<mat-datetimepicker-toggle [for]="startTimePicker" matPrefix></mat-datetimepicker-toggle> <mat-datetimepicker-toggle [for]="startTimePicker" matPrefix></mat-datetimepicker-toggle>
<mat-datetimepicker #startTimePicker type="datetime" openOnFocus="true"></mat-datetimepicker> <mat-datetimepicker #startTimePicker type="datetime" openOnFocus="true"></mat-datetimepicker>
<input required matInput fxFlex formControlName="time" [min]="minDate()" [matDatetimepicker]="startTimePicker"> <input required matInput fxFlex formControlName="time" [min]="minDate()" [max]="maxDate()" [matDatetimepicker]="startTimePicker">
</mat-form-field> </mat-form-field>
</div> </div>
</section> </section>

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

@ -193,4 +193,10 @@ export class RequestNotificationDialogComponent extends
minDate(): Date { minDate(): Date {
return new Date(getCurrentTime(this.notificationRequestForm.get('additionalConfig.timezone').value).format('lll')); return new Date(getCurrentTime(this.notificationRequestForm.get('additionalConfig.timezone').value).format('lll'));
} }
maxDate(): Date {
const date = this.minDate();
date.setDate(date.getDate() + 7);
return date;
}
} }

4
ui-ngx/src/app/modules/home/pages/notification-center/rule-table/escalation-form.component.html

@ -26,7 +26,9 @@
style="min-width: 100px;" style="min-width: 100px;"
ngStyle.xs="padding: 0 10px;" ngStyle.xs="padding: 0 10px;"
formControlName="delayInSec" formControlName="delayInSec"
[disabledAdvanced]="true"></tb-timeinterval> min="{{ 0 }}"
max="{{ 604800000 }}"
disabledAdvanced></tb-timeinterval>
<span fxFlex class="escalation-notify" translate>notification.notify</span> <span fxFlex class="escalation-notify" translate>notification.notify</span>
</div> </div>
</div> </div>

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

@ -143,8 +143,8 @@ export class RuleNotificationDialogComponent extends
); );
this.alarmTemplateForm = this.fb.group({ this.alarmTemplateForm = this.fb.group({
alarmTypes: [[], Validators.required], alarmTypes: [null],
alarmSeverities: [[], Validators.required], alarmSeverities: [null, Validators.required],
clearRule: this.fb.group({ clearRule: this.fb.group({
alarmStatus: [] alarmStatus: []
}), }),

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

@ -75,10 +75,19 @@ export class TimeintervalComponent implements OnInit, ControlValueAccessor {
} }
set hideFlag(val) { set hideFlag(val) {
this.hideFlagValue = val; this.hideFlagValue = coerceBooleanProperty(val);
} }
@Input() disabledAdvanced = false; private disabledAdvancedValue = false;
get disabledAdvanced() {
return this.disabledAdvancedValue;
}
@Input()
set disabledAdvanced(val) {
this.disabledAdvancedValue = coerceBooleanProperty(val);
}
@Output() hideFlagChange = new EventEmitter<boolean>(); @Output() hideFlagChange = new EventEmitter<boolean>();

Loading…
Cancel
Save