diff options
author | Zuul <zuul@review.opendev.org> | 2022-12-01 23:05:30 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-12-01 23:05:30 +0000 |
commit | 02c241daea1806bf0032efe0ec8f220cc9d040f7 (patch) | |
tree | c33ca8ac7411eadbc38cc7a1d4fbea6bc5b4366e | |
parent | 22d629caecceba1f2bdcf3565e04b3f0a2ec06ce (diff) | |
parent | ef2eff72995bf9847b2cda5f0e6ec27742ffb20a (diff) | |
download | horizon-02c241daea1806bf0032efe0ec8f220cc9d040f7.tar.gz |
Merge "Fix preselection for launch Instance dialog" into stable/wallaby
-rw-r--r-- | openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js | 13 |
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 9f0801723..bbe868f54 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 @@ -408,7 +408,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) @@ -416,7 +416,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++) { @@ -482,8 +482,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); } |