feat: various analytics updates (#6330)

* feat: add button to view user analytics

* feat: add "Your projects" preset selection

* feat: fix revenue rounding for values under 1 and show full values for all statcards with tooltip

* fix: sum rounded value instead of raw value for tooltip total if it's under 1

* fix: show decimal in playtime statcard if under 1 hrs

* feat: disable playtime statcard for purely plugin projects

* refactor: pnpm prepr
This commit is contained in:
Truman Gao
2026-06-08 22:03:28 +00:00
committed by GitHub
parent a92b5b08df
commit 2c9bf58d1f
12 changed files with 491 additions and 51 deletions
+18
View File
@@ -263,6 +263,15 @@
action: () => $refs.userDetailsModal.show(),
shown: auth.user && isStaff(auth.user),
},
{
id: 'open-analytics',
action: () =>
navigateTo({
path: '/dashboard/analytics',
query: { user: user.username || user.id },
}),
shown: auth.user && isAdmin(auth.user),
},
{
id: 'edit-role',
action: () => openRoleEditModal(),
@@ -297,6 +306,10 @@
<InfoIcon aria-hidden="true" />
{{ formatMessage(messages.infoButton) }}
</template>
<template #open-analytics>
<ChartIcon aria-hidden="true" />
{{ formatMessage(messages.analyticsButton) }}
</template>
<template #toggle-affiliate>
<AffiliateIcon aria-hidden="true" />
{{
@@ -500,6 +513,7 @@ import {
BadgeCheckIcon,
BoxIcon,
CalendarIcon,
ChartIcon,
CheckIcon,
ClipboardCopyIcon,
CurrencyIcon,
@@ -692,6 +706,10 @@ const messages = defineMessages({
id: 'profile.button.info',
defaultMessage: 'View user details',
},
analyticsButton: {
id: 'profile.button.analytics',
defaultMessage: 'View user analytics',
},
setAffiliateButton: {
id: 'profile.button.set-affiliate',
defaultMessage: 'Set as affiliate',