Skip to content

Commit 2d72338

Browse files
authored
Rename proposal expiration to threshold deadline (#2427)
Signed-off-by: fayi-da <fayimora.femibalogun@digitalasset.com>
1 parent 650c872 commit 2d72338

File tree

11 files changed

+51
-31
lines changed

11 files changed

+51
-31
lines changed

apps/sv/frontend/src/__tests__/governance/proposal-listing.test.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const inflightVoteRequests: ProposalListingData[] = [
1212
{
1313
actionName: 'Feature Application',
1414
contractId: '2abcde123456' as ContractId<VoteRequest>,
15-
votingCloses: '2025-09-25 11:00',
15+
votingThresholdDeadline: '2025-09-25 11:00',
1616
voteTakesEffect: '2025-09-26 11:00',
1717
yourVote: 'no-vote',
1818
status: 'In Progress',
@@ -22,7 +22,7 @@ const inflightVoteRequests: ProposalListingData[] = [
2222
{
2323
actionName: 'Set DSO Rules Configuration',
2424
contractId: 'bcde123456' as ContractId<VoteRequest>,
25-
votingCloses: '2025-09-25 11:00',
25+
votingThresholdDeadline: '2025-09-25 11:00',
2626
voteTakesEffect: '2025-09-26 11:00',
2727
yourVote: 'accepted',
2828
status: 'In Progress',
@@ -35,7 +35,7 @@ const voteHistory: ProposalListingData[] = [
3535
{
3636
actionName: 'Feature Application',
3737
contractId: '2abcde123456' as ContractId<VoteRequest>,
38-
votingCloses: '2025-09-25 11:00',
38+
votingThresholdDeadline: '2025-09-25 11:00',
3939
voteTakesEffect: '2025-09-26 11:00',
4040
yourVote: 'no-vote',
4141
status: 'Implemented',
@@ -45,7 +45,7 @@ const voteHistory: ProposalListingData[] = [
4545
{
4646
actionName: 'Set DSO Rules Configuration',
4747
contractId: '2bcde123456' as ContractId<VoteRequest>,
48-
votingCloses: '2025-09-25 11:00',
48+
votingThresholdDeadline: '2025-09-25 11:00',
4949
voteTakesEffect: '2025-09-26 11:00',
5050
yourVote: 'accepted',
5151
status: 'Rejected',
@@ -91,7 +91,7 @@ describe('Inflight Vote Requests', () => {
9191
const uniqueId = 'inflight-vote-request';
9292
const data = {
9393
actionName: 'Feature Application',
94-
votingCloses: '2025-09-25 11:00',
94+
votingThresholdDeadline: '2025-09-25 11:00',
9595
voteTakesEffect: '2025-09-26 11:00',
9696
yourVote: 'no-vote',
9797
status: 'In Progress',
@@ -107,6 +107,7 @@ describe('Inflight Vote Requests', () => {
107107
uniqueId={uniqueId}
108108
showVoteStats
109109
showAcceptanceThreshold
110+
showThresholdDeadline
110111
/>
111112
</MemoryRouter>
112113
);
@@ -117,8 +118,8 @@ describe('Inflight Vote Requests', () => {
117118
const action = screen.getByTestId(`${uniqueId}-row-action-name`);
118119
expect(action.textContent).toBe(data.actionName);
119120

120-
const votingCloses = screen.getByTestId(`${uniqueId}-row-voting-closes`);
121-
expect(votingCloses.textContent).toBe(data.votingCloses);
121+
const votingThresholdDeadline = screen.getByTestId(`${uniqueId}-row-voting-threshold-deadline`);
122+
expect(votingThresholdDeadline.textContent).toBe(data.votingThresholdDeadline);
122123

123124
const voteTakesEffect = screen.getByTestId(`${uniqueId}-row-vote-takes-effect`);
124125
expect(voteTakesEffect.textContent).toBe(data.voteTakesEffect);
@@ -140,7 +141,7 @@ describe('Inflight Vote Requests', () => {
140141
const uniqueId = 'inflight-vote-request';
141142
const data = {
142143
actionName: 'Feature Application',
143-
votingCloses: '2025-09-25 11:00',
144+
votingThresholdDeadline: '2025-09-25 11:00',
144145
voteTakesEffect: '2025-09-26 11:00',
145146
yourVote: 'accepted',
146147
status: 'In Progress',
@@ -170,7 +171,7 @@ describe('Inflight Vote Requests', () => {
170171
const uniqueId = 'inflight-vote-request';
171172
const data = {
172173
actionName: 'Feature Application',
173-
votingCloses: '2025-09-25 11:00',
174+
votingThresholdDeadline: '2025-09-25 11:00',
174175
voteTakesEffect: '2025-09-26 11:00',
175176
yourVote: 'rejected',
176177
status: 'In Progress',
@@ -246,7 +247,7 @@ describe('Vote history', () => {
246247
const uniqueId = 'vote-history';
247248
const data = {
248249
actionName: 'Feature Application',
249-
votingCloses: '2024-09-25 11:00',
250+
votingThresholdDeadline: '2024-09-25 11:00',
250251
voteTakesEffect: '2024-09-26 11:00',
251252
yourVote: 'no-vote',
252253
status: 'Implemented',
@@ -271,8 +272,8 @@ describe('Vote history', () => {
271272
const action = screen.getByTestId(`${uniqueId}-row-action-name`);
272273
expect(action.textContent).toBe(data.actionName);
273274

274-
const votingCloses = screen.getByTestId(`${uniqueId}-row-voting-closes`);
275-
expect(votingCloses.textContent).toBe(data.votingCloses);
275+
const votingCloses = screen.queryByTestId(`${uniqueId}-row-voting-threshold-deadline`);
276+
expect(votingCloses).toBeNull();
276277

277278
const voteTakesEffect = screen.getByTestId(`${uniqueId}-row-vote-takes-effect`);
278279
expect(voteTakesEffect.textContent).toBe(data.voteTakesEffect);

apps/sv/frontend/src/components/forms/GrantRevokeFeaturedAppForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export const GrantRevokeFeaturedAppForm: React.FC<GrantRevokeFeaturedAppFormProp
169169
>
170170
{field => (
171171
<field.DateField
172-
title="Vote Proposal Expiration"
172+
title="Threshold Deadline"
173173
description="This is the last day voters can vote on this proposal"
174174
id={`${testIdPrefix}-expiry-date`}
175175
/>

apps/sv/frontend/src/components/forms/OffboardSvForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const OffboardSvForm: React.FC = _ => {
130130
>
131131
{field => (
132132
<field.DateField
133-
title="Vote Proposal Expiration"
133+
title="Threshold Deadline"
134134
description="This is the last day voters can vote on this proposal"
135135
id="offboard-sv-expiry-date"
136136
/>

apps/sv/frontend/src/components/forms/SetAmuletConfigRulesForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export const SetAmuletConfigRulesForm: React.FC<SetAmuletConfigRulesFormProps> =
140140
<form.AppField name="common.expiryDate">
141141
{field => (
142142
<field.DateField
143-
title="Vote Proposal Expiration"
143+
title="Threshold Deadline"
144144
description="This is the last day voters can vote on this proposal"
145145
id="set-amulet-config-rules-expiry-date"
146146
/>

apps/sv/frontend/src/components/forms/SetDsoConfigRulesForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export const SetDsoConfigRulesForm: () => JSX.Element = () => {
215215
<form.AppField name="common.expiryDate">
216216
{field => (
217217
<field.DateField
218-
title="Vote Proposal Expiration"
218+
title="Threshold Deadline"
219219
description="This is the last day voters can vote on this proposal"
220220
id="set-dso-config-rules-expiry-date"
221221
/>

apps/sv/frontend/src/components/forms/UpdateSvRewardWeightForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const UpdateSvRewardWeightForm: React.FC = _ => {
146146
>
147147
{field => (
148148
<field.DateField
149-
title="Vote Proposal Expiration"
149+
title="Threshold Deadline"
150150
description="This is the last day voters can vote on this proposal"
151151
id="update-sv-reward-weight-expiry-date"
152152
/>

apps/sv/frontend/src/components/governance/ActionRequiredSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const ActionCard = (props: ActionCardProps) => {
109109
<Grid xs={2}>
110110
<Box>
111111
<Typography variant="subtitle2" color="text.secondary" gutterBottom>
112-
VOTING CLOSES
112+
THRESHOLD DEADLINE
113113
</Typography>
114114
<Typography
115115
variant="body1"

apps/sv/frontend/src/components/governance/ProposalDetailsContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export const ProposalDetailsContent: React.FC<ProposalDetailsContentProps> = pro
194194

195195
<Box sx={{ py: 1 }}>
196196
<Typography variant="subtitle2" color="text.secondary" gutterBottom>
197-
Voting Expires At
197+
Threshold Deadline
198198
</Typography>
199199
<Typography
200200
variant="body1"

apps/sv/frontend/src/components/governance/ProposalListingSection.tsx

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
import {
45
Box,
56
Typography,
@@ -25,14 +26,22 @@ interface ProposalListingSectionProps {
2526
sectionTitle: string;
2627
data: ProposalListingData[];
2728
uniqueId: string;
29+
showThresholdDeadline?: boolean;
2830
showVoteStats?: boolean;
2931
showAcceptanceThreshold?: boolean;
3032
showStatus?: boolean;
3133
}
3234

3335
export const ProposalListingSection: React.FC<ProposalListingSectionProps> = props => {
34-
const { sectionTitle, data, uniqueId, showVoteStats, showAcceptanceThreshold, showStatus } =
35-
props;
36+
const {
37+
sectionTitle,
38+
data,
39+
uniqueId,
40+
showThresholdDeadline,
41+
showVoteStats,
42+
showAcceptanceThreshold,
43+
showStatus,
44+
} = props;
3645

3746
return (
3847
<Box sx={{ mb: 6 }} data-testid={`${uniqueId}-section`}>
@@ -49,9 +58,11 @@ export const ProposalListingSection: React.FC<ProposalListingSectionProps> = pro
4958
<Table>
5059
<TableHead>
5160
<TableRow>
52-
<TableCell sx={{ width: '25%' }}>Action</TableCell>
53-
<TableCell sx={{ width: '15%' }}>Voting Closes At</TableCell>
54-
<TableCell sx={{ width: '15%' }}>Takes Effect</TableCell>
61+
<TableCell sx={{ width: '15%' }}>Action</TableCell>
62+
{showThresholdDeadline && (
63+
<TableCell sx={{ width: '15%' }}>Threshold Deadline</TableCell>
64+
)}
65+
<TableCell sx={{ width: '15%' }}>Effect At</TableCell>
5566

5667
{showVoteStats && <TableCell sx={{ width: '20%' }}>Votes</TableCell>}
5768
{showAcceptanceThreshold && (
@@ -70,14 +81,15 @@ export const ProposalListingSection: React.FC<ProposalListingSectionProps> = pro
7081
actionName={vote.actionName}
7182
contractId={vote.contractId}
7283
uniqueId={uniqueId}
73-
votingCloses={vote.votingCloses}
84+
votingThresholdDeadline={vote.votingThresholdDeadline}
7485
voteTakesEffect={vote.voteTakesEffect}
7586
yourVote={vote.yourVote}
7687
status={vote.status}
7788
voteStats={vote.voteStats}
7889
acceptanceThreshold={vote.acceptanceThreshold}
7990
showVoteStats={showVoteStats}
8091
showAcceptanceThreshold={showAcceptanceThreshold}
92+
showThresholdDeadline={showThresholdDeadline}
8193
showStatus={showStatus}
8294
/>
8395
))}
@@ -97,8 +109,9 @@ interface VoteRowProps {
97109
uniqueId: string;
98110
voteStats: Record<YourVoteStatus, number>;
99111
voteTakesEffect: string;
100-
votingCloses: string;
112+
votingThresholdDeadline: string;
101113
yourVote: YourVoteStatus;
114+
showThresholdDeadline?: boolean;
102115
showAcceptanceThreshold?: boolean;
103116
showStatus?: boolean;
104117
showVoteStats?: boolean;
@@ -113,8 +126,9 @@ const VoteRow: React.FC<VoteRowProps> = props => {
113126
uniqueId,
114127
voteStats,
115128
voteTakesEffect,
116-
votingCloses,
129+
votingThresholdDeadline,
117130
yourVote,
131+
showThresholdDeadline,
118132
showAcceptanceThreshold,
119133
showStatus,
120134
showVoteStats,
@@ -123,7 +137,11 @@ const VoteRow: React.FC<VoteRowProps> = props => {
123137
return (
124138
<TableRow data-testid={`${uniqueId}-row`}>
125139
<TableCell data-testid={`${uniqueId}-row-action-name`}>{actionName}</TableCell>
126-
<TableCell data-testid={`${uniqueId}-row-voting-closes`}>{votingCloses}</TableCell>
140+
{showThresholdDeadline && (
141+
<TableCell data-testid={`${uniqueId}-row-voting-threshold-deadline`}>
142+
{votingThresholdDeadline}
143+
</TableCell>
144+
)}
127145
<TableCell data-testid={`${uniqueId}-row-vote-takes-effect`}>{voteTakesEffect}</TableCell>
128146

129147
{showVoteStats && (

apps/sv/frontend/src/routes/governance.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export const Governance: React.FC = () => {
119119
return {
120120
contractId: v.payload.trackingCid || v.contractId,
121121
actionName: actionTagToTitle(amuletName)[getAction(v.payload.action) as SupportedActionTag],
122-
votingCloses: dayjs(v.payload.voteBefore).format(dateTimeFormatISO),
122+
votingThresholdDeadline: dayjs(v.payload.voteBefore).format(dateTimeFormatISO),
123123
voteTakesEffect: effectiveAt,
124124
yourVote: computeYourVote(votes, svPartyId),
125125
status: 'In Progress',
@@ -146,7 +146,7 @@ export const Governance: React.FC = () => {
146146
contractId: vr.request.trackingCid,
147147
actionName:
148148
actionTagToTitle(amuletName)[getAction(vr.request.action) as SupportedActionTag],
149-
votingCloses: dayjs(vr.request.voteBefore).format(dateTimeFormatISO),
149+
votingThresholdDeadline: dayjs(vr.request.voteBefore).format(dateTimeFormatISO),
150150
voteTakesEffect:
151151
(vr.outcome.tag === 'VRO_Accepted' &&
152152
dayjs(vr.outcome.value.effectiveAt).format(dateTimeFormatISO)) ||
@@ -178,6 +178,7 @@ export const Governance: React.FC = () => {
178178
uniqueId="inflight-vote-requests"
179179
showVoteStats
180180
showAcceptanceThreshold
181+
showThresholdDeadline
181182
/>
182183

183184
<ProposalListingSection

0 commit comments

Comments
 (0)