Merge branch 'develop/3.4' into refactoring_tests_alarm_customer

This commit is contained in:
nickAS21 2022-06-14 15:18:01 +03:00
commit f36fc44afc
5 changed files with 13 additions and 9 deletions

View File

@ -49,6 +49,7 @@ import org.thingsboard.server.common.data.device.profile.RepeatingAlarmCondition
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.DeviceProfileId;
import org.thingsboard.server.common.data.id.QueueId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.kv.AttributeKvEntry;
import org.thingsboard.server.common.data.query.BooleanFilterPredicate;

View File

@ -28,7 +28,7 @@
</mat-toolbar>
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
</mat-progress-bar>
<div mat-dialog-content>
<div mat-dialog-content style="padding: 0;">
<fieldset [disabled]="isLoading$ | async" style="position: relative; height: 600px;">
<tb-widget-config
[aliasController]="aliasController"

View File

@ -74,7 +74,7 @@
</div>
</section>
<section *ngIf="alarmScheduleForm.get('type').value === alarmScheduleType.CUSTOM">
<tb-alarm-dynamic-value formControlName = 'dynamicValue' helpId = 'device-profile/alarm_сustom_schedule_format'></tb-alarm-dynamic-value>
<tb-alarm-dynamic-value formControlName = 'dynamicValue' helpId = 'device-profile/alarm_custom_schedule_format'></tb-alarm-dynamic-value>
<div class="tb-small" style="margin-bottom: 0.5em" translate>device-profile.schedule-days</div>
<div *ngFor="let day of allDays" fxLayout="column" formArrayName="items" fxLayoutGap="1em">
<div fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px" [formGroupName]="''+day" fxLayoutAlign="start center" fxLayoutAlign.xs="center start">

View File

@ -290,9 +290,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
debounceTime(150),
distinctUntilChanged(),
tap(() => {
if (this.displayPagination) {
this.paginator.pageIndex = 0;
}
this.resetPageIndex();
this.updateData();
})
)
@ -556,6 +554,12 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
this.ctx.detectChanges();
}
private resetPageIndex(): void {
if (this.displayPagination) {
this.paginator.pageIndex = 0;
}
}
private editAlarmFilter($event: Event) {
if ($event) {
$event.stopPropagation();
@ -600,6 +604,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
this.pageLink.statusList = result.statusList;
this.pageLink.severityList = result.severityList;
this.pageLink.typeList = result.typeList;
this.resetPageIndex();
this.updateData();
}
});
@ -620,9 +625,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
exitFilterMode() {
this.textSearchMode = false;
this.pageLink.textSearch = null;
if (this.displayPagination) {
this.paginator.pageIndex = 0;
}
this.resetPageIndex();
this.updateData();
this.ctx.hideTitlePanel = false;
this.ctx.detectChanges(true);
@ -959,7 +962,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
} else if (alarmField.value === alarmFields.severity.value) {
return this.translate.instant(alarmSeverityTranslations.get(value));
} else if (alarmField.value === alarmFields.status.value) {
return this.translate.instant(alarmStatusTranslations.get(value));
return alarmStatusTranslations.get(value) ? this.translate.instant(alarmStatusTranslations.get(value)) : value;
} else if (alarmField.value === alarmFields.originatorType.value) {
return this.translate.instant(entityTypeTranslations.get(value).type);
} else {