Skip to content

feat(web): top jurors component #1290

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

Merged
merged 14 commits into from
Oct 25, 2023
Merged

feat(web): top jurors component #1290

merged 14 commits into from
Oct 25, 2023

Conversation

kemuru
Copy link
Contributor

@kemuru kemuru commented Oct 20, 2023

ATTENTION: subgraph needs to be redeployed since I updated schema for User entity as well as the mappings to calculate the juror coherenceScore. So after reviewing, and if everything is fine, please if you have access to the devnet subgraph redeploy it


PR-Codex overview

This PR focuses on adding a coherence score calculation and displaying top jurors on the Home page.

Detailed summary

  • Added coherenceScore field to the User entity in the subgraph
  • Added computeCoherenceScore function to calculate the coherence score based on totalCoherent and totalResolvedDisputes
  • Added TopJurors component to display top jurors on the Home page
  • Added useTopUsersByCoherenceScore hook to fetch top users by coherence score
  • Updated Coherency component to display total coherent votes and total resolved disputes
  • Updated PixelArt component to accept width and height props
  • Updated IdenticonOrAvatar and AddressOrName components to accept address prop
  • Added levelTitles and getUserLevelData functions to calculate user level based on coherence score
  • Added rewards and calculateTotalJurorReward functions to calculate total juror reward

The following files were skipped due to too many changes: web/src/utils/jurorRewardConfig.ts, web/src/pages/Dashboard/JurorInfo/index.tsx, web/src/pages/Dashboard/JurorInfo/JurorRewards.tsx, web/src/pages/Home/TopJurors/TopJurorsHeader.tsx, web/src/pages/Home/TopJurors/JurorCard.tsx, yarn.lock

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@netlify
Copy link

netlify bot commented Oct 20, 2023

Deploy Preview for kleros-v2 ready!

Name Link
🔨 Latest commit 7f8be8e
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/65392f0ef047b00008a08523
😎 Deploy Preview https://deploy-preview-1290--kleros-v2.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kemuru kemuru changed the title feat(web): structure for top jurors component with some hardcoded values feat(web): top jurors component Oct 20, 2023
@kemuru kemuru linked an issue Oct 23, 2023 that may be closed by this pull request
@kemuru kemuru requested review from alcercu and jaybuidl and removed request for alcercu October 24, 2023 08:47
@kemuru kemuru marked this pull request as ready for review October 24, 2023 08:47
@jaybuidl jaybuidl added this to the testnet-2.1 milestone Oct 24, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codeclimate
Copy link

codeclimate bot commented Oct 25, 2023

Code Climate has analyzed commit 7f8be8e and detected 41 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2
Duplication 6
Style 33

View more on Code Climate.

Copy link
Contributor

Choose a reason for hiding this comment

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

This file seems to big, maybe split it into components

@kemuru kemuru merged commit 7f8be8e into dev Oct 25, 2023
@jaybuidl jaybuidl deleted the feat(web)/top-jurors-component branch October 25, 2023 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top jurors
3 participants