diff --git a/client/app/scripts/charts/node-container.js b/client/app/scripts/charts/node-container.js index f87d89c59..2ef7d991a 100644 --- a/client/app/scripts/charts/node-container.js +++ b/client/app/scripts/charts/node-container.js @@ -44,7 +44,7 @@ class NodeContainer extends React.Component { const matchedParents = this.props.matches.get('parents', makeList()); const matchedDetails = matchedMetadata.concat(matchedParents); return ( - + ); }; diff --git a/client/app/scripts/components/matched-results.js b/client/app/scripts/components/matched-results.js index 72bae1a7b..7817f3f4c 100644 --- a/client/app/scripts/components/matched-results.js +++ b/client/app/scripts/components/matched-results.js @@ -2,10 +2,8 @@ import React from 'react'; import { MatchedText } from 'weaveworks-ui-components'; const SHOW_ROW_COUNT = 2; -const MAX_MATCH_LENGTH = 24; - -const Match = match => ( +const Match = (searchTerms, match) => (
@@ -13,9 +11,7 @@ const Match = match => (
@@ -23,7 +19,7 @@ const Match = match => ( export default class MatchedResults extends React.PureComponent { render() { - const { matches, style } = this.props; + const { matches, searchTerms, style } = this.props; if (!matches) { return null; @@ -41,7 +37,11 @@ export default class MatchedResults extends React.PureComponent { return (
- {matches.keySeq().take(SHOW_ROW_COUNT).map(fieldId => Match(matches.get(fieldId)))} + {matches + .keySeq() + .take(SHOW_ROW_COUNT) + .map(fieldId => Match(searchTerms, matches.get(fieldId))) + } {moreFieldMatches &&
{`${moreFieldMatches.size} more matches`} diff --git a/client/package.json b/client/package.json index 0ee7ae0ad..dab5fc984 100644 --- a/client/package.json +++ b/client/package.json @@ -44,7 +44,7 @@ "reselect": "3.0.1", "reselect-map": "1.0.3", "styled-components": "2.2.4", - "weaveworks-ui-components": "0.11.31", + "weaveworks-ui-components": "0.12.2", "whatwg-fetch": "2.0.3", "xterm": "3.3.0" }, diff --git a/client/yarn.lock b/client/yarn.lock index 6618af758..3459a8481 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -4069,6 +4069,10 @@ interpret@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.4.tgz#820cdd588b868ffb191a809506d6c9c8f212b1b0" +intersperse@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/intersperse/-/intersperse-1.0.0.tgz#f2561fb1cfef9f5277cc3347a22886b4351a5181" + invariant@^2.0.0, invariant@^2.2.0, invariant@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" @@ -8401,9 +8405,9 @@ wd@^0.4.0: underscore.string "~3.0.3" vargs "~0.1.0" -weaveworks-ui-components@0.11.31: - version "0.11.31" - resolved "https://registry.yarnpkg.com/weaveworks-ui-components/-/weaveworks-ui-components-0.11.31.tgz#90392fe5aafd6a911d985ef9ef554cb7178474d5" +weaveworks-ui-components@0.12.2: + version "0.12.2" + resolved "https://registry.yarnpkg.com/weaveworks-ui-components/-/weaveworks-ui-components-0.12.2.tgz#6eea81c4b1e48ff05743680c343c6c1116156494" dependencies: classnames "2.2.5" d3-drag "1.2.1" @@ -8411,6 +8415,7 @@ weaveworks-ui-components@0.11.31: d3-scale "1.0.7" d3-selection "1.2.0" d3-shape "1.2.0" + intersperse "1.0.0" polished "1.9.0" prop-types "15.6.0" react-input-autosize "2.2.1"