mirror of
https://github.com/siv-org/siv.git
synced 2026-05-03 03:00:59 -04:00
results: <DecryptedVotes /> respect type: 'ranked-choice-irv'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { orderBy } from 'lodash-es'
|
||||
import { flatten } from 'lodash-es'
|
||||
import { defaultRankingsAllowed } from 'src/vote/RankedChoiceItem'
|
||||
|
||||
import { unTruncateSelection } from './un-truncate-selection'
|
||||
import { useDecryptedVotes } from './use-decrypted-votes'
|
||||
@@ -14,11 +15,13 @@ export const DecryptedVotes = ({ proofsPage }: { proofsPage?: boolean }): JSX.El
|
||||
const sorted_votes = orderBy(votes, 'tracking')
|
||||
|
||||
const columns = flatten(
|
||||
ballot_design.map(({ id, multiple_votes_allowed }) => {
|
||||
return multiple_votes_allowed
|
||||
? new Array(multiple_votes_allowed).fill('').map((_, index) => `${id || 'vote'}_${index + 1}`)
|
||||
: id || 'vote'
|
||||
}),
|
||||
ballot_design?.map(({ id, multiple_votes_allowed, type }) =>
|
||||
multiple_votes_allowed || type === 'ranked-choice-irv'
|
||||
? new Array(multiple_votes_allowed || defaultRankingsAllowed)
|
||||
.fill('')
|
||||
.map((_, index) => `${id || 'vote'}_${index + 1}`)
|
||||
: id || 'vote',
|
||||
),
|
||||
)
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user