added syscreatedat in trustee

This commit is contained in:
ValueOn AG 2026-04-14 00:22:01 +02:00
parent b76947d613
commit c89d96c6b0
3 changed files with 18 additions and 8 deletions

View file

@ -1,6 +1,6 @@
import { IconType } from 'react-icons';
export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'success' | 'warning';
export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'ghost';
export type ButtonSize = 'sm' | 'md' | 'lg';
export interface BaseButtonProps {

View file

@ -57,9 +57,10 @@ export const TrusteeDocumentsView: React.FC = () => {
}
}, [instanceId]);
// Generate columns from attributes
const documentColumnOrder = ['sysCreatedAt'];
const columns = useMemo(() => {
return (attributes || []).map(attr => ({
const allCols = (attributes || []).map(attr => ({
key: attr.name,
label: attr.label || attr.name,
type: attr.type as any,
@ -70,6 +71,16 @@ export const TrusteeDocumentsView: React.FC = () => {
minWidth: attr.minWidth || 100,
maxWidth: attr.maxWidth || 400,
}));
const byKey = new Map(allCols.map(c => [c.key, c]));
const ordered: typeof allCols = [];
for (const key of documentColumnOrder) {
const col = byKey.get(key);
if (col) { ordered.push(col); byKey.delete(key); }
}
for (const col of allCols) {
if (byKey.has(col.key)) ordered.push(col);
}
return ordered;
}, [attributes]);
// Check permissions

View file

@ -257,12 +257,11 @@ export const TrusteePositionsView: React.FC = () => {
[syncByPosition]
);
// Desired column order: Belege (icons), Sync-Status, Erstellt am, Valuta, Tags, Company, then the rest
const positionColumnOrder = [
'_documentRefs', // Belege (download icons)
'_syncStatus', // Sync-Status
'sysCreatedAt', // Erstellt am
'valuta', // Valuta date
'sysCreatedAt',
'_documentRefs',
'_syncStatus',
'valuta',
'tags',
'company',
];