Problem/Motivation

The intention of upgrade status is to provide a high level overview and help people make decisions on what to do. A high level summary similar to the status report summary was on the original designs but we did not get there to implement that yet. This is how it looks on the status report:

The current UI looks like this with some parsed projects:

While it is possible to get an overview of these results, most real sites have a lot more modules. Having a summary of the results would therefore be useful.

Proposed resolution

UpgradeStatusForm already has this commented out code:

    // @todo Make the display better and more visual.
    /* $summary = [];
    if ($counters['known-errors'] > 0) {
      $summary[] = $this->formatPlural($counters['known-errors'], '@count total error found', '@count total errors found');
    }
    if ($counters['no-known-error'] > 0) {
      $summary[] = $this->formatPlural($counters['no-known-error'], '@count project has no known errors', '@count projects have no known errors');
    }
    if ($counters['not-scanned'] > 0) {
      $summary[] = $this->formatPlural($counters['not-scanned'], '@count project remaining to scan', '@count projects remaining to scan');
    }
    $build['summary'] = [
      '#type' => 'markup',
      '#markup' => '<div class="report-counters">' . join(', ', $summary) . '.</div>',
      '#weight' => -10,
    ];*/

This is commented out because it did look very odd and barely readable, so it was not providing value. Making it visual would let us return to displaying them for both categories.

I think we actually need 4 categories:

1. Known errors found (this is actual number of errors count, not projects with errors IMHO)
2. Known warnings found (these are problems that are not yet fixable, but should be fixed before Drupal 9, also should count actual warnings, not projects)
3. Projects that had no warnings/errors (this is counting projects)
4. Projects not yet scanned (this is also counting projects)

I think making it clear in the label that 1/2 is counting actual issues and 3/4 are counting projects should be enough. Also we already have icons for these in the table (the black X not shown for unscanned module).

Remaining tasks

Create twig template and css, add it to the right places. It looked like status report CSS/templates are not reusable as-is.

User interface changes

Category summary numbers would be added for custom and contrib modules.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

Comments

Gábor Hojtsy created an issue. See original summary.

tsega’s picture

Here is a first iteration on adding the summary counter.

  1. Added a twig template;
    • registered the template in hook_theme()
    • changed the $build array in UpdateStatusForm.php file buildProjectList() function to use the template and passed in the required variables
  2. Added CSS which is a copy of the System Update Summary; except some minor changes at certain breakpoints because of the 4 status counters instead of three.
  3. Copied the icons to the module itself so there won't be issues with path trying to reference the original ones in core

Upgrade Status Summary Counter

gábor hojtsy’s picture

Status: Active » Needs work

Yay thanks! Great work, looks good. I am pondering whether displaying the zeros is a good idea, but since we have two of these it is probably best for consistency. I think status report hides the ones that would be zero, but there is only one summary there.

I think its a great idea to copy the icons over to be sure that we have them. The patch does not have the icons or the template though. Apart of that, I only found these two minor issues :)

I am happy to commit it once those are done. Thanks!

  1. +++ b/modules/contrib/upgrade_status/css/upgrade_status.admin.theme.css
    @@ -20,56 +20,202 @@
    +/**
    + * @file
    + * Styles for the upgrade status counter.
    + */
    

    Instead of a /* @file */ comment, this should be a simple one line comment. @file comments should only appear at the top of files.

  2. +++ b/modules/contrib/upgrade_status/css/upgrade_status.admin.theme.css
    @@ -20,56 +20,202 @@
    \ No newline at end of file
    

    Should add a newline at the end.

tsega’s picture

Here is the update to the patch. This time I made sure the new files are there :D

Also excluded the zero information from the counter; it actually made sense to remove that.

Only local images are allowed.

  • Gábor Hojtsy committed f11e456 on 8.x-1.x
    Issue #3064582 by tsega: Summarize results in custom and contrib...
gábor hojtsy’s picture

Status: Needs work » Fixed

Thanks, committed this one. I'll work a bit to fix the interface labels, particularly:

1. The category labels translated in twig but provided in PHP will not be extractable. Also not using plural formatting for them will look very odd with "3 ERROR" type of labels.

2. We can use the description to clarify the counter, eg. say "3 ERRORS" in the label but say "Found in 2 projects" or somesuch, instead of repeating the same info that is already displayed.

I should be able to fix these quickly :) Thanks for working on this, yay!

gábor hojtsy’s picture

Worked on a followup commit:

1. Made the main labels formatPlural()
2. Made the summaries talk consistently about number of projects, so where we count the warnings/errors, we also give info about how many projects we found them in.

Committed that in https://git.drupalcode.org/project/upgrade_status/commit/6e481ed7a328030...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.