Browse Source

UI: Refactoring entities-table-models

pull/4695/head
Vladyslav_Prykhodko 5 years ago
parent
commit
d60318a709
  1. 2
      ui-ngx/src/app/modules/home/components/entity/entities-table.component.html
  2. 6
      ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts

2
ui-ngx/src/app/modules/home/components/entity/entities-table.component.html

@ -165,7 +165,7 @@
matTooltipPosition="above" matTooltipPosition="above"
[ngStyle]="cellStyle(entity, column, row)"> [ngStyle]="cellStyle(entity, column, row)">
<span [innerHTML]="cellContent(entity, column, row)"></span> <span [innerHTML]="cellContent(entity, column, row)"></span>
<ng-template [ngIf]="column.actionCell.name"> <ng-template [ngIf]="column.actionCell">
<ng-container [ngSwitch]="column.actionCell.type"> <ng-container [ngSwitch]="column.actionCell.type">
<ng-template [ngSwitchCase]="cellActionType.COPY_BUTTON"> <ng-template [ngSwitchCase]="cellActionType.COPY_BUTTON">
<tb-copy-button <tb-copy-button

6
ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts

@ -100,7 +100,7 @@ export class EntityTableColumn<T extends BaseData<HasId>> extends BaseEntityTabl
public headerCellStyleFunction: HeaderCellStyleFunction<T> = () => ({}), public headerCellStyleFunction: HeaderCellStyleFunction<T> = () => ({}),
public cellTooltipFunction: CellTooltipFunction<T> = () => undefined, public cellTooltipFunction: CellTooltipFunction<T> = () => undefined,
public isNumberColumn: boolean = false, public isNumberColumn: boolean = false,
public actionCell: CellActionDescriptor<T> = {isEnabled: () => false, name: null, onAction: () => ({})}) { public actionCell: CellActionDescriptor<T> = null) {
super('content', key, title, width, sortable); super('content', key, title, width, sortable);
} }
} }
@ -192,7 +192,3 @@ export class EntityTableConfig<T extends BaseData<HasId>, P extends PageLink = P
export function checkBoxCell(value: boolean): string { export function checkBoxCell(value: boolean): string {
return `<mat-icon class="material-icons mat-icon">${value ? 'check_box' : 'check_box_outline_blank'}</mat-icon>`; return `<mat-icon class="material-icons mat-icon">${value ? 'check_box' : 'check_box_outline_blank'}</mat-icon>`;
} }
export function copyCellContent(value: string): string {
return `<mat-icon class="material-icons mat-icon">${value ? 'check_box' : 'check_box_outline_blank'}</mat-icon>`;
}

Loading…
Cancel
Save