From 5c0dfa359688343acb4983f29af8561f8aab6638 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Wed, 17 Apr 2024 12:37:14 +0200 Subject: [PATCH] fixed stats and added views in researchComp --- .../src/Apps/ScientificPublications/ResearchComponent.vue | 3 ++- .../src/Apps/ScientificPublications/ResearcherProfile.vue | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/Apps/ScientificPublications/ResearchComponent.vue b/frontend/src/Apps/ScientificPublications/ResearchComponent.vue index dd4316e..66c31f7 100644 --- a/frontend/src/Apps/ScientificPublications/ResearchComponent.vue +++ b/frontend/src/Apps/ScientificPublications/ResearchComponent.vue @@ -22,7 +22,7 @@ function format(date){ } -const emit = defineEmits(["downloadPdf","downloadBibTex"]); +const emit = defineEmits(["modal-close","downloadPdf","downloadBibTex"]); const target = ref(null) onClickOutside(target, ()=>emit('modal-close')) @@ -42,6 +42,7 @@ onClickOutside(target, ()=>emit('modal-close'))
  • Language : {{article.language}}
  • PaperType : {{article.paperType}}
  • Domain : {{article.domain}}
  • +
  • Views : {{article.views}}
  • Access : {{article.access}}
  • diff --git a/frontend/src/Apps/ScientificPublications/ResearcherProfile.vue b/frontend/src/Apps/ScientificPublications/ResearcherProfile.vue index bbd22f5..cd7e6cd 100644 --- a/frontend/src/Apps/ScientificPublications/ResearcherProfile.vue +++ b/frontend/src/Apps/ScientificPublications/ResearcherProfile.vue @@ -117,10 +117,10 @@ function update(){ fontColor: "white", text: statsOf.value + " By "+ statsBy.value, } - const index = (0 ?statsOf.value === "views": 3 ? statsOf.value === "researches":6) + (0?statsBy.value ==="years":1?statsBy.value==="months":2) + let index = (statsOf.value === "views"?0:(statsOf.value === "researches"?3:6)) + (statsBy.value ==="years"?0:(statsBy.value==="months"?1:2)) - - options.data[0].dataPoints = stats.value[index] + if (statsOf.value !== "" && statsBy.value !== "") + options.data[0].dataPoints = stats.value[index] options.title.text = statsOf.value + " By "+ statsBy.value;