@spinnaker/google 0.1.7 → 0.1.8
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/CHANGELOG.md +8 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/serverGroup/details/resize/resizeAutoscalingPolicy.component.js +30 -26
- package/src/serverGroup/details/resize/resizeCapacity.component.js +18 -14
- package/src/serverGroup/details/resize/resizeServerGroup.controller.spec.js +0 -7
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.
|
|
4
|
+
"version": "0.1.8",
|
|
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.
|
|
16
|
+
"@spinnaker/core": "^0.19.2",
|
|
17
17
|
"@uirouter/angularjs": "1.0.26",
|
|
18
18
|
"angular": "1.6.10",
|
|
19
19
|
"angular-ui-bootstrap": "2.5.0",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"shx": "0.3.3",
|
|
38
38
|
"typescript": "4.3.5"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "3ea12b48839ff145c4a602d489507f317b06f856"
|
|
41
41
|
}
|
|
@@ -24,33 +24,37 @@ angular
|
|
|
24
24
|
'$scope',
|
|
25
25
|
'gceAutoscalingPolicyWriter',
|
|
26
26
|
function ($scope, gceAutoscalingPolicyWriter) {
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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_,
|