X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Faccounts%2Fsrc%2Faccount%2Faccount.jsx;h=4f011cb1ae7053979f131b05d72155b749c4650a;hp=6797cb3e509618c54b8794c956ce3317c0dac5b5;hb=0fc4b246b69ecd59401aa6c9bf921b29793d8136;hpb=b78fbe20fd7d976b3e15abb2387b4e329a5ea918 diff --git a/skyquake/plugins/accounts/src/account/account.jsx b/skyquake/plugins/accounts/src/account/account.jsx index 6797cb3e5..4f011cb1a 100644 --- a/skyquake/plugins/accounts/src/account/account.jsx +++ b/skyquake/plugins/accounts/src/account/account.jsx @@ -18,7 +18,7 @@ import React from 'react'; import Button from 'widgets/button/rw.button.js'; -import _ from 'lodash'; +import _cloneDeep from 'lodash/cloneDeep'; import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx'; import Crouton from 'react-crouton'; import TextInput from 'widgets/form_controls/textInput.jsx'; @@ -47,7 +47,6 @@ class Account extends React.Component { } } componentWillUnmount() { - this.props.store.closeSocket(); this.props.store.unlisten(this.storeListener); } setUp(props){ @@ -95,7 +94,7 @@ class Account extends React.Component { } } - let newAccount = _.cloneDeep(removeTrailingWhitespace(Account)); + let newAccount = _cloneDeep(removeTrailingWhitespace(Account)); delete newAccount.params; newAccount.nestedParams && newAccount.nestedParams['container-name'] && @@ -107,8 +106,8 @@ class Account extends React.Component { self.props.router.push({pathname:'accounts'}); self.props.flux.actions.global.hideScreenLoader.defer(); }, - function() { - self.props.flux.actions.global.showNotification("There was an error creating your account. Please contact your system administrator."); + function(error) { + self.props.flux.actions.global.showNotification(error); self.props.flux.actions.global.hideScreenLoader.defer(); }); } @@ -170,7 +169,7 @@ class Account extends React.Component { } evaluateSubmit = (e) => { if (e.keyCode == 13) { - if (this.props.edit) { + if (this.props.params.name != 'create') { this.update(e); } else { this.create(e); @@ -329,12 +328,12 @@ class Account extends React.Component {
- {Account['connection-status'].status.toUpperCase()} + {Account['connection-status'] && Account['connection-status'].status && Account['connection-status'].status.toUpperCase()}
{ - Account['connection-status'].status.toUpperCase() === 'FAILURE' ? + (Account['connection-status'] && Account['connection-status'].status && Account['connection-status'].status.toUpperCase()) === 'FAILURE' ? displayFailureMessage(Account['connection-status'].details) : null }