@@ -37,10 +37,10 @@
@if (column.valueCell) {
@if (typeof column.valueCell === 'boolean') {
- {{ resolveValue(item, column) }}
+
} @else {
@if (!column.valueCell.component) {
- {{ resolveValue(item, column, column.valueCell) }}
+
} @else {
diff --git a/admin/src/app/components/generic-table/generic-table.ts b/admin/src/app/components/generic-table/generic-table.ts
index 4fafb71..9e74298 100644
--- a/admin/src/app/components/generic-table/generic-table.ts
+++ b/admin/src/app/components/generic-table/generic-table.ts
@@ -8,11 +8,12 @@ import { DomSanitizer } from '@angular/platform-browser';
import { GenericTableConfig } from './generic-table.config';
import { startWith, switchMap } from 'rxjs/operators';
import { GenericTableSearchForm } from './generic-table-search-form/generic-table-search-form';
+import { SafeHtmlPipe } from '../../pipes/safe-html-pipe';
@Component({
selector: 'app-generic-table',
templateUrl: './generic-table.html',
- imports: [NgClass, AsyncPipe, NgComponentOutlet, GenericTableSearchForm],
+ imports: [NgClass, AsyncPipe, NgComponentOutlet, GenericTableSearchForm, SafeHtmlPipe],
standalone: true,
})
export class GenericTable implements OnInit {
@@ -68,7 +69,7 @@ export class GenericTable implements OnInit {
if (cell.componentInputs) {
return cell.componentInputs(item);
}
- return { data: item }; // Default input
+ return { item }; // Default input
}
getAsHtml(str: string) {
diff --git a/admin/src/app/features/event-type/components/event-type-table/event-type-table.component.html b/admin/src/app/features/event-type/components/event-type-table/event-type-table.component.html
index ddd007c..927a37d 100644
--- a/admin/src/app/features/event-type/components/event-type-table/event-type-table.component.html
+++ b/admin/src/app/features/event-type/components/event-type-table/event-type-table.component.html
@@ -3,9 +3,9 @@
- EventTypes (Generic Table)
+ Esemény típusok
Create New
-
\ No newline at end of file
+
diff --git a/admin/src/app/features/event-type/components/event-type-table/event-type-table.component.ts b/admin/src/app/features/event-type/components/event-type-table/event-type-table.component.ts
index e3c6ab3..f67cc4f 100644
--- a/admin/src/app/features/event-type/components/event-type-table/event-type-table.component.ts
+++ b/admin/src/app/features/event-type/components/event-type-table/event-type-table.component.ts
@@ -15,6 +15,7 @@ import {
import { EventTypeService } from '../../services/event-type.service';
import { BehaviorSubject } from 'rxjs';
import { SvgIcons } from '../../../../svg-icons';
+import { ColorView } from '../../../../components/color-view/color-view';
@Component({
selector: 'app-event-type-table',
@@ -60,42 +61,52 @@ export class EventTypeTableComponent implements OnInit {
{
attribute: 'name',
headerCell: true,
- valueCell: true,
+ valueCell: {
+ styleClass: ctx => 'w-[1%]',
+ value: item => item?.name,
+ },
},
{
attribute: 'description',
headerCell: true,
valueCell: {
- styleClass: ctx => 'w-auto',
value: item => item?.description,
},
},
{
attribute: 'color',
headerCell: true,
- valueCell: true,
+ valueCell: {
+ styleClass: ctx => 'w-[1%]',
+ value: item => item?.color,
+ component: ColorView,
+ componentInputs: item => {
+ return { color: item?.color };
+ }
+ },
},
{
attribute: 'actions',
headerCell: { value: 'Actions' },
valueCell: {
+ styleClass: ctx => 'w-[1%]',
component: GenericActionColumn,
componentInputs: item => ({
item: item,
actions: [
- { action: 'view', text: false, handler: actionHandler, svgIcon: SvgIcons.heroDocument },
+ { action: 'view', title: 'Részletek', text: false, handler: actionHandler, svgIcon: SvgIcons.heroDocument },
{
- action: 'edit', text: false,
+ action: 'edit', title: 'Szerkesztés', text: false,
svgIcon: SvgIcons.heroCog6Tooth,
handler: actionHandler,
},
- { action: 'delete', text: false, handler: actionHandler, svgIcon: SvgIcons.heroTrash },
+ { action: 'delete', title: 'Törlés', text: false, handler: actionHandler, svgIcon: SvgIcons.heroTrash },
] as ActionDefinition[],
}),
},
},
] as ColumnDefinition[],
- tableCssClass: 'event-type-table-container',
+ tableCssClass: 'event-type-table-container w-full',
};
}
|