Skip to content

Commit

Permalink
chore(angularjs): Explicitly annotate all AngularJS injection points
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Feb 21, 2019
1 parent 2ba3b8d commit f3fd790
Show file tree
Hide file tree
Showing 584 changed files with 1,036 additions and 867 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface IAmazonMultiInstanceJob extends IMultiInstanceJob {
}

export class AmazonInstanceWriter extends InstanceWriter {
public static $inject = ['providerServiceDelegate'];
public constructor(protected providerServiceDelegate: ProviderServiceDelegate) {
'ngInject';
super(providerServiceDelegate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { API } from '@spinnaker/core';

module.exports = angular
.module('spinnaker.amazon.instanceType.service', [])
.factory('awsInstanceTypeService', function($http, $q) {
.factory('awsInstanceTypeService', ['$http', '$q', function($http, $q) {
var m5 = {
type: 'm5',
description:
Expand Down Expand Up @@ -289,4 +289,4 @@ module.exports = angular
filterInstanceTypes,
isEbsOptimized,
};
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = angular
require('../../vpc/vpcTag.directive').name,
CONFIRMATION_MODAL_SERVICE,
])
.controller('awsInstanceDetailsCtrl', function(
.controller('awsInstanceDetailsCtrl', ['$scope', '$state', '$uibModal', 'amazonInstanceWriter', 'confirmationModalService', 'instance', 'app', 'moniker', 'environment', '$q', 'overrides', function(
$scope,
$state,
$uibModal,
Expand Down Expand Up @@ -514,4 +514,4 @@ module.exports = angular
});

$scope.account = instance.account;
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class AwsLoadBalancerDetailsController implements IController {
public firewallsLabel = FirewallLabels.get('Firewalls');
public oidcConfigPath = SETTINGS.oidcConfigPath;

public static $inject = ['$scope', '$state', '$q', 'loadBalancer', 'app', 'securityGroupReader', 'loadBalancerReader'];
constructor(
private $scope: IScope,
private $state: StateService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class AwsTargetGroupDetailsController implements IController {
public targetGroup: ITargetGroup;
public loadBalancer: IAmazonApplicationLoadBalancer;

public static $inject = ['$scope', '$q', '$state', 'targetGroup', 'app'];
constructor(
private $scope: IScope,
private $q: IQService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TargetGroupDetails } from './TargetGroupDetails';

export const TARGET_GROUP_STATES = 'spinnaker.amazon.loadBalancer.targetGroup.states';
module(TARGET_GROUP_STATES, [APPLICATION_STATE_PROVIDER]).config(
(applicationStateProvider: ApplicationStateProvider) => {
['applicationStateProvider', (applicationStateProvider: ApplicationStateProvider) => {
const targetGroupDetails: INestedState = {
name: 'targetGroupDetails',
url: '/targetGroupDetails/:provider/:accountId/:region/:vpcId/:loadBalancerName/:name',
Expand Down Expand Up @@ -49,5 +49,5 @@ module(TARGET_GROUP_STATES, [APPLICATION_STATE_PROVIDER]).config(
};

applicationStateProvider.addInsightDetailState(targetGroupDetails);
},
}],
);
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = angular
restartable: true,
});
})
.controller('awsBakeStageCtrl', function($scope, $q, $uibModal) {
.controller('awsBakeStageCtrl', ['$scope', '$q', '$uibModal', function($scope, $q, $uibModal) {
$scope.stage.extendedAttributes = $scope.stage.extendedAttributes || {};
$scope.stage.regions = ($scope.stage.regions && $scope.stage.regions.sort()) || [];

Expand Down Expand Up @@ -164,4 +164,4 @@ module.exports = angular
$scope.$watch('stage', deleteEmptyProperties, true);

initialize();
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SETTINGS } from '@spinnaker/core';

module.exports = angular
.module('spinnaker.amazon.pipeline.stage.bake.executionDetails.controller', [require('@uirouter/angularjs').default])
.controller('awsBakeExecutionDetailsCtrl', function(
.controller('awsBakeExecutionDetailsCtrl', ['$scope', '$stateParams', 'executionDetailsSectionService', '$interpolate', function(
$scope,
$stateParams,
executionDetailsSectionService,
Expand All @@ -29,4 +29,4 @@ module.exports = angular
initialize();

$scope.$on('$stateChangeSuccess', initialize);
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = angular
],
});
})
.controller('awsCloneServerGroupStageCtrl', function($scope) {
.controller('awsCloneServerGroupStageCtrl', ['$scope', function($scope) {
let stage = $scope.stage;

$scope.viewState = {
Expand Down Expand Up @@ -128,4 +128,4 @@ module.exports = angular
stage.useAmiBlockDeviceMappings = false;
}
};
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = angular
],
});
})
.controller('awsDestroyAsgStageCtrl', function($scope) {
.controller('awsDestroyAsgStageCtrl', ['$scope', function($scope) {
let stage = $scope.stage;

$scope.state = {
Expand Down Expand Up @@ -58,4 +58,4 @@ module.exports = angular
if (!stage.target) {
stage.target = $scope.targets[0].val;
}
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = angular
],
});
})
.controller('awsDisableAsgStageCtrl', function($scope) {
.controller('awsDisableAsgStageCtrl', ['$scope', function($scope) {
let stage = $scope.stage;

$scope.state = {
Expand Down Expand Up @@ -62,4 +62,4 @@ module.exports = angular
if (!stage.target) {
stage.target = $scope.targets[0].val;
}
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = angular
],
});
})
.controller('awsDisableClusterStageCtrl', function($scope) {
.controller('awsDisableClusterStageCtrl', ['$scope', function($scope) {
var ctrl = this;

let stage = $scope.stage;
Expand Down Expand Up @@ -76,4 +76,4 @@ module.exports = angular
stage.preferLargerOverNewer = 'false';
}
stage.preferLargerOverNewer = stage.preferLargerOverNewer.toString();
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = angular
],
});
})
.controller('awsEnableAsgStageCtrl', function($scope) {
.controller('awsEnableAsgStageCtrl', ['$scope', function($scope) {
var ctrl = this;

let stage = $scope.stage;
Expand Down Expand Up @@ -66,4 +66,4 @@ module.exports = angular
}

$scope.$watch('stage.credentials', $scope.accountUpdated);
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = angular
],
});
})
.controller('awsFindAmiStageCtrl', function($scope) {
.controller('awsFindAmiStageCtrl', ['$scope', function($scope) {
let stage = $scope.stage;

$scope.state = {
Expand Down Expand Up @@ -71,4 +71,4 @@ module.exports = angular
}

$scope.$watch('stage.credentials', $scope.accountUpdated);
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ module.exports = angular
],
});
})
.controller('awsFindImageFromTagsStageCtrl', function($scope) {
.controller('awsFindImageFromTagsStageCtrl', ['$scope', function($scope) {
$scope.stage.tags = $scope.stage.tags || {};
$scope.stage.regions = $scope.stage.regions || [];
$scope.stage.cloudProvider = $scope.stage.cloudProvider || 'aws';

BakeryReader.getRegions('aws').then(function(regions) {
$scope.regions = regions;
});
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = angular
strategy: true,
});
})
.controller('ModifyScalingProcessStageCtrl', function($scope, stage) {
.controller('ModifyScalingProcessStageCtrl', ['$scope', 'stage', function($scope, stage) {
$scope.stage = stage;

$scope.state = {
Expand Down Expand Up @@ -89,4 +89,4 @@ module.exports = angular
};

$scope.$watch('stage.credentials', $scope.accountUpdated);
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = angular
],
});
})
.controller('awsResizeAsgStageCtrl', function($scope) {
.controller('awsResizeAsgStageCtrl', ['$scope', function($scope) {
var ctrl = this;

let stage = $scope.stage;
Expand Down Expand Up @@ -120,4 +120,4 @@ module.exports = angular
}
}
};
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = angular
],
});
})
.controller('awsRollbackClusterStageCtrl', function($scope) {
.controller('awsRollbackClusterStageCtrl', ['$scope', function($scope) {
var ctrl = this;

let stage = $scope.stage;
Expand Down Expand Up @@ -56,4 +56,4 @@ module.exports = angular
if (!stage.regions.length && $scope.application.defaultRegions.aws) {
stage.regions.push($scope.application.defaultRegions.aws);
}
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = angular
strategy: true,
});
})
.controller('awsScaleDownClusterStageCtrl', function($scope) {
.controller('awsScaleDownClusterStageCtrl', ['$scope', function($scope) {
var ctrl = this;

let stage = $scope.stage;
Expand Down Expand Up @@ -70,4 +70,4 @@ module.exports = angular
stage.preferLargerOverNewer = 'false';
}
stage.preferLargerOverNewer = stage.preferLargerOverNewer.toString();
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = angular
],
});
})
.controller('awsShrinkClusterStageCtrl', function($scope) {
.controller('awsShrinkClusterStageCtrl', ['$scope', function($scope) {
var ctrl = this;

let stage = $scope.stage;
Expand Down Expand Up @@ -65,4 +65,4 @@ module.exports = angular
stage.retainLargerOverNewer = 'false';
}
stage.retainLargerOverNewer = stage.retainLargerOverNewer.toString();
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = angular
executionConfigSections: ['tagImageConfig', 'taskStatus'],
});
})
.controller('awsTagImageStageCtrl', $scope => {
.controller('awsTagImageStageCtrl', ['$scope', $scope => {
$scope.stage.tags = $scope.stage.tags || {};
$scope.stage.cloudProvider = $scope.stage.cloudProvider || 'aws';

Expand All @@ -27,4 +27,4 @@ module.exports = angular
$scope.consideredStages = new Map(upstreamDependencies.map(stage => [stage.refId, stage.name]));
};
$scope.$watch('stage.requisiteStageRefIds', initUpstreamStages);
});
}]);
4 changes: 2 additions & 2 deletions app/scripts/modules/amazon/src/reactShims/aws.react.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { AwsNgReact } from './aws.ngReact';
import { AwsReactInjector } from './aws.react.injector';

export const AWS_REACT_MODULE = 'spinnaker.amazon.react';
module(AWS_REACT_MODULE, []).run(function($injector: any) {
module(AWS_REACT_MODULE, []).run(['$injector', function($injector: any) {
// Make angular services importable and (TODO when relevant) convert angular components to react
AwsReactInjector.initialize($injector);
AwsNgReact.initialize($injector);
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = angular
.module('spinnaker.amazon.securityGroup.clone.controller', [
require('../configure/configSecurityGroup.mixin.controller').name,
])
.controller('awsCloneSecurityGroupController', function(
.controller('awsCloneSecurityGroupController', ['$scope', '$uibModalInstance', '$controller', 'securityGroup', 'application', function(
$scope,
$uibModalInstance,
$controller,
Expand Down Expand Up @@ -95,4 +95,4 @@ module.exports = angular
};

vm.initializeSecurityGroups();
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = angular
require('@uirouter/angularjs').default,
CACHE_INITIALIZER_SERVICE,
])
.controller('awsCreateSecurityGroupCtrl', function(
.controller('awsCreateSecurityGroupCtrl', ['$scope', '$uibModalInstance', '$state', '$controller', 'cacheInitializer', 'application', 'securityGroup', function(
$scope,
$uibModalInstance,
$state,
Expand Down Expand Up @@ -42,4 +42,4 @@ module.exports = angular
ctrl.upsert = () => ctrl.mixinUpsert('Create');

ctrl.initializeSecurityGroups().then(ctrl.initializeAccounts);
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SecurityGroupWriter, TaskMonitor, FirewallLabels } from '@spinnaker/cor

module.exports = angular
.module('spinnaker.amazon.securityGroup.edit.controller', [require('@uirouter/angularjs').default])
.controller('awsEditSecurityGroupCtrl', function(
.controller('awsEditSecurityGroupCtrl', ['$scope', '$uibModalInstance', '$state', 'application', 'securityGroup', '$controller', function(
$scope,
$uibModalInstance,
$state,
Expand Down Expand Up @@ -107,4 +107,4 @@ module.exports = angular
};

this.initializeSecurityGroups().then(this.initializeAccounts);
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = angular
require('@uirouter/angularjs').default,
SECURITY_GROUP_READER,
])
.controller('awsConfigSecurityGroupMixin', function(
.controller('awsConfigSecurityGroupMixin', ['$scope', '$state', '$uibModalInstance', 'application', 'securityGroup', 'securityGroupReader', 'cacheInitializer', function(
$scope,
$state,
$uibModalInstance,
Expand Down Expand Up @@ -336,4 +336,4 @@ module.exports = angular

var classicPattern = /^[\x20-\x7F]+$/;
var vpcPattern = /^[a-zA-Z0-9\s._\-:/()#,@[\]+=&;{}!$*]+$/;
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = angular
CONFIRMATION_MODAL_SERVICE,
require('../clone/cloneSecurityGroup.controller').name,
])
.controller('awsSecurityGroupDetailsCtrl', function(
.controller('awsSecurityGroupDetailsCtrl', ['$scope', '$state', 'resolvedSecurityGroup', 'app', 'confirmationModalService', 'securityGroupReader', '$uibModal', function(
$scope,
$state,
resolvedSecurityGroup,
Expand Down Expand Up @@ -217,4 +217,4 @@ module.exports = angular
refresh: extractSecurityGroup,
};
}
});
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = angular
INSTANCE_TYPE_SERVICE,
AWS_SERVER_GROUP_CONFIGURATION_SERVICE,
])
.factory('awsServerGroupCommandBuilder', function($q, instanceTypeService, awsServerGroupConfigurationService) {
.factory('awsServerGroupCommandBuilder', ['$q', 'instanceTypeService', 'awsServerGroupConfigurationService', function($q, instanceTypeService, awsServerGroupConfigurationService) {
function buildNewServerGroupCommand(application, defaults) {
defaults = defaults || {};
var credentialsLoader = AccountService.getCredentialsKeyedByAccount('aws');
Expand Down Expand Up @@ -334,4 +334,4 @@ module.exports = angular
buildServerGroupCommandFromPipeline: buildServerGroupCommandFromPipeline,
buildUpdateServerGroupCommand: buildUpdateServerGroupCommand,
};
});
}]);
Loading

0 comments on commit f3fd790

Please sign in to comment.