feat(admin): E2E CRUD/i18n polish, IFT smoke workflow, fix edit payload wiping id. Refs EventHub/EventHubFrontAdmin#33 #37 #38 #39

This commit is contained in:
2026-07-14 23:34:31 +03:00
parent 836e4a7eea
commit 607209b35f
16 changed files with 345 additions and 128 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ export function DenseRowList<TParams extends ServerTableParams>({
</button>
{item.actions && item.actions.length > 0 && (
<div className="shrink-0 pt-0.5" onClick={(e) => e.stopPropagation()}>
<RowActionsMenu actions={item.actions} />
<RowActionsMenu
actions={item.actions}
data-testid={`row-actions-${item.id}`}
/>
</div>
)}
</div>
@@ -20,6 +20,7 @@ export function ExploreViewToggle({ value, onChange, className }: ExploreViewTog
>
<Button
type="button"
data-testid="view-table"
variant={value === 'table' ? 'secondary' : 'ghost'}
size="sm"
className="h-8 gap-1.5 px-2.5"
@@ -31,6 +32,7 @@ export function ExploreViewToggle({ value, onChange, className }: ExploreViewTog
</Button>
<Button
type="button"
data-testid="view-rows"
variant={value === 'rows' ? 'secondary' : 'ghost'}
size="sm"
className="h-8 gap-1.5 px-2.5"
+11 -3
View File
@@ -23,9 +23,10 @@ export interface RowAction {
interface RowActionsMenuProps {
actions: RowAction[];
label?: string;
'data-testid'?: string;
}
export function RowActionsMenu({ actions, label }: RowActionsMenuProps) {
export function RowActionsMenu({ actions, label, 'data-testid': dataTestId }: RowActionsMenuProps) {
const { t } = useTranslation();
const menuLabel = label ?? t('common.actions');
if (actions.length === 0) return null;
@@ -33,11 +34,18 @@ export function RowActionsMenu({ actions, label }: RowActionsMenuProps) {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon" className="h-8 w-8" aria-label={menuLabel} title={menuLabel}>
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
aria-label={menuLabel}
title={menuLabel}
data-testid={dataTestId}
>
<MoreHorizontal className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-48">
<DropdownMenuContent align="end" className="w-48" data-testid={dataTestId ? `${dataTestId}-menu` : undefined}>
{actions.map((action) => (
<Fragment key={action.label}>
{action.separatorBefore && <DropdownMenuSeparator />}