Skip to content

Commit 67b46a7

Browse files
committed
fix table row routing [ci]
Signed-off-by: Paweł Perek <[email protected]>
1 parent 2429b61 commit 67b46a7

File tree

1 file changed

+50
-47
lines changed

1 file changed

+50
-47
lines changed

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

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
1717
import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined';
1818
import { VoteRequest } from '@daml.js/splice-dso-governance/lib/Splice/DsoRules';
1919
import { ContractId } from '@daml/types';
20+
import { Link as RouterLink } from 'react-router-dom';
2021
import { PageSectionHeader } from '../../components/beta';
2122
import { ProposalListingData, ProposalListingStatus, YourVoteStatus } from '../../utils/types';
2223

@@ -125,7 +126,7 @@ const VoteRow: React.FC<VoteRowProps> = props => {
125126
const {
126127
acceptanceThreshold,
127128
actionName,
128-
// contractId,
129+
contractId,
129130
status,
130131
uniqueId,
131132
voteStats,
@@ -147,55 +148,57 @@ const VoteRow: React.FC<VoteRowProps> = props => {
147148
);
148149

149150
return (
150-
<TableRow
151-
sx={{
152-
display: 'grid',
153-
gridTemplateColumns: `repeat(${columnsCount}, 1fr)`,
154-
alignItems: 'center',
155-
borderRadius: '4px',
156-
border: '1px solid #4F4F4F',
157-
paddingBlock: '10px',
158-
}}
159-
data-testid={`${uniqueId}-row`}
160-
>
161-
<TableCell data-testid={`${uniqueId}-row-action-name`}>
162-
<TableBodyTypography>{actionName}</TableBodyTypography>
163-
</TableCell>
164-
{showThresholdDeadline && (
165-
<TableCell data-testid={`${uniqueId}-row-voting-threshold-deadline`}>
166-
<TableBodyTypography>{votingThresholdDeadline}</TableBodyTypography>
151+
<RouterLink to={`/governance-beta/proposals/${contractId}`} style={{ textDecoration: 'none' }}>
152+
<TableRow
153+
sx={{
154+
display: 'grid',
155+
gridTemplateColumns: `repeat(${columnsCount}, 1fr)`,
156+
alignItems: 'center',
157+
borderRadius: '4px',
158+
border: '1px solid #4F4F4F',
159+
paddingBlock: '10px',
160+
}}
161+
data-testid={`${uniqueId}-row`}
162+
>
163+
<TableCell data-testid={`${uniqueId}-row-action-name`}>
164+
<TableBodyTypography>{actionName}</TableBodyTypography>
167165
</TableCell>
168-
)}
169-
<TableCell data-testid={`${uniqueId}-row-vote-takes-effect`}>
170-
<TableBodyTypography>{voteTakesEffect}</TableBodyTypography>
171-
</TableCell>
172-
173-
{showStatus && (
174-
<TableCell data-testid={`${uniqueId}-row-status`}>
175-
<TableBodyTypography>{status}</TableBodyTypography>
166+
{showThresholdDeadline && (
167+
<TableCell data-testid={`${uniqueId}-row-voting-threshold-deadline`}>
168+
<TableBodyTypography>{votingThresholdDeadline}</TableBodyTypography>
169+
</TableCell>
170+
)}
171+
<TableCell data-testid={`${uniqueId}-row-vote-takes-effect`}>
172+
<TableBodyTypography>{voteTakesEffect}</TableBodyTypography>
176173
</TableCell>
177-
)}
178-
{showVoteStats && (
179-
<TableCell data-testid={`${uniqueId}-row-all-votes`}>
180-
<TableBodyTypography>
181-
<AllVotes
182-
acceptedVotes={voteStats['accepted']}
183-
rejectedVotes={voteStats['rejected']}
184-
data-testid={`${uniqueId}-row-all-votes-stats`}
185-
/>
186-
</TableBodyTypography>
187-
</TableCell>
188-
)}
189-
{showAcceptanceThreshold && (
190-
<TableCell data-testid={`${uniqueId}-row-acceptance-threshold`}>
191-
<TableBodyTypography>{acceptanceThreshold.toString()}</TableBodyTypography>
192-
</TableCell>
193-
)}
194174

195-
<TableCell data-testid={`${uniqueId}-row-your-vote`}>
196-
<VoteStats vote={yourVote} data-testid={`${uniqueId}-row-your-vote-stats`} />
197-
</TableCell>
198-
</TableRow>
175+
{showStatus && (
176+
<TableCell data-testid={`${uniqueId}-row-status`}>
177+
<TableBodyTypography>{status}</TableBodyTypography>
178+
</TableCell>
179+
)}
180+
{showVoteStats && (
181+
<TableCell data-testid={`${uniqueId}-row-all-votes`}>
182+
<TableBodyTypography>
183+
<AllVotes
184+
acceptedVotes={voteStats['accepted']}
185+
rejectedVotes={voteStats['rejected']}
186+
data-testid={`${uniqueId}-row-all-votes-stats`}
187+
/>
188+
</TableBodyTypography>
189+
</TableCell>
190+
)}
191+
{showAcceptanceThreshold && (
192+
<TableCell data-testid={`${uniqueId}-row-acceptance-threshold`}>
193+
<TableBodyTypography>{acceptanceThreshold.toString()}</TableBodyTypography>
194+
</TableCell>
195+
)}
196+
197+
<TableCell data-testid={`${uniqueId}-row-your-vote`}>
198+
<VoteStats vote={yourVote} data-testid={`${uniqueId}-row-your-vote-stats`} />
199+
</TableCell>
200+
</TableRow>
201+
</RouterLink>
199202
);
200203
};
201204

0 commit comments

Comments
 (0)