From fa2deca1b9ca9588dbdc24bd00b19f1af249c617 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Mon, 22 Apr 2024 10:02:45 +0200 Subject: [PATCH 1/2] fix once again the stats and translations --- .../StatsRepository.java | 34 +++++++++---------- .../StatisticsService.java | 18 +++++----- .../ResearchComponent.vue | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java index 6dc1726..4c6a6e0 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Repositories/ScientificPublications/StatsRepository.java @@ -15,33 +15,33 @@ import java.util.Map; public interface StatsRepository extends CrudRepository { - @Query("select new map(to_char(r.releaseDate, 'month') as label, sum(r.views) as y) from Research r group by to_char(r.releaseDate, 'month')") - Iterable> viewsByMonths(); + @Query("select new map(to_char(r.releaseDate, 'month') as label, sum(r.views) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate, 'month')") + Iterable> viewsByMonths(long researcherId); @Query("select new map(to_char(r.releaseDate,'YYYY') as label, sum (r.views) as y) from Research r group by to_char(r.releaseDate,'YYYY')") - Iterable> viewsByYears(); + Iterable> viewsByYears(long researcherId); - @Query("select new map(r.domain as label, sum(r.views) as y) from Research r group by r.domain") - Iterable> viewsByTopics(); + @Query("select new map(r.domain as label, sum(r.views) as y) from Research r where r.author.id = ?1 group by r.domain") + Iterable> viewsByTopics(long researcherId); - @Query("select new map(r.domain as label, count(distinct r.language) as y) from Research r group by r.domain") - Iterable> languageByTopics(); + @Query("select new map(r.domain as label, count(distinct r.language) as y) from Research r where r.author.id = ?1 group by r.domain") + Iterable> languageByTopics(long researcherId); - @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate,'YYYY')") - Iterable> languageByYears(); + @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r.language) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate,'YYYY')") + Iterable> languageByYears(long researcherId); - @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r.language) as y) from Research r group by to_char(r.releaseDate, 'month')") - Iterable> languageByMonths(); + @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r.language) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate, 'month')") + Iterable> languageByMonths(long researcherId); - @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate,'YYYY')") - Iterable> researchesByYears(); + @Query("select new map(to_char(r.releaseDate,'YYYY') as label, count(distinct r) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate,'YYYY')") + Iterable> researchesByYears(long researcherId); - @Query("select new map(r.domain as label, count(distinct r) as y) from Research r group by r.domain") - Iterable> researchesByTopics(); + @Query("select new map(r.domain as label, count(distinct r) as y) from Research r where r.author.id = ?1 group by r.domain") + Iterable> researchesByTopics(long researcherId); - @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r) as y) from Research r group by to_char(r.releaseDate, 'month')") - Iterable> researchesByMonth(); + @Query("select new map(to_char(r.releaseDate, 'month') as label, count(distinct r) as y) from Research r where r.author.id = ?1 group by to_char(r.releaseDate, 'month')") + Iterable> researchesByMonth(long researcherId); } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/StatisticsService.java b/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/StatisticsService.java index 350feca..9f47466 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/StatisticsService.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Services/ScientificPublications/StatisticsService.java @@ -34,17 +34,17 @@ public class StatisticsService { ArrayList>> toReturn = new ArrayList<>(); - toReturn.add(statsRepo.viewsByYears()); - toReturn.add(statsRepo.viewsByMonths()); - toReturn.add(statsRepo.viewsByTopics()); + toReturn.add(statsRepo.viewsByYears(researcher.getId())); + toReturn.add(statsRepo.viewsByMonths(researcher.getId())); + toReturn.add(statsRepo.viewsByTopics(researcher.getId())); - toReturn.add(statsRepo.researchesByYears()); - toReturn.add(statsRepo.researchesByMonth()); - toReturn.add(statsRepo.researchesByTopics()); + toReturn.add(statsRepo.researchesByYears(researcher.getId())); + toReturn.add(statsRepo.researchesByMonth(researcher.getId())); + toReturn.add(statsRepo.researchesByTopics(researcher.getId())); - toReturn.add(statsRepo.languageByYears()); - toReturn.add(statsRepo.languageByMonths()); - toReturn.add(statsRepo.languageByTopics()); + toReturn.add(statsRepo.languageByYears(researcher.getId())); + toReturn.add(statsRepo.languageByMonths(researcher.getId())); + toReturn.add(statsRepo.languageByTopics(researcher.getId())); return toReturn; } } \ No newline at end of file diff --git a/frontend/src/Apps/ScientificPublications/ResearchComponent.vue b/frontend/src/Apps/ScientificPublications/ResearchComponent.vue index 3034e0d..13524f9 100644 --- a/frontend/src/Apps/ScientificPublications/ResearchComponent.vue +++ b/frontend/src/Apps/ScientificPublications/ResearchComponent.vue @@ -103,7 +103,7 @@ async function articleClicked(){ + {{i18n("SeeBibTex")}}
-- 2.46.0 From 4d6387ca8b7ebb9c22f426698c43d41db2afcb58 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Mon, 22 Apr 2024 11:29:58 +0200 Subject: [PATCH 2/2] fixed the search input --- frontend/src/Apps/ScientificPublications/ListResearches.vue | 1 + frontend/src/Apps/ScientificPublications/ResearcherProfile.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/Apps/ScientificPublications/ListResearches.vue b/frontend/src/Apps/ScientificPublications/ListResearches.vue index d056f72..67bae6d 100644 --- a/frontend/src/Apps/ScientificPublications/ListResearches.vue +++ b/frontend/src/Apps/ScientificPublications/ListResearches.vue @@ -136,6 +136,7 @@ const emit = defineEmits(["modified"]);