added syscreatedat in trustee
This commit is contained in:
parent
b76947d613
commit
c89d96c6b0
3 changed files with 18 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import { IconType } from 'react-icons';
|
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 type ButtonSize = 'sm' | 'md' | 'lg';
|
||||||
|
|
||||||
export interface BaseButtonProps {
|
export interface BaseButtonProps {
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,10 @@ export const TrusteeDocumentsView: React.FC = () => {
|
||||||
}
|
}
|
||||||
}, [instanceId]);
|
}, [instanceId]);
|
||||||
|
|
||||||
// Generate columns from attributes
|
const documentColumnOrder = ['sysCreatedAt'];
|
||||||
|
|
||||||
const columns = useMemo(() => {
|
const columns = useMemo(() => {
|
||||||
return (attributes || []).map(attr => ({
|
const allCols = (attributes || []).map(attr => ({
|
||||||
key: attr.name,
|
key: attr.name,
|
||||||
label: attr.label || attr.name,
|
label: attr.label || attr.name,
|
||||||
type: attr.type as any,
|
type: attr.type as any,
|
||||||
|
|
@ -70,6 +71,16 @@ export const TrusteeDocumentsView: React.FC = () => {
|
||||||
minWidth: attr.minWidth || 100,
|
minWidth: attr.minWidth || 100,
|
||||||
maxWidth: attr.maxWidth || 400,
|
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]);
|
}, [attributes]);
|
||||||
|
|
||||||
// Check permissions
|
// Check permissions
|
||||||
|
|
|
||||||
|
|
@ -257,12 +257,11 @@ export const TrusteePositionsView: React.FC = () => {
|
||||||
[syncByPosition]
|
[syncByPosition]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Desired column order: Belege (icons), Sync-Status, Erstellt am, Valuta, Tags, Company, then the rest
|
|
||||||
const positionColumnOrder = [
|
const positionColumnOrder = [
|
||||||
'_documentRefs', // Belege (download icons)
|
'sysCreatedAt',
|
||||||
'_syncStatus', // Sync-Status
|
'_documentRefs',
|
||||||
'sysCreatedAt', // Erstellt am
|
'_syncStatus',
|
||||||
'valuta', // Valuta date
|
'valuta',
|
||||||
'tags',
|
'tags',
|
||||||
'company',
|
'company',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue