UI: Add option show/hide table cell actions
This commit is contained in:
parent
dd900dafba
commit
a1bf0f6e19
@ -125,7 +125,7 @@
|
||||
<mat-cell *matCellDef="let alarm" [ngStyle.gt-md]="{ minWidth: (alarmsDatasource.countCellButtonAction * 48) + 'px',
|
||||
maxWidth: (alarmsDatasource.countCellButtonAction * 48) + 'px',
|
||||
width: (alarmsDatasource.countCellButtonAction * 48) + 'px' }">
|
||||
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
|
||||
<div [fxHide]="hideActionCellButtons" fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
|
||||
<ng-container *ngFor="let actionDescriptor of alarm.actionCellButtons; trackBy: trackByActionCellDescriptionId">
|
||||
<span *ngIf="!actionDescriptor.icon" style="width: 40px;"></span>
|
||||
<button mat-icon-button [disabled]="(isLoading$ | async) || !actionEnabled(alarm, actionDescriptor)"
|
||||
@ -137,7 +137,7 @@
|
||||
</button>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div fxHide fxShow.lt-lg *ngIf="alarm.hasActions">
|
||||
<div fxHide [fxShow.lt-lg]="hideActionCellButtons" *ngIf="alarm.hasActions">
|
||||
<button mat-icon-button
|
||||
(click)="$event.stopPropagation(); ctx.detectChanges();"
|
||||
[matMenuTriggerFor]="cellActionsMenu">
|
||||
|
||||
@ -23,6 +23,7 @@ import {
|
||||
Injector,
|
||||
Input,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
StaticProvider,
|
||||
ViewChild,
|
||||
@ -165,7 +166,7 @@ interface AlarmWidgetActionDescriptor extends TableCellButtonActionDescriptor {
|
||||
templateUrl: './alarms-table-widget.component.html',
|
||||
styleUrls: ['./alarms-table-widget.component.scss', './table-widget.scss']
|
||||
})
|
||||
export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, AfterViewInit {
|
||||
export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
@Input()
|
||||
ctx: WidgetContext;
|
||||
@ -178,6 +179,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
|
||||
public displayPagination = true;
|
||||
public enableStickyHeader = true;
|
||||
public enableStickyAction = false;
|
||||
public hideActionCellButtons = true;
|
||||
public pageSizeOptions;
|
||||
public pageLink: AlarmDataPageLink;
|
||||
public sortOrderProperty: string;
|
||||
@ -362,6 +364,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
|
||||
this.displayPagination = isDefined(this.settings.displayPagination) ? this.settings.displayPagination : true;
|
||||
this.enableStickyHeader = isDefined(this.settings.enableStickyHeader) ? this.settings.enableStickyHeader : true;
|
||||
this.enableStickyAction = isDefined(this.settings.enableStickyAction) ? this.settings.enableStickyAction : false;
|
||||
this.hideActionCellButtons = isDefined(this.settings.hideActionCellButtons) ? this.settings.hideActionCellButtons : true;
|
||||
this.columnDisplayAction.show = isDefined(this.settings.enableSelectColumnDisplay) ? this.settings.enableSelectColumnDisplay : true;
|
||||
let enableFilter;
|
||||
if (isDefined(this.settings.enableFilter)) {
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
<mat-cell *matCellDef="let entity" [ngStyle.gt-md]="{ minWidth: (entityDatasource.countCellButtonAction * 48) + 'px',
|
||||
maxWidth: (entityDatasource.countCellButtonAction * 48) + 'px',
|
||||
width: (entityDatasource.countCellButtonAction * 48) + 'px' }">
|
||||
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
|
||||
<div [fxHide]="hideActionCellButtons" fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
|
||||
<ng-container *ngFor="let actionDescriptor of entity.actionCellButtons; trackBy: trackByActionCellDescriptionId">
|
||||
<span *ngIf="!actionDescriptor.icon" style="width: 40px;"></span>
|
||||
<button mat-icon-button [disabled]="isLoading$ | async"
|
||||
@ -67,7 +67,7 @@
|
||||
</button>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div fxHide fxShow.lt-lg *ngIf="entity.hasActions">
|
||||
<div fxHide [fxShow.lt-lg]="hideActionCellButtons" *ngIf="entity.hasActions">
|
||||
<button mat-icon-button
|
||||
(click)="$event.stopPropagation(); ctx.detectChanges();"
|
||||
[matMenuTriggerFor]="cellActionsMenu">
|
||||
|
||||
@ -22,6 +22,7 @@ import {
|
||||
Injector,
|
||||
Input,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
StaticProvider,
|
||||
ViewChild,
|
||||
@ -78,8 +79,8 @@ import {
|
||||
getColumnDefaultVisibility,
|
||||
getColumnSelectionAvailability,
|
||||
getColumnWidth,
|
||||
getHeaderTitle,
|
||||
getEntityValue,
|
||||
getHeaderTitle,
|
||||
getRowStyleInfo,
|
||||
getTableCellButtonActions,
|
||||
noDataMessage,
|
||||
@ -129,7 +130,7 @@ interface EntitiesTableWidgetSettings extends TableWidgetSettings {
|
||||
templateUrl: './entities-table-widget.component.html',
|
||||
styleUrls: ['./entities-table-widget.component.scss', './table-widget.scss']
|
||||
})
|
||||
export class EntitiesTableWidgetComponent extends PageComponent implements OnInit, AfterViewInit {
|
||||
export class EntitiesTableWidgetComponent extends PageComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
@Input()
|
||||
ctx: WidgetContext;
|
||||
@ -141,6 +142,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
|
||||
public displayPagination = true;
|
||||
public enableStickyHeader = true;
|
||||
public enableStickyAction = true;
|
||||
public hideActionCellButtons = true;
|
||||
public pageSizeOptions;
|
||||
public pageLink: EntityDataPageLink;
|
||||
public sortOrderProperty: string;
|
||||
@ -290,6 +292,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
|
||||
this.displayPagination = isDefined(this.settings.displayPagination) ? this.settings.displayPagination : true;
|
||||
this.enableStickyHeader = isDefined(this.settings.enableStickyHeader) ? this.settings.enableStickyHeader : true;
|
||||
this.enableStickyAction = isDefined(this.settings.enableStickyAction) ? this.settings.enableStickyAction : true;
|
||||
this.hideActionCellButtons = isDefined(this.settings.hideActionCellButtons) ? this.settings.hideActionCellButtons : true;
|
||||
this.columnDisplayAction.show = isDefined(this.settings.enableSelectColumnDisplay) ? this.settings.enableSelectColumnDisplay : true;
|
||||
|
||||
this.rowStylesInfo = getRowStyleInfo(this.settings, 'entity, ctx');
|
||||
|
||||
@ -44,6 +44,9 @@
|
||||
<mat-checkbox formControlName="enableStickyAction">
|
||||
{{ 'widgets.table.enable-sticky-action' | translate }}
|
||||
</mat-checkbox>
|
||||
<mat-checkbox formControlName="hideActionCellButtons">
|
||||
{{ 'widgets.table.hide-action-cell-buttons' | translate }}
|
||||
</mat-checkbox>
|
||||
</section>
|
||||
</section>
|
||||
<mat-form-field fxFlex class="mat-block">
|
||||
|
||||
@ -47,6 +47,7 @@ export class AlarmsTableWidgetSettingsComponent extends WidgetSettingsComponent
|
||||
enableFilter: true,
|
||||
enableStickyHeader: true,
|
||||
enableStickyAction: true,
|
||||
hideActionCellButtons: true,
|
||||
reserveSpaceForHiddenAction: 'true',
|
||||
displayDetails: true,
|
||||
allowAcknowledgment: true,
|
||||
@ -69,6 +70,7 @@ export class AlarmsTableWidgetSettingsComponent extends WidgetSettingsComponent
|
||||
enableFilter: [settings.enableFilter, []],
|
||||
enableStickyHeader: [settings.enableStickyHeader, []],
|
||||
enableStickyAction: [settings.enableStickyAction, []],
|
||||
hideActionCellButtons: [settings.hideActionCellButtons, []],
|
||||
reserveSpaceForHiddenAction: [settings.reserveSpaceForHiddenAction, []],
|
||||
displayDetails: [settings.displayDetails, []],
|
||||
allowAcknowledgment: [settings.allowAcknowledgment, []],
|
||||
|
||||
@ -38,6 +38,9 @@
|
||||
<mat-checkbox formControlName="enableStickyAction">
|
||||
{{ 'widgets.table.enable-sticky-action' | translate }}
|
||||
</mat-checkbox>
|
||||
<mat-checkbox formControlName="hideActionCellButtons">
|
||||
{{ 'widgets.table.hide-action-cell-buttons' | translate }}
|
||||
</mat-checkbox>
|
||||
</section>
|
||||
</section>
|
||||
<mat-form-field fxFlex class="mat-block">
|
||||
|
||||
@ -45,6 +45,7 @@ export class EntitiesTableWidgetSettingsComponent extends WidgetSettingsComponen
|
||||
enableSelectColumnDisplay: true,
|
||||
enableStickyHeader: true,
|
||||
enableStickyAction: true,
|
||||
hideActionCellButtons: true,
|
||||
reserveSpaceForHiddenAction: 'true',
|
||||
displayEntityName: true,
|
||||
entityNameColumnTitle: '',
|
||||
@ -66,6 +67,7 @@ export class EntitiesTableWidgetSettingsComponent extends WidgetSettingsComponen
|
||||
enableSelectColumnDisplay: [settings.enableSelectColumnDisplay, []],
|
||||
enableStickyHeader: [settings.enableStickyHeader, []],
|
||||
enableStickyAction: [settings.enableStickyAction, []],
|
||||
hideActionCellButtons: [settings.hideActionCellButtons, []],
|
||||
reserveSpaceForHiddenAction: [settings.reserveSpaceForHiddenAction, []],
|
||||
displayEntityName: [settings.displayEntityName, []],
|
||||
entityNameColumnTitle: [settings.entityNameColumnTitle, []],
|
||||
|
||||
@ -34,6 +34,9 @@
|
||||
<mat-checkbox formControlName="enableStickyAction">
|
||||
{{ 'widgets.table.enable-sticky-action' | translate }}
|
||||
</mat-checkbox>
|
||||
<mat-checkbox formControlName="hideActionCellButtons">
|
||||
{{ 'widgets.table.hide-action-cell-buttons' | translate }}
|
||||
</mat-checkbox>
|
||||
</section>
|
||||
</section>
|
||||
<mat-form-field fxFlex class="mat-block">
|
||||
|
||||
@ -44,6 +44,7 @@ export class TimeseriesTableWidgetSettingsComponent extends WidgetSettingsCompon
|
||||
enableSelectColumnDisplay: true,
|
||||
enableStickyHeader: true,
|
||||
enableStickyAction: true,
|
||||
hideActionCellButtons: true,
|
||||
reserveSpaceForHiddenAction: 'true',
|
||||
showTimestamp: true,
|
||||
showMilliseconds: false,
|
||||
@ -63,6 +64,7 @@ export class TimeseriesTableWidgetSettingsComponent extends WidgetSettingsCompon
|
||||
enableSelectColumnDisplay: [settings.enableSelectColumnDisplay, []],
|
||||
enableStickyHeader: [settings.enableStickyHeader, []],
|
||||
enableStickyAction: [settings.enableStickyAction, []],
|
||||
hideActionCellButtons: [settings.hideActionCellButtons, []],
|
||||
reserveSpaceForHiddenAction: [settings.reserveSpaceForHiddenAction, []],
|
||||
showTimestamp: [settings.showTimestamp, []],
|
||||
showMilliseconds: [settings.showMilliseconds, []],
|
||||
|
||||
@ -33,6 +33,7 @@ export interface TableWidgetSettings {
|
||||
enableSearch: boolean;
|
||||
enableSelectColumnDisplay: boolean;
|
||||
enableStickyAction: boolean;
|
||||
hideActionCellButtons: boolean;
|
||||
enableStickyHeader: boolean;
|
||||
displayPagination: boolean;
|
||||
defaultPageSize: number;
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
<mat-cell *matCellDef="let row" [ngStyle.gt-md]="{ minWidth: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px',
|
||||
maxWidth: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px',
|
||||
width: (source.timeseriesDatasource.countCellButtonAction * 48) + 'px' }">
|
||||
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
|
||||
<div [fxHide]="hideActionCellButtons" fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
|
||||
<ng-container *ngFor="let actionDescriptor of row.actionCellButtons; trackBy: trackByActionCellDescriptionId">
|
||||
<span *ngIf="!actionDescriptor.icon" style="width: 40px;"></span>
|
||||
<button *ngIf="actionDescriptor.icon"
|
||||
@ -79,7 +79,7 @@
|
||||
</button>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div fxHide fxShow.lt-lg *ngIf="row.hasActions">
|
||||
<div fxHide [fxShow.lt-lg]="hideActionCellButtons" *ngIf="row.hasActions">
|
||||
<button mat-icon-button
|
||||
(click)="$event.stopPropagation(); ctx.detectChanges();"
|
||||
[matMenuTriggerFor]="cellActionsMenu">
|
||||
|
||||
@ -154,6 +154,7 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
|
||||
public displayPagination = true;
|
||||
public enableStickyHeader = true;
|
||||
public enableStickyAction = true;
|
||||
public hideActionCellButtons = true;
|
||||
public pageSizeOptions;
|
||||
public textSearchMode = false;
|
||||
public hidePageSize = false;
|
||||
@ -306,6 +307,7 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
|
||||
this.displayPagination = isDefined(this.settings.displayPagination) ? this.settings.displayPagination : true;
|
||||
this.enableStickyHeader = isDefined(this.settings.enableStickyHeader) ? this.settings.enableStickyHeader : true;
|
||||
this.enableStickyAction = isDefined(this.settings.enableStickyAction) ? this.settings.enableStickyAction : true;
|
||||
this.hideActionCellButtons = isDefined(this.settings.hideActionCellButtons) ? this.settings.hideActionCellButtons : true;
|
||||
this.hideEmptyLines = isDefined(this.settings.hideEmptyLines) ? this.settings.hideEmptyLines : false;
|
||||
this.useEntityLabel = isDefined(this.widgetConfig.settings.useEntityLabel) ? this.widgetConfig.settings.useEntityLabel : false;
|
||||
this.showTimestamp = this.settings.showTimestamp !== false;
|
||||
|
||||
@ -5213,7 +5213,8 @@
|
||||
"columns": "Columns",
|
||||
"remove-column": "Remove column",
|
||||
"add-column": "Add column",
|
||||
"no-columns": "No columns configured"
|
||||
"no-columns": "No columns configured",
|
||||
"hide-action-cell-buttons": "Hide action cell buttons"
|
||||
},
|
||||
"value-source": {
|
||||
"value-source": "Value source",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user