RIFT-14704: SSH Keys fix on Instantiate page 71/371/1
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Wed, 21 Sep 2016 13:30:56 +0000 (09:30 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Wed, 21 Sep 2016 13:30:56 +0000 (09:30 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/launchpad/src/instantiate/instantiateInputParams.jsx
skyquake/plugins/launchpad/src/instantiate/instantiateParameters.jsx

index 4db4a63..ec40ccf 100644 (file)
@@ -420,8 +420,9 @@ export default class InstantiateInputParams extends Component {
 
             {
               sshKeysRef.map(function(ref, i) {
+                let keyref = JSON.stringify(ref)
                 return (
-                  <div key={i} className="inputControls inputControls-sshkeys">
+                  <div key={keyref.name + '-' + i} className="inputControls inputControls-sshkeys">
                     <label>
                       <div>
                       <SelectOption
@@ -434,13 +435,13 @@ export default class InstantiateInputParams extends Component {
                         })}
                         ref="keyPairSelection"
                         initial={false}
-                        defaultValue={sshKeysList[0].name}
-                        onChange={self.props.updateSshKeyRef(i)}>
+                        defaultValue={keyref.name || sshKeysList[0].name}
+                        onChange={props.sshFn.updateKeyRef(i)}>
                       </SelectOption>
                       </div>
                     </label>
                     <label>
-                      <span onClick={self.props.updateSshKeyRef(i, true)} className="removeInput">
+                      <span onClick={props.sshFn.updateKeyRef(i, true)} className="removeInput">
                         <img src={imgRemove} />
                         Remove
                       </span>
@@ -452,7 +453,7 @@ export default class InstantiateInputParams extends Component {
             <div className="inputControls inputControls-sshkeys ">
               <label style={{display: 'flex', 'flexDirection': 'row'}}>
               SSH KEY PAIR
-                <span onClick={self.props.updateSshKeyRef().bind(null, {target:{value: JSON.stringify(sshKeysList[0])}})} className="addInput">
+                <span onClick={props.sshFn.updateKeyRef().bind(null, {target:{value: JSON.stringify(sshKeysList[0])}})} className="addInput">
                   <img src={imgAdd} />
                   ADD
                 </span>
index 5546b25..0e5fa1f 100644 (file)
@@ -78,6 +78,9 @@ class Instantiate extends Component {
 
             ipProfileList={this.props.ipProfiles}
 
+            sshKeysList={this.props.sshKeysList}
+            sshKeysRef={this.props.sshKeysRef}
+
             dnsServers={this.props.dnsServers}
 
             usersList = {this.props.usersList}