Skip to content

Commit c66f5d5

Browse files
Merge pull request #87 from MobilityData/feat/81-dataset-unzipped-sizes
feat: display dataset size in table
2 parents 5a41671 + d1afc0a commit c66f5d5

File tree

4 files changed

+233
-100
lines changed

4 files changed

+233
-100
lines changed

messages/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"errors": "errors",
4848
"noErrors": "No errors",
4949
"noWarnings": "No warnings",
50+
"noInfoNotices": "No info notices",
5051
"warnings": "warnings",
5152
"infoNotices": "info notices"
5253
},
@@ -266,6 +267,8 @@
266267
"datasetHistoryColumns": {
267268
"downloadedAt": "Downloaded At",
268269
"serviceDateRange": "Service Date Range",
270+
"sizeZipped": "Size Zipped (MB)",
271+
"sizeUnzipped": "Size Unzipped (MB)",
269272
"validationReport": "Validation Report",
270273
"actions": "Actions"
271274
},

messages/fr.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"errors": "errors",
4848
"noErrors": "No errors",
4949
"noWarnings": "No warnings",
50+
"noInfoNotices": "Aucune notice d'information",
5051
"warnings": "warnings",
5152
"infoNotices": "info notices"
5253
},
@@ -266,6 +267,8 @@
266267
"datasetHistoryColumns": {
267268
"downloadedAt": "Téléchargé le",
268269
"serviceDateRange": "Plage de dates de service",
270+
"sizeZipped": "Taille compressée (Mo)",
271+
"sizeUnzipped": "Taille décompressée (Mo)",
269272
"validationReport": "Rapport de validation",
270273
"actions": "Actions"
271274
},

src/app/screens/Feed/components/DataQualitySummary.tsx

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export default async function DataQualitySummary({
4242
<>
4343
<Chip
4444
data-testid='error-count'
45-
clickable
45+
clickable={Boolean(latestDataset?.validation_report?.url_html)}
4646
component='a'
47-
href={latestDataset?.validation_report?.url_html}
47+
href={latestDataset?.validation_report?.url_html ?? undefined}
4848
target='_blank'
4949
rel='noopener noreferrer nofollow'
5050
icon={
@@ -77,9 +77,9 @@ export default async function DataQualitySummary({
7777

7878
<Chip
7979
data-testid='warning-count'
80-
clickable
80+
clickable={Boolean(latestDataset?.validation_report?.url_html)}
8181
component='a'
82-
href={latestDataset?.validation_report?.url_html}
82+
href={latestDataset?.validation_report?.url_html ?? undefined}
8383
target='_blank'
8484
rel='noopener noreferrer nofollow'
8585
icon={
@@ -112,16 +112,29 @@ export default async function DataQualitySummary({
112112

113113
<Chip
114114
data-testid='info-count'
115-
icon={<InfoOutlinedIcon />}
116-
clickable
115+
icon={
116+
(latestDataset?.validation_report?.unique_info_count ?? 0) >
117+
0 ? (
118+
<InfoOutlinedIcon />
119+
) : (
120+
<CheckCircle />
121+
)
122+
}
123+
clickable={Boolean(latestDataset?.validation_report?.url_html)}
117124
component='a'
118-
href={latestDataset?.validation_report?.url_html}
125+
href={latestDataset?.validation_report?.url_html ?? undefined}
119126
target='_blank'
120127
rel='noopener noreferrer nofollow'
121-
label={`${
122-
latestDataset?.validation_report?.unique_info_count ?? '0'
123-
} ${tCommon('feedback.infoNotices')}`}
124-
color='primary'
128+
label={
129+
(latestDataset?.validation_report?.unique_info_count ?? 0) > 0
130+
? `${latestDataset?.validation_report?.unique_info_count} ${tCommon('feedback.infoNotices')}`
131+
: tCommon('feedback.noInfoNotices')
132+
}
133+
color={
134+
(latestDataset?.validation_report?.unique_info_count ?? 0) > 0
135+
? 'primary'
136+
: 'success'
137+
}
125138
variant='outlined'
126139
/>
127140
</>

0 commit comments

Comments
 (0)