@@ -71,7 +71,7 @@ const DailyUsersPanel = ({
71
71
return (
72
72
< Panel { ...panelProps } >
73
73
< PanelHeader sx = { { display : "flex" , alignItems : "center" , gap : 1 } } >
74
- Active daily users
74
+ Daily Active Users
75
75
< HelpTooltip size = "small" >
76
76
< HelpTooltipTitle > How do we calculate DAUs?</ HelpTooltipTitle >
77
77
< HelpTooltipText >
@@ -153,14 +153,15 @@ const TemplateUsagePanel = ({
153
153
} : PanelProps & {
154
154
data : TemplateInsightsResponse [ "report" ] [ "apps_usage" ] | undefined
155
155
} ) => {
156
+ const validUsage = data ?. filter ( ( u ) => u . seconds > 0 )
156
157
const totalInSeconds =
157
- data ?. reduce ( ( total , usage ) => total + usage . seconds , 0 ) ?? 1
158
+ validUsage ?. reduce ( ( total , usage ) => total + usage . seconds , 0 ) ?? 1
158
159
const usageColors = chroma
159
160
. scale ( [ colors . green [ 8 ] , colors . blue [ 8 ] ] )
160
161
. mode ( "lch" )
161
- . colors ( data ?. length ?? 0 )
162
+ . colors ( validUsage ?. length ?? 0 )
162
163
// The API returns a row for each app, even if the user didn't use it.
163
- const hasDataAvailable = data ?. some ( ( u ) => u . seconds > 0 )
164
+ const hasDataAvailable = validUsage && validUsage . length > 0
164
165
return (
165
166
< Panel { ...panelProps } >
166
167
< PanelHeader > App‘s & IDE usage </ PanelHeader >
@@ -169,7 +170,7 @@ const TemplateUsagePanel = ({
169
170
{ data && ! hasDataAvailable && < NoDataAvailable sx = { { height : 200 } } /> }
170
171
{ data && hasDataAvailable && (
171
172
< Box sx = { { display : "flex" , flexDirection : "column" , gap : 3 } } >
172
- { data
173
+ { validUsage
173
174
. sort ( ( a , b ) => b . seconds - a . seconds )
174
175
. map ( ( usage , i ) => {
175
176
const percentage = ( usage . seconds / totalInSeconds ) * 100
@@ -199,7 +200,7 @@ const TemplateUsagePanel = ({
199
200
/>
200
201
</ Box >
201
202
< Box sx = { { fontSize : 13 , fontWeight : 500 , width : 200 } } >
202
- { usage . slug }
203
+ { usage . display_name }
203
204
</ Box >
204
205
</ Box >
205
206
< LinearProgress
0 commit comments