X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Faccounts%2Fsrc%2Faccount%2FaccountStore.js;h=22e8a17a9a49a9e8e3bcd5479237639c6241243d;hb=56e55f5efc98e32a1afb3d99d07e9e5b0847a258;hp=5d5bd2f922845062a6df0f887b66677c91667b88;hpb=91aceafac5d6453d5decbde9ba03232abf108c3c;p=osm%2FUI.git diff --git a/skyquake/plugins/accounts/src/account/accountStore.js b/skyquake/plugins/accounts/src/account/accountStore.js index 5d5bd2f92..22e8a17a9 100644 --- a/skyquake/plugins/accounts/src/account/accountStore.js +++ b/skyquake/plugins/accounts/src/account/accountStore.js @@ -21,6 +21,7 @@ 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; +var _ = require('lodash'); let Params = { //Config Agent @@ -249,7 +250,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 }) @@ -291,7 +292,7 @@ export default class AccountStore { if(self.currentAccount) { let Account = self.getAccountFromStream(data[self.currentAccount.type].data, self.currentAccount.name); newState.account = self.account; - newState.account['connection-status'] = Account['connection-status'] + newState.account['connection-status'] = Account && Account['connection-status'] } self.setState(newState) } catch(error) { @@ -332,7 +333,7 @@ export default class AccountStore { } getAccountFromStream(data, name) { let result = null; - data.map(function(a) { + data && _.isArray(data) && data.map(function(a) { if(a.name == name) { result = a; } @@ -342,7 +343,7 @@ export default class AccountStore { viewAccount = ({type, name}) => { var data = null; var accounts = null; - if(this && this[type].length) { + if(this && this[type] && this[type].length) { accounts = this[type]; data = this.getAccountFromStream(accounts, name); if(data) { @@ -364,7 +365,7 @@ export default class AccountStore { } generateOptionsByName(data) { let results = []; - if (data && data.constructor.name == "Array") { + if (data && _.isArray(data)) { data.map(function(d) { results.push({ label: d.name,