summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-12-01 23:05:27 +0000
committerGerrit Code Review <review@openstack.org>2022-12-01 23:05:27 +0000
commita7f95784785408afdd2273de7aef33cee31793e1 (patch)
tree8802cf49366a0803062f11e2c3c3940532d128fc
parentf1dc912c28ef322d94961f94d91df7a8ac5bf0c6 (diff)
parentc92c6d3bd9f3002fc032ebee0dfea7ac4d49b557 (diff)
downloadhorizon-a7f95784785408afdd2273de7aef33cee31793e1.tar.gz
Merge "Fix preselection for launch Instance dialog" into stable/xena
-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);
}