Skip to content

Commit

Permalink
Fix Reports Success/Warning icons, counts
Browse files Browse the repository at this point in the history
  • Loading branch information
sultan committed Oct 17, 2022
1 parent bce8646 commit f93afda
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,59 +136,33 @@ protected void renderOverview()
*/
protected <Q extends OverviewStats> void renderOverviewTableRow( Q stats )
{
sink.tableCell();
renderSuccessIcon();
sink.tableCell_();
sink.tableCell();
sink.text( getText( "report.overview.numUpToDate" ) );
sink.tableCell_();
sink.tableCell();
sink.text( Integer.toString( stats.getUpToDate() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
sink.tableCell();
renderWarningIcon();
sink.tableCell_();
sink.tableCell();
sink.text( getText( "report.overview.numNewerVersionAvailable" ) );
sink.tableCell_();
sink.tableCell();
sink.text( Integer.toString( stats.getAny() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
sink.tableCell();
renderWarningIcon();
sink.tableCell_();
sink.tableCell();
sink.text( getText( "report.overview.numNewerIncrementalAvailable" ) );
sink.tableCell_();
sink.tableCell();
sink.text( Integer.toString( stats.getIncremental() ) );
sink.tableCell_();
sink.tableRow_();
renderStatRow( "report.overview.numUpToDate", stats.getUpToDate(), true );
renderStatRow( "report.overview.numNewerVersionAvailable", stats.getAny(), false );
renderStatRow( "report.overview.numNewerIncrementalAvailable", stats.getIncremental(), false );
renderStatRow( "report.overview.numNewerMinorAvailable", stats.getMinor(), false );
renderStatRow( "report.overview.numNewerMajorAvailable", stats.getMajor(), false );
}

protected void renderStatRow( String textKey, int statCount, boolean forceSuccessIcon )
{
sink.tableRow();
sink.tableCell();
renderWarningIcon();
if ( statCount == 0 || forceSuccessIcon )
{
renderSuccessIcon();
}
else
{
renderWarningIcon();
}
sink.tableCell_();
sink.tableCell();
sink.text( getText( "report.overview.numNewerMinorAvailable" ) );
sink.text( getText( textKey ) );
sink.tableCell_();
sink.tableCell();
sink.text( Integer.toString( stats.getMinor() ) );
sink.text( Integer.toString( statCount ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
sink.tableCell();
renderWarningIcon();
sink.tableCell_();
sink.tableCell();
sink.text( getText( "report.overview.numNewerMajorAvailable" ) );
sink.tableCell_();
sink.tableCell();
sink.text( Integer.toString( stats.getMajor() ) );
sink.tableCell_();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,8 @@ protected void renderSummaryTableHeader( boolean hasScope, boolean hasType )
protected <T extends OverviewStats> void renderOverviewTableRow( T stats )
{
super.renderOverviewTableRow( stats );
sink.tableCell();
sink.text( getText( "report.overview.numNewerDependenciesAvailable" ) );
sink.tableCell_();
sink.tableCell();
sink.text( Integer.toString( ( (PluginOverviewStats) stats ).getDependencies() ) );
sink.tableCell_();
super.renderStatRow( "report.overview.numNewerDependenciesAvailable",
( (PluginOverviewStats) stats ).getDependencies(), false );
}

protected void renderSummaryTableRow( Dependency artifact, PluginUpdatesDetails details )
Expand Down

0 comments on commit f93afda

Please sign in to comment.