aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/dialogs/Loop/DeployLoopModal.js
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2021-04-15 19:43:27 +0200
committersebdet <sebastien.determe@intl.att.com>2021-04-16 18:40:43 +0200
commit4b6371f7ed8e35fd157ea640d05b5898989f32ca (patch)
tree64ce4f0fd56b2c227d093f589fb5bfa76dbc5387 /ui-react/src/components/dialogs/Loop/DeployLoopModal.js
parent1f2d62dd48694fa78041572a200b3e5d04bd268e (diff)
Fix Sonar bugs & sec issues
Fix all bugs & sec issues reported by Sonar Issue-ID: POLICY-3200 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: Ifb3d0d3602586b8defb0826e799ef0e24742235c
Diffstat (limited to 'ui-react/src/components/dialogs/Loop/DeployLoopModal.js')
-rw-r--r--ui-react/src/components/dialogs/Loop/DeployLoopModal.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/ui-react/src/components/dialogs/Loop/DeployLoopModal.js b/ui-react/src/components/dialogs/Loop/DeployLoopModal.js
index 2155977f6..921ba1806 100644
--- a/ui-react/src/components/dialogs/Loop/DeployLoopModal.js
+++ b/ui-react/src/components/dialogs/Loop/DeployLoopModal.js
@@ -1,8 +1,8 @@
/*-
* ============LICENSE_START=======================================================
- * ONAP CLAMP
+ * ONAP POLICY-CLAMP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -66,13 +66,7 @@ export default class DeployLoopModal extends React.Component {
}
getInitialKeyValue(temporaryPropertiesJson) {
const deployJsonList = temporaryPropertiesJson["dcaeDeployParameters"];
- let initialKey;
- Object.keys(deployJsonList)
- .filter((obj) => Object.keys(deployJsonList).indexOf(obj) === 0)
- .map(obj =>
- initialKey = obj
- );
- return initialKey;
+ return Object.keys(deployJsonList).find((obj) => Object.keys(deployJsonList).indexOf(obj) === 0);
}
componentWillReceiveProps(newProps) {
this.setState({
@@ -143,7 +137,7 @@ export default class DeployLoopModal extends React.Component {
const deployJsonList = this.state.temporaryPropertiesJson["dcaeDeployParameters"];
var indents = [];
- Object.keys(deployJsonList).map((item,key) =>
+ Object.keys(deployJsonList).forEach(item =>
indents.push(<Tab eventKey={item} title={item}>
{this.renderDeployParam(deployJsonList[item])}
</Tab>)
@@ -152,7 +146,7 @@ export default class DeployLoopModal extends React.Component {
}
renderDeployParam(deployJson) {
var indents = [];
- Object.keys(deployJson).map((item,key) =>
+ Object.keys(deployJson).forEach(item =>
indents.push(<FormStyled>
<Form.Label>{item}</Form.Label>
<Form.Control type="text" name={item} onChange={this.handleChange} defaultValue={deployJson[item]}></Form.Control>