Skip to content

Commit

Permalink
Merge pull request #57 from cloudogu/feature/7479_MouseOverAtSearch
Browse files Browse the repository at this point in the history
add tooltip for scoring of search
  • Loading branch information
msuewer authored Apr 4, 2018
2 parents db4909f + 7bbb068 commit d2b04b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/main/js/wiki/components/SearchResult.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
//@flow
import React from 'react';
import {Link} from "react-router-dom";
import {translate} from 'react-i18next';

type Props = {
result: any,
createPageLink: (path: string) => string
createPageLink: (path: string) => string,
t: any
};

class SearchResult extends React.Component<Props> {

render() {
const { result } = this.props;
const { result, t } = this.props;
const pageLink = this.props.createPageLink(result.path);
return (
<Link to={pageLink} className="list-group-item">
<span className="badge">{ result.score.toFixed(2) }</span>
<span className="badge" data-toggle="tooltip" title={t('search-scoring_tooltip')}>{ result.score.toFixed(2) }</span>
<h4 className="list-group-item-heading">{ result.path }</h4>
<p className="list-group-item-text" dangerouslySetInnerHTML={{__html: result.contentFragment}} />
</Link>
Expand All @@ -23,4 +25,4 @@ class SearchResult extends React.Component<Props> {

}

export default SearchResult;
export default translate()(SearchResult);
3 changes: 2 additions & 1 deletion src/main/public/locales/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
"back-to-repositories-button_text": "Zurück zur Repository-Übersicht",
"search-bar_placeholder": "Suchen nach ...",
"search-result-header_title": "Suchergebnisse für",
"search_failed_to_fetch": "Die Suchergebnisse konnten nicht geladen werden"
"search_failed_to_fetch": "Die Suchergebnisse konnten nicht geladen werden",
"search-scoring_tooltip": "Relevanz für Deine Anfrage"
}
3 changes: 2 additions & 1 deletion src/main/public/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
"back-to-repositories-button_text": "Back to Repository Overview",
"search-bar_placeholder": "Search for ...",
"search-result-header_title": "Search Results for",
"search_failed_to_fetch": "Failed to fetch search results"
"search_failed_to_fetch": "Failed to fetch search results",
"search-scoring_tooltip": "Relevance for your search"
}

0 comments on commit d2b04b9

Please sign in to comment.