Skip to content

Commit

Permalink
fix(ui): Sort top users by their query count in datasets stats tab (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykadambi authored Jan 27, 2023
1 parent 54562cd commit 1192dbf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default function TableStats({
) {
return null;
}
const sortedUsers = users?.slice().sort((a, b) => (b?.count || 0) - (a?.count || 0));
return (
<StatSection>
<Typography.Title level={5}>Table Stats</Typography.Title>
Expand Down Expand Up @@ -77,15 +78,15 @@ export default function TableStats({
</Typography.Text>
</InfoItem>
)}
{users && users.length > 0 && (
{sortedUsers && sortedUsers.length > 0 && (
<InfoItem title="Top Users">
<div style={{ paddingTop: 8 }}>
<ExpandedActorGroup
containerStyle={{
justifyContent: 'left',
}}
actors={
users
sortedUsers
.filter((user) => user && user?.user !== undefined && user?.user !== null)
.map((user) => user?.user as CorpUser) || []
}
Expand Down

0 comments on commit 1192dbf

Please sign in to comment.