Skip to content

Commit ceb8566

Browse files
miguelgrcpazembrz
authored andcommitted
ui: add h-index tooltip
* INSPIR-3166
1 parent b8dc98e commit ceb8566

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

ui/src/common/components/CitationSummaryTable/CitationSummaryTable.jsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
33
import { Map } from 'immutable';
4+
import { Link } from 'react-router-dom';
45

56
import './CitationSummaryTable.scss';
67
import ExternalLink from '../ExternalLink';
@@ -9,7 +10,7 @@ import LoadingOrChildren from '../LoadingOrChildren';
910
import ErrorAlertOrChildren from '../ErrorAlertOrChildren';
1011
import { ErrorPropType } from '../../propTypes';
1112

12-
const CITABLE_HELP_MESSAGE = (
13+
const PUBLISHED_HELP_MESSAGE = (
1314
<span>
1415
Published papers are believed to have undergone rigorous peer review.{' '}
1516
<ExternalLink href="http://inspirehep.net/info/faq/general#published">
@@ -18,6 +19,13 @@ const CITABLE_HELP_MESSAGE = (
1819
</span>
1920
);
2021

22+
const H_INDEX_HELP_MESSAGE = (
23+
<span>
24+
The h-index is defined as the number of papers with citation number higher
25+
or equal to h. <Link to="/literature/690567">Learn more</Link>
26+
</span>
27+
);
28+
2129
class CitationSummaryTable extends Component {
2230
render() {
2331
const {
@@ -47,7 +55,7 @@ class CitationSummaryTable extends Component {
4755
<th>
4856
<LabelWithHelp
4957
label="Published"
50-
help={CITABLE_HELP_MESSAGE}
58+
help={PUBLISHED_HELP_MESSAGE}
5159
/>
5260
</th>
5361
</tr>
@@ -74,7 +82,12 @@ class CitationSummaryTable extends Component {
7482
<td>{publishedBucket.getIn(['citations_count', 'value'])}</td>
7583
</tr>
7684
<tr>
77-
<th>h-index</th>
85+
<th>
86+
<LabelWithHelp
87+
label="h-index"
88+
help={H_INDEX_HELP_MESSAGE}
89+
/>
90+
</th>
7891
<td>{hIndex.get('all')}</td>
7992
<td>{hIndex.get('published')}</td>
8093
</tr>

ui/src/common/components/CitationSummaryTable/__tests__/__snapshots__/CitationSummaryTable.test.jsx.snap

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,20 @@ exports[`CitationSummaryTable renders table without render props 1`] = `
6161
</tr>
6262
<tr>
6363
<th>
64-
h-index
64+
<LabelWithHelp
65+
help={
66+
<span>
67+
The h-index is defined as the number of papers with citation number higher or equal to h.
68+
<Link
69+
replace={false}
70+
to="/literature/690567"
71+
>
72+
Learn more
73+
</Link>
74+
</span>
75+
}
76+
label="h-index"
77+
/>
6578
</th>
6679
<td />
6780
<td />
558 Bytes
Loading
477 Bytes
Loading

0 commit comments

Comments
 (0)