-
Notifications
You must be signed in to change notification settings - Fork 0
feat: display dataset size in table #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -162,6 +162,22 @@ export default function PreviousDatasets({ | |||||||||||||||
| > | ||||||||||||||||
| {t('datasetHistoryColumns.serviceDateRange')} | ||||||||||||||||
| </TableCell> | ||||||||||||||||
| <TableCell | ||||||||||||||||
| component='th' | ||||||||||||||||
| scope='col' | ||||||||||||||||
| sx={{ fontWeight: 'bold' }} | ||||||||||||||||
| align='right' | ||||||||||||||||
| > | ||||||||||||||||
| {t('datasetHistoryColumns.sizeZipped')} | ||||||||||||||||
| </TableCell> | ||||||||||||||||
| <TableCell | ||||||||||||||||
| component='th' | ||||||||||||||||
| scope='col' | ||||||||||||||||
| sx={{ fontWeight: 'bold' }} | ||||||||||||||||
| align='right' | ||||||||||||||||
| > | ||||||||||||||||
| {t('datasetHistoryColumns.sizeUnzipped')} | ||||||||||||||||
| </TableCell> | ||||||||||||||||
| <TableCell | ||||||||||||||||
| component='th' | ||||||||||||||||
| scope='col' | ||||||||||||||||
|
|
@@ -216,6 +232,20 @@ export default function PreviousDatasets({ | |||||||||||||||
| </Box> | ||||||||||||||||
| )} | ||||||||||||||||
| </TableCell> | ||||||||||||||||
| <TableCell align='right'> | ||||||||||||||||
| <Typography variant='body1'> | ||||||||||||||||
| {dataset?.zipped_folder_size_mb != null | ||||||||||||||||
| ? dataset.zipped_folder_size_mb | ||||||||||||||||
| : '–'} | ||||||||||||||||
| </Typography> | ||||||||||||||||
| </TableCell> | ||||||||||||||||
| <TableCell align='right'> | ||||||||||||||||
| <Typography variant='body1'> | ||||||||||||||||
| {dataset?.unzipped_folder_size_mb != null | ||||||||||||||||
| ? dataset.unzipped_folder_size_mb | ||||||||||||||||
| : '–'} | ||||||||||||||||
| </Typography> | ||||||||||||||||
| </TableCell> | ||||||||||||||||
| <TableCell sx={{ textAlign: { xs: 'left', xl: 'center' } }}> | ||||||||||||||||
| {dataset.validation_report == null && ( | ||||||||||||||||
| <Typography sx={{ ml: '4px' }}> | ||||||||||||||||
|
|
@@ -224,106 +254,178 @@ export default function PreviousDatasets({ | |||||||||||||||
| )} | ||||||||||||||||
| {dataset.validation_report != null && ( | ||||||||||||||||
| <> | ||||||||||||||||
| <Chip | ||||||||||||||||
| component='a' | ||||||||||||||||
| clickable | ||||||||||||||||
| href={`${dataset?.validation_report?.url_html}`} | ||||||||||||||||
| target='_blank' | ||||||||||||||||
| rel='noreferrer nofollow' | ||||||||||||||||
| sx={{ m: '4px' }} | ||||||||||||||||
| icon={ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_error_count > | ||||||||||||||||
| 0 ? ( | ||||||||||||||||
| <ReportOutlined aria-hidden /> | ||||||||||||||||
| ) : ( | ||||||||||||||||
| <CheckCircle aria-hidden /> | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| label={ | ||||||||||||||||
| <Tooltip | ||||||||||||||||
| title={ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_error_count > 0 | ||||||||||||||||
| ? `${ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count | ||||||||||||||||
| } ${tCommon('feedback.errors')}` | ||||||||||||||||
| ? `${dataset.validation_report.unique_error_count} ${tCommon('feedback.errors')}` | ||||||||||||||||
| : tCommon('feedback.noErrors') | ||||||||||||||||
| } | ||||||||||||||||
| aria-label={ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_error_count > 0 | ||||||||||||||||
| ? `${dataset.validation_report.unique_error_count} ${tCommon('feedback.errors')} – ${t('datasetHistoryTooltip.viewReport')}` | ||||||||||||||||
| : `${tCommon('feedback.noErrors')} – ${t('datasetHistoryTooltip.viewReport')}` | ||||||||||||||||
| } | ||||||||||||||||
| color={ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_error_count > 0 | ||||||||||||||||
| ? 'error' | ||||||||||||||||
| : 'success' | ||||||||||||||||
| } | ||||||||||||||||
| variant='outlined' | ||||||||||||||||
| /> | ||||||||||||||||
| <Chip | ||||||||||||||||
| sx={{ m: '4px' }} | ||||||||||||||||
| component='a' | ||||||||||||||||
| clickable | ||||||||||||||||
| href={`${dataset?.validation_report?.url_html}`} | ||||||||||||||||
| target='_blank' | ||||||||||||||||
| rel='noreferrer nofollow' | ||||||||||||||||
| icon={ | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count > | ||||||||||||||||
| 0 ? ( | ||||||||||||||||
| <ReportOutlined aria-hidden /> | ||||||||||||||||
| ) : ( | ||||||||||||||||
| <CheckCircle aria-hidden /> | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| label={ | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count > 0 | ||||||||||||||||
| ? `${ | ||||||||||||||||
| placement='top' | ||||||||||||||||
| > | ||||||||||||||||
| <Chip | ||||||||||||||||
| component='a' | ||||||||||||||||
| clickable | ||||||||||||||||
| href={`${dataset?.validation_report?.url_html}`} | ||||||||||||||||
|
Alessandro100 marked this conversation as resolved.
Outdated
|
||||||||||||||||
| target='_blank' | ||||||||||||||||
| rel='noreferrer nofollow' | ||||||||||||||||
| sx={{ | ||||||||||||||||
| m: '4px', | ||||||||||||||||
| '.MuiChip-label': { | ||||||||||||||||
| pr: | ||||||||||||||||
| dataset?.validation_report | ||||||||||||||||
| ?.unique_warning_count | ||||||||||||||||
| } ${tCommon('feedback.warnings')}` | ||||||||||||||||
| : tCommon('feedback.noWarnings') | ||||||||||||||||
| } | ||||||||||||||||
| aria-label={ | ||||||||||||||||
| ?.unique_error_count === 0 | ||||||||||||||||
| ? 0 | ||||||||||||||||
| : undefined, | ||||||||||||||||
| }, | ||||||||||||||||
| }} | ||||||||||||||||
| icon={ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_error_count > | ||||||||||||||||
| 0 ? ( | ||||||||||||||||
| <ReportOutlined aria-hidden /> | ||||||||||||||||
| ) : ( | ||||||||||||||||
| <CheckCircle aria-hidden /> | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| label={ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_error_count > 0 | ||||||||||||||||
| ? dataset.validation_report.unique_error_count | ||||||||||||||||
| : undefined | ||||||||||||||||
| } | ||||||||||||||||
| aria-label={ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_error_count > 0 | ||||||||||||||||
| ? `${dataset.validation_report.unique_error_count} ${tCommon('feedback.errors')} – ${t('datasetHistoryTooltip.viewReport')}` | ||||||||||||||||
| : `${tCommon('feedback.noErrors')} – ${t('datasetHistoryTooltip.viewReport')}` | ||||||||||||||||
| } | ||||||||||||||||
| color={ | ||||||||||||||||
| dataset?.validation_report?.unique_error_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_error_count > 0 | ||||||||||||||||
| ? 'error' | ||||||||||||||||
| : 'success' | ||||||||||||||||
| } | ||||||||||||||||
| variant='outlined' | ||||||||||||||||
| /> | ||||||||||||||||
| </Tooltip> | ||||||||||||||||
| <Tooltip | ||||||||||||||||
| title={ | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count > 0 | ||||||||||||||||
| ? `${dataset.validation_report.unique_warning_count} ${tCommon('feedback.warnings')} – ${t('datasetHistoryTooltip.viewReport')}` | ||||||||||||||||
| : `${tCommon('feedback.noWarnings')} – ${t('datasetHistoryTooltip.viewReport')}` | ||||||||||||||||
| ? `${dataset.validation_report.unique_warning_count} ${tCommon('feedback.warnings')}` | ||||||||||||||||
| : tCommon('feedback.noWarnings') | ||||||||||||||||
| } | ||||||||||||||||
| color={ | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count != | ||||||||||||||||
| undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count > 0 | ||||||||||||||||
| ? 'warning' | ||||||||||||||||
| : 'success' | ||||||||||||||||
| placement='top' | ||||||||||||||||
| > | ||||||||||||||||
| <Chip | ||||||||||||||||
| sx={{ | ||||||||||||||||
| m: '4px', | ||||||||||||||||
| '.MuiChip-label': { | ||||||||||||||||
| pr: | ||||||||||||||||
| dataset?.validation_report | ||||||||||||||||
| ?.unique_warning_count === 0 | ||||||||||||||||
| ? 0 | ||||||||||||||||
| : undefined, | ||||||||||||||||
| }, | ||||||||||||||||
| }} | ||||||||||||||||
| component='a' | ||||||||||||||||
| clickable | ||||||||||||||||
| href={`${dataset?.validation_report?.url_html}`} | ||||||||||||||||
| target='_blank' | ||||||||||||||||
| rel='noreferrer nofollow' | ||||||||||||||||
| icon={ | ||||||||||||||||
| dataset?.validation_report | ||||||||||||||||
| ?.unique_warning_count != undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count > | ||||||||||||||||
| 0 ? ( | ||||||||||||||||
| <ReportOutlined aria-hidden /> | ||||||||||||||||
| ) : ( | ||||||||||||||||
| <CheckCircle aria-hidden /> | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| label={ | ||||||||||||||||
| dataset?.validation_report | ||||||||||||||||
| ?.unique_warning_count != undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count > | ||||||||||||||||
| 0 | ||||||||||||||||
| ? dataset.validation_report.unique_warning_count | ||||||||||||||||
| : undefined | ||||||||||||||||
| } | ||||||||||||||||
| aria-label={ | ||||||||||||||||
| dataset?.validation_report | ||||||||||||||||
| ?.unique_warning_count != undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count > | ||||||||||||||||
| 0 | ||||||||||||||||
| ? `${dataset.validation_report.unique_warning_count} ${tCommon('feedback.warnings')} – ${t('datasetHistoryTooltip.viewReport')}` | ||||||||||||||||
| : `${tCommon('feedback.noWarnings')} – ${t('datasetHistoryTooltip.viewReport')}` | ||||||||||||||||
| } | ||||||||||||||||
| color={ | ||||||||||||||||
| dataset?.validation_report | ||||||||||||||||
| ?.unique_warning_count != undefined && | ||||||||||||||||
| dataset?.validation_report?.unique_warning_count > | ||||||||||||||||
| 0 | ||||||||||||||||
| ? 'warning' | ||||||||||||||||
| : 'success' | ||||||||||||||||
| } | ||||||||||||||||
| variant='outlined' | ||||||||||||||||
| /> | ||||||||||||||||
| </Tooltip> | ||||||||||||||||
| <Tooltip | ||||||||||||||||
| title={ | ||||||||||||||||
| (dataset?.validation_report?.unique_info_count ?? | ||||||||||||||||
| 0) > 0 | ||||||||||||||||
| ? `${dataset?.validation_report?.unique_info_count} ${tCommon('feedback.infoNotices')}` | ||||||||||||||||
| : tCommon('feedback.noInfoNotices') | ||||||||||||||||
| } | ||||||||||||||||
| variant='outlined' | ||||||||||||||||
| /> | ||||||||||||||||
| <Chip | ||||||||||||||||
| sx={{ m: '4px' }} | ||||||||||||||||
| component='a' | ||||||||||||||||
| clickable | ||||||||||||||||
| href={`${dataset?.validation_report?.url_html}`} | ||||||||||||||||
| target='_blank' | ||||||||||||||||
| rel='noreferrer nofollow' | ||||||||||||||||
| icon={<InfoOutlinedIcon aria-hidden />} | ||||||||||||||||
| label={`${ | ||||||||||||||||
| dataset?.validation_report?.unique_info_count ?? '0' | ||||||||||||||||
| } ${tCommon('feedback.infoNotices')}`} | ||||||||||||||||
| aria-label={`${dataset?.validation_report?.unique_info_count ?? '0'} ${tCommon('feedback.infoNotices')} – ${t('datasetHistoryTooltip.viewReport')}`} | ||||||||||||||||
| color='primary' | ||||||||||||||||
| variant='outlined' | ||||||||||||||||
| /> | ||||||||||||||||
| placement='top' | ||||||||||||||||
| > | ||||||||||||||||
| <Chip | ||||||||||||||||
| sx={{ | ||||||||||||||||
| m: '4px', | ||||||||||||||||
| '.MuiChip-label': { | ||||||||||||||||
| pr: | ||||||||||||||||
| (dataset?.validation_report | ||||||||||||||||
| ?.unique_info_count ?? 0) === 0 | ||||||||||||||||
| ? 0 | ||||||||||||||||
| : undefined, | ||||||||||||||||
| }, | ||||||||||||||||
| }} | ||||||||||||||||
| component='a' | ||||||||||||||||
| clickable | ||||||||||||||||
| href={`${dataset?.validation_report?.url_html}`} | ||||||||||||||||
| target='_blank' | ||||||||||||||||
| rel='noreferrer nofollow' | ||||||||||||||||
| icon={ | ||||||||||||||||
| (dataset?.validation_report?.unique_info_count ?? | ||||||||||||||||
| 0) > 0 ? ( | ||||||||||||||||
| <InfoOutlinedIcon aria-hidden /> | ||||||||||||||||
| ) : ( | ||||||||||||||||
| <CheckCircle aria-hidden /> | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| label={ | ||||||||||||||||
| (dataset?.validation_report?.unique_info_count ?? | ||||||||||||||||
| 0) > 0 | ||||||||||||||||
| ? dataset?.validation_report?.unique_info_count | ||||||||||||||||
| : undefined | ||||||||||||||||
| } | ||||||||||||||||
| aria-label={`${dataset?.validation_report?.unique_info_count ?? '0'} ${tCommon('feedback.infoNotices')} – ${t('datasetHistoryTooltip.viewReport')}`} | ||||||||||||||||
|
||||||||||||||||
| aria-label={`${dataset?.validation_report?.unique_info_count ?? '0'} ${tCommon('feedback.infoNotices')} – ${t('datasetHistoryTooltip.viewReport')}`} | |
| aria-label={ | |
| (dataset?.validation_report?.unique_info_count ?? | |
| 0) > 0 | |
| ? `${dataset?.validation_report?.unique_info_count ?? '0'} ${tCommon('feedback.infoNotices')} – ${t('datasetHistoryTooltip.viewReport')}` | |
| : t('datasetHistoryTooltip.noInfoNotices') | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validation_report.url_htmlis optional in the generated types, but this chip is always rendered as a clickable anchor. Ifurl_htmlis missing, the anchor will have no valid destination (and may still look interactive). Consider guarding onurl_htmlbefore rendering a link chip, or render a non-clickable/disabled chip when the URL is absent.