fix: use server-side sorting for paginated tables
Some checks failed
CI / cleanup-branch (push) Has been skipped
CI / build (push) Failing after 1m10s
CI / docker (push) Has been skipped
CI / deploy (push) Has been skipped
CI / deploy-feature (push) Has been skipped

Upgrade @cameleer/design-system to v0.1.1 which adds onSortChange
callback to DataTable. Wire it up in Dashboard (exchanges), AuditLog,
and RouteDetail (recent executions) so sorting triggers a new API
request with sortField/sortDir instead of only sorting the current page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-24 17:05:06 +01:00
parent aa3d9f375b
commit 48455cd559
5 changed files with 39 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { useState, useMemo } from 'react';
import { useState, useMemo, useCallback } from 'react';
import { useParams, useNavigate, Link } from 'react-router';
import {
KpiStrip,
@@ -260,6 +260,13 @@ export default function RouteDetail() {
const timeTo = timeRange.end.toISOString();
const [activeTab, setActiveTab] = useState('performance');
const [recentSortField, setRecentSortField] = useState<string>('startTime');
const [recentSortDir, setRecentSortDir] = useState<'asc' | 'desc'>('desc');
const handleRecentSortChange = useCallback((key: string, dir: 'asc' | 'desc') => {
setRecentSortField(key);
setRecentSortDir(dir);
}, []);
// ── API queries ────────────────────────────────────────────────────────────
const { data: catalog } = useRouteCatalog();
@@ -272,6 +279,8 @@ export default function RouteDetail() {
timeTo,
routeId: routeId || undefined,
application: appId || undefined,
sortField: recentSortField,
sortDir: recentSortDir,
offset: 0,
limit: 50,
});
@@ -560,6 +569,7 @@ export default function RouteDetail() {
onRowClick={(row) => navigate(`/exchanges/${row.executionId}`)}
sortable
pageSize={20}
onSortChange={handleRecentSortChange}
/>
)}
</div>