fixes sync and ai tree

This commit is contained in:
ValueOn AG 2026-02-22 22:34:14 +01:00
parent 843b481c36
commit be8757e15e
3 changed files with 5 additions and 3 deletions

View file

@ -195,7 +195,7 @@ export function FormGeneratorTable<T extends Record<string, any>>({
actionButtons = [],
customActions = [],
onDelete,
onDeleteMultiple,
onDeleteMultiple: onDeleteMultipleProp,
batchActions = [],
onRefresh,
className = '',
@ -210,6 +210,8 @@ export function FormGeneratorTable<T extends Record<string, any>>({
groupActions
}: FormGeneratorTableProps<T>) {
const { t, currentLanguage: contextLanguage } = useLanguage();
// When only onDelete is provided, use it for multi-delete too so Delete stays visible with 2+ selected
const onDeleteMultiple = onDeleteMultipleProp ?? (onDelete ? (rows: T[]) => rows.forEach((r) => onDelete(r)) : undefined);
// Map frontend language codes (de/en/fr) to backend codes (ge/en/fr) for multilingual field resolution
const currentLanguage = useMemo(() => {
const langMap: Record<string, string> = { 'de': 'ge', 'en': 'en', 'fr': 'fr', 'it': 'it' };

View file

@ -235,7 +235,7 @@ export const TrusteeDocumentsView: React.FC = () => {
searchable={true}
filterable={true}
sortable={true}
selectable={false}
selectable={true}
actionButtons={[
...(canUpdate ? [{
type: 'edit' as const,

View file

@ -458,7 +458,7 @@ export const TrusteePositionsView: React.FC = () => {
batchActions={[
{
label: 'Buchhaltung synchronisieren',
icon: <FaSync />,
icon: FaSync,
loading: syncingPositionIds.size > 0,
onClick: handleBatchSyncToAccounting,
},