vocdoni / ui-components

Vocdoni UI components libs
GNU General Public License v3.0
3 stars 2 forks source link

Delete abstain option #162

Closed selankon closed 4 months ago

selankon commented 4 months ago

Abstain option and badge are not shown anymore.

Instead, if abstain is possible, you can just continue selecting only zero or n options.

A warning message will appear on confirmation modal.

image

Implemented on https://github.com/vocdoni/ui-scaffold/pull/648

If less options than max are chosen, it will add the abstain choices to the ballor

selankon commented 4 months ago

Based on the code of this PR, I don't understand what's going on with the abstain option anymore. I mean, I see we now accept sending empty results, but where are the changes for the mapping of these abstains when voting? Or aren't required anymore due to underlying SDK changes? 🤔

On the SDK anything changed. Now the flow is quite different, and if abstain is enabled the abstain options will be mapped here, during the ballot creation.

https://github.com/vocdoni/ui-components/blob/84cd1a303bd88551e4ed1bce67ca16d09c2f23a0/packages/chakra-components/src/components/Election/Questions.tsx#L89-L94

So for the user is transparent: