Commit 23ece9c247ca5a0a8b83d6565ddd4902c2e79917

Authored by Kalutka Zhenya
1 parent 501df250

Refactoring

... ... @@ -39,7 +39,7 @@
39 39 </mat-toolbar>
40 40 <mat-tab-group [ngClass]="{'tb-headless': sources.length === 1}" fxFlex
41 41 [(selectedIndex)]="sourceIndex" (selectedIndexChange)="onSourceIndexChanged()">
42   - <mat-tab *ngFor="let source of sources; trackBy: trackBySourcesIndex; let index = index;" label="{{getTabLabel(source, this.useDeviceLabel)}}">
  42 + <mat-tab *ngFor="let source of sources; trackBy: trackBySourcesIndex; let index = index;" label="{{getTabLabel(source)}}">
43 43 <ng-template [ngIf]="isActiveTab(index)">
44 44 <div fxFlex class="table-container">
45 45 <table mat-table [dataSource]="source.timeseriesDatasource" [trackBy]="trackByRowTimestamp"
... ...
... ... @@ -129,7 +129,7 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
129 129 private defaultSortOrder = '-0';
130 130 private hideEmptyLines = false;
131 131 public showTimestamp = true;
132   - public useDeviceLabel = false;
  132 + private useDeviceLabel = false;
133 133 private dateFormatFilter: string;
134 134
135 135 private rowStylesInfo: RowStyleInfo;
... ... @@ -234,9 +234,9 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
234 234 this.updateDatasources();
235 235 }
236 236
237   - public getTabLabel(source, useDeviceLabel){
238   - if(useDeviceLabel){
239   - return source.datasource.entityLabel ? source.datasource.entityLabel : source.datasource.entityName;
  237 + public getTabLabel(source){
  238 + if(this.useDeviceLabel){
  239 + return source.datasource.entityLabel || source.datasource.entityName;
240 240 } else {
241 241 return source.datasource.entityName;
242 242 }
... ...