Browse Source

AlarmsTableWidgetComponent, TimeseriesTableWidgetComponent - show pointer cursor if widget has rowClick action

pull/8960/head
deaflynx 3 years ago
parent
commit
753258c1ba
  1. 3
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.html
  2. 2
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts
  3. 3
      ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html
  4. 2
      ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts

3
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.html

@ -160,7 +160,8 @@
<mat-row [ngClass]="{'mat-row-select': enableSelection,
'mat-selected': alarmsDatasource.isSelected(alarm),
'tb-current-entity': alarmsDatasource.isCurrentAlarm(alarm),
'invisible': alarmsDatasource.dataLoading}"
'invisible': alarmsDatasource.dataLoading,
'tb-pointer': hasRowAction}"
*matRowDef="let alarm; columns: displayedColumns; let row = index"
[ngStyle]="rowStyle(alarm, row)"
(click)="onRowClick($event, alarm)"></mat-row>

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

@ -180,6 +180,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
public displayedColumns: string[] = [];
public alarmsDatasource: AlarmsDatasource;
public noDataDisplayMessageText: string;
public hasRowAction: boolean;
private setCellButtonAction: boolean;
private cellContentCache: Array<any> = [];
@ -493,6 +494,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
}
this.setCellButtonAction = !!(actionCellDescriptors.length + this.ctx.actionsApi.getActionDescriptors('actionCellButton').length);
this.hasRowAction = !!this.ctx.actionsApi.getActionDescriptors('rowClick').length;
if (this.setCellButtonAction) {
this.displayedColumns.push('actions');

3
ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html

@ -99,7 +99,8 @@
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="source.displayedColumns; sticky: enableStickyHeader"></mat-header-row>
<mat-row *matRowDef="let row; columns: source.displayedColumns; let rowIndex = index"
<mat-row [ngClass]="{'tb-pointer': hasRowAction}"
*matRowDef="let row; columns: source.displayedColumns; let rowIndex = index"
[ngStyle]="rowStyle(source, row, rowIndex)"
(click)="onRowClick($event, row)"></mat-row>
</table>

2
ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts

@ -161,6 +161,7 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
public sources: TimeseriesTableSource[];
public sourceIndex: number;
public noDataDisplayMessageText: string;
public hasRowAction: boolean;
private setCellButtonAction: boolean;
private cellContentCache: Array<any> = [];
@ -300,6 +301,7 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
this.ctx.widgetActions = [this.searchAction, this.columnDisplayAction];
this.setCellButtonAction = !!this.ctx.actionsApi.getActionDescriptors('actionCellButton').length;
this.hasRowAction = !!this.ctx.actionsApi.getActionDescriptors('rowClick').length;
this.searchAction.show = isDefined(this.settings.enableSearch) ? this.settings.enableSearch : true;
this.columnDisplayAction.show = isDefined(this.settings.enableSelectColumnDisplay) ? this.settings.enableSelectColumnDisplay : true;

Loading…
Cancel
Save