From bf73559c301ae74c8319dc0e6597e80d7b9ae4b9 Mon Sep 17 00:00:00 2001 From: Sam Keen Date: Thu, 11 May 2023 13:39:30 +0100 Subject: [PATCH] fix(governance): change proposal sort order (#3716) --- .../components/proposals-list/proposals-list.spec.tsx | 4 ---- .../src/routes/proposals/proposals/proposals-container.tsx | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/governance/src/routes/proposals/components/proposals-list/proposals-list.spec.tsx b/apps/governance/src/routes/proposals/components/proposals-list/proposals-list.spec.tsx index 6a37b4e72..2016f0633 100644 --- a/apps/governance/src/routes/proposals/components/proposals-list/proposals-list.spec.tsx +++ b/apps/governance/src/routes/proposals/components/proposals-list/proposals-list.spec.tsx @@ -24,7 +24,6 @@ const openProposalClosesNextMonth = generateProposal({ }, terms: { closingDatetime: nextMonth.toString(), - enactmentDatetime: nextMonth.toString(), }, }); @@ -36,7 +35,6 @@ const openProposalClosesNextWeek = generateProposal({ }, terms: { closingDatetime: nextWeek.toString(), - enactmentDatetime: nextWeek.toString(), }, }); @@ -45,7 +43,6 @@ const enactedProposalClosedLastWeek = generateProposal({ state: ProposalState.STATE_ENACTED, terms: { closingDatetime: lastWeek.toString(), - enactmentDatetime: lastWeek.toString(), }, }); @@ -54,7 +51,6 @@ const failedProposalClosedLastMonth = generateProposal({ state: ProposalState.STATE_FAILED, terms: { closingDatetime: lastMonth.toString(), - enactmentDatetime: lastMonth.toString(), }, }); diff --git a/apps/governance/src/routes/proposals/proposals/proposals-container.tsx b/apps/governance/src/routes/proposals/proposals/proposals-container.tsx index 7d63a91f2..29b289d27 100644 --- a/apps/governance/src/routes/proposals/proposals/proposals-container.tsx +++ b/apps/governance/src/routes/proposals/proposals/proposals-container.tsx @@ -20,8 +20,11 @@ import { useProtocolUpgradeProposalsQuery } from '@vegaprotocol/proposals'; const orderByDate = (arr: ProposalFieldsFragment[]) => orderBy( arr, - [(p) => new Date(p?.terms?.closingDatetime).getTime(), (p) => p.id], - ['desc', 'desc'] + [ + (p) => new Date(p?.terms?.closingDatetime).getTime(), + (p) => new Date(p?.datetime).getTime(), + ], + ['asc', 'asc'] ); const orderByUpgradeBlockHeight = (