Compare commits
	
		
			1 Commits
		
	
	
		
			730a72dba3
			...
			tonitch/fi
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						d21655c535
	
				 | 
					
					
						
@ -15,33 +15,33 @@ import java.util.Map;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public interface StatsRepository extends CrudRepository<Research,Long> {
 | 
					public interface StatsRepository extends CrudRepository<Research,Long> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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')")
 | 
					    @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<Map<String ,Integer>> viewsByMonths(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> viewsByMonths();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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')")
 | 
					    @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<Map<String ,Integer>> viewsByYears(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> viewsByYears();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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")
 | 
					    @Query("select new map(r.domain as label, sum(r.views) as y) from Research r group by r.domain")
 | 
				
			||||||
    Iterable<Map<String ,Integer>> viewsByTopics(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> viewsByTopics();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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")
 | 
					    @Query("select new map(r.domain as label, count(distinct r.language) as y) from Research r group by r.domain")
 | 
				
			||||||
    Iterable<Map<String ,Integer>> languageByTopics(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> languageByTopics();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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')")
 | 
					    @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<Map<String ,Integer>> languageByYears(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> languageByYears();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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')")
 | 
					    @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<Map<String ,Integer>> languageByMonths(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> languageByMonths();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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')")
 | 
					    @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<Map<String ,Integer>> researchesByYears(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> researchesByYears();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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")
 | 
					    @Query("select new map(r.domain as label, count(distinct r) as y) from Research r group by r.domain")
 | 
				
			||||||
    Iterable<Map<String ,Integer>> researchesByTopics(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> researchesByTopics();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @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')")
 | 
					    @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<Map<String ,Integer>> researchesByMonth(long researcherId);
 | 
					    Iterable<Map<String ,Integer>> researchesByMonth();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -34,17 +34,17 @@ public class StatisticsService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        ArrayList<Iterable<Map<String,Integer>>> toReturn = new ArrayList<>();
 | 
					        ArrayList<Iterable<Map<String,Integer>>> toReturn = new ArrayList<>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        toReturn.add(statsRepo.viewsByYears(researcher.getId()));
 | 
					        toReturn.add(statsRepo.viewsByYears());
 | 
				
			||||||
        toReturn.add(statsRepo.viewsByMonths(researcher.getId()));
 | 
					        toReturn.add(statsRepo.viewsByMonths());
 | 
				
			||||||
        toReturn.add(statsRepo.viewsByTopics(researcher.getId()));
 | 
					        toReturn.add(statsRepo.viewsByTopics());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        toReturn.add(statsRepo.researchesByYears(researcher.getId()));
 | 
					        toReturn.add(statsRepo.researchesByYears());
 | 
				
			||||||
        toReturn.add(statsRepo.researchesByMonth(researcher.getId()));
 | 
					        toReturn.add(statsRepo.researchesByMonth());
 | 
				
			||||||
        toReturn.add(statsRepo.researchesByTopics(researcher.getId()));
 | 
					        toReturn.add(statsRepo.researchesByTopics());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        toReturn.add(statsRepo.languageByYears(researcher.getId()));
 | 
					        toReturn.add(statsRepo.languageByYears());
 | 
				
			||||||
        toReturn.add(statsRepo.languageByMonths(researcher.getId()));
 | 
					        toReturn.add(statsRepo.languageByMonths());
 | 
				
			||||||
        toReturn.add(statsRepo.languageByTopics(researcher.getId()));
 | 
					        toReturn.add(statsRepo.languageByTopics());
 | 
				
			||||||
        return toReturn;
 | 
					        return toReturn;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -32,7 +32,6 @@ async function createResearcher(){
 | 
				
			|||||||
  toCreate.user = user.value
 | 
					  toCreate.user = user.value
 | 
				
			||||||
  await postResearcher(toCreate)
 | 
					  await postResearcher(toCreate)
 | 
				
			||||||
  creating.value = false
 | 
					  creating.value = false
 | 
				
			||||||
  allResearcher.value = await fetchAllResearchers()
 | 
					 | 
				
			||||||
  for (let i = 0; i < allResearcher.value.length; i++) {
 | 
					  for (let i = 0; i < allResearcher.value.length; i++) {
 | 
				
			||||||
    if (user.value.regNo === allResearcher.value[i].user.regNo){
 | 
					    if (user.value.regNo === allResearcher.value[i].user.regNo){
 | 
				
			||||||
      researcher.value = allResearcher.value[i]
 | 
					      researcher.value = allResearcher.value[i]
 | 
				
			||||||
@ -148,7 +147,8 @@ async function modify(){
 | 
				
			|||||||
  column-gap:2.7%;
 | 
					  column-gap:2.7%;
 | 
				
			||||||
  row-gap:45px;
 | 
					  row-gap:45px;
 | 
				
			||||||
  grid-template-areas:
 | 
					  grid-template-areas:
 | 
				
			||||||
  "profilPic globalInfos";
 | 
					  "profilPic globalInfos"
 | 
				
			||||||
 | 
					  "minfos minfos";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.profilPic{
 | 
					.profilPic{
 | 
				
			||||||
@ -167,8 +167,7 @@ async function modify(){
 | 
				
			|||||||
  display:flex;
 | 
					  display:flex;
 | 
				
			||||||
  align-items:center;
 | 
					  align-items:center;
 | 
				
			||||||
  justify-content:center;
 | 
					  justify-content:center;
 | 
				
			||||||
  margin-right: auto;
 | 
					  margin-top:5%;
 | 
				
			||||||
  margin-left: auto;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.subContainer{
 | 
					.subContainer{
 | 
				
			||||||
 | 
				
			|||||||
@ -93,14 +93,12 @@
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
  async function ChangeInfos(){
 | 
					  async function ChangeInfos(){
 | 
				
			||||||
    for (let element in toModify){
 | 
					    for (let element in toModify){
 | 
				
			||||||
      console.log(element)
 | 
					 | 
				
			||||||
      console.log(toModify[element])
 | 
					 | 
				
			||||||
         if (element ==="email" && (toModify[element] !== null)){
 | 
					         if (element ==="email" && (toModify[element] !== null)){
 | 
				
			||||||
          await  alterSelf(user.value.regNo,{email : toModify[element]});
 | 
					          await  alterSelf(user.value.regNo,{email : toModify[element]});
 | 
				
			||||||
        }      
 | 
					        }      
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (element ==="profilePictureUrl" && (toModify[element] !== null)){
 | 
					        if (element ==="profilPictureUrl" && (toModify[element] !== null)){
 | 
				
			||||||
          await  alterSelf(user.value.regNo,{ profilePictureUrl : toModify[element]});
 | 
					          await  alterSelf(user.value.regNo,{ profilPictureUrl : toModify[element]});
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else if(element === "address" && (toModify[element] !== null)){
 | 
					        else if(element === "address" && (toModify[element] !== null)){
 | 
				
			||||||
          await  alterSelf(user.value.regNo,{address : toModify[element]});
 | 
					          await  alterSelf(user.value.regNo,{address : toModify[element]});
 | 
				
			||||||
@ -118,7 +116,7 @@
 | 
				
			|||||||
     toModify.address = item.address;
 | 
					     toModify.address = item.address;
 | 
				
			||||||
     toModify.profilPictureUrl = item.profilPictureUrl;
 | 
					     toModify.profilPictureUrl = item.profilPictureUrl;
 | 
				
			||||||
     toModify.email= item.email;
 | 
					     toModify.email= item.email;
 | 
				
			||||||
     toModify.password= item.password
 | 
					     toModify.password= item.password;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function getPP(){
 | 
					  function getPP(){
 | 
				
			||||||
@ -178,13 +176,6 @@
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
  async function getProfilePic(data){
 | 
					 | 
				
			||||||
    const pp= await uploadProfilePicture(data)
 | 
					 | 
				
			||||||
    toModify.profilePictureUrl = pp.url
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@ -315,7 +306,7 @@
 | 
				
			|||||||
        <div v-else-if="windowState === 1" class="infosContainer">
 | 
					        <div v-else-if="windowState === 1" class="infosContainer">
 | 
				
			||||||
          <div>
 | 
					          <div>
 | 
				
			||||||
            {{i18n("profile.picture")}}:
 | 
					            {{i18n("profile.picture")}}:
 | 
				
			||||||
            <input type="file" @change="getProfilePic($event.target.files)" accept="image/*">
 | 
					            <input type="file" @change="user.profilPicture = uploadProfilePicture($event.target.files);" accept="image/*">
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <div>
 | 
					          <div>
 | 
				
			||||||
            {{ i18n("login.guest.email")}}
 | 
					            {{ i18n("login.guest.email")}}
 | 
				
			||||||
 | 
				
			|||||||
@ -136,10 +136,8 @@ const emit = defineEmits(["modified"]);
 | 
				
			|||||||
<style scoped>
 | 
					<style scoped>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#researches{
 | 
					#researches{
 | 
				
			||||||
  padding-top: 15px;
 | 
					 | 
				
			||||||
  width: 100%;
 | 
					  width: 100%;
 | 
				
			||||||
  height: 100%;
 | 
					  height: 100%;
 | 
				
			||||||
  overflow: scroll;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#search{
 | 
					#search{
 | 
				
			||||||
  width: 100%;
 | 
					  width: 100%;
 | 
				
			||||||
 | 
				
			|||||||
@ -50,8 +50,8 @@ function getPP(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<template> <div class="body"><div id="main">
 | 
					<template> <div class="body"><div id="main">
 | 
				
			||||||
    <ResearchPostComponent :allResearcher="allResearcher" :researcher="researcher" :isOpen="isPostResearchOpened" @modal-close="isPostResearchOpened = false" @posted="modifiedResearch"></ResearchPostComponent>
 | 
					    <ResearchPostComponent :allResearcher="allResearcher" :researcher="researcher" :isOpen="isPostResearchOpened" @modal-close="isPostResearchOpened = false" @posted="modifiedResearch"></ResearchPostComponent>
 | 
				
			||||||
    <div id="profilePicture" >
 | 
					    <div id="profilePicture">
 | 
				
			||||||
      <img :src=getPP() style="border-radius: 20%"/>
 | 
					      <img :src=getPP() />
 | 
				
			||||||
    </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>
 | 
				
			||||||
@ -82,7 +82,7 @@ function getPP(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div> <ListResearches :allResearcher="allResearcher" :research-list="researchList" :manage="true" @modified="modifiedResearch"></ListResearches> </div>
 | 
					    <ListResearches :allResearcher="allResearcher" :research-list="researchList" :manage="true" @modified="modifiedResearch"></ListResearches>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
				
			|||||||
@ -103,7 +103,7 @@ async function articleClicked(){
 | 
				
			|||||||
        </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">{{i18n("See.Research")}}</a>
 | 
				
			||||||
            <a v-if="article.bibTexLocation !== null" :href=downloadBibTex() @click.stop="emit('modal-close')"  target="_blank">{{i18n("SeeBibTex")}}</a> </div>
 | 
					            <a v-if="article.bibTexLocation !== null" :href=downloadBibTex() @click.stop="emit('modal-close')"  target="_blank">{{i18n("See.BibTex")}}</a> </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div v-if="manage" id="manage">
 | 
					        <div v-if="manage" id="manage">
 | 
				
			||||||
          <div>
 | 
					          <div>
 | 
				
			||||||
 | 
				
			|||||||
@ -78,7 +78,7 @@ function update(){
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div id="main">
 | 
					  <div id="main">
 | 
				
			||||||
    <div id="profilePicture">
 | 
					    <div id="profilePicture">
 | 
				
			||||||
      <img :src=getPP() style="border-radius: 20%"/>
 | 
					      <img :src=getPP() />
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div id="researcherInfos">
 | 
					    <div id="researcherInfos">
 | 
				
			||||||
      <div class="surrounded">{{researcher.user.lastName}} {{researcher.user.firstName}}</div>
 | 
					      <div class="surrounded">{{researcher.user.lastName}} {{researcher.user.firstName}}</div>
 | 
				
			||||||
@ -111,7 +111,7 @@ function update(){
 | 
				
			|||||||
		  <CanvasJSChart :options="options" id=chart @chart-ref="c => chart = c "/>
 | 
							  <CanvasJSChart :options="options" id=chart @chart-ref="c => chart = c "/>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div id="researches" style="margin-top: -15px"><list-researches :researchList="researchList"></list-researches></div>
 | 
					    <div id="researches"><list-researches :researchList="researchList"></list-researches></div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user