diff options
author | Pavel Paroulek <pavel.paroulek@orange.com> | 2019-08-30 18:48:24 +0200 |
---|---|---|
committer | Pavel Paroulek <pavel.paroulek@orange.com> | 2019-08-30 18:48:24 +0200 |
commit | e9f43d63da7f1f5bf2f96e7d1d0b6c1b877e60b6 (patch) | |
tree | 0d03e814d41cae56adda54cea3396c67a8b9de04 /graphgraph-fe/src/GraphSettings.js | |
parent | 235c881daa50e9ec5d4f488a7feafbd1247a3168 (diff) |
Adding schema validation base
Change-Id: I2047a47d2b7b233fda59bdee4c77142d4a14d540
Signed-off-by: Pavel Paroulek <pavel.paroulek@orange.com>
Issue-ID: AAI-2583
Diffstat (limited to 'graphgraph-fe/src/GraphSettings.js')
-rw-r--r-- | graphgraph-fe/src/GraphSettings.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/graphgraph-fe/src/GraphSettings.js b/graphgraph-fe/src/GraphSettings.js index 1e80da9..4d44aef 100644 --- a/graphgraph-fe/src/GraphSettings.js +++ b/graphgraph-fe/src/GraphSettings.js @@ -3,9 +3,11 @@ import _ from 'underscore' import { DropdownButton, MenuItem, Label } from 'react-bootstrap' import './GraphSettings.css' import Popup from './PopupSettings' -import { pathGraph, basicGraph, schemas, nodeNames } from './requests' +import ValidationModal from './ValidationModal' +import { validateSchema, pathGraph, basicGraph, schemas, nodeNames } from './requests' var emptyState = { + schemaProblems: [], nodeNames: [], fromNode: '', graph: { @@ -94,6 +96,12 @@ class GraphSettings extends React.Component { s['nodeNames'] = nodeNames this.setState(s) }) + fetch(validateSchema(schema)) + .then(response => response.json()) + .then(p => { + s['schemaProblems'] = p.problems + this.setState(s) + }) } changeEdgeFilter (edgeFilter) { @@ -211,8 +219,11 @@ class GraphSettings extends React.Component { </div> <Popup isDisabled={!this.state.showHops} edgeFilter={this.state.edgeFilter} parentHops={this.state.hops.parents} childHops={this.state.hops.child} cousinHops={this.state.hops.cousin} updateHops={this.updateHops}/> + <div className="modal-button"> + <ValidationModal schemaProblems={this.state.schemaProblems}/> + </div> </div> - + </div> </div> ) |