aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Paroulek <pavel.paroulek@orange.com>2019-05-28 14:43:01 +0200
committerPavel Paroulek <pavel.paroulek@orange.com>2019-05-28 14:43:01 +0200
commitcd8c4a64f0b6aa74e8190c53bf21924d291b76e0 (patch)
treee2ecdc6a33897a39207ad6412870b605dd1f3428
parente22629636b27a473f7950d7b684c7017d01f6298 (diff)
Adding edgerule filtering
Adding edgerule filter and removing 'Both' option from drop down menu Change-Id: I1969052166cc213a891d52fef9e79c1901ff7f9f Issue-ID: AAI-531 Signed-off-by: Pavel Paroulek <pavel.paroulek@orange.com>
-rw-r--r--graphgraph-fe/src/GraphHops.js9
-rw-r--r--graphgraph-fe/src/GraphSettings.js5
-rw-r--r--graphgraph-fe/src/PopupSettings.js2
-rw-r--r--src/main/java/org/onap/aai/graphgraph/reader/BasicSchemaReader.java7
4 files changed, 15 insertions, 8 deletions
diff --git a/graphgraph-fe/src/GraphHops.js b/graphgraph-fe/src/GraphHops.js
index cd5763a..de7a4cc 100644
--- a/graphgraph-fe/src/GraphHops.js
+++ b/graphgraph-fe/src/GraphHops.js
@@ -50,7 +50,14 @@ class GraphHops extends React.Component {
}
render () {
- // {createNumInput('cousin hops', this.onChangeCousin, this.state.cousinHops)}
+ if (this.props.edgeFilter === 'Edgerules'){
+ return (
+ <div className="hops-input">
+ {createNumInput('edgerule hops', this.onChangeCousin, this.state.cousinHops)}
+ </div>
+ )
+ }
+
return (
<div className="hops-input">
{createNumInput('parent hops', this.onChangeParent, this.state.parentHops)}
diff --git a/graphgraph-fe/src/GraphSettings.js b/graphgraph-fe/src/GraphSettings.js
index 0c036db..1e80da9 100644
--- a/graphgraph-fe/src/GraphSettings.js
+++ b/graphgraph-fe/src/GraphSettings.js
@@ -74,7 +74,7 @@ class GraphSettings extends React.Component {
s['toNode'] = endNode
s['graph'] = g
s['edgeFilter'] = edgeFilter
- s['showHops'] = endNode === 'none' && startNode !== 'none' && startNode !== 'all' && edgeFilter !== 'Edgerules'
+ s['showHops'] = endNode === 'none' && startNode !== 'none' && startNode !== 'all'
s['enableDestinationNode'] = startNode !== 'none' && startNode !== 'all'
this.setState(s)
@@ -174,7 +174,6 @@ class GraphSettings extends React.Component {
let edgeFilterItems = [
<MenuItem key='Edgerules' eventKey='Edgerules'>Edgerules</MenuItem>,
<MenuItem key='Parents' eventKey='Parents'>Parent-child (OXM structure)</MenuItem>,
- <MenuItem key='Both' eventKey='Both'>Both</MenuItem>
]
return (
<div>
@@ -211,7 +210,7 @@ class GraphSettings extends React.Component {
</DropdownButton>
</div>
- <Popup isDisabled={!this.state.showHops} parentHops={this.state.hops.parents} childHops={this.state.hops.child} cousinHops={this.state.hops.cousin} updateHops={this.updateHops}/>
+ <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>
</div>
diff --git a/graphgraph-fe/src/PopupSettings.js b/graphgraph-fe/src/PopupSettings.js
index a278bc8..cb8a533 100644
--- a/graphgraph-fe/src/PopupSettings.js
+++ b/graphgraph-fe/src/PopupSettings.js
@@ -9,7 +9,7 @@ class PopupMenu extends React.Component {
<Popup trigger={<button className='settings-button' disabled={this.props.isDisabled}>Hops</button>} position="bottom right">
{close => (
<div>
- <GraphHops parentHops={this.props.parentHops} childHops={this.props.childHops} cousinHops={this.props.cousinHops} updateHops={this.props.updateHops} />
+ <GraphHops edgeFilter={this.props.edgeFilter} parentHops={this.props.parentHops} childHops={this.props.childHops} cousinHops={this.props.cousinHops} updateHops={this.props.updateHops} />
<button
type="button"
className="link-button, close"
diff --git a/src/main/java/org/onap/aai/graphgraph/reader/BasicSchemaReader.java b/src/main/java/org/onap/aai/graphgraph/reader/BasicSchemaReader.java
index 1367aeb..a52a297 100644
--- a/src/main/java/org/onap/aai/graphgraph/reader/BasicSchemaReader.java
+++ b/src/main/java/org/onap/aai/graphgraph/reader/BasicSchemaReader.java
@@ -166,7 +166,7 @@ public class BasicSchemaReader implements SchemaReader {
p,
introspector.getPropertyMetadata(p)
.getOrDefault(PropertyMetadata.DESCRIPTION,"no description available"),
- "I dont know", //TODO how to get this information????
+ "I don't know", //TODO how to get this information????
introspector.getAllKeys().contains(p),
introspector.getIndexedProperties().contains(p),
introspector.getRequiredProperties().contains(p))
@@ -243,6 +243,7 @@ public class BasicSchemaReader implements SchemaReader {
if (!"all".equals(initialNode)) {
Set<String> subGraphVertices = computeNodes(initialNode, parentHops, EdgeType.CHILD.getTypeName());
subGraphVertices.addAll(computeNodes(initialNode, childHops, EdgeType.PARENT.getTypeName()));
+ subGraphVertices.addAll(computeNodes(initialNode, cousinHops, EdgeType.EDGE_RULE.getTypeName()));
edges = filterEdges(edges, subGraphVertices);
}
@@ -251,11 +252,11 @@ public class BasicSchemaReader implements SchemaReader {
}
private boolean isParentChildFilter(String edgeFilter) {
- return "Both".equals(edgeFilter) || "Parents".equals(edgeFilter);
+ return "Parents".equals(edgeFilter);
}
private boolean isEdgeRulesFilter(String edgeFilter) {
- return "Both".equals(edgeFilter) || "Edgerules".equals(edgeFilter);
+ return "Edgerules".equals(edgeFilter);
}
private Set<Edge> filterEdgesStrict(Set<Edge> edges, Set<String> subGraphVertices) {