1
0
forked from PGL/Clyde

Compare commits

..

No commits in common. "219165aacf8812f59fbe5c6327a49d951c17e557" and "54d19eb888b98362ba15fc5d9323570e8e07edfa" have entirely different histories.

16 changed files with 308 additions and 285 deletions

View File

@ -1,12 +1,5 @@
package ovh.herisson.Clyde.EndPoints.ScientificPublications; package ovh.herisson.Clyde.EndPoints.ScientificPublications;
/******************************************************
* @file StatController.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Api class for handling statistics
******************************************************/
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;

View File

@ -1,12 +1,5 @@
package ovh.herisson.Clyde.Repositories.ScientificPublications; package ovh.herisson.Clyde.Repositories.ScientificPublications;
/******************************************************
* @file ResearchRepository.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Repository handling communication with Reseach table
******************************************************/
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research; import ovh.herisson.Clyde.Tables.ScientificPublications.Research;

View File

@ -1,12 +1,5 @@
package ovh.herisson.Clyde.Repositories.ScientificPublications; package ovh.herisson.Clyde.Repositories.ScientificPublications;
/******************************************************
* @file ResearcherRepository.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Repository handling communication with Reseacher table
******************************************************/
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research; import ovh.herisson.Clyde.Tables.ScientificPublications.Research;

View File

@ -1,12 +1,5 @@
package ovh.herisson.Clyde.Repositories.ScientificPublications; package ovh.herisson.Clyde.Repositories.ScientificPublications;
/******************************************************
* @file StatsRepository.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Repository handling communication with Reseach table for making statistics
******************************************************/
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research; import ovh.herisson.Clyde.Tables.ScientificPublications.Research;

View File

@ -1,12 +1,5 @@
package ovh.herisson.Clyde.Services.ScientificPublications; package ovh.herisson.Clyde.Services.ScientificPublications;
/******************************************************
* @file ResearchesService.java
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Service for managing researcher and researches
******************************************************/
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository; import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository;
@ -137,6 +130,39 @@ public class ResearchesService {
} }
researcherRepo.save(researcher); researcherRepo.save(researcher);
} }
//Co Author part
public boolean saveCoAuthors(Iterable<Long> researchersId, Research research) {
if (researchersId == null) return false;
ArrayList<Researcher> toAdd = new ArrayList<>();
for (long researcherId : researchersId){
Researcher researcher= researcherRepo.findById(researcherId);
if (researcher== null){
return false;
}
if (!toAdd.contains(researcher))
{
toAdd.add(researcher);
}
}
research.getCoAuthors().addAll(toAdd);
articleRepo.save(research);
return true;
}
public boolean deleteCoAuthor(Research research,Researcher coAuthor) {
if (!research.getCoAuthors().contains(coAuthor))
return false;
research.getCoAuthors().remove(coAuthor);
articleRepo.save(research);
return true;
}
// Other stuff // Other stuff
public Research addView(Research research) { public Research addView(Research research) {
@ -162,9 +188,12 @@ public class ResearchesService {
} }
} }
return research.getAccess() != Access.Restricted || (user.getRole() != Role.Secretary && if (research.getAccess() == Access.Restricted && (
user.getRole() != Role.Teacher && user.getRole() != Role.InscriptionService); user.getRole() == Role.Secretary ||
// if the access is restricted only the staff member (above) can access the research user.getRole() == Role.Teacher || user.getRole() == Role.InscriptionService))
return false; // if the access is restricted only the staff member (above) can access the research
return true;
// if the researcher is the author or one of the co-authors of the research will return false
} }
} }

View File

@ -1,19 +1,14 @@
package ovh.herisson.Clyde.Services.ScientificPublications; package ovh.herisson.Clyde.Services.ScientificPublications;
/******************************************************
* @file StatisticsService
* @author Bartha Maxime
* @scope Publications Scientifiques
*
* Service for managing statistics
******************************************************/
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository; import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearchRepository;
import ovh.herisson.Clyde.Repositories.ScientificPublications.ResearcherRepository;
import ovh.herisson.Clyde.Repositories.ScientificPublications.StatsRepository; import ovh.herisson.Clyde.Repositories.ScientificPublications.StatsRepository;
import ovh.herisson.Clyde.Tables.ScientificPublications.Research; import ovh.herisson.Clyde.Tables.ScientificPublications.Research;
import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher; import ovh.herisson.Clyde.Tables.ScientificPublications.Researcher;
import java.security.Key;
import java.util.*; import java.util.*;
@Service @Service

View File

@ -6,6 +6,7 @@ package ovh.herisson.Clyde.Tables.ScientificPublications;
* @scope Extension Publications scientifiques * @scope Extension Publications scientifiques
* *
* Research entity * Research entity
*
******************************************************/ ******************************************************/
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;

View File

@ -6,6 +6,7 @@ package ovh.herisson.Clyde.Tables.ScientificPublications;
* @scope Extension Publications scientifiques * @scope Extension Publications scientifiques
* *
* Researcher entity * Researcher entity
*
******************************************************/ ******************************************************/
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;

View File

@ -54,64 +54,3 @@ Curriculum=curriculum
Credits=Credits Credits=Credits
InscriptionService=I.S. InscriptionService=I.S.
faculty=Faculty faculty=Faculty
Year=Year
Access=Access
Access.Restricted=Restricted
Access.OpenSource=OpenSource
Access.Private=Private
Language=Language
Month=Month
Month.01=january
Month.02=february
Month.03=march
Month.04=april
Month.05=may
Month.06=june
Month.07=july
Month.08=august
Month.09=september
Month.10=october
Month.11=november
Month.12=december
Domain=Domain
PaperType=PaperType
Submit=Submit
Search.Researches=Search For Researches
Search.Researchers=Search For Researchers
Filters=Filters
Toggle.Researcher=Toggle Researcher Search
Untoggle.Researcher=Toggle Research Search
MoreInfo=More Info
Modify.Research=Modify Research
To.Change.In.Options=To change in regular account options
Modify.Data=Modify Data
Confirm.Changes=Confirm Changes
Cancel.Changes=Cancel Changes
Post.Research=Post a new Research
Summary=Summary
Title=Title
Views=Number of Views
See.Research=See Research
SeeBibTex=See BibTex
Author=Author
CoAuthors=Co-Authors
ReleaseDate=ReleaseDate
Article.Id=Article Id
Delete.Research=Delete Research
Here=Here
Stat.Type=Stat Type
Researches=Researches
Please.Select.Option=Please Select an Option
Class.By=Class By
PaperType.Article=Article
PaperType.Book=Book
PaperType.Book.Chapter=Book Chapter
PaperType.Paper=Paper
Research.Pdf=Research Pdf
BibTex.Pdf=BibTex Pdf
CoAuthors.List=Co-Author List
Confirm.Publish=Confirm Publishing
Cancel.Publish=Cancel Publishing
Years=Years
Months=Months
By=By

View File

@ -54,64 +54,3 @@ Curriculum=Cursus
Credits=Credits Credits=Credits
InscriptionService=S.I. InscriptionService=S.I.
faculty=Faculté faculty=Faculté
Year=Année
Access=Accès
Access.Restricted=Restreint
Access.OpenSource=Libre
Access.Private=Privé
Language=Langue
Month=Mois
Month.01=janvier
Month.02=fevrier
Month.03=mars
Month.04=avril
Month.05=mai
Month.06=juin
Month.07=juillet
Month.08=août
Month.09=septembre
Month.10=octobre
Month.11=novembre
Month.12=decembre
Domain=Domaine
PaperType=Type de recherche
Submit=Envoyer
Search.Researches=Chercher Par Recherche
Search.Researchers=Chercher Par Chercheur
Filters=Filtres
Toggle.Researcher=Activer la recherche par chercheur
Untoggle.Researcher=Désactiver la recherche par chercheur
MoreInfo=Plus d'info
Modify.Research=Modifer l'article
To.Change.In.Options=À changer dans les options
Modify.Data=Modifier
Confirm.Changes=Confirmer les Changements
Cancel.Changes=Abandonner les Changements
Post.Research=Poster un nouvel article
Summary=Résumé
Title=Titre
Views=Nombre de Vues
See.Research=Ouvrir l'article
SeeBibTex=Ouvrir le BibTex
Author=Autheur
CoAuthors=Co-Autheurs
ReleaseDate=Date de Parution
Article.Id=Id de l'article
Delete.Research=Supprimer l'article
Here=Ici
Stat.Type=Type de Stat
Researches=Recherches
Please.Select.Option=Selectionnez des Options
Class.By=Classifer Par
PaperType.Article=Article
PaperType.Book=Livre
PaperType.Book.Chapter=Chapitre de Livre
PaperType.Paper=Papier
Research.Pdf=Pdf de la Recherche
BibTex.Pdf=BibTex de la Recherche
CoAuthors.List=Liste des Co-Autheurs
Confirm.Publish=Confirmer la Publication
Cancel.Publish=Annuler la Publication
Years=Années
Months=Mois
By=par

View File

@ -7,19 +7,12 @@
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
import {onClickOutside} from '@vueuse/core' import {onClickOutside} from '@vueuse/core'
import i18n from "@/i18n.js";
const yearList = ref([]) const yearList = ref([])
const yearCheckedList = ref([])
const monthList = ref([]) const monthList = ref([])
const monthCheckedList = ref([])
const accessList = ref([]) const accessList = ref([])
const accessCheckedList = ref([])
const languageList = ref([]) const languageList = ref([])
const languageCheckedList = ref([])
const domainList = ref([]) const domainList = ref([])
const domainCheckedList = ref([])
const paperTypeList = ref([]) const paperTypeList = ref([])
const paperTypCheckedList = ref([])
const filters = Object.assign({},{ const filters = Object.assign({},{
year:[], year:[],
@ -30,7 +23,6 @@ const filters = Object.assign({},{
paperType:[], paperType:[],
}) })
const props = defineProps({ const props = defineProps({
isOpen: Boolean, isOpen: Boolean,
allArticles: ref([Object]) allArticles: ref([Object])
@ -38,12 +30,6 @@ const props = defineProps({
function submit(){ function submit(){
filters.paperType = paperTypCheckedList.value
filters.year = yearCheckedList.value
filters.month = monthCheckedList.value
filters.access = accessCheckedList.value
filters.language = languageCheckedList.value
filters.domain = domainCheckedList.value
emit("modal-close") emit("modal-close")
emit("submit", filters) emit("submit", filters)
} }
@ -67,6 +53,37 @@ for (let i=0;i< props.allArticles.length;i++) {
if (!paperTypeList.value.includes(r.paperType) && r.paperType !== null) paperTypeList.value.push(r.paperType); if (!paperTypeList.value.includes(r.paperType) && r.paperType !== null) paperTypeList.value.push(r.paperType);
} }
function monthToString(month){
switch (month){
case "01":
return "january"
case "02":
return "february"
case "03":
return "march"
case "04":
return "april"
case "05":
return "may"
case "06":
return "june"
case "07":
return "july"
case "08":
return "august"
case "09":
return "september"
case "10":
return "november"
case "11":
return "october"
case "12":
return "december"
default:
return "unknown"
}
}
const emit = defineEmits(["modal-close", "submit"]); const emit = defineEmits(["modal-close", "submit"]);
const target = ref(null) const target = ref(null)
@ -79,15 +96,15 @@ onClickOutside(target, ()=>emit('modal-close'))
<div class="modal-wrapper"> <div class="modal-wrapper">
<div class="modal-container" ref="target"> <div class="modal-container" ref="target">
<div id="filterGrid"> <div id="filterGrid">
<div> {{i18n("Year")}} :<ul class="checkers"> <li v-for="n in yearList"> <input type="checkbox" :value=n v-model="yearCheckedList"> {{n}} </li> </ul> </div> <div> Year :<ul class="checkers"> <li v-for="n in yearList"> <input type="checkbox" :value=n v-model="filters.year"> {{n}} </li> </ul> </div>
<div class="vl"> {{i18n("Access")}}:<ul class="checkers"> <li v-for="n in accessList"> <input type="checkbox" :value=n v-model="accessCheckedList"> {{i18n("Access."+n)}} </li> </ul> </div> <div class="vl"> Access :<ul class="checkers"> <li v-for="n in accessList"> <input type="checkbox" :value=n v-model="filters.access"> {{n}} </li> </ul> </div>
<div class="vl"> {{i18n("Language")}} :<ul class="checkers"> <li v-for="n in languageList"> <input type="checkbox" :value=n v-model="languageCheckedList"> {{n}} </li> </ul> </div> <div class="vl"> Language :<ul class="checkers"> <li v-for="n in languageList"> <input type="checkbox" :value=n v-model="filters.language"> {{n}} </li> </ul> </div>
<div> {{i18n("Month")}} :<ul class="checkers"> <li v-for="n in monthList"> <input type="checkbox" :value=n v-model="monthCheckedList"> {{i18n("Month." + n)}} </li> </ul> </div> <div> Month :<ul class="checkers"> <li v-for="n in monthList"> <input type="checkbox" :value=n v-model="filters.month"> {{monthToString(n)}} </li> </ul> </div>
<div class="vl"> {{i18n("Domain")}} :<ul class="checkers"> <li v-for="n in domainList"> <input type="checkbox" :value=n v-model="domainCheckedList"> {{n}} </li> </ul> </div> <div class="vl"> Domain :<ul class="checkers"> <li v-for="n in domainList"> <input type="checkbox" :value=n v-model="filters.domain"> {{n}} </li> </ul> </div>
<div class="vl"> {{i18n("PaperType")}} :<ul class="checkers"> <li v-for="n in paperTypeList"> <input type="checkbox" :value=n v-model="paperTypCheckedList"> {{n}} </li> </ul> </div> <div class="vl"> PaperType :<ul class="checkers"> <li v-for="n in paperTypeList"> <input type="checkbox" :value=n v-model="filters.paperType"> {{n}} </li> </ul> </div>
</div> </div>
<div id="submit"> <div id="submit">
<button @click.stop="submit">{{i18n("Submit")}}</button> <button @click.stop="submit">Submit</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,15 +1,8 @@
<!----------------------------------------------------
File: ListResearches.vue
Author: Maxime Bartha
Scope: Extension Publicatons scientifiquess
Description: Listing of the researches with filters
----------------------------------------------------->
<script setup> <script setup>
import {ref, watch} from "vue"; import {ref, watch} from "vue";
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue"; import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue"; import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
import {fetchAllResearches} from "@/rest/ScientificPublications/ManageResearch.js"; import {fetchAllResearches} from "@/rest/ScientificPublications/ManageResearch.js";
import i18n from "../../i18n.js";
const input = ref("") const input = ref("")
const isFilterOpened = ref(false); const isFilterOpened = ref(false);
const isResearchOpened = ref(false); const isResearchOpened = ref(false);
@ -43,6 +36,7 @@ const closeFilter = () => {
}; };
const submitFilters = (receivedFilters)=>{ const submitFilters = (receivedFilters)=>{
filters.value = receivedFilters filters.value = receivedFilters
console.log(filters.value)
} }
@ -113,11 +107,11 @@ const emit = defineEmits(["modified"]);
<FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters"></FilterComponent> <FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters"></FilterComponent>
<ArticleComponent :article="articleToDisplay" :isOpen="isResearchOpened" :manage="props.manage" @modal-close="closeResearch" @modified="emit('modified')"></ArticleComponent> <ArticleComponent :article="articleToDisplay" :isOpen="isResearchOpened" :manage="props.manage" @modal-close="closeResearch" @modified="emit('modified')"></ArticleComponent>
<div id="search"> <div id="search">
<input v-if="!isResearcher" type="text" id="search-input" :placeholder="i18n('Search.Researches')" v-model="input"/> <input v-if="!isResearcher" type="text" id="search-input" placeholder="search for researches" v-model="input"/>
<input v-else type="text" id="search-input" :placeholder="i18n('Search.Researchers')" v-model="input"/> <input v-else type="text" id="search-input" placeholder="search for researcher" v-model="input"/>
<button v-if="!isResearcher" id="filterButton" @click="openFilter"> {{i18n("Filters")}} </button> <button v-if="!isResearcher" id="filterButton" @click="openFilter"> Filters </button>
<button v-if="!isResearcher" id="unToggledResearchButton" @click="isResearcher = !isResearcher"> {{i18n("Toggle.Researcher")}}</button> <button v-if="!isResearcher" id="unToggledResearchButton" @click="isResearcher = !isResearcher"> Toggle Researcher Search</button>
<button v-if="isResearcher" id="toggledResearchButton" @click="isResearcher = !isResearcher"> {{i18n("Untoggle.Researcher")}}</button> <button v-if="isResearcher" id="toggledResearchButton" @click="isResearcher = !isResearcher"> UnToggle Researcher Search</button>
</div> </div>
<div id="researches"> <div id="researches">
<ul id="researchUL"> <ul id="researchUL">
@ -125,8 +119,8 @@ const emit = defineEmits(["modified"]);
<div class="vl"> {{n.title}}</div> <div class="vl"> {{n.title}}</div>
<div class="vl"> <a :href="'#/researcher-profile?id=' + n.researcher.id"> {{ n.researcher.user.firstName +" "+ n.researcher.user.lastName }}</a> <div class="vl"> <a :href="'#/researcher-profile?id=' + n.researcher.id"> {{ n.researcher.user.firstName +" "+ n.researcher.user.lastName }}</a>
</div> </div>
<a v-if="!manage" @click="openResearch(n)"> {{i18n("MoreInfo")}}</a> <a v-if="!manage" @click="openResearch(n)"> MoreInfo </a>
<a v-else @click="openResearch(n)"> {{i18n("Modify.Research")}}</a></li> <a v-else @click="openResearch(n)"> Modify Research</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -222,4 +216,7 @@ a{
#toggledResearchButton:hover{ #toggledResearchButton:hover{
background: #ff2d55; background: #ff2d55;
} }
</style> </style>

View File

@ -1,27 +1,77 @@
<!----------------------------------------------------
File: ManageResearchesProfile.vue
Author: Maxime Bartha
Scope: Extension Publicatons scientifiquess
Description: Managing Researcher Profile page
----------------------------------------------------->
<script setup> <script setup>
import { ref} from "vue"; import { ref} from "vue";
import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
import {fetchResearches, } from "@/rest/ScientificPublications/ResearcherProfile.js"; import {fetchResearches, } from "@/rest/ScientificPublications/ResearcherProfile.js";
import {getSelf, patchProfile} from "@/rest/ScientificPublications/ManageResearcherProfile.js"; import {getSelf, patchProfile} from "@/rest/ScientificPublications/ManageResearcherProfile.js";
import ResearchPostComponent from "@/Apps/ScientificPublications/ResearchPostComponent.vue"; import ResearchPostComponent from "@/Apps/ScientificPublications/ResearchPostComponent.vue";
import ListResearches from "@/Apps/ScientificPublications/ListResearches.vue"; import ListResearches from "@/Apps/ScientificPublications/ListResearches.vue";
import i18n from "../../i18n.js";
const input = ref(""); const input = ref("");
const isFilterOpened = ref(false);
const isResearchOpened = ref(false);
const isPostResearchOpened = ref(false); const isPostResearchOpened = ref(false);
const articleToDisplay = ref()
const changing = ref(false); const changing = ref(false);
let toModify= Object.assign({}, {}); let toModify= Object.assign({}, {});
const researcher = ref(await getSelf()); const researcher = ref(await getSelf());
const researchList = ref(await fetchResearches(researcher.value.id)); const researchList = ref(await fetchResearches(researcher.value.id));
//todo get the filters
const openFilter = () => {
isFilterOpened.value = true;
};
const closeFilter = () => {
isFilterOpened.value = false;
};
const submitFilters = ()=>{
}
const openResearch = (article) => {
isResearchOpened.value = true;
articleToDisplay.value = article;
}
const closeResearch = () => {
isResearchOpened.value =false;
articleToDisplay.value = null;
}
function openPostResearch(){ function openPostResearch(){
isPostResearchOpened.value = true isPostResearchOpened.value = true
} }
function searchInList(list, searchInput) {
let retList = []
for (let i = 0; i < list.length; i++) {
if (lDistance(list[i].title, searchInput) < 10 || list[i].title.toUpperCase().indexOf(searchInput.toUpperCase()) > -1){
retList.push(list[i])
}
}
return retList
}
function lDistance(s,t){
if (!s.length) return t.length;
if (!t.length) return s.length;
const arr = [];
for (let i = 0; i <= t.length; i++) {
arr[i] = [i];
for (let j = 1; j <= s.length; j++) {
arr[i][j] =
i === 0
? j
: Math.min(
arr[i - 1][j] + 1,
arr[i][j - 1] + 1,
arr[i - 1][j - 1] + (s[j - 1] === t[i - 1] ? 0 : 1)
);
}
}
return arr[t.length][s.length];
}
function cancelChanges(){ function cancelChanges(){
changing.value = false changing.value = false
toModify= Object.assign({}, {}); toModify= Object.assign({}, {});
@ -41,40 +91,42 @@ async function modifiedResearch(){
</script> </script>
<template> <div class="body"><div id="main"> <template> <div class="body"><div id="main">
<FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters()"></FilterComponent>
<ArticleComponent :article="articleToDisplay" :isOpen="isResearchOpened" :manage="true" @modal-close="closeResearch" @modified="modifiedResearch" ></ArticleComponent>
<ResearchPostComponent :researcher="researcher" :isOpen="isPostResearchOpened" @modal-close="isPostResearchOpened = false" @posted="modifiedResearch"></ResearchPostComponent> <ResearchPostComponent :researcher="researcher" :isOpen="isPostResearchOpened" @modal-close="isPostResearchOpened = false" @posted="modifiedResearch"></ResearchPostComponent>
<div id="profilePicture"> <div id="profilePicture">
<img src="/Clyde.png" /> <img src="/Clyde.png" />
</div> </div>
<div id="researcherInfos"> <div id="researcherInfos">
<div class="surrounded" v-if="!changing">{{researcher.user.lastName}} {{researcher.user.firstName}}</div> <div class="surrounded" v-if="!changing">{{researcher.user.lastName}} {{researcher.user.firstName}}</div>
<div class="surrounded" v-else> {{i18n("To.Change.In.Options")}}</div> <div class="surrounded" v-else> To Be changed in manage (simple) Profile</div>
<div class="surrounded" v-if="!changing">Orcid : {{researcher.orcidId}}</div> <div class="surrounded" v-if="!changing">Orcid : {{researcher.orcidId}}</div>
<div class="surrounded" v-else>Orcid : <input v-model="toModify.orcidId"> </input></div> <div class="surrounded" v-else>Orcid : <input v-model="toModify.orcidId"> </input></div>
<div class="surrounded" v-if="!changing">Email : {{researcher.user.email}}</div> <div class="surrounded" v-if="!changing">Email : {{researcher.user.email}}</div>
<div class="surrounded" v-else> {{i18n("To.Change.In.Options")}}</div> <div class="surrounded" v-else> To Be changed in manage (simple) Profile</div>
<div class="surrounded" v-if="!changing"> <div class="surrounded" v-if="!changing">
Site : <a :href=researcher.site style="color: #007aff"> {{researcher.site}}</a> site : <a :href=researcher.site style="color: #007aff"> {{researcher.site}}</a>
</div> </div>
<div class="surrounded" v-else>Site : <input v-model="toModify.site"></input></div> <div class="surrounded" v-else>Site : <input v-model="toModify.site"></input></div>
<div class="surrounded" v-if="!changing">{{i18n("Domain")}} : {{researcher.domain}}</div> <div class="surrounded" v-if="!changing">Domain : {{researcher.domain}}</div>
<div class="surrounded" v-else>Domain : <input v-model="toModify.domain"> </input></div> <div class="surrounded" v-else>Domain : <input v-model="toModify.domain"> </input></div>
<div style="text-align: center; align-self: center" v-if="!changing"> <button class="modifyButton" @click="changing = !changing">{{i18n("Modify.Data")}}</button></div> <div style="text-align: center; align-self: center" v-if="!changing"> <button class="modifyButton" @click="changing = !changing">Modify Data</button></div>
<div v-else style="text-align: center; align-self: center"> <div v-else style="text-align: center; align-self: center">
<button id="confirmButton" @click="confirmChanges"> {{i18n("Confirm.Changes")}}</button> <button id="confirmButton" @click="confirmChanges">Confirm Changes</button>
<button id="cancelButton" @click="cancelChanges"> {{i18n("Cancel.Changes")}}</button> <button id="cancelButton" @click="cancelChanges">Cancel Changes</button>
</div> </div>
</div> </div>
<div class="postArticle" style="text-align: center"> <div class="postArticle" style="text-align: center">
<button class="modifyButton" @click="openPostResearch">{{i18n("Post.Research")}}</button> <button class="modifyButton" @click="openPostResearch">Post a Research</button>
</div> </div>
<div> <ListResearches :research-list="researchList" :manage="true" @modified="modifiedResearch"></ListResearches> </div> <div id="researches"> <ListResearches :research-list="researchList" :manage="true" @modified="modifiedResearch"></ListResearches> </div>
</div> </div>
</div> </div>
</template> </template>
@ -135,7 +187,6 @@ async function modifiedResearch(){
font-size: xx-large; font-size: xx-large;
background-color:rgba(191, 64, 191,0.5); background-color:rgba(191, 64, 191,0.5);
border-radius: 20px; border-radius: 20px;
margin-bottom: 20px;
} }
.modifyButton:hover{ .modifyButton:hover{
@ -168,9 +219,61 @@ async function modifiedResearch(){
background: #4cd964; background: #4cd964;
} }
#search{
width: 100%;
height: 10%;
display: inline-flex;
}
#search-input {
margin-left: 25px;
width: 75%;
font-size: 16px;
padding: 12px 20px 12px 40px;
border: 1px solid #ddd;
height: 20px;
align-self: center;
}
#filterButton {
align-self: center;
margin-left: 2px;
font-size: xx-large;
color: white;
background: rgba(191, 64, 191,0.5);
border:2px solid black;
}
#filterButton:hover{
background: rgba(191, 64, 191);
}
#researchUL {
list-style-type: none;
color: white;
padding: 12px;
margin: 5px;
height: 400px;
overflow: scroll;
}
#researchLi{
display: grid;
grid-template-columns: auto auto auto;
border: 2px solid black;
color: white;
font-size: x-large;
text-align: center;
text-indent: 7px;
background-color: rgba(255, 255, 255, 0.09);
border-radius: 18px;
margin-bottom: 15px;
}
a{ a{
color:#007aff; color:#007aff;
text-decoration: underline; text-decoration: underline;
cursor: pointer; cursor: pointer;
} }
.vl {
border-right: 2px solid black;
}
</style> </style>

View File

@ -2,14 +2,13 @@
File: ResearchComponent.vue File: ResearchComponent.vue
Author: Maxime Bartha Author: Maxime Bartha
Scope: Extension Publicatons scientifiquess Scope: Extension Publicatons scientifiquess
Description: Pop Up summarizing a research infos Description: Pop Up summarizing
-----------------------------------------------------> ----------------------------------------------------->
<script setup xmlns="http://www.w3.org/1999/html"> <script setup xmlns="http://www.w3.org/1999/html">
import {ref } from "vue"; import {ref } from "vue";
import {onClickOutside} from '@vueuse/core' import {onClickOutside} from '@vueuse/core'
import {patchArticle, deleteArticle, addView} from "@/rest/ScientificPublications/ManageResearch.js"; import {patchArticle, deleteArticle, addView} from "@/rest/ScientificPublications/ManageResearch.js";
import i18n from "../../i18n.js";
const restURL = import.meta.env.VITE_CLYDE_MODE === 'container' ? "http://localhost:8000": import.meta.env.DEV ? "http://localhost:5173" : "https://clyde.herisson.ovh/api" const restURL = import.meta.env.VITE_CLYDE_MODE === 'container' ? "http://localhost:8000": import.meta.env.DEV ? "http://localhost:5173" : "https://clyde.herisson.ovh/api"
const props = defineProps({ const props = defineProps({
@ -72,40 +71,40 @@ async function articleClicked(){
<div class="modal-wrapper"> <div class="modal-wrapper">
<div class="modal-container" ref="target"> <div class="modal-container" ref="target">
<div ><ul> <div ><ul>
<li>{{i18n("Article.Id")}} : {{article.id}}</li> <li>Article Id : {{article.id}}</li>
<li>{{i18n("Title")}} : {{article.title}}</li> <li>Title : {{article.title}}</li>
<li>{{i18n("Author")}} : {{article.researcher.user.lastName + " " + article.researcher.user.firstName}}</li> <li>Author : {{article.researcher.user.lastName + " " + article.researcher.user.firstName}}</li>
<li>{{i18n("CoAuthors")}} : <ul id="coAuthors" v-for="n in article.coAuthors"> <li id="coAuthorsLi"> {{n.user.firstName}} {{n.user.lastName}}, </li></ul></li> <li> Co Authors : <ul id="coAuthors" v-for="n in article.coAuthors"> <li id="coAuthorsLi"> {{n.user.firstName}} {{n.user.lastName}}, </li></ul></li>
<li>{{i18n("Summary")}} : {{article.summary}}</li> <li>Summary : {{article.summary}}</li>
<li>{{i18n("ReleaseDate")}} : {{format(article.releaseDate)}}</li> <li>ReleaseDate: {{format(article.releaseDate)}}</li>
<li>{{i18n("Language")}} : {{article.language}}</li> <li>Language : {{article.language}}</li>
<li>{{i18n("PaperType")}} : {{article.paperType}}</li> <li>PaperType : {{article.paperType}}</li>
<li>{{i18n("Domain")}} : {{article.domain}}</li> <li>Domain : {{article.domain}}</li>
<li>{{i18n("Views")}} : {{article.views}}</li> <li>Views : {{article.views}}</li>
<li>{{i18n("Access")}} : {{i18n(article.access)}}</li> <li>Access : {{article.access}}</li>
</ul> </ul>
<div id="downloads" v-if="article.pdfLocation !== null && !manage"> <div id="downloads" v-if="article.pdfLocation !== null && !manage">
<a :href=downloadPdf() @click.stop="articleClicked" target="_blank">{{i18n("See.Research")}}</a> <a :href=downloadPdf() @click.stop="articleClicked" target="_blank">See Research</a>
<a v-if="article.bibTexLocation !== null" :href=downloadBibTex() @click.stop="emit('modal-close')" target="_blank">{{i18n("See.BibTex")}}</a> </div> <a v-if="article.bibTexLocation !== null" :href=downloadBibTex() @click.stop="emit('modal-close')" target="_blank">See bibTex</a> </div>
</div> </div>
<div v-if="manage"> <div v-if="manage">
<div> <div>
<ul> <ul>
<li>{{i18n("Title")}} : <input v-model="toModify.title"></li> <li>Title : <input v-model="toModify.title"></li>
<li>{{i18n("Language")}} : <input v-model="toModify.language"></li> <li>Language : <input v-model="toModify.language"></li>
<li>{{i18n("Summary")}} : <input v-model="toModify.summary"></li> <li>Summary : <input v-model="toModify.summary"></li>
<li>{{i18n("Domain")}} : <input v-model="toModify.domain"></li> <li>Domain : <input v-model="toModify.domain"></li>
<li>{{i18n("Access")}} : <li>Access :
<select id="classed-select" v-model="toModify.access"> <select id="classed-select" v-model="toModify.access">
<option value="OpenSource">{{i18n("Access.OpenSource")}}</option> <option value="OpenSource">OpenSource</option>
<option value="Restricted">{{i18n("Access.Restricted")}}</option> <option value="Restricted">Restricted</option>
<option value="Private">{{i18n("Access.Private")}}</option> <option value="Private">Private</option>
</select></li> </select></li>
</ul> </ul>
</div> </div>
<button id="confirmButton" @click="confirmChanges"> {{i18n("Confirm.Changes")}}</button> <button id="confirmButton" @click="confirmChanges">Confirm Changes</button>
<button id="cancelButton" @click="cancelChanges">{{i18n("Cancel.Changes")}}</button> <button id="cancelButton" @click="cancelChanges">Cancel Changes</button>
<button id="deleteButton" @click="deleteThisArticle">{{i18n("Delete.Research")}} </button> <button id="deleteButton" @click="deleteThisArticle">Delete Research </button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,15 +1,8 @@
<!----------------------------------------------------
File: ResearchPostComponent.vue
Author: Maxime Bartha
Scope: Extension Publicatons scientifiquess
Description: pop up for posting a research
----------------------------------------------------->
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
import {onClickOutside} from '@vueuse/core' import {onClickOutside} from '@vueuse/core'
import {uploadFile, postResearch, fetchAllResearchers} from "@/rest/ScientificPublications/ManageResearch.js"; import {uploadFile, postResearch, fetchAllResearchers} from "@/rest/ScientificPublications/ManageResearch.js";
import i18n from "../../i18n.js";
const allResearcher = ref(await fetchAllResearchers()) const allResearcher = ref(await fetchAllResearchers())
const coAuthors = ref([]) const coAuthors = ref([])
@ -68,34 +61,34 @@ onClickOutside(target, ()=>emit('modal-close'))
<div class="modal-container" ref="target"> <div class="modal-container" ref="target">
<div ><ul> <div ><ul>
<li>{{i18n("Title")}} : <input v-model="toPost.title"></li> <li>Title : <input v-model="toPost.title"></li>
<li>{{i18n("Summary")}} : <input v-model="toPost.summary"></li> <li>Summary : <input v-model="toPost.summary"></li>
<li>{{i18n("Language")}} : <input v-model="toPost.language"></li> <li>Language : <input v-model="toPost.language"></li>
<li>{{i18n("Domain")}} : <input v-model="toPost.domain"></li> <li>Domain : <input v-model="toPost.domain"></li>
<li>{{i18n("PaperType")}} : <select id="classed-select" v-model="toPost.paperType"> <li>PaperType : <select id="classed-select" v-model="toPost.paperType">
<option value="Article">{{i18n("PaperType.Article")}}</option> <option value="Article">Article</option>
<option value="Book">{{i18n("PaperType.Book")}}</option> <option value="Book">Book</option>
<option value="BookChapter">{{i18n("PaperType.Book.Chapter")}}</option> <option value="BookChapter">Book Chapter</option>
<option value="Paper">{{i18n("PaperType.Paper")}}Paper</option> <option value="Paper">Paper</option>
</select></li> </select></li>
<li>{{i18n("Access")}} : <select id="classed-select" v-model="toPost.access"> <li>Access : <select id="classed-select" v-model="toPost.access">
<option value="OpenSource">{{i18n("Access.OpenSource")}}</option> <option value="OpenSource">OpenSource</option>
<option value="Restricted">{{i18n("Access.Restricted")}}</option> <option value="Restricted">Restricted</option>
<option value="Private">{{i18n("Access.Private")}}</option> <option value="Private">Private</option>
</select></li> </select></li>
<li> {{i18n("Research.Pdf")}} : <li> Research Pdf :
<form novalidate enctype="multipart/form-data" class="inputBox"> <form novalidate enctype="multipart/form-data" class="inputBox">
<input type="file" @change="uploadResearchPdf($event.target.files);" accept="application/pdf"> <input type="file" @change="uploadResearchPdf($event.target.files);" accept="application/pdf">
</form></li> </form></li>
<li> {{i18n("BibTex.Pdf")}} <li> Research BibTex :
<form novalidate enctype="multipart/form-data" class="inputBox"> <form novalidate enctype="multipart/form-data" class="inputBox">
<input type="file" @change="uploadBibTex($event.target.files);" accept=".bib"> <input type="file" @change="uploadBibTex($event.target.files);" accept=".bib">
</form></li> </form></li>
</ul> </ul>
</div> </div>
<div id="CoAuthorList"> {{i18n("CoAuthors.List")}} : <div id="CoAuthorList"> Co-Authors List:
<ul style="list-style-type: none;" v-for="n in allResearcher"> <ul style="list-style-type: none;" v-for="n in allResearcher">
<li v-if="n.id !== props.researcher.id"> <input type="checkbox" :value=n v-model="coAuthors"> {{n.id}} : {{n.user.firstName}} {{n.user.lastName}}</li> <li v-if="n.id !== props.researcher.id"> <input type="checkbox" :value=n v-model="coAuthors"> {{n.id}} : {{n.user.firstName}} {{n.user.lastName}}</li>
</ul> </ul>
@ -103,12 +96,14 @@ onClickOutside(target, ()=>emit('modal-close'))
</div> </div>
<div></div> <div></div>
<div> <div>
<button id="confirmButton" @click="postNewResearch">{{i18n("Confirm.Publish")}}</button> <button id="confirmButton" @click="postNewResearch">Confirm Publish</button>
<button id="cancelButton" @click="cancelPost">{{i18n("Cancel.Publish")}}</button> <button id="cancelButton" @click="cancelPost">Cancel Publish</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<style scoped> <style scoped>
@ -137,6 +132,12 @@ onClickOutside(target, ()=>emit('modal-close'))
margin-top: 9px; margin-top: 9px;
} }
#coAuthorList{
overflow: scroll;
}
#downloads button { #downloads button {
align-self: center; align-self: center;
margin-left: 2px; margin-left: 2px;

View File

@ -7,12 +7,17 @@
<script setup> <script setup>
import { ref, reactive } from "vue"; import { ref, reactive } from "vue";
import {fetchResearcher, fetchResearches, fetchStats} from "@/rest/ScientificPublications/ResearcherProfile.js"; import FilterComponent from "@/Apps/ScientificPublications/FilterComponent.vue";
import ArticleComponent from "@/Apps/ScientificPublications/ResearchComponent.vue";
import {fetchResearcher, fetchResearches, fetchStats, fetchResearch} from "@/rest/ScientificPublications/ResearcherProfile.js";
import {getFile, addView} from "@/rest/ScientificPublications/ManageResearch.js";
import ListResearches from "@/Apps/ScientificPublications/ListResearches.vue"; import ListResearches from "@/Apps/ScientificPublications/ListResearches.vue";
import i18n from "../../i18n.js";
const input = ref(""); const input = ref("");
const statsOf = ref(""); const statsOf = ref("");
const statsBy = ref(""); const statsBy = ref("");
const isFilterOpened = ref(false);
const isResearchOpened = ref(false);
const articleToDisplay = ref(Object)
let chart; let chart;
const researcherId = window.location.href.split("=")[1] const researcherId = window.location.href.split("=")[1]
@ -22,6 +27,29 @@ const researchList = ref(await fetchResearches(researcherId));
const researcher = ref(await fetchResearcher(researcherId)); const researcher = ref(await fetchResearcher(researcherId));
const stats = ref(await fetchStats(researcherId)) const stats = ref(await fetchStats(researcherId))
const closeFilter = () => {
isFilterOpened.value = false;
};
const submitFilters = ()=>{
}
const closeResearch = () => {
isResearchOpened.value =false;
articleToDisplay.value = null;
}
const downloadBibTex = (research) => {
getFile(research.bibTexLocation)
}
async function downloadArticle (research) {
await addView(research.pdfLocation)
await getFile(research.pdfLocation)
articleToDisplay.value = await fetchResearch(articleToDisplay.value.id)
stats.value = await fetchStats(researcher.value.id)
update()
}
function downloadCoAuthors(){ function downloadCoAuthors(){
let coAuthors = [] let coAuthors = []
for (let i in researchList.value) { for (let i in researchList.value) {
@ -41,7 +69,7 @@ const options = reactive({
animationEnabled: true, animationEnabled: true,
title: { title: {
fontColor: "white", fontColor: "white",
text : i18n("Please.Select.Option"), text : "please select options",
}, },
data: [ data: [
{ {
@ -65,13 +93,15 @@ function update(){
options.data[0].dataPoints = stats.value[index] options.data[0].dataPoints = stats.value[index]
options.title.text = i18n(statsOf.value) +" "+ i18n("By") +" " + i18n(statsBy.value); options.title.text = statsOf.value + " By "+ statsBy.value;
chart.render(); chart.render();
} }
</script> </script>
<template> <template>
<div id="main"> <div id="main">
<FilterComponent :isOpen="isFilterOpened" :allArticles="researchList" @modal-close="closeFilter" @submit="submitFilters()"></FilterComponent>
<ArticleComponent :article="articleToDisplay" :isOpen="isResearchOpened" :manage="false" @modal-close="closeResearch" @downloadPdf="downloadArticle(articleToDisplay)" @downloadBibTex="downloadBibTex(articleToDisplay)"></ArticleComponent>
<div id="profilePicture"> <div id="profilePicture">
<img src="/Clyde.png" /> <img src="/Clyde.png" />
</div> </div>
@ -80,26 +110,26 @@ function update(){
<div class="surrounded">Orcid : {{researcher.orcidId}}</div> <div class="surrounded">Orcid : {{researcher.orcidId}}</div>
<div class="surrounded">Email : {{researcher.user.email}}</div> <div class="surrounded">Email : {{researcher.user.email}}</div>
<div class="surrounded"> <div class="surrounded">
Site : <a :href=researcher.site style="color: #007aff"> {{researcher.site}}</a> site : <a :href=researcher.site style="color: #007aff"> {{researcher.site}}</a>
</div> </div>
<div class="surrounded">{{i18n("Domain")}} : {{researcher.domain}}</div> <div class="surrounded">Domain : {{researcher.domain}}</div>
<div id="coAuthorList" class="surrounded">Co-authors list : <a :href=downloadCoAuthors() download="coAuthors.json">{{i18n("Here")}}</a></div> <div id="coAuthorList" class="surrounded">Co-authors list : <a :href=downloadCoAuthors() download="coAuthors.json"> here </a></div>
</div> </div>
<div id="stats"> <div id="stats">
<div class="surrounded"> <div class="surrounded">
{{i18n("Stat.Type")}} : Stat type :
<select @change="update()" id="stats-select" v-model="statsOf"> <select @change="update()" id="stats-select" v-model="statsOf">
<option value="Views">{{i18n("Views")}}</option> <option value="views">Views</option>
<option value="Researches">{{i18n("Researches")}}</option> <option value="researches">Researches</option>
<option value="Languages">{{i18n("Language")}}</option> <option value="languages">Languages</option>
</select> </select>
</div> </div>
<div class="surrounded"> <div class="surrounded">
{{i18n("Class.By")}} : Class by:
<select @change="update()" id="classed-select" v-model="statsBy"> <select @change="update()" id="classed-select" v-model="statsBy">
<option value="Years">{{i18n("Years")}}</option> <option value="years">Years</option>
<option value="Months">{{i18n("Months")}}</option> <option value="months">Months</option>
<option value="Topics">{{i18n("Domain")}}</option> <option value="topics">Topics</option>
</select> </select>
</div> </div>
<div id="statsPie"> <div id="statsPie">