+ handleRefresh() {
+ LoopService.refreshOpPolicyJson(this.state.loopCache.getLoopName()).then(data => {
+ var newLoopCache = new LoopCache(data);
+ var schema_json = newLoopCache.getOperationalPolicyJsonSchema();
+ var operationalPoliciesData = newLoopCache.getOperationalPoliciesNoJsonSchema();
+ document.getElementById("editor").innerHTML = "";
+ this.setState({
+ loopCache: newLoopCache,
+ jsonEditor: new JSONEditor(document.getElementById("editor"),
+ { schema: schema_json.schema, startval: operationalPoliciesData })
+ })
+ this.props.updateLoopFunction(data);
+
+ })
+ .catch(error => {
+ console.error("Error while refreshing the Operational Policy Json Representation");
+ });
+ }
+