componentWillMount() {
(!this.state.nsrId && this.props.nsrId) && this.Store.saveNSRId(this.props.nsrId);
this.Store.saveMode(this.props.mode);
+ this.Store.saveOnSuccess(this.props.onSuccess);
switch (this.props.mode) {
case 'creating':
if (!this.state.vld) {
saveVnfdIdRefs: this.saveVnfdIdRefs,
saveIpProfileNames: this.saveIpProfileNames,
removeVirtualLink: this.removeVirtualLink,
- saveMode: this.saveMode
+ saveMode: this.saveMode,
+ saveOnSuccess: this.saveOnSuccess
});
}
});
}
+ saveOnSuccess = (onSuccess) => {
+ this.setState({
+ onSuccess: onSuccess
+ })
+ }
+
saveMode = (mode) => {
this.setState({
mode: mode
}
createVirtualLinkSuccess(data) {
- this.setState({
- // vld: this.vld,
- mode: 'editing',
- isLoading: false
- });
+ this.onSuccess();
}
editVirtualLinkSuccess(data) {
- this.setState({
- mode: 'editing',
- isLoading: false
- });
+ this.onSuccess();
}
deleteVirtualLinkSuccess(data) {
- this.setState({
- deleteState: 'success'
- });
+ this.onSuccess();
}
cleanupPayload = (mode, vld) => {
let nsd = nsr.nsd && nsr.nsd;
nsr['decorated-vlrs'] && nsr['decorated-vlrs'].map((vlr, vlrIndex) => {
- let name = vlr.name || 'New virtual link being created';
+ let name = vlr.name || 'Undergoing virtual link operation';
let operationalStatus = vlr['operational-status'];
let vlrId = vlr['id'];
let vldId = vlr['vld-ref'];
<div className="launchpadCard_title" style={{textAlign:'right'}}><span style={{float:'left'}}>VLD DETAILS</span>
</div>
{
- <NSVirtualLinkCreate vld={this.state.editingVirtualLink} mode={this.state.mode} nsd={this.state.nsd} nsrId={this.state.nsrId} onCancel={this.handleCancelCreate}/>
+ <NSVirtualLinkCreate vld={this.state.editingVirtualLink} mode={this.state.mode} nsd={this.state.nsd} nsrId={this.state.nsrId} onSuccess={this.resetState.bind(this)} onCancel={this.handleCancelCreate}/>
}
</div>
);