gamedaoco / gamedao-beta

https://beta.gamedao.co
Apache License 2.0
9 stars 1 forks source link

Corrections Proposal Detail Page #196

Closed 5-mark closed 2 years ago

5-mark commented 2 years ago

User Story

As user I want to have a more intuitive user experience on the proposal detail page so I know always what is happening and not get confused

Acceptance Criteria

  1. The different options (in this case YES, NO) have their own percentage bar as to be seen in figma 1.1 the colors are in the voting-context color (orange) 1.2 the percentage and votes sum for the option are displayed above the bar
  2. after submitting a vote succesfully the page updates the voting result by: 2.1 refreshing the voted option sum and percentage 2.2 refreshing the bars 2.3 refreshing the voting options with the selcted option (eg.: "voted YES") and leaving no button to vote on any more after having voted 2.4 refreshing the voters list below the detail page 2.4.1 if this was the initial vote the voters list appears with the inital vote and not before.

Additional Information

How to test

  1. go to proposal detail page
  2. vote for an option
  3. see all relevant data listed in the AC refresh.
PAkhidue commented 2 years ago

2.3. isn't working because "proposalVoters" doesn't update on chain. The value keeps the same. @2075 could you have a look at it? (Maybe I'm doing something wrong).

2075 commented 2 years ago

@PAkhidue hm did you check on polkadot apps already? which extrinsic is it you are calling?

2075 commented 2 years ago

also could add this ``` ProposalVotes get(fn proposal_votes): map hasher(blake2_128_concat) T::Hash => u64 = 0;



proposalvoters should also update:
```         let mut voters = ProposalVoters::<T>::get(&proposal_id);
            match voters.binary_search(&sender) {
                Ok(_) => {}, // should never happen
                Err(index) => {
                    voters.insert(index, sender.clone());
                    ProposalVoters::<T>::insert( &proposal_id, voters );
                }
            }```

maybe try a new campaign/voting?
PAkhidue commented 2 years ago

also could add this ``` ProposalVotes get(fn proposal_votes): map hasher(blake2_128_concat) T::Hash => u64 = 0;


proposalvoters should also update:
```           let mut voters = ProposalVoters::<T>::get(&proposal_id);
          match voters.binary_search(&sender) {
              Ok(_) => {}, // should never happen
              Err(index) => {
                  voters.insert(index, sender.clone());
                  ProposalVoters::<T>::insert( &proposal_id, voters );
              }
          }```

maybe try a new campaign/voting?

Just saw that I've 2 different address formats and that's why I couldn't find my address in the list. Problem is solved.

PAkhidue commented 2 years ago

Ready to test now on: https://gamedao-beta-c04v9jla0-75.vercel.app/

5-mark commented 2 years ago

@PAkhidue 2.4 & 2.4.1 couldnt be tested. please implement that via #194. will close this ticket