feat: add file upload and management features; enhance pagination and permissions handling
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 5m43s
Workflow / ⚫️ Test (push) Has been skipped

This commit is contained in:
T. Zehetbauer
2026-04-01 20:13:15 +02:00
parent db4e19c3af
commit bbb33aa63d
39 changed files with 2858 additions and 99 deletions

View File

@@ -2,6 +2,8 @@
import { useState } from 'react';
import { Button } from '@kit/ui/button';
import type { CmsFieldType } from '../schema/module.schema';
import { FieldRenderer } from './field-renderer';
@@ -114,13 +116,13 @@ export function ModuleForm({
))}
<div className="flex justify-end gap-2 border-t pt-4">
<button
<Button
type="submit"
disabled={isLoading}
className="bg-primary text-primary-foreground hover:bg-primary/90 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50"
data-test="module-record-submit-btn"
>
{isLoading ? 'Wird gespeichert...' : 'Speichern'}
</button>
</Button>
</div>
</form>
);

View File

@@ -1,5 +1,7 @@
'use client';
import { useTranslations } from 'next-intl';
import { formatDate } from '@kit/shared/dates';
import type { CmsFieldType } from '../schema/module.schema';
@@ -56,6 +58,7 @@ export function ModuleTable({
onSelectionChange,
currentSort,
}: ModuleTableProps) {
const t = useTranslations('cms.modules');
const visibleFields = fields
.filter((f) => f.show_in_table)
.sort((a, b) => a.sort_order - b.sort_order);
@@ -137,7 +140,7 @@ export function ModuleTable({
colSpan={visibleFields.length + (onSelectionChange ? 1 : 0)}
className="text-muted-foreground p-8 text-center"
>
Keine Datensätze gefunden
{t('noRecords')}
</td>
</tr>
) : (
@@ -183,8 +186,11 @@ export function ModuleTable({
{pagination.totalPages > 1 && (
<div className="flex items-center justify-between px-2">
<span className="text-muted-foreground text-sm">
{pagination.total} Datensätze Seite {pagination.page} von{' '}
{pagination.totalPages}
{t('paginationSummary', {
total: pagination.total,
page: pagination.page,
totalPages: pagination.totalPages,
})}
</span>
<div className="flex gap-1">
<button
@@ -192,14 +198,14 @@ export function ModuleTable({
disabled={pagination.page <= 1}
className="hover:bg-muted rounded border px-3 py-1 text-sm disabled:opacity-50"
>
Zurück
{t('paginationPrevious')}
</button>
<button
onClick={() => onPageChange(pagination.page + 1)}
disabled={pagination.page >= pagination.totalPages}
className="hover:bg-muted rounded border px-3 py-1 text-sm disabled:opacity-50"
>
Weiter
{t('paginationNext')}
</button>
</div>
</div>