diff --git a/client/app/scripts/charts/node.js b/client/app/scripts/charts/node.js index 6d969b37df..6a1ff9b951 100644 --- a/client/app/scripts/charts/node.js +++ b/client/app/scripts/charts/node.js @@ -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'; @@ -117,6 +117,8 @@ class Node extends React.Component { onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, }; + const matchedNodeDetails = matches.get('metadata', makeList()) + .concat(matches.get('parents', makeList())); return ( @@ -136,7 +138,7 @@ class Node extends React.Component {
- {!blurred && } + {!blurred && } } diff --git a/client/app/scripts/components/node-details.js b/client/app/scripts/components/node-details.js index 7278e3a581..6226bd420d 100644 --- a/client/app/scripts/components/node-details.js +++ b/client/app/scripts/components/node-details.js @@ -158,7 +158,9 @@ export class NodeDetails extends React.Component {
- {details.parents && } + {details.parents && }
diff --git a/client/app/scripts/components/node-details/node-details-relatives-link.js b/client/app/scripts/components/node-details/node-details-relatives-link.js index 81c9d43d7d..3505ac7738 100644 --- a/client/app/scripts/components/node-details/node-details-relatives-link.js +++ b/client/app/scripts/components/node-details/node-details-relatives-link.js @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom'; import { connect } from 'react-redux'; import { clickRelative } from '../../actions/app-actions'; +import MatchedText from '../matched-text'; class NodeDetailsRelativesLink extends React.Component { @@ -21,7 +22,7 @@ class NodeDetailsRelativesLink extends React.Component { const title = `View in ${this.props.topologyId}: ${this.props.label}`; return ( - {this.props.label} + ); } diff --git a/client/app/scripts/components/node-details/node-details-relatives.js b/client/app/scripts/components/node-details/node-details-relatives.js index 864a3b9709..06c3038a5e 100644 --- a/client/app/scripts/components/node-details/node-details-relatives.js +++ b/client/app/scripts/components/node-details/node-details-relatives.js @@ -1,4 +1,5 @@ import React from 'react'; +import { Map as makeMap } from 'immutable'; import NodeDetailsRelativesLink from './node-details-relatives-link'; @@ -20,7 +21,9 @@ export default class NodeDetailsRelatives extends React.Component { } render() { - let relatives = this.props.relatives; + let { relatives } = this.props; + const { matches = makeMap() } = this.props; + const limited = this.state.limit > 0 && relatives.length > this.state.limit; const showLimitAction = limited || (this.state.limit === 0 && relatives.length > this.DEFAULT_LIMIT); @@ -31,7 +34,11 @@ export default class NodeDetailsRelatives extends React.Component { return (
- {relatives.map(relative => )} + {relatives.map(relative => ( + ))} {showLimitAction && {limitActionText}}
diff --git a/client/app/scripts/utils/search-utils.js b/client/app/scripts/utils/search-utils.js index ca7bba3690..93c537c8aa 100644 --- a/client/app/scripts/utils/search-utils.js +++ b/client/app/scripts/utils/search-utils.js @@ -139,6 +139,15 @@ export function searchTopology(nodes, { prefix, query, metric, comp, value }) { }); } + // parents and relatives + if (node.get('parents')) { + node.get('parents').forEach(parent => { + const keyPath = [nodeId, 'parents', parent.get('id')]; + nodeMatches = findNodeMatch(nodeMatches, keyPath, parent.get('label'), + query, prefix, parent.get('topologyId')); + }); + } + // tables (envvars and labels) const tables = node.get('tables'); if (tables) {