@@ -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