Browse Source

Merge branch 'fix/4088-connector-tables-row-description' into improvements/050824-gateway

pull/11354/head
mpetrov 2 years ago
parent
commit
d16838e22a
  1. 18
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/mapping-table/mapping-table.component.html
  2. 32
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/modbus/modbus-master-table/modbus-master-table.component.html
  3. 2
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/modbus/modbus-master-table/modbus-master-table.component.ts

18
ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/mapping-table/mapping-table.component.html

@ -75,15 +75,22 @@
</mat-header-cell> </mat-header-cell>
<mat-cell *matCellDef="let mapping; let i = index" <mat-cell *matCellDef="let mapping; let i = index"
[ngStyle.gt-md]="{ minWidth: '96px', maxWidth: '96px', width: '96px'}"> [ngStyle.gt-md]="{ minWidth: '96px', maxWidth: '96px', width: '96px'}">
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end"> <ng-template #rowActions>
<button mat-icon-button <button mat-icon-button
matTooltip="{{ 'action.edit' | translate }}"
matTooltipPosition="above"
(click)="manageMapping($event, i)"> (click)="manageMapping($event, i)">
<tb-icon>edit</tb-icon> <tb-icon>edit</tb-icon>
</button> </button>
<button mat-icon-button <button mat-icon-button
matTooltip="{{ 'action.delete' | translate }}"
matTooltipPosition="above"
(click)="deleteMapping($event, i)"> (click)="deleteMapping($event, i)">
<tb-icon>delete</tb-icon> <tb-icon>delete</tb-icon>
</button> </button>
</ng-template>
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
<ng-container [ngTemplateOutlet]="rowActions"></ng-container>
</div> </div>
<div fxHide fxShow.lt-lg fxFlex fxLayout="row" fxLayoutAlign="end"> <div fxHide fxShow.lt-lg fxFlex fxLayout="row" fxLayoutAlign="end">
<button mat-icon-button <button mat-icon-button
@ -92,14 +99,7 @@
<mat-icon class="material-icons">more_vert</mat-icon> <mat-icon class="material-icons">more_vert</mat-icon>
</button> </button>
<mat-menu #cellActionsMenu="matMenu" xPosition="before"> <mat-menu #cellActionsMenu="matMenu" xPosition="before">
<button mat-icon-button <ng-container [ngTemplateOutlet]="rowActions"></ng-container>
(click)="manageMapping($event, i)">
<tb-icon>edit</tb-icon>
</button>
<button mat-icon-button
(click)="deleteMapping($event, i)">
<tb-icon>delete</tb-icon>
</button>
</mat-menu> </mat-menu>
</div> </div>
</mat-cell> </mat-cell>

32
ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/modbus/modbus-master-table/modbus-master-table.component.html

@ -66,33 +66,40 @@
<mat-header-cell *matHeaderCellDef class="table-value-column"> <mat-header-cell *matHeaderCellDef class="table-value-column">
{{ 'gateway.name' | translate }} {{ 'gateway.name' | translate }}
</mat-header-cell> </mat-header-cell>
<mat-cell *matCellDef="let mapping" class="table-value-column"> <mat-cell *matCellDef="let slave" class="table-value-column">
{{ mapping['name'] }} {{ slave['name'] }}
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container [matColumnDef]="'type'"> <ng-container [matColumnDef]="'type'">
<mat-header-cell *matHeaderCellDef class="table-value-column"> <mat-header-cell *matHeaderCellDef class="table-value-column">
{{ 'gateway.client-communication-type' | translate }} {{ 'gateway.client-communication-type' | translate }}
</mat-header-cell> </mat-header-cell>
<mat-cell *matCellDef="let mapping" class="table-value-column"> <mat-cell *matCellDef="let slave" class="table-value-column">
{{ ModbusProtocolLabelsMap.get(mapping['type']) }} {{ ModbusProtocolLabelsMap.get(slave['type']) }}
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="actions" stickyEnd> <ng-container matColumnDef="actions" stickyEnd>
<mat-header-cell *matHeaderCellDef <mat-header-cell *matHeaderCellDef
[ngStyle.gt-md]="{ minWidth: '96px', maxWidth: '96px', width: '96px', textAlign: 'center'}"> [ngStyle.gt-md]="{ minWidth: '96px', maxWidth: '96px', width: '96px', textAlign: 'center'}">
</mat-header-cell> </mat-header-cell>
<mat-cell *matCellDef="let mapping; let i = index" <mat-cell *matCellDef="let slave; let i = index"
[ngStyle.gt-md]="{ minWidth: '96px', maxWidth: '96px', width: '96px'}"> [ngStyle.gt-md]="{ minWidth: '96px', maxWidth: '96px', width: '96px'}">
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end"> <ng-template #rowActions>
<button mat-icon-button <button mat-icon-button
matTooltip="{{ 'action.edit' | translate }}"
matTooltipPosition="above"
(click)="manageSlave($event, i)"> (click)="manageSlave($event, i)">
<tb-icon>edit</tb-icon> <tb-icon>edit</tb-icon>
</button> </button>
<button mat-icon-button <button mat-icon-button
(click)="deleteMapping($event, i)"> matTooltip="{{ 'action.delete' | translate }}"
matTooltipPosition="above"
(click)="deleteSlave($event, i)">
<tb-icon>delete</tb-icon> <tb-icon>delete</tb-icon>
</button> </button>
</ng-template>
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end">
<ng-container [ngTemplateOutlet]="rowActions"></ng-container>
</div> </div>
<div fxHide fxShow.lt-lg fxFlex fxLayout="row" fxLayoutAlign="end"> <div fxHide fxShow.lt-lg fxFlex fxLayout="row" fxLayoutAlign="end">
<button mat-icon-button <button mat-icon-button
@ -101,20 +108,13 @@
<mat-icon class="material-icons">more_vert</mat-icon> <mat-icon class="material-icons">more_vert</mat-icon>
</button> </button>
<mat-menu #cellActionsMenu="matMenu" xPosition="before"> <mat-menu #cellActionsMenu="matMenu" xPosition="before">
<button mat-icon-button <ng-container [ngTemplateOutlet]="rowActions"></ng-container>
(click)="manageSlave($event, i)">
<tb-icon>edit</tb-icon>
</button>
<button mat-icon-button
(click)="deleteMapping($event, i)">
<tb-icon>delete</tb-icon>
</button>
</mat-menu> </mat-menu>
</div> </div>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<mat-header-row [ngClass]="{'mat-row-select': true}" *matHeaderRowDef="['name', 'type', 'actions']; sticky: true"></mat-header-row> <mat-header-row [ngClass]="{'mat-row-select': true}" *matHeaderRowDef="['name', 'type', 'actions']; sticky: true"></mat-header-row>
<mat-row *matRowDef="let mapping; columns: ['name', 'type', 'actions']"></mat-row> <mat-row *matRowDef="let slave; columns: ['name', 'type', 'actions']"></mat-row>
</table> </table>
<section [fxShow]="!textSearchMode && (dataSource.isEmpty() | async)" fxLayoutAlign="center center" <section [fxShow]="!textSearchMode && (dataSource.isEmpty() | async)" fxLayoutAlign="center center"
class="mat-headline-5 tb-absolute-fill tb-add-new"> class="mat-headline-5 tb-absolute-fill tb-add-new">

2
ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/modbus/modbus-master-table/modbus-master-table.component.ts

@ -173,7 +173,7 @@ export class ModbusMasterTableComponent implements ControlValueAccessor, AfterVi
}); });
} }
deleteMapping($event: Event, index: number): void { deleteSlave($event: Event, index: number): void {
if ($event) { if ($event) {
$event.stopPropagation(); $event.stopPropagation();
} }

Loading…
Cancel
Save