Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Cancel poll vote interaction #815

Merged
merged 7 commits into from
May 30, 2020

Conversation

erler
Copy link
Collaborator

@erler erler commented May 27, 2020

To indicate whether and how a user has voted on a poll, the respective button mimics hover style while the other button is disabled. Clicking on the link below cancels the vote.

I also tried out keeping both buttons active so that clicking the other option would cancel the previous vote and cast a new one, but that felt a bit unintuitive.

Screenshot 2020-05-27 at 17 09 58

Screenshot 2020-05-27 at 17 10 13

@erler erler changed the base branch from master to niklabh-feature-vote May 27, 2020 15:24
@erler erler mentioned this pull request May 27, 2020
@Tbaut
Copy link
Collaborator

Tbaut commented May 28, 2020

This works definitely well thank a lot for that. There a warning for the href:

./src/components/Post/Poll/GeneralSignals.tsx
Line 94:39: The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid

Check the ButtonLink that was created for this purpose, that's what the Resend verification email uses for instance.

Also with 3 votes the percentage look long :)
image

@erler
Copy link
Collaborator Author

erler commented May 29, 2020

As you suggested, added the styling in the GeneralSignals component. Showing disabled buttons when not logged in.

Edit: overlooked the main comment...
ButtonLink used and trimmed percentage to one decimal.

Screenshot 2020-05-29 at 17 24 47

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better now thanks. Just 2 things left and we're good.

@erler
Copy link
Collaborator Author

erler commented May 29, 2020

Sorry, misinterpreted a comment. Api check is back.

@erler erler requested a review from Tbaut May 29, 2020 16:52
@Tbaut Tbaut merged commit 36848ac into niklabh-feature-vote May 30, 2020
@Tbaut Tbaut deleted the erler-cancel-vote-interaction branch May 30, 2020 10:30
niklabh added a commit that referenced this pull request Jun 2, 2020
* Added vote tables

* Added permissions

* Added votes post relationship

* Added UI

* Added Offchain Poll

* Everything works

* onchain only

* removed console

* using default address field

* removed span

* Split useEffect

* Using encoded address

* && instead of ?

* Using use callback

* Box shadow

* conditional component dispaly

* comment

* Using enum

* Added own vote

* Added check of has_poll on create post itself

* Added check of has_poll on create post itself

* box-shadow fix

* Update front-end/src/ui-components/CouncilSignalBar.tsx

Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>

* Update front-end/src/components/Post/Poll/CouncilSignals.tsx

Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>

* Update front-end/src/ui-components/OffChainSignalBar.tsx

Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>

* Adding address of council if it exist

* checking defaultAddress not empty string

* renamed OffChainSignals -> GeneralSignals

* Commented poll

* lint

* Update front-end/src/ui-components/CouncilSignalBar.tsx

Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>

* fix table setup

* < 2 check

* Signal percentage

* Helpertooltip next to title

* Update front-end/src/components/Post/Poll/CouncilSignals.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update front-end/src/components/Post/Poll/GeneralSignals.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Added checkbox

* fix

* Fix ayes nays

* Cancel poll vote interaction (#815)

* Cancel poll vote interaction

* remove apiReady and revert AyeNayButtons

* ownVote css styling

* space

* Use ButtonLink

* fix percentage decimal display

* api check

* use type guard and avoid over fetching

* comment out Poll

* lint

* Added isReferendum

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: erler <mail@michelerler.com>
Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>
Co-authored-by: thib <thibaut.sardan@gmail.com>
Tbaut added a commit that referenced this pull request Jun 10, 2020
* Added vote tables

* Added permissions

* Added votes post relationship

* Added UI

* Added Offchain Poll

* Everything works

* onchain only

* removed console

* using default address field

* removed span

* Split useEffect

* Using encoded address

* && instead of ?

* Using use callback

* Box shadow

* conditional component dispaly

* comment

* Using enum

* Added own vote

* Added check of has_poll on create post itself

* Added check of has_poll on create post itself

* box-shadow fix

* Update front-end/src/ui-components/CouncilSignalBar.tsx

Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>

* Update front-end/src/components/Post/Poll/CouncilSignals.tsx

Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>

* Update front-end/src/ui-components/OffChainSignalBar.tsx

Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>

* Adding address of council if it exist

* checking defaultAddress not empty string

* renamed OffChainSignals -> GeneralSignals

* Commented poll

* lint

* Update front-end/src/ui-components/CouncilSignalBar.tsx

Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>

* fix table setup

* Using council members from chain db rather than onchain. Showing old council of poll closing time has passed

* < 2 check

* Signal percentage

* Helpertooltip next to title

* Update front-end/src/components/Post/Poll/CouncilSignals.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update front-end/src/components/Post/Poll/GeneralSignals.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Added checkbox

* fix

* Fix ayes nays

* Cancel poll vote interaction (#815)

* Cancel poll vote interaction

* remove apiReady and revert AyeNayButtons

* ownVote css styling

* space

* Use ButtonLink

* fix percentage decimal display

* api check

* use type guard and avoid over fetching

* comment out Poll

* lint

* changed block_number to poll_block_number_end

* extracted reused code in function

* Uncommented poll

* removed twoWeekBlocks

* Calculating end block

* fix

* Added blocktime context

* using hook instead of context for getting block time

* not using default 0

* showing error on no block number

* Moved poll table

* timestamps and permissions

* added relationship

* added @ardatan/graphql-tools

* added permission

* removed unused relationship

* prevent poll vote when finished (#878)

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: erler <mail@michelerler.com>
Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com>
Co-authored-by: thib <thibaut.sardan@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants