Skip to content

Commit

Permalink
Bump ui-components to v0.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarl committed Sep 17, 2018
1 parent 39530aa commit 3f66348
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion client/app/scripts/charts/node-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class NodeContainer extends React.Component {
const matchedParents = this.props.matches.get('parents', makeList());
const matchedDetails = matchedMetadata.concat(matchedParents);
return (
<MatchedResults matches={matchedDetails} />
<MatchedResults matches={matchedDetails} searchTerms={this.props.searchTerms} />
);
};

Expand Down
16 changes: 8 additions & 8 deletions client/app/scripts/components/matched-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@ 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) => (
<div className="matched-results-match" key={match.label}>
<div className="matched-results-match-wrapper">
<span className="matched-results-match-label">
{match.label}:
</span>
<MatchedText
text={match.text}
match={match}
maxLength={MAX_MATCH_LENGTH}
truncate={match.truncate}
matches={searchTerms}
/>
</div>
</div>
);

export default class MatchedResults extends React.PureComponent {
render() {
const { matches, style } = this.props;
const { matches, searchTerms, style } = this.props;

if (!matches) {
return null;
Expand All @@ -41,7 +37,11 @@ export default class MatchedResults extends React.PureComponent {

return (
<div className="matched-results" style={style}>
{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 &&
<div className="matched-results-more" title={moreFieldMatchesTitle}>
{`${moreFieldMatches.size} more matches`}
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
11 changes: 8 additions & 3 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -8401,16 +8405,17 @@ 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"
d3-format "1.2.2"
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"
Expand Down

0 comments on commit 3f66348

Please sign in to comment.