UI: Refactoring entities-table-models

This commit is contained in:
Vladyslav_Prykhodko 2021-06-07 14:05:10 +03:00
parent 084d1eed37
commit d60318a709
2 changed files with 2 additions and 6 deletions

View File

@ -165,7 +165,7 @@
matTooltipPosition="above"
[ngStyle]="cellStyle(entity, column, row)">
<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-template [ngSwitchCase]="cellActionType.COPY_BUTTON">
<tb-copy-button

View File

@ -100,7 +100,7 @@ export class EntityTableColumn<T extends BaseData<HasId>> extends BaseEntityTabl
public headerCellStyleFunction: HeaderCellStyleFunction<T> = () => ({}),
public cellTooltipFunction: CellTooltipFunction<T> = () => undefined,
public isNumberColumn: boolean = false,
public actionCell: CellActionDescriptor<T> = {isEnabled: () => false, name: null, onAction: () => ({})}) {
public actionCell: CellActionDescriptor<T> = null) {
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 {
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>`;
}