diff --git a/src/components/UiComponents/Button/ButtonTypes.ts b/src/components/UiComponents/Button/ButtonTypes.ts index 3bee1ee..3458cf0 100644 --- a/src/components/UiComponents/Button/ButtonTypes.ts +++ b/src/components/UiComponents/Button/ButtonTypes.ts @@ -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 { diff --git a/src/pages/views/trustee/TrusteeDocumentsView.tsx b/src/pages/views/trustee/TrusteeDocumentsView.tsx index f1ab67b..2e52944 100644 --- a/src/pages/views/trustee/TrusteeDocumentsView.tsx +++ b/src/pages/views/trustee/TrusteeDocumentsView.tsx @@ -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 diff --git a/src/pages/views/trustee/TrusteePositionsView.tsx b/src/pages/views/trustee/TrusteePositionsView.tsx index fec99a0..3d6f192 100644 --- a/src/pages/views/trustee/TrusteePositionsView.tsx +++ b/src/pages/views/trustee/TrusteePositionsView.tsx @@ -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', ];