Problem/Motivation

We have a use case that requires us to customize the progress bar, that's currently not possible.

Proposed resolution

Change it to expect a list of parts and some other meta information to make that available to custom templates and preprocess hooks.

Remaining tasks

User interface changes

None.

API changes

The template arguments change.

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

Status: Active » Needs review
FileSize
4.52 KB

Status: Needs review » Needs work

The last submitted patch, 2: tmgmt-refactor-progress-template-2944131-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Berdir’s picture

Tests failed due to the additional class.

miro_dietiker’s picture

In general looks pretty clean. One detail..

+++ b/src/Plugin/views/field/Progress.php
@@ -67,24 +67,36 @@ class Progress extends StatisticsBase {
+          'width' => $counts['@pending'] / $sum * 100,
...
+          'width' => $counts['@translated'] / $sum * 100,
...
+          'width' => $counts['@reviewed'] / $sum * 100,
...
+          'width' => $counts['@accepted'] / $sum * 100,

I'd expect that we need to round somewhere?

  • Berdir committed 432cc08 on 8.x-1.x
    Issue #2944131 by Berdir: Refactor progress bar template so it is easier...
Berdir’s picture

Status: Needs review » Fixed

Thought about that, but it was like this before but I've never a problem. As discussed, kept and committed.

Status: Fixed » Closed (fixed)

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