-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Voter Status to Network Configuration Tooltip (Popout) #2471
Conversation
This is awesome @jseagrave21 ! Some minor design feedback: Lets ditch the row dedicated to the position of the node and instead display this pink icon as used frequently with this component => Lets also display that same icon if no vote has been cast for the address |
@comountainclimber Thank you! Here is what I have so far. If the node has fallen outside of 21: I kept the node row after the public key because I thought the variation in opacity helped highlight the data.
'To Do' list is updated to track outstanding tasks. |
I think this is good to go except for testing all the possibilities for I was not able to figure out how to pass state changes into the tests. I tried setting the state of |
const results = [] | ||
const { net, address } = this.props | ||
const network = net === 'MainNet' ? 'mainnet' : 'testnet' | ||
const data1 = await NeoRest.voter(address, network) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: the variable name data1
is highly ambiguous perhaps "candateResponse" would be better here. Same goes for data2
I think something like "committeeResponse" would be slightly better
The following is how you would accomplish setting state in jest: https://legacy.reactjs.org/docs/test-utils.html#act
|
A few things:
This one is getting super close, after this stuff gets addressed I will approve this, thanks @jseagrave21 ! |
|
@comountainclimber I refactored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 🔥
What current issue(s) from Trello/Github does this address?
#2284
What problem does this PR solve?
Adds voter status to the Network Configuration Tooltip
How did you solve this problem?
Added calls to the
voter
andcommittee
endpoints then displays them in the popout as recommended in the issue.If a user has voted, the popout will look like this:
If a user has not voted, the popout will look like this:
How did you make sure your solution works?
yarn dev
testing and updated unit testsAre there any special changes in the code that we should be aware of?
All translations are updated.
Is there anything else we should know?
I did not implement a warning if the voted node has fallen out of the top 21. I can work on that if it is necessary. I was thinking that changing the color of the text to red would be enough of a warning but I would like some guidance if this is necessary before I put more work into figuring out how to do that.
The text displayed without a vote is hard coded in English. I could drop it so there is nothing displayed if that is preferable. Or please recommend a better solution.
To Do:
WarningIcon
color or leave as isrenderNode()
NetworkConfigurationToolTip
Container Size