Skip to content

Commit

Permalink
feat(ui): Improve wording in statistic cards
Browse files Browse the repository at this point in the history
A job being skipped due to it not being enabled in the run configuration
is the only reason why data would be unavailable, so be more explicit
about that. Also use the description to give a hint how to change that a
job is being skipped.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Oct 18, 2024
1 parent be56038 commit fe7ac8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ export const PackagesStatisticsCard = ({
icon={() => (
<ListTree className={`h-4 w-4 ${getStatusFontColor(status)}`} />
)}
value={status ? packagesTotal : 'Unavailable'}
value={status ? packagesTotal : 'Skipped'}
description={
ecoSystems.length
? ecoSystems.length > 1
? `from ${ecoSystems.length} ecosystems (${ecoSystems.join(`,`)})`
: `from 1 ecosystem (${ecoSystems})`
: ''
: status
? ''
: 'Enable the job for results'
}
className='h-full hover:bg-muted/50'
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export const RuleViolationsStatisticsCard = ({
icon={() => (
<ListTree className={`h-4 w-4 ${getStatusFontColor(status)}`} />
)}
value={status ? ruleViolationsTotal : 'Unavailable'}
value={status ? ruleViolationsTotal : 'Skipped'}
description={status ? '' : 'Enable the job for results'}
className='h-full hover:bg-muted/50'
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ const RunComponent = () => {
className={`h-4 w-4 ${getStatusFontColor(ortRun.jobs.advisor?.status)}`}
/>
)}
value={ortRun.jobs.advisor ? vulnTotal : 'Unavailable'}
value={ortRun.jobs.advisor ? vulnTotal : 'Skipped'}
description={
ortRun.jobs.advisor ? '' : 'Enable the job for results'
}
className='h-full hover:bg-muted/50'
/>
</Link>
Expand Down

0 comments on commit fe7ac8f

Please sign in to comment.