Add entity title function
This commit is contained in:
parent
73da299aaf
commit
eb1461a8a3
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
<tb-details-panel fxFlex
|
<tb-details-panel fxFlex
|
||||||
[headerTitle]="entity?.name"
|
[headerTitle]="entitiesTableConfig.entityTitle(entity)"
|
||||||
headerSubtitle="{{ translations.details | translate }}"
|
headerSubtitle="{{ translations.details | translate }}"
|
||||||
[isReadOnly]="entitiesTableConfig.detailsReadonly(entity)"
|
[isReadOnly]="entitiesTableConfig.detailsReadonly(entity)"
|
||||||
[isEdit]="isEditValue"
|
[isEdit]="isEditValue"
|
||||||
|
|||||||
@ -163,6 +163,7 @@ export class EntityTableConfig<T extends BaseData<HasId>, P extends PageLink = P
|
|||||||
deleteEntity: EntityIdOneWayOperation = () => of();
|
deleteEntity: EntityIdOneWayOperation = () => of();
|
||||||
entitiesFetchFunction: EntitiesFetchFunction<T, P> = () => of(emptyPageData<T>());
|
entitiesFetchFunction: EntitiesFetchFunction<T, P> = () => of(emptyPageData<T>());
|
||||||
onEntityAction: EntityActionFunction<T> = () => false;
|
onEntityAction: EntityActionFunction<T> = () => false;
|
||||||
|
entityTitle: EntityStringFunction<T> = (entity) => entity?.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function checkBoxCell(value: boolean): string {
|
export function checkBoxCell(value: boolean): string {
|
||||||
|
|||||||
@ -56,6 +56,9 @@ export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableCon
|
|||||||
this.config.entityTranslations = entityTypeTranslations.get(EntityType.WIDGETS_BUNDLE);
|
this.config.entityTranslations = entityTypeTranslations.get(EntityType.WIDGETS_BUNDLE);
|
||||||
this.config.entityResources = entityTypeResources.get(EntityType.WIDGETS_BUNDLE);
|
this.config.entityResources = entityTypeResources.get(EntityType.WIDGETS_BUNDLE);
|
||||||
|
|
||||||
|
this.config.entityTitle = (widgetsBundle) => widgetsBundle ?
|
||||||
|
widgetsBundle.title : '';
|
||||||
|
|
||||||
this.config.columns.push(
|
this.config.columns.push(
|
||||||
new DateEntityTableColumn<WidgetsBundle>('createdTime', 'common.created-time', this.datePipe, '150px'),
|
new DateEntityTableColumn<WidgetsBundle>('createdTime', 'common.created-time', this.datePipe, '150px'),
|
||||||
new EntityTableColumn<WidgetsBundle>('title', 'widgets-bundle.title', '100%'),
|
new EntityTableColumn<WidgetsBundle>('title', 'widgets-bundle.title', '100%'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user