From ed0c3ad1cb0beb9070ce449d74c876395da37428 Mon Sep 17 00:00:00 2001 From: Jan Konstant Date: Thu, 10 Feb 2022 12:56:55 +0100 Subject: [PATCH] created config param for "cite as" feature --- vis/js/default-config.js | 4 +++- vis/js/reducers/list.js | 2 ++ vis/js/templates/listentry/PaperButtons.jsx | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/vis/js/default-config.js b/vis/js/default-config.js index a20a31795..fb4533d80 100644 --- a/vis/js/default-config.js +++ b/vis/js/default-config.js @@ -177,8 +177,10 @@ var config = { faqs_button: false, //url for link to faqs faqs_url: "", - // show citation button + // show citation button for the whole map show_cite_button: false, + // show citation button for each paper + cite_papers: false, /*** streamgraph settings ***/ //streamgraph color definition diff --git a/vis/js/reducers/list.js b/vis/js/reducers/list.js index cd4044b37..76879f8f9 100644 --- a/vis/js/reducers/list.js +++ b/vis/js/reducers/list.js @@ -17,6 +17,7 @@ const list = ( showKeywords: false, hideUnselectedKeywords: true, height: null, + citePapers: false, }, action ) => { @@ -47,6 +48,7 @@ const list = ( hideUnselectedKeywords: config.hide_keywords_overview, disableClicks: !config.render_map, height: action.listHeight, + citePapers: config.cite_papers, }; case "TOGGLE_LIST": return { diff --git a/vis/js/templates/listentry/PaperButtons.jsx b/vis/js/templates/listentry/PaperButtons.jsx index 1c6a90595..8355e7f40 100644 --- a/vis/js/templates/listentry/PaperButtons.jsx +++ b/vis/js/templates/listentry/PaperButtons.jsx @@ -31,7 +31,8 @@ const PaperButtons = ({
{!!onPDFClick && ( )} {showCiteButton && ( @@ -45,7 +46,8 @@ const PaperButtons = ({ }; const mapStateToProps = (state) => ({ - showCiteButton: ["base", "pubmed"].includes(state.service), + //showCiteButton: ["base", "pubmed"].includes(state.service), + showCiteButton: state.list.citePapers, }); export default connect(