Fix warnings
Fix reported javascript warnings by NodeJS when compiling
Issue-ID: CLAMP-426
Change-Id: Iebf369c0d3094fcbe83e9e5b1d6138b808105e46
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
diff --git a/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js b/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js
index 453ca6b..da2d423 100644
--- a/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js
+++ b/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js
@@ -72,8 +72,10 @@
JSONEditor.defaults.options.disable_array_delete_all_rows = false;
JSONEditor.defaults.options.show_errors = 'always';
- this.state.jsonEditor = new JSONEditor(document.getElementById("editor"),
- { schema: toscaModel.schema, startval: editorData });
+ this.setState({
+ jsonEditor: new JSONEditor(document.getElementById("editor"),
+ { schema: toscaModel.schema, startval: editorData })
+ })
}
diff --git a/ui-react/src/components/dialogs/OperationalPolicy/OperationalPolicyModal.js b/ui-react/src/components/dialogs/OperationalPolicy/OperationalPolicyModal.js
index 6822f3f..2a812c8 100644
--- a/ui-react/src/components/dialogs/OperationalPolicy/OperationalPolicyModal.js
+++ b/ui-react/src/components/dialogs/OperationalPolicy/OperationalPolicyModal.js
@@ -217,7 +217,7 @@
</div>
<span id="formSpan" style={{ display: 'none' }}>
- <form className="policyProperties" className="form-horizontal"
+ <form className="policyProperties form-horizontal"
style={{ border: '2px dotted gray' }}
title="Operational Policy Properties">
<div className="form-group clearfix">
@@ -350,7 +350,7 @@
</div>
</div>
</form>
- <form className="policyTarget" className="form-horizontal"
+ <form className="policyTarget form-horizontal"
title="Operational Policy Target" style={{ border: '2px dotted gray' }}>
<div className="form-group clearfix">
<label htmlFor="type" className="col-sm-4 control-label"> Target
@@ -437,7 +437,7 @@
</select>
</div>
</div>
- <form className="guardProperties" className="form-horizontal"
+ <form className="guardProperties form-horizontal"
title="Guard policy associated" style={{ border: '2px dotted gray' }}>
<div className="form-group clearfix withnote">
diff --git a/ui-react/src/components/loop_viewer/svg/LoopSvg.js b/ui-react/src/components/loop_viewer/svg/LoopSvg.js
index 44356c1..fa028c0 100644
--- a/ui-react/src/components/loop_viewer/svg/LoopSvg.js
+++ b/ui-react/src/components/loop_viewer/svg/LoopSvg.js
@@ -23,7 +23,6 @@
import React from 'react';
import styled from 'styled-components';
import { withRouter } from "react-router";
-import LoopCache from '../../../api/LoopCache'
import LoopService from '../../../api/LoopService'
const LoopViewSvgDivStyled = styled.div`
@@ -57,13 +56,13 @@
}
componentWillReceiveProps(newProps) {
- this.state.loopCache = newProps.loopCache;
+ this.setState({ loopCache: newProps.loopCache });
this.getSvg();
}
getSvg() {
LoopService.getSvg(this.state.loopCache.getLoopName()).then(svgXml => {
- if (svgXml.length != 0) {
+ if (svgXml.length !== 0) {
this.setState({ svgContent: svgXml })
} else {
this.setState({ svgContent: LoopViewSvg.emptySvg })