@spinnaker/google 0.1.6 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spinnaker/google",
3
3
  "license": "Apache-2.0",
4
- "version": "0.1.6",
4
+ "version": "0.1.9",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "scripts": {
@@ -13,7 +13,7 @@
13
13
  "lib": "npm run build"
14
14
  },
15
15
  "dependencies": {
16
- "@spinnaker/core": "^0.19.0",
16
+ "@spinnaker/core": "^0.19.3",
17
17
  "@uirouter/angularjs": "1.0.26",
18
18
  "angular": "1.6.10",
19
19
  "angular-ui-bootstrap": "2.5.0",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@spinnaker/eslint-plugin": "^3.0.1",
30
- "@spinnaker/scripts": "^0.2.4",
30
+ "@spinnaker/scripts": "^0.2.5",
31
31
  "@types/angular": "1.6.26",
32
32
  "@types/angular-mocks": "1.5.10",
33
33
  "@types/angular-ui-bootstrap": "0.13.41",
@@ -37,5 +37,5 @@
37
37
  "shx": "0.3.3",
38
38
  "typescript": "4.3.5"
39
39
  },
40
- "gitHead": "9f35728cf0ae71f5b28422920e4f802d92193845"
40
+ "gitHead": "4e2ec409f093985f4c084f8140c650f29bb9009b"
41
41
  }
@@ -24,33 +24,37 @@ angular
24
24
  '$scope',
25
25
  'gceAutoscalingPolicyWriter',
26
26
  function ($scope, gceAutoscalingPolicyWriter) {
27
- const newPolicyBounds = ['newMinNumReplicas', 'newMaxNumReplicas'];
28
- newPolicyBounds.forEach((prop) => (this.command[prop] = null));
27
+ // In Angular 1.7 Directive bindings were removed in the constructor, default values now must be instantiated within $onInit
28
+ // See https://docs.angularjs.org/guide/migration#-compile- and https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
29
+ this.$onInit = () => {
30
+ const newPolicyBounds = ['newMinNumReplicas', 'newMaxNumReplicas'];
31
+ newPolicyBounds.forEach((prop) => (this.command[prop] = null));
29
32
 
30
- angular.extend(this.formMethods, {
31
- formIsValid: () =>
32
- _.every([
33
- _.chain(newPolicyBounds)
34
- .map((bound) => this.command[bound] !== null)
35
- .every()
36
- .value(),
37
- $scope.resizeAutoscalingPolicyForm.$valid,
38
- ]),
39
- submitMethod: () => {
40
- return gceAutoscalingPolicyWriter.upsertAutoscalingPolicy(
41
- this.application,
42
- this.serverGroup,
43
- {
44
- minNumReplicas: this.command.newMinNumReplicas,
45
- maxNumReplicas: this.command.newMaxNumReplicas,
46
- },
47
- {
48
- reason: this.command.reason,
49
- interestingHealthProviderNames: this.command.interestingHealthProviderNames,
50
- },
51
- );
52
- },
53
- });
33
+ angular.extend(this.formMethods, {
34
+ formIsValid: () =>
35
+ _.every([
36
+ _.chain(newPolicyBounds)
37
+ .map((bound) => this.command[bound] !== null)
38
+ .every()
39
+ .value(),
40
+ $scope.resizeAutoscalingPolicyForm.$valid,
41
+ ]),
42
+ submitMethod: () => {
43
+ return gceAutoscalingPolicyWriter.upsertAutoscalingPolicy(
44
+ this.application,
45
+ this.serverGroup,
46
+ {
47
+ minNumReplicas: this.command.newMinNumReplicas,
48
+ maxNumReplicas: this.command.newMaxNumReplicas,
49
+ },
50
+ {
51
+ reason: this.command.reason,
52
+ interestingHealthProviderNames: this.command.interestingHealthProviderNames,
53
+ },
54
+ );
55
+ },
56
+ });
57
+ };
54
58
  },
55
59
  ],
56
60
  });
@@ -22,21 +22,25 @@ angular
22
22
  '$scope',
23
23
  'serverGroupWriter',
24
24
  function ($scope, serverGroupWriter) {
25
- this.command.newSize = null;
25
+ // In Angular 1.7 Directive bindings were removed in the constructor, default values now must be instantiated within $onInit
26
+ // See https://docs.angularjs.org/guide/migration#-compile- and https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
27
+ this.$onInit = () => {
28
+ this.command.newSize = null;
26
29
 
27
- angular.extend(this.formMethods, {
28
- formIsValid: () => _.every([this.command.newSize !== null, $scope.resizeCapacityForm.$valid]),
29
- submitMethod: () => {
30
- return serverGroupWriter.resizeServerGroup(this.serverGroup, this.application, {
31
- capacity: { min: this.command.newSize, max: this.command.newSize, desired: this.command.newSize },
32
- serverGroupName: this.serverGroup.name,
33
- targetSize: this.command.newSize,
34
- region: this.serverGroup.region,
35
- interestingHealthProviderNames: this.command.interestingHealthProviderNames,
36
- reason: this.command.reason,
37
- });
38
- },
39
- });
30
+ angular.extend(this.formMethods, {
31
+ formIsValid: () => _.every([this.command.newSize !== null, $scope.resizeCapacityForm.$valid]),
32
+ submitMethod: () => {
33
+ return serverGroupWriter.resizeServerGroup(this.serverGroup, this.application, {
34
+ capacity: { min: this.command.newSize, max: this.command.newSize, desired: this.command.newSize },
35
+ serverGroupName: this.serverGroup.name,
36
+ targetSize: this.command.newSize,
37
+ region: this.serverGroup.region,
38
+ interestingHealthProviderNames: this.command.interestingHealthProviderNames,
39
+ reason: this.command.reason,
40
+ });
41
+ },
42
+ });
43
+ };
40
44
  },
41
45
  ],
42
46
  });
@@ -18,13 +18,6 @@ describe('Controller: gceResizeServerGroupCtrl', function () {
18
18
  ),
19
19
  );
20
20
 
21
- // https://docs.angularjs.org/guide/migration#migrate1.5to1.6-ng-services-$compile
22
- beforeEach(
23
- window.module(($compileProvider) => {
24
- $compileProvider.preAssignBindingsEnabled(true);
25
- }),
26
- );
27
-
28
21
  beforeEach(
29
22
  window.inject(function (
30
23
  _$controller_,