Skip to content

Commit

Permalink
chore(azure/pipeline): Migrate from $q.all({}) to $q.all([])
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen authored and mergify[bot] committed Oct 26, 2020
1 parent f8b38de commit 7cc752b
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ module(AZURE_PIPELINE_STAGES_BAKE_AZUREBAKESTAGE, [AZURE_PIPELINE_STAGES_BAKE_BA
};

function initialize() {
$q.all({
regions: BakeryReader.getRegions('azure'),
baseOsOptions: BakeryReader.getBaseOsOptions('azure'),
baseLabelOptions: BakeryReader.getBaseLabelOptions(),
}).then(function (results) {
$scope.regions = results.regions;
$q.all([
BakeryReader.getRegions('azure'),
BakeryReader.getBaseOsOptions('azure'),
BakeryReader.getBaseLabelOptions(),
]).then(function ([regions, baseOsOptions, baseLabelOptions]) {
$scope.regions = regions;
if ($scope.regions.length === 1) {
$scope.stage.region = $scope.regions[0];
} else if (!$scope.regions.includes($scope.stage.region)) {
Expand All @@ -80,12 +80,12 @@ module(AZURE_PIPELINE_STAGES_BAKE_AZUREBAKESTAGE, [AZURE_PIPELINE_STAGES_BAKE_BA
if (!$scope.stage.regions.length && $scope.application.defaultRegions.azure) {
$scope.stage.regions.push($scope.application.defaultRegions.azure);
}
$scope.baseOsOptions = results.baseOsOptions.baseImages;
$scope.baseOsOptions = baseOsOptions.baseImages;
if ($scope.baseOsOptions.length) {
$scope.stage.osType = results.baseOsOptions.baseImages[0].osType;
$scope.stage.osType = baseOsOptions.baseImages[0].osType;
}

$scope.baseLabelOptions = results.baseLabelOptions;
$scope.baseLabelOptions = baseLabelOptions;

if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {
$scope.stage.baseOs = $scope.baseOsOptions[0].id;
Expand Down

0 comments on commit 7cc752b

Please sign in to comment.