summaryrefslogtreecommitdiffstats
path: root/lib/toaster
diff options
context:
space:
mode:
authorDave Lerner <dave.lerner@windriver.com>2015-03-18 10:52:48 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-24 22:54:37 +0000
commit24d0938001da27c7ebcf36ce076f2aa58cbcf256 (patch)
tree2f6a0a5d7ea7c05b6aed94402807a1af329c6926 /lib/toaster
parent7c86ed5fb51c6237fa40fb454e58564ef027dd51 (diff)
downloadbitbake-contrib-24d0938001da27c7ebcf36ce076f2aa58cbcf256.tar.gz
toaster: alert fixes for project release change
When a project release changes, if there are layers included with the project, then show the release branch name in the layer list. If there aren't any layers in the project, then suppress the statement on the changed layers. [YOCTO # 7168] Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Diffstat (limited to 'lib/toaster')
-rw-r--r--lib/toaster/toastergui/static/js/projectapp.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/toaster/toastergui/static/js/projectapp.js b/lib/toaster/toastergui/static/js/projectapp.js
index 6b1bbb40f..40e764382 100644
--- a/lib/toaster/toastergui/static/js/projectapp.js
+++ b/lib/toaster/toastergui/static/js/projectapp.js
@@ -608,7 +608,6 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
// requirement https://bugzilla.yoctoproject.org/attachment.cgi?id=2229, notification for changed version to include layers
$scope.zone2alerts.forEach(function (e) { e.close(); });
- alertText += "This has caused the following changes in your project layers:<ul>";
// warnings - this is executed AFTER the generic XHRCall handling is done; at this point,
@@ -620,6 +619,10 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
function (e) {addedLayers.push(e); },
function (e) {deletedLayers.push(e); });
+ var hasDifferentLayers = (addedLayers.length || deletedLayers.length)
+ if (hasDifferentLayers) {
+ alertText += "This has caused the following changes in your project layers:<ul>";
+ }
// some of the deleted layers are actually replaced (changed) layers
var changedLayers = [];
deletedLayers.forEach(function (e) {
@@ -633,14 +636,16 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
});
if (addedLayers.length > 0) {
- alertText += "<li><strong>"+addedLayers.length+"</strong> layer" + ((addedLayers.length>1)?"s changed: ":" changed: ") + addedLayers.map(function (e) { return "<a href=\""+e.layerdetailurl+"\">"+e.name+"</a>"; }).join(", ") + "</li>";
+ alertText += "<li><strong>"+addedLayers.length+"</strong> layer" + ((addedLayers.length>1)?"s":"") + " changed to the <strong> " + $scope.project.release.name + " </strong> branch: " + addedLayers.map(function (e) { return "<a href=\""+e.layerdetailurl+"\">"+e.name+"</a>"; }).join(", ") + "</li>";
}
if (deletedLayers.length > 0) {
- alertText += "<li><strong>"+deletedLayers.length+"</strong> layer" + ((deletedLayers.length>1)?"s deleted: ":"deleted: ") + deletedLayers.map(function (e) { return "<a href=\""+e.layerdetailurl+"\">"+e.name+"</a>"; }).join(", ") + "</li>";
+ alertText += "<li><strong>"+deletedLayers.length+"</strong> layer" + ((deletedLayers.length>1)?"s":"") + " deleted from the <strong> " + $scope.project.release.name + " </strong> branch: " + deletedLayers.map(function (e) { return "<a href=\""+e.layerdetailurl+"\">"+e.name+"</a>"; }).join(", ") + "</li>";
}
}
- alertText += "</ul>";
+ if (hasDifferentLayers) {
+ alertText += "</ul>";
+ }
}
$scope.displayAlert(alertZone, alertText, "alert-info");
});