summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-11-25 13:49:33 +0000
committerGerrit Code Review <review@openstack.org>2022-11-25 13:49:33 +0000
commitb8648536c6422023354b28575d870f0326182d3e (patch)
tree85d2042e588e52e4bec4c861820354be38de954b
parent2f6b1e906a5852d9c27892ba2e8a614d7fb5f4b9 (diff)
parent452c37dd369d2fa4c0dac9da1aba53bf1da89a30 (diff)
downloadhorizon-b8648536c6422023354b28575d870f0326182d3e.tar.gz
Merge "Fix preselection for launch Instance dialog"
-rw-r--r--openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
index 3a22b26df..24b949144 100644
--- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
+++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js
@@ -410,7 +410,7 @@
);
// When the allowedboot list changes, change the source_type
- // and update the table for the new source selection. The devault value is
+ // and update the table for the new source selection. The default value is
// set by the DEFAULT_BOOT_SOURCE config option.
// The boot source is changed only if the selected value is not included
// in the updated list (newValue)
@@ -418,7 +418,7 @@
function getAllowedBootSources() {
return $scope.model.allowedBootSources;
},
- function changeBootSource(newValue) {
+ function updateBootSource(newValue) {
if (angular.isArray(newValue) && newValue.length > 0 ) {
var opt = newValue[0];
for (var index = 0; index < newValue.length; index++) {
@@ -484,8 +484,17 @@
updateFacets(key);
}
+ // Update the initial boot source selection when launching from a preselected source
function updateDataSource(key, preSelection) {
if (preSelection) {
+ for (var index = 0; index < $scope.model.allowedBootSources.length; index++) {
+ if ($scope.model.allowedBootSources[index].type === key) {
+ $scope.model.allowedBootSources[index].selected = true;
+ }
+ else {
+ $scope.model.allowedBootSources[index].selected = false;
+ }
+ }
ctrl.selection.length = 0;
push.apply(selection, preSelection);
}