@spinnaker/core 0.29.0 → 0.29.1

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/core",
3
3
  "license": "Apache-2.0",
4
- "version": "0.29.0",
4
+ "version": "0.29.1",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "publishConfig": {
@@ -123,5 +123,5 @@
123
123
  "shx": "0.3.3",
124
124
  "typescript": "4.3.5"
125
125
  },
126
- "gitHead": "082a084908e13888d640e88a5bd6e1571479de14"
126
+ "gitHead": "2f7f8de7b0c43ea29ac505a9b4c0f5d9b29456f4"
127
127
  }
@@ -8,72 +8,101 @@ export interface IRedBlackStrategyAdditionalFieldsProps extends IDeploymentStrat
8
8
  command: IRedBlackCommand;
9
9
  }
10
10
 
11
- export const AdditionalFields = ({ command, onChange }: IRedBlackStrategyAdditionalFieldsProps) => (
12
- <div className="form-group">
13
- <div className="col-md-12 checkbox">
14
- <label>
15
- <input
16
- type="checkbox"
17
- checked={command.rollback?.onFailure ?? false}
18
- onChange={(e) => onChange('rollback.onFailure', e.target.checked)}
19
- />
20
- Rollback to previous server group if deployment fails <HelpField id="strategy.redblack.rollback" />
21
- </label>
22
- </div>
23
- <div className="col-md-12 checkbox">
24
- <label>
25
- <input type="checkbox" checked={command.scaleDown} onChange={(e) => onChange('scaleDown', e.target.checked)} />
26
- Scale down replaced server groups to zero instances
27
- <HelpField id="strategy.redblack.scaleDown" />
28
- </label>
29
- </div>
30
- <div className="col-md-12 form-inline">
31
- <label>
32
- Maximum number of server groups to leave
33
- <HelpField id="strategy.redblack.maxRemainingAsgs" />
34
- </label>
35
- <input
36
- className="form-control input-sm"
37
- style={{ width: '50px' }}
38
- type="number"
39
- value={command.maxRemainingAsgs}
40
- onChange={(e) => onChange('maxRemainingAsgs', e.target.value)}
41
- min="2"
42
- />
43
- </div>
44
- <div className="col-md-12 form-inline">
45
- <label>
46
- Wait Before Disable
47
- <HelpField content="Time to wait before disabling all old server groups in this cluster" />
48
- </label>
49
- <input
50
- className="form-control input-sm"
51
- style={{ width: '60px' }}
52
- min="0"
53
- type="number"
54
- value={command.delayBeforeDisableSec}
55
- onChange={(e) => onChange('delayBeforeDisableSec', e.target.value)}
56
- placeholder="0"
57
- />
58
- seconds
59
- </div>
60
- {command.scaleDown && (
61
- <div className="col-md-12 form-inline" style={{ marginTop: '5px' }}>
62
- <label>
63
- Wait Before Scale Down
64
- <HelpField content="Time to wait before scaling down all old server groups in this cluster" />
65
- </label>
66
- <input
67
- className="form-control input-sm"
68
- style={{ width: '60px' }}
69
- min="0"
70
- type="number"
71
- value={command.delayBeforeScaleDownSec}
72
- onChange={(e) => onChange('delayBeforeScaleDownSec', e.target.value)}
73
- placeholder="0"
74
- />
75
- seconds
11
+ export class AdditionalFields extends React.Component<IRedBlackStrategyAdditionalFieldsProps> {
12
+ private rollbackOnFailureChange = (e: React.ChangeEvent<HTMLInputElement>) => {
13
+ this.props.command.rollback.onFailure = e.target.checked;
14
+ this.forceUpdate();
15
+ };
16
+
17
+ private scaleDownChange = (e: React.ChangeEvent<HTMLInputElement>) => {
18
+ this.props.command.scaleDown = e.target.checked;
19
+ this.forceUpdate();
20
+ };
21
+
22
+ private maxRemainingAsgsChange = (e: React.ChangeEvent<HTMLInputElement>) => {
23
+ this.props.command.maxRemainingAsgs = parseInt(e.target.value, 10);
24
+ this.forceUpdate();
25
+ };
26
+
27
+ private delayBeforeDisableSecChange = (e: React.ChangeEvent<HTMLInputElement>) => {
28
+ this.props.command.delayBeforeDisableSec = parseInt(e.target.value, 10);
29
+ this.forceUpdate();
30
+ };
31
+
32
+ private delayBeforeScaleDownSecChange = (e: React.ChangeEvent<HTMLInputElement>) => {
33
+ this.props.command.delayBeforeScaleDownSec = parseInt(e.target.value, 10);
34
+ this.forceUpdate();
35
+ };
36
+
37
+ public render() {
38
+ const { command } = this.props;
39
+ return (
40
+ <div className="form-group">
41
+ <div className="col-md-12 checkbox" style={{ marginTop: 0 }}>
42
+ <label>
43
+ <input
44
+ type="checkbox"
45
+ checked={command.rollback?.onFailure ?? false}
46
+ onChange={this.rollbackOnFailureChange}
47
+ />
48
+ Rollback to previous server group if deployment fails <HelpField id="strategy.redblack.rollback" />
49
+ </label>
50
+ </div>
51
+ <div className="col-md-12 checkbox">
52
+ <label>
53
+ <input type="checkbox" checked={command.scaleDown} onChange={this.scaleDownChange} />
54
+ Scale down replaced server groups to zero instances <HelpField id="strategy.redblack.scaleDown" />
55
+ </label>
56
+ </div>
57
+ <div className="col-md-12 form-inline">
58
+ <label>
59
+ Maximum number of server groups to leave
60
+ <HelpField id="strategy.redblack.maxRemainingAsgs" />
61
+ </label>
62
+ <input
63
+ className="form-control input-sm"
64
+ style={{ width: '50px' }}
65
+ type="number"
66
+ value={command.maxRemainingAsgs}
67
+ onChange={this.maxRemainingAsgsChange}
68
+ min="2"
69
+ />
70
+ </div>
71
+ <div className="col-md-12 form-inline">
72
+ <label>
73
+ Wait Before Disable
74
+ <HelpField content="Time to wait before disabling all old server groups in this cluster" />
75
+ </label>
76
+ <input
77
+ className="form-control input-sm"
78
+ style={{ width: '60px' }}
79
+ min="0"
80
+ type="number"
81
+ value={command.delayBeforeDisableSec}
82
+ onChange={this.delayBeforeDisableSecChange}
83
+ placeholder="0"
84
+ />
85
+ seconds
86
+ </div>
87
+ {command.scaleDown && (
88
+ <div className="col-md-12 form-inline" style={{ marginTop: '5px' }}>
89
+ <label>
90
+ Wait Before Scale Down
91
+ <HelpField content="Time to wait before scaling down all old server groups in this cluster" />
92
+ </label>
93
+ <input
94
+ className="form-control input-sm"
95
+ style={{ width: '60px' }}
96
+ min="0"
97
+ type="number"
98
+ value={command.delayBeforeScaleDownSec}
99
+ onChange={this.delayBeforeScaleDownSecChange}
100
+ placeholder="0"
101
+ />
102
+ seconds
103
+ </div>
104
+ )}
76
105
  </div>
77
- )}
78
- </div>
79
- );
106
+ );
107
+ }
108
+ }