Adds support for filtering node/table by relatives

Now that they are available in the summary data.
This commit is contained in:
Simon Howe
2016-08-09 18:20:43 +02:00
parent d06547e596
commit fc2fcfb298
5 changed files with 27 additions and 6 deletions
+4 -2
View File
@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux';
import classnames from 'classnames';
import { Map as makeMap } from 'immutable';
import { Map as makeMap, List as makeList } from 'immutable';
import { clickNode, enterNode, leaveNode } from '../actions/app-actions';
import { getNodeColor } from '../utils/color-utils';
@@ -110,6 +110,8 @@ class Node extends React.Component {
onMouseEnter: this.handleMouseEnter,
onMouseLeave: this.handleMouseLeave,
};
const matchedNodeDetails = matches.get('metadata', makeList())
.concat(matches.get('parents', makeList()));
return (
<g className={nodeClassName} transform={transform}>
@@ -127,7 +129,7 @@ class Node extends React.Component {
<div className={subLabelClassName}>
<MatchedText text={subLabel} match={matches.get('sublabel')} />
</div>
{!blurred && <MatchedResults matches={matches.get('metadata')} />}
{!blurred && <MatchedResults matches={matchedNodeDetails} />}
</div>
</foreignObject>}