This commit is contained in:
Adina Țeudan 2021-09-15 23:45:18 +03:00
parent d6764126b4
commit 2ee21a6a3a
3 changed files with 4 additions and 4 deletions

View File

@ -20,11 +20,11 @@ export abstract class ListingComponent<T extends Listable> extends AutoUnsubscri
readonly noMatch$ = this._noMatch$;
readonly noContent$ = this._noContent$;
readonly sortedDisplayedEntities$ = this._sortedDisplayedEntities$;
readonly routerLinkFn?: (entity: T) => string | string[];
// TODO: These should be somewhere in table listing, not generic listing
abstract readonly tableColumnConfigs: readonly TableColumnConfig<T>[];
readonly tableHeaderLabel?: string;
readonly routerLinkFn?: (entity: T) => string | string[];
abstract readonly tableHeaderLabel: string;
/**
* Key used in the *trackBy* function with **ngFor* or **cdkVirtualFor*

View File

@ -10,7 +10,7 @@ export interface TableColumnConfig<T> {
readonly rightIconTooltip?: string;
readonly notTranslatable?: boolean;
readonly width?: string;
readonly template?: TemplateRef<unknown>; // TODO: make required
readonly template: TemplateRef<unknown>;
readonly extra?: unknown;
last?: boolean;
}

View File

@ -46,7 +46,7 @@ export class TableComponent<T extends Listable> implements OnInit {
@Input() itemMouseLeaveFn?: (entity: T) => void;
routerLinkFn?: (entity: T) => string | string[];
tableColumnConfigs!: readonly TableColumnConfig<T>[];
tableHeaderLabel?: string; // todo not optional
tableHeaderLabel!: string;
@ViewChild(CdkVirtualScrollViewport, { static: true }) readonly scrollViewport!: CdkVirtualScrollViewport;
constructor(