Browse Source
Merge pull request #8960 from deaflynx/ui/entities-table-widget/pointer-row-click
Widget Entities Table: show pointer if row has click action
pull/8980/head
Igor Kulikov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
13 additions and
3 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.html
-
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts
-
ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html
-
ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts
-
ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html
-
ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts
|
|
|
@ -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> |
|
|
|
|
|
|
|
@ -182,6 +182,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> = []; |
|
|
|
@ -496,6 +497,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'); |
|
|
|
|
|
|
|
@ -88,7 +88,8 @@ |
|
|
|
</ng-container> |
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns; sticky: enableStickyHeader"></mat-header-row> |
|
|
|
<mat-row [ngClass]="{'tb-current-entity': entityDatasource.isCurrentEntity(entity), |
|
|
|
'invisible': entityDatasource.dataLoading}" |
|
|
|
'invisible': entityDatasource.dataLoading, |
|
|
|
'tb-pointer': hasRowAction}" |
|
|
|
*matRowDef="let entity; columns: displayedColumns; let row = index" |
|
|
|
[ngStyle]="rowStyle(entity, row)" |
|
|
|
(click)="onRowClick($event, entity)" (dblclick)="onRowClick($event, entity, true)"></mat-row> |
|
|
|
|
|
|
|
@ -152,6 +152,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni |
|
|
|
public displayedColumns: string[] = []; |
|
|
|
public entityDatasource: EntityDatasource; |
|
|
|
public noDataDisplayMessageText: string; |
|
|
|
public hasRowAction: boolean; |
|
|
|
private setCellButtonAction: boolean; |
|
|
|
|
|
|
|
private cellContentCache: Array<any> = []; |
|
|
|
@ -280,6 +281,8 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni |
|
|
|
|
|
|
|
this.setCellButtonAction = !!this.ctx.actionsApi.getActionDescriptors('actionCellButton').length; |
|
|
|
|
|
|
|
this.hasRowAction = !!this.ctx.actionsApi.getActionDescriptors('rowClick').length || !!this.ctx.actionsApi.getActionDescriptors('rowDoubleClick').length; |
|
|
|
|
|
|
|
if (this.settings.entitiesTitle && this.settings.entitiesTitle.length) { |
|
|
|
this.entitiesTitlePattern = this.utils.customTranslation(this.settings.entitiesTitle, this.settings.entitiesTitle); |
|
|
|
} else { |
|
|
|
|
|
|
|
@ -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> |
|
|
|
|
|
|
|
@ -162,6 +162,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> = []; |
|
|
|
@ -301,6 +302,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; |
|
|
|
|