Browse Source

Merge branch 'develop/3.4' into refactoring_tests_alarm_customer

pull/6695/head
nickAS21 4 years ago
parent
commit
f36fc44afc
  1. 1
      rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/TbDeviceProfileNodeTest.java
  2. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html
  3. 2
      ui-ngx/src/app/modules/home/components/profile/alarm/alarm-schedule.component.html
  4. 17
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts
  5. 0
      ui-ngx/src/assets/help/en_US/device-profile/alarm_custom_schedule_format.md

1
rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/TbDeviceProfileNodeTest.java

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

2
ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html

@ -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"

2
ui-ngx/src/app/modules/home/components/profile/alarm/alarm-schedule.component.html

@ -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">

17
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts

@ -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 {

0
ui-ngx/src/assets/help/en_US/device-profile/alarm_сustom_schedule_format.md → ui-ngx/src/assets/help/en_US/device-profile/alarm_custom_schedule_format.md

Loading…
Cancel
Save