Skip to content

Commit

Permalink
VTAdmin: Order the transactions by time_created
Browse files Browse the repository at this point in the history
Signed-off-by: Noble Mittal <[email protected]>
  • Loading branch information
beingnoble03 committed Sep 19, 2024
1 parent 12e4698 commit 9d47262
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/vtadmin/src/components/routes/Transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { FetchTransactionsParams } from '../../api/http';
import { formatTransactionState } from '../../util/transactions';
import { ShardLink } from '../links/ShardLink';
import { formatDateTime, formatRelativeTime } from '../../util/time';
import { orderBy } from 'lodash-es';

const COLUMNS = ['ID', 'State', 'Participants', 'Time Created'];

Expand All @@ -48,7 +49,8 @@ export const Transactions = () => {
enabled: !!params.keyspace,
});

const transactions = (transactionsQuery.data && transactionsQuery.data.transactions) || [];
const transactions =
(transactionsQuery.data && orderBy(transactionsQuery.data.transactions, ['time_created'], 'asc')) || [];

const renderRows = (rows: query.ITransactionMetadata[]) => {
return rows.map((row) => {
Expand Down

0 comments on commit 9d47262

Please sign in to comment.