RIFT-14984: show only available VIM in instantiate. Display warning when one more... 99/599/1
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Thu, 3 Nov 2016 16:03:56 +0000 (12:03 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Thu, 3 Nov 2016 16:03:56 +0000 (12:03 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/framework/widgets/skyquake_container/skyquakeContainerStore.js
skyquake/plugins/launchpad/api/launchpad.js
skyquake/plugins/launchpad/src/instantiate/instantiateStore.js

index aa4e744..d1a8a9e 100644 (file)
@@ -173,8 +173,8 @@ class SkyquakeContainerStore {
 
         } else {
             state.notificationMessage = data.msg;
-            if(data.type == 'success') {
-                state.notificationType = 'success';
+            if(data.type) {
+                state.notificationType = data.type;
             }
         }
         this.setState(state);
index 96818e0..509ff77 100644 (file)
@@ -1664,7 +1664,7 @@ VDUR.consoleUrl.get = function(req) {
 CloudAccount.get = function(req) {
     var api_server = req.query["api_server"];
     var uri = utils.confdPort(api_server);
-    uri += APIVersion + '/api/config/cloud/account?deep';
+    uri += APIVersion + '/api/operational/cloud/account?deep';
     var headers = _.extend({}, constants.HTTP_HEADERS.accept.collection, {
         'Authorization': req.get('Authorization')
     });
index 94ba391..2e6e242 100644 (file)
@@ -131,7 +131,13 @@ class LaunchNetworkServiceStore {
     }
     getLaunchCloudAccountSuccess(cloudAccounts) {
         let newState = {};
-        newState.cloudAccounts = cloudAccounts || [];
+        newState.cloudAccounts = cloudAccounts.filter(function(v) {
+            console.log(v)
+                return v['connection-status'].status == 'success';
+            }) || [];
+        if(cloudAccounts.length != newState.cloudAccounts.length) {
+            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];
             if (cloudAccounts[0]['account-type'] == 'openstack') {