Skip to content

Commit 3d002fa

Browse files
RomuDeuxfoissavacano28
authored andcommitted
[frontend] On Dashboard, display to the user that we show the activity < 180 days (#2123)
1 parent d04dbb6 commit 3d002fa

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

openbas-front/src/admin/components/Dashboard.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ const Dashboard = () => {
154154
<Grid item xs={3}>
155155
<PaperMetric
156156
title={t('Scenarios')}
157+
subTitle={t('(last 180 days)')}
157158
icon={<MovieFilterOutlined />}
158159
number={statistics?.scenarios_count?.global_count}
159160
progression={statistics?.scenarios_count?.progression_count}
@@ -162,6 +163,7 @@ const Dashboard = () => {
162163
<Grid item xs={3}>
163164
<PaperMetric
164165
title={t('Simulations')}
166+
subTitle={t('(last 180 days)')}
165167
icon={<HubOutlined />}
166168
number={statistics?.exercises_count?.global_count}
167169
progression={statistics?.exercises_count?.progression_count}
@@ -170,6 +172,7 @@ const Dashboard = () => {
170172
<Grid item xs={3}>
171173
<PaperMetric
172174
title={t('Players')}
175+
subTitle={t('(last 180 days)')}
173176
icon={<PersonOutlined />}
174177
number={statistics?.users_count?.global_count}
175178
progression={statistics?.users_count?.progression_count}
@@ -178,6 +181,7 @@ const Dashboard = () => {
178181
<Grid item xs={3}>
179182
<PaperMetric
180183
title={t('Assets')}
184+
subTitle={t('(last 180 days)')}
181185
icon={<ComputerOutlined />}
182186
number={statistics?.assets_count?.global_count}
183187
progression={statistics?.assets_count?.progression_count}

openbas-front/src/admin/components/common/simulate/PaperMetric.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ import type { Theme } from '../../../../components/Theme';
1010
const useStyles = makeStyles((theme: Theme) => ({
1111
title: {
1212
textTransform: 'uppercase',
13-
fontSize: 12,
14-
fontWeight: 500,
13+
fontSize: theme.typography.h4.fontSize,
14+
fontWeight: theme.typography.h4.fontWeight,
15+
color: theme.palette.text?.secondary,
16+
},
17+
subtitle: {
18+
fontSize: theme.typography.h4.fontSize,
19+
fontWeight: theme.typography.h4.fontWeight,
1520
color: theme.palette.text?.secondary,
1621
},
1722
number: {
@@ -29,13 +34,15 @@ const useStyles = makeStyles((theme: Theme) => ({
2934

3035
interface Props {
3136
title: string;
37+
subTitle: string;
3238
icon: React.ReactElement;
3339
number?: number;
3440
progression?: number;
3541
}
3642

3743
const PaperMetric: FunctionComponent<Props> = ({
3844
title,
45+
subTitle,
3946
icon,
4047
number,
4148
progression,
@@ -47,7 +54,13 @@ const PaperMetric: FunctionComponent<Props> = ({
4754
return (
4855
<Paper variant="outlined" className={classes.container}>
4956
<div>
50-
<div className={classes.title}>{t(title)}</div>
57+
<div>
58+
<span className={classes.title}>{t(title)}</span>
59+
<span className={classes.subtitle}>
60+
&nbsp;
61+
{t(subTitle)}
62+
</span>
63+
</div>
5164
<div className={classes.number}>
5265
{number ?? '-'}
5366
</div>

0 commit comments

Comments
 (0)