Skip to content

Commit 8863ae4

Browse files
committed
test: js bundles
1 parent 59c90a5 commit 8863ae4

1 file changed

Lines changed: 50 additions & 45 deletions

File tree

vis/js/templates/listentry/PaperButtons.tsx

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const PaperButtons = ({
2020
}) => {
2121
const { trackEvent } = useMatomo();
2222

23+
console.log("Hello");
24+
2325
const onPDFClick = getPaperPDFClickHandler(paper, handlePDFClick);
2426

2527
const handlePDFButtonClick = () => {
@@ -41,53 +43,56 @@ const PaperButtons = ({
4143

4244
noCitationDoctypes = noCitationDoctypes.map((t) => t.toLowerCase());
4345
const hasCiteButton =
44-
showCiteButton &&
45-
!paper.resulttype.some((t) => noCitationDoctypes.includes(t.toLowerCase()));
46+
showCiteButton &&
47+
!paper.resulttype.some((t) => noCitationDoctypes.includes(t.toLowerCase()));
4648

4749
return (
48-
// html template starts here
49-
<div className="paper_buttons_row">
50-
{isText && !!onPDFClick && (
51-
<button
52-
className="paper_button main"
53-
title="Open the PDF"
54-
onClick={handlePDFButtonClick}
55-
>
56-
<i className="far fa-file-pdf"></i>&nbsp;&nbsp;
57-
<Highlight>PDF</Highlight>
58-
</button>
59-
)}
60-
{/*add paper.oa condition to avoid show file button if no access */}
61-
{!!paper.oa &&
62-
(!isText &&
63-
<a href={paper.list_link.address} title="Open the file" target="_blank" rel="noreferrer">
64-
<div className="paper_button main">
65-
<i className="far fa-file"></i>&nbsp;&nbsp;
66-
<Highlight>File</Highlight>
67-
</div>
68-
</a>
69-
)
70-
}
71-
{hasCiteButton && (
72-
<button
73-
className="paper_button"
74-
title="Cite this document"
75-
onClick={handleCiteButtonClick}
76-
>
77-
<i className="fa fa-quote-right"></i>&nbsp;&nbsp;Cite as
78-
</button>
79-
)}
80-
{showExportButton && (
81-
<button
82-
className="paper_button"
83-
title="Export this document"
84-
onClick={handleExportButtonClick}
85-
>
86-
<i className="fa fa-arrow-down"></i>&nbsp;&nbsp;Export
87-
</button>
88-
)}
89-
</div>
90-
// html template ends here
50+
// html template starts here
51+
<div className="paper_buttons_row">
52+
{isText && !!onPDFClick && (
53+
<button
54+
className="paper_button main"
55+
title="Open the PDF"
56+
onClick={handlePDFButtonClick}
57+
>
58+
<i className="far fa-file-pdf"></i>&nbsp;&nbsp;
59+
<Highlight>PDF</Highlight>
60+
</button>
61+
)}
62+
{/*add paper.oa condition to avoid show file button if no access */}
63+
{!!paper.oa && !isText && (
64+
<a
65+
href={paper.list_link.address}
66+
title="Open the file"
67+
target="_blank"
68+
rel="noreferrer"
69+
>
70+
<div className="paper_button main">
71+
<i className="far fa-file"></i>&nbsp;&nbsp;
72+
<Highlight>File</Highlight>
73+
</div>
74+
</a>
75+
)}
76+
{hasCiteButton && (
77+
<button
78+
className="paper_button"
79+
title="Cite this document"
80+
onClick={handleCiteButtonClick}
81+
>
82+
<i className="fa fa-quote-right"></i>&nbsp;&nbsp;Cite as
83+
</button>
84+
)}
85+
{showExportButton && (
86+
<button
87+
className="paper_button"
88+
title="Export this document"
89+
onClick={handleExportButtonClick}
90+
>
91+
<i className="fa fa-arrow-down"></i>&nbsp;&nbsp;Export
92+
</button>
93+
)}
94+
</div>
95+
// html template ends here
9196
);
9297
};
9398

0 commit comments

Comments
 (0)