projects
/
osm
/
UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check for vim account selection before instantiating- display error and prevent user...
[osm/UI.git]
/
skyquake
/
plugins
/
launchpad
/
src
/
instantiate
/
instantiateStore.js
diff --git
a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js
b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js
index
e779beb
..
b673e3a
100644
(file)
--- a/
skyquake/plugins/launchpad/src/instantiate/instantiateStore.js
+++ b/
skyquake/plugins/launchpad/src/instantiate/instantiateStore.js
@@
-20,7
+20,8
@@
import NetworkServiceSource from './launchNetworkServiceSource.js';
import GUID from 'utils/guid.js';
import AppHeaderActions from 'widgets/header/headerActions.js';
import Alt from '../alt';
import GUID from 'utils/guid.js';
import AppHeaderActions from 'widgets/header/headerActions.js';
import Alt from '../alt';
-import _ from 'lodash';
+import _cloneDeep from 'lodash/cloneDeep';
+import _find from 'lodash/find';
class LaunchNetworkServiceStore {
class LaunchNetworkServiceStore {
@@
-139,7
+140,7
@@
class LaunchNetworkServiceStore {
Alt.actions.global.showNotification.defer({type: 'warning', msg: 'One or more VIM accounts have failed to connect'});
}
if(cloudAccounts && cloudAccounts.length > 0) {
Alt.actions.global.showNotification.defer({type: 'warning', msg: 'One or more VIM accounts have failed to connect'});
}
if(cloudAccounts && cloudAccounts.length > 0) {
- newState.selectedCloudAccount = cloudAccounts[0];
+ newState.selectedCloudAccount =
newState.
cloudAccounts[0];
if (cloudAccounts[0]['account-type'] == 'openstack') {
newState.displayPlacementGroups = true;
} else {
if (cloudAccounts[0]['account-type'] == 'openstack') {
newState.displayPlacementGroups = true;
} else {
@@
-188,10
+189,10
@@
class LaunchNetworkServiceStore {
});
return window.location.hash = 'launchpad/' + tokenizedHash[2];
}
});
return window.location.hash = 'launchpad/' + tokenizedHash[2];
}
- launchNSRError(
error
) {
+ launchNSRError(
data
) {
var msg = 'Something went wrong while trying to instantiate. Check the error logs for more information';
var msg = 'Something went wrong while trying to instantiate. Check the error logs for more information';
- if
(
error) {
- msg = error;
+ if
(data.
error) {
+ msg =
data.
error;
}
Alt.actions.global.showNotification.defer(msg);
Alt.actions.global.hideScreenLoader.defer();
}
Alt.actions.global.showNotification.defer(msg);
Alt.actions.global.hideScreenLoader.defer();
@@
-640,7
+641,7
@@
class LaunchNetworkServiceStore {
},
updateSSHkeyRef: function(i, j, remove){
return function(e) {
},
updateSSHkeyRef: function(i, j, remove){
return function(e) {
- let usersList = _
.
cloneDeep(self.usersList)
+ let usersList = _cloneDeep(self.usersList)
let keys = usersList[i]['ssh-authorized-key'];
if(!remove) {
let keyRef = JSON.parse(e.target.value).name;
let keys = usersList[i]['ssh-authorized-key'];
if(!remove) {
let keyRef = JSON.parse(e.target.value).name;
@@
-672,7
+673,7
@@
class LaunchNetworkServiceStore {
// Create a filtered NSD payload from the decorated one as RW.REST cannot handle extra parameters now
let nsdPayload = {};
// Create a filtered NSD payload from the decorated one as RW.REST cannot handle extra parameters now
let nsdPayload = {};
- nsdPayload = _
.cloneDeep(_.
find(this.state.nsd[0].descriptors, {id: this.state.selectedNSDid}));
+ nsdPayload = _
cloneDeep(_
find(this.state.nsd[0].descriptors, {id: this.state.selectedNSDid}));
if (nsdPayload != {}) {
nsdPayload['meta'] && delete nsdPayload['meta'];
if (nsdPayload != {}) {
nsdPayload['meta'] && delete nsdPayload['meta'];
@@
-706,6
+707,10
@@
class LaunchNetworkServiceStore {
if (this.state.ro && this.state.ro['account-type'] == 'openmano') {
payload['om-datacenter'] = this.state.dataCenterID;
} else {
if (this.state.ro && this.state.ro['account-type'] == 'openmano') {
payload['om-datacenter'] = this.state.dataCenterID;
} else {
+ if(!this.state.selectedCloudAccount) {
+ Alt.actions.global.showNotification.defer("No VIM Account Selected");
+ return;
+ }
payload["cloud-account"] = this.state.selectedCloudAccount.name;
}
if (this.state.hasConfigureNSD) {
payload["cloud-account"] = this.state.selectedCloudAccount.name;
}
if (this.state.hasConfigureNSD) {
@@
-851,5
+856,4
@@
function getMockData() {
pnfd: data.pnfd
});
}
pnfd: data.pnfd
});
}
-// export default Alt.createStore(LaunchNetworkServiceStore);
export default LaunchNetworkServiceStore;
export default LaunchNetworkServiceStore;