Display the version when confirming "Delete"
When confirming an image delete the GUI now displays
"Delete firmware v2.0-165-ge571670?"
Resolves openbmc/openbmc#2961
Tested: Confirmed text is correct and delete works
Change-Id: Iad23908fbafc9514044be7770d269e723b35cb58
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/directives/firmware-list.html b/app/common/directives/firmware-list.html
index ceec160..2afbf0a 100644
--- a/app/common/directives/firmware-list.html
+++ b/app/common/directives/firmware-list.html
@@ -58,7 +58,7 @@
<div class="table__cell">
<span class="table__cell-label">Action:</span>
<button class="firmware__action-link" ng-show="firmware.activationStatus == 'Ready'" ng-click="activate(firmware.imageId)">Activate</button>
- <button class="firmware__action-link" ng-show="firmware.activationStatus != 'Functional'" ng-click="delete(firmware.imageId)">Delete</button>
+ <button class="firmware__action-link" ng-show="firmware.activationStatus != 'Functional'" ng-click="delete(firmware.imageId, firmware.Version)">Delete</button>
</div>
</div>
</div>
diff --git a/app/common/directives/firmware-list.js b/app/common/directives/firmware-list.js
index 69a8bdd..0404fe6 100644
--- a/app/common/directives/firmware-list.js
+++ b/app/common/directives/firmware-list.js
@@ -19,8 +19,8 @@
$scope.$parent.activateImage(imageId);
}
- $scope.delete = function(imageId){
- $scope.$parent.deleteImage(imageId);
+ $scope.delete = function(imageId, imageVersion){
+ $scope.$parent.deleteImage(imageId, imageVersion);
}
$scope.changePriority = function(imageId, imageVersion, from, to){
diff --git a/app/configuration/controllers/firmware-controller.js b/app/configuration/controllers/firmware-controller.js
index 9416177..d46b6e4 100644
--- a/app/configuration/controllers/firmware-controller.js
+++ b/app/configuration/controllers/firmware-controller.js
@@ -36,6 +36,7 @@
$scope.reboot_confirm = false;
$scope.preserve_settings_confirm = false;
$scope.delete_image_id = "";
+ $scope.delete_image_version = "";
$scope.activate_image_id = "";
$scope.priority_image_id = "";
$scope.priority_image_version = "";
@@ -167,8 +168,9 @@
});
$scope.confirm_priority = false;
}
- $scope.deleteImage = function(imageId){
+ $scope.deleteImage = function(imageId, imageVersion){
$scope.delete_image_id = imageId;
+ $scope.delete_image_version = imageVersion;
$scope.confirm_delete = true;
}
$scope.confirmDeleteImage = function(){