Bug 206 - Creation of VIM accounts in the UI should be hidden until SO can add new...
[osm/UI.git] / skyquake / plugins / accounts / src / account / accountStore.js
index 29a15e2..aeb5f48 100644 (file)
@@ -18,7 +18,7 @@
 import AccountActions from './accountActions.js';
 import AccountSource from './accountSource.js';
 
-
+var Utils = require('utils/utils.js');
 var rw = require('utils/rw.js');
 var altImage = rw.getSearchParams(window.location).alt_image;
 
@@ -125,6 +125,18 @@ let AccountMeta = {
                 label: 'Floating IP Pool',
                 ref: 'floating-ip-pool',
                 optional: true
+            }, {
+                label: "User Domain",
+                ref: 'user-domain',
+                optional: true
+            }, {
+                label: "Project Domain",
+                ref: 'project-domain',
+                optional: true
+            }, {
+              label: "Region",
+              ref: 'region',
+              optional: true
             }],
             "openvim": [{
                 label: "Host",
@@ -237,7 +249,7 @@ export default class AccountStore {
     }
     getResourceOrchestratorSuccess = (data) => {
         this.alt.actions.global.hideScreenLoader.defer();
-        if(data['account-type'] == 'openmano') {
+        if(data['rw-launchpad:resource-orchestrator'] && (data['rw-launchpad:resource-orchestrator']['account-type'] == 'openmano')) {
             this.setState({
                 showVIM: false
             })
@@ -252,7 +264,6 @@ export default class AccountStore {
     openAccountSocketSuccess = (connection) => {
         let self = this;
         let  ws = window.multiplexer.channel(connection);
-
         if (!connection) return;
         this.setState({
             socket: ws.ws,
@@ -261,6 +272,9 @@ export default class AccountStore {
         ws.onmessage = (socket) => {
             try {
                 var data = JSON.parse(socket.data);
+                Utils.checkAuthentication(data.statusCode, function() {
+                    self.closeSocket();
+                });
                 let SdnOptions = [{
                     label: 'Select an SDN Account',
                     value: false
@@ -407,18 +421,3 @@ export default class AccountStore {
     }
 }
 
-
-/**
- *Cloud
- *
- * {"name":"eng2","account-type":"openstack","openstack":{"key":"lmaultsb","secret":"mypasswd","auth_url":"http://engstack.eng.riftio.com:5000/v3/","tenant":"lmaultsb","mgmt-network":"private"}}
-Name
-Path
-
-
-SDN
-
-
- *
- *
- */