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 = [], actionButtons = [],
customActions = [], customActions = [],
onDelete, onDelete,
onDeleteMultiple, onDeleteMultiple: onDeleteMultipleProp,
batchActions = [], batchActions = [],
onRefresh, onRefresh,
className = '', className = '',
@ -210,6 +210,8 @@ export function FormGeneratorTable<T extends Record<string, any>>({
groupActions groupActions
}: FormGeneratorTableProps<T>) { }: FormGeneratorTableProps<T>) {
const { t, currentLanguage: contextLanguage } = useLanguage(); 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 // Map frontend language codes (de/en/fr) to backend codes (ge/en/fr) for multilingual field resolution
const currentLanguage = useMemo(() => { const currentLanguage = useMemo(() => {
const langMap: Record<string, string> = { 'de': 'ge', 'en': 'en', 'fr': 'fr', 'it': 'it' }; 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} searchable={true}
filterable={true} filterable={true}
sortable={true} sortable={true}
selectable={false} selectable={true}
actionButtons={[ actionButtons={[
...(canUpdate ? [{ ...(canUpdate ? [{
type: 'edit' as const, type: 'edit' as const,

View file

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