- );
+ if(node.ref == "password" || node.ref == "secret") {
+ let displayValue = value;
+ if (self.props.readonly) {
+ displayValue = new Array(value.length + 1).join( '*' );
+ }
+ nestedParamsStack.push(
+
+ );
+ } else {
+ nestedParamsStack.push(
+
+ );
+ }
}
}
@@ -330,7 +447,9 @@ class Account extends React.Component {
{Account['connection-status'] && Account['connection-status'].status && Account['connection-status'].status.toUpperCase()}
-
+ { self.props.readonly ? null :
+
+ }
{
(Account['connection-status'] && Account['connection-status'].status && Account['connection-status'].status.toUpperCase()) === 'FAILURE' ?
@@ -338,25 +457,7 @@ class Account extends React.Component {
}
) : null;
- // cloudResourcesStateHTML = (
- //
- //
Resources Status
- //
- //
- // {
- // cloudResources && props.AccountMeta.resources[Account['account-type']].map(function(r, i) {
-
- // return (
- // -
- // {r}: {cloudResources[r]}
- //
- // )
- // }) || 'No Additional Resources'
- // }
- //
- //
- //
- // )
+
}
var html = (
@@ -368,15 +469,23 @@ class Account extends React.Component {
Account
-
{name}
+ {name}
{ isEdit ?
(
-
{props.AccountMeta.labelByType[Account['account-type']]}
+
{props.AccountMeta.labelByType[Account['account-type'] || Account['ro-account-type']]}
)
: null
}
+ {
+ AccountType == 'cloud' ? (
+
+ {setVduTimeout}
+
+ )
+ : null
+ }
{selectAccount}
@@ -387,14 +496,19 @@ class Account extends React.Component {
{params}
- {buttons}
+ {!self.props.readonly ? buttons : null}
)
- return html;
+ return Types.length ? html : null;
}
}
+Account.contextTypes = {
+ router: React.PropTypes.object,
+ userProfile: React.PropTypes.object
+}
+
function displayFailureMessage(msg) {
return (
@@ -435,8 +549,37 @@ SelectOption.defaultProps = {
}
}
+function wasAllDetailsFilled(Account) {
+ var type = Account['account-type'] || Account['ro-account-type'];
+ var params = Account.params;
+
+ if(params) {
+ for (var i = 0; i < params.length; i++) {
+ var param = params[i].ref;
+ if (typeof(Account[type]) == 'undefined' || typeof(Account[type][param]) == 'undefined' || Account[type][param] == "") {
+ if (!params[i].optional) {
+ return false;
+ }
+ }
+ }
+ }
+
+ let nestedParams = Account.nestedParams && Account.nestedParams;
+ if (nestedParams && nestedParams.params) {
+ for (let i = 0; i < nestedParams.params.length; i++) {
+ let nestedParam = nestedParams.params[i].ref;
+ if (typeof(Account[type]) == 'undefined' || typeof(Account[type][nestedParams['container-name']][nestedParam]) == 'undefined' || Account[type][nestedParams['container-name']][nestedParam] == "") {
+ if (!nestedParams.params[i].optional) {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
function removeTrailingWhitespace(Account) {
- var type = Account['account-type'];
+ var type = Account['account-type'] || Account['ro-account-type'];
var params = Account.params;
if(params) {