File tree 3 files changed +14
-3
lines changed
components/ActiveUserChart
DeploySettingsPage/GeneralSettingsPage
TemplatePage/TemplateInsightsPage
3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,13 @@ ChartJS.register(
39
39
40
40
export interface ActiveUserChartProps {
41
41
data : { date : string ; amount : number } [ ] ;
42
+ interval : "day" | "week" ;
42
43
}
43
44
44
- export const ActiveUserChart : FC < ActiveUserChartProps > = ( { data } ) => {
45
+ export const ActiveUserChart : FC < ActiveUserChartProps > = ( {
46
+ data,
47
+ interval,
48
+ } ) => {
45
49
const theme : Theme = useTheme ( ) ;
46
50
47
51
const labels = data . map ( ( val ) => {
@@ -85,7 +89,7 @@ export const ActiveUserChart: FC<ActiveUserChartProps> = ({ data }) => {
85
89
} ,
86
90
type : "time" ,
87
91
time : {
88
- unit : "day" ,
92
+ unit : interval ,
89
93
} ,
90
94
} ,
91
95
} ,
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export const GeneralSettingsPageView = ({
36
36
{ deploymentDAUs && (
37
37
< Box height = { 200 } sx = { { mb : 3 } } >
38
38
< ChartSection title = { < ActiveUsersTitle /> } >
39
- < ActiveUserChart data = { deploymentDAUs . entries } />
39
+ < ActiveUserChart data = { deploymentDAUs . entries } interval = "day" />
40
40
</ ChartSection >
41
41
</ Box >
42
42
) }
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ export default function TemplateInsightsPage() {
112
112
}
113
113
templateInsights = { templateInsights }
114
114
userLatency = { userLatency }
115
+ interval = { interval }
115
116
/>
116
117
</ >
117
118
) ;
@@ -121,10 +122,12 @@ export const TemplateInsightsPageView = ({
121
122
templateInsights,
122
123
userLatency,
123
124
controls,
125
+ interval,
124
126
} : {
125
127
templateInsights : TemplateInsightsResponse | undefined ;
126
128
userLatency : UserLatencyInsightsResponse | undefined ;
127
129
controls : ReactNode ;
130
+ interval : InsightsInterval ;
128
131
} ) => {
129
132
return (
130
133
< >
@@ -148,6 +151,7 @@ export const TemplateInsightsPageView = ({
148
151
>
149
152
< ActiveUsersPanel
150
153
sx = { { gridColumn : "span 2" } }
154
+ interval = { interval }
151
155
data = { templateInsights ?. interval_reports }
152
156
/>
153
157
< UserLatencyPanel data = { userLatency } />
@@ -166,9 +170,11 @@ export const TemplateInsightsPageView = ({
166
170
167
171
const ActiveUsersPanel = ( {
168
172
data,
173
+ interval,
169
174
...panelProps
170
175
} : PanelProps & {
171
176
data : TemplateInsightsResponse [ "interval_reports" ] | undefined ;
177
+ interval : InsightsInterval ;
172
178
} ) => {
173
179
return (
174
180
< Panel { ...panelProps } >
@@ -182,6 +188,7 @@ const ActiveUsersPanel = ({
182
188
{ data && data . length === 0 && < NoDataAvailable /> }
183
189
{ data && data . length > 0 && (
184
190
< ActiveUserChart
191
+ interval = { interval }
185
192
data = { data . map ( ( d ) => {
186
193
return {
187
194
amount : d . active_users ,
You can’t perform that action at this time.
0 commit comments