-
Notifications
You must be signed in to change notification settings - Fork 33
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
Feat/leaderboard datagrid #2650
base: develop
Are you sure you want to change the base?
Feat/leaderboard datagrid #2650
Conversation
…d in leaderboard and search select inputs
…nted to work on mobile
…9-2024 Dashboard improvements 23 09 2024
@migace is attempting to deploy a commit to the HUMAN Protocol Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
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.
"View All" is not available anymore, is this expected?
Also font size is changed from 16 to 14, not sure if it's an intended change
packages/apps/dashboard/ui-2024/src/features/Leaderboard/index.tsx
Outdated
Show resolved
Hide resolved
packages/apps/dashboard/ui-2024/src/features/Leaderboard/hooks/useDataGrid.tsx
Outdated
Show resolved
Hide resolved
packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/DataGrid.tsx
Outdated
Show resolved
Hide resolved
packages/apps/dashboard/ui-2024/src/features/Leaderboard/hooks/useDataGrid.tsx
Outdated
Show resolved
Hide resolved
packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/DataGrid.tsx
Outdated
Show resolved
Hide resolved
packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/DataGrid.tsx
Outdated
Show resolved
Hide resolved
…o feat/leaderboard-datagrid
…human-protocol into feat/leaderboard-datagrid
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.
- Sorting arrows are cut
- Please fix the git history, maybe by re-applying changes on top of current HEAD in develop. Right now we see excessive commits (like this one) when we should not
- Some other minor comments
@@ -1,57 +1,58 @@ | |||
{ |
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.
Projects in repo set up to use 2 spaces for tab
, not tab character for indents. Could you please align with that and update this file? It's confusing that we have it full of changes and makes hard to find the real change with new package installed
"@mui/icons-material": "^6.1.1", | ||
"@mui/material": "^5.15.18", | ||
"@mui/styled-engine-sc": "6.1.3", | ||
"@mui/x-data-grid": "^7.19.0", |
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.
Please remove it and add install package properly, so it can be reflected in lock
file as will
You need to run add
command for this particular workspace:
yarn workspace @human-protocol/dashboard-ui-2024 add @mui/x-data-grid@<version-you-need>
}} | ||
initialState={{ | ||
sorting: { | ||
sortModel: [{ field: 'role', sort: 'asc' }], |
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.
IMU the idea of leaderboard is to show by default leaders ordered by amountStaked
(ref from SDK) and BE already returns leaders ordered, so we need to change that to amountStaked
and desc
or remove it at all to use data we get from BE
display="flex" | ||
alignItems="center" | ||
> | ||
{params.api.state.sorting.sortedRows.indexOf(params.id) + 1} |
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.
This logic is implicit and easy to break, esp. with the fact we have a hack with onSortModelChange
for it. The right way of doing this would be to implement something similar "server-side" sorting, where we sort on our end and change raw index accordingly.
IMU the idea of this leaderboard is to show items depending on "amountStaked" by default and "index" column should show the "rank" based on this criteria. In case user decides to sort the table based on some other column - rank won't change.
So I see three possible ways of making it right:
- Implement it like "server-side" to avoid hacks with re-render triggering
- Remove this column at all
- Display it as is, assuming it is a
rank
value (so it will work like this table)
IMO #1 is overhead here, so I would go #3 since it corresponds to the idea of leaderboard
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.
Discussed with the team, let's do the following now:
- keep sorting only for
stake
,reputation
andfee
columns - always keep 1-2-3 row index, no matter what is the sort criteria; either go with a suggested option №1 (it will be useful in the future - [Dashboard] Support leaderboard sorting by reputation and fee on BE #2778) or find some other ways to achieve that w/o implicit trigger of re-rendering
task HDM-20