fixes sync and ai tree
This commit is contained in:
parent
843b481c36
commit
be8757e15e
3 changed files with 5 additions and 3 deletions
|
|
@ -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' };
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue