diff --git a/lib/av_client/types.ts b/lib/av_client/types.ts index 701d63ae..ae085cbd 100644 --- a/lib/av_client/types.ts +++ b/lib/av_client/types.ts @@ -401,6 +401,7 @@ export interface ContestContent { identifiable?: boolean contestPositions?: ContestPositionMap blankOptionColor?: string + customRulesets?: string[] attachments?: Attachment[] } diff --git a/lib/validators/selectionPileValidator.ts b/lib/validators/selectionPileValidator.ts index 811a6ebc..c3c8a28a 100644 --- a/lib/validators/selectionPileValidator.ts +++ b/lib/validators/selectionPileValidator.ts @@ -17,9 +17,15 @@ class SelectionPileValidator { return errors; } + optionIsExclusive(optionReference: string) { + const current = this.contest.options.find(option => option.reference === optionReference); + return current?.exclusive; + } + isComplete(selectionPile: SelectionPile) { const enoughVotes = selectionPile.explicitBlank || + (selectionPile.optionSelections.length === 1 && this.optionIsExclusive(selectionPile.optionSelections[0].reference)) || this.implicitlyBlank(selectionPile.optionSelections) || !this.tooFewSelections(selectionPile.optionSelections); return enoughVotes && this.validate(selectionPile).length == 0; diff --git a/package.json b/package.json index a6fed7bb..1e7a6185 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "3.1.14", + "version": "3.1.15", "name": "@aion-dk/js-client", "license": "MIT", "description": "Assembly Voting JS client",