Skip to content

Commit

Permalink
Make the "Select Boot Source" order deterministic
Browse files Browse the repository at this point in the history
This patch makes the "Select Boot Source" dropdown in the Source step of
the new Launch Instance have a deterministic order.

The slight downside to this is that the order needs to be recalculated
as new possible boot sources are loaded. However, given that this is the
second step of the workflow, this is unlikely to ever be noticed by a
user.

Change-Id: Iaa2e37bae02c9ce5ab654ac8a3327c0834e7b49e
Closes-Bug: 1640493
  • Loading branch information
Rob Cresswell committed May 19, 2017
1 parent 1f9e7b6 commit b0099bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -671,6 +671,9 @@
type: type,
label: label
});
model.allowedBootSources.sort(function(a, b) {
return a.type > b.type;
});
}
}

Expand Down
Expand Up @@ -393,8 +393,7 @@
return $scope.model.allowedBootSources;
},
function changeBootSource(newValue) {
if (angular.isArray(newValue) && newValue.length > 0 &&
!$scope.model.newInstanceSpec.source_type) {
if (angular.isArray(newValue) && newValue.length > 0) {
updateBootSourceSelection(newValue[0].type);
$scope.model.newInstanceSpec.source_type = newValue[0];
}
Expand Down

0 comments on commit b0099bb

Please sign in to comment.