]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: fix progress bar in MySQL environment
authorElliot Smith <elliot.smith@intel.com>
Fri, 13 May 2016 16:02:58 +0000 (17:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 May 2016 16:45:43 +0000 (17:45 +0100)
When using MySQL, the project builds info delivered by MySQL
differs from that delivered by SQLite: the former returns text
values from the enumeration for Build outcomes, while the latter
returns the integer value. This causes the progress bar JS to
break, as it is expecting outcome strings.

Modify the recent_build() method to include an outcomeText property
for each Build object, then use this in the conditionals in the
progress bar JS.

[YOCTO #9498]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/orm/models.py
lib/toaster/toastergui/static/js/mrbsection.js

index 2669606e2ee2f71be58c9a59428a2991366f65c9..88967a23f57b3ffbc7bfb45039bb2f8c8dc24716 100644 (file)
@@ -416,6 +416,7 @@ class Build(models.Model):
         # to show build progress in mrb_section.html
         for build in recent_builds:
             build.percentDone = build.completeper()
+            build.outcomeText = build.get_outcome_text()
 
         return recent_builds
 
index 09117e1daf3d8ff7851d63b996e371bf6ce156fb..9a76ee6407043419ee954d3ac59182cd42af97aa 100644 (file)
@@ -57,12 +57,12 @@ function mrbSectionInit(ctx){
           for (var i in prjInfo.builds){
             var build = prjInfo.builds[i];
 
-            if (build.outcome === "In Progress" ||
+            if (build.outcomeText === "In Progress" ||
                $(".progress .bar").length > 0){
               /* Update the build progress */
               var percentDone;
 
-              if (build.outcome !== "In Progress"){
+              if (build.outcomeText !== "In Progress"){
                 /* We have to ignore the value when it's Succeeded because it
                 *   goes back to 0
                 */