Compare commits
	
		
			13 Commits
		
	
	
		
			tonitch/fi
			...
			1f66ac5a4d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1f66ac5a4d | |||
| 59b82abf71 | |||
| cf0c465248 | |||
| 2917d645fa | |||
| 730a72dba3 | |||
| 47eb98da57 | |||
| eafcf6b265 | |||
| 34e537ff02 | |||
| 364f39c4bc | |||
| f2675ed764 | |||
| 85c1282f48 | |||
| 4d6387ca8b | |||
| fa2deca1b9 | 
| @ -42,6 +42,7 @@ public class MockController { | ||||
|     public final LessonRequestService lessonRequestService; | ||||
|     ArrayList<User> mockUsers; | ||||
|  | ||||
|     public static boolean isMocked = false; | ||||
|     public final ResearchesService researchesService; | ||||
|     public final UserCurriculumRepository ucr; | ||||
|     public final MinervalRepository minervalRepository; | ||||
| @ -78,7 +79,7 @@ public class MockController { | ||||
|     @PostMapping("/mock") | ||||
|     public void postMock() { | ||||
|  | ||||
|  | ||||
|         if(!isMocked){ | ||||
|         // user part | ||||
|         User herobrine = new User("brine","hero","admin@admin.com","behind","ShadowsLand",new Date(0), null,Role.Admin,"admin"); | ||||
|         User joe = new User("Piplo","Joe","student@student.com","roundabout","England",new Date(0), null,Role.Student,"student"); | ||||
| @ -230,6 +231,9 @@ public class MockController { | ||||
|  | ||||
|         externalCurriculum = new ExternalCurriculum(inscriptionRequest, "HEH", "Bachelier en informatique", "Completed", 2015, 2018, null, null); | ||||
|         externalCurriculumRepository.save(externalCurriculum); | ||||
|  | ||||
|         isMocked = true; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -15,33 +15,33 @@ import java.util.Map; | ||||
|  | ||||
| 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 group by to_char(r.releaseDate, 'month')") | ||||
|     Iterable<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> viewsByYears(); | ||||
|     Iterable<Map<String ,Integer>> viewsByYears(long researcherId); | ||||
|  | ||||
|  | ||||
|     @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(); | ||||
|     @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<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> researchesByYears(long researcherId); | ||||
|  | ||||
|     @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(); | ||||
|     @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<Map<String ,Integer>> 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<Map<String ,Integer>> 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<Map<String ,Integer>> researchesByMonth(long researcherId); | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -34,17 +34,17 @@ public class StatisticsService { | ||||
|  | ||||
|         ArrayList<Iterable<Map<String,Integer>>> 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; | ||||
|     } | ||||
| } | ||||
| @ -2,8 +2,6 @@ package ovh.herisson.Clyde.Tables.Inscription; | ||||
|  | ||||
|  | ||||
| import jakarta.persistence.*; | ||||
| import org.hibernate.annotations.OnDelete; | ||||
| import org.hibernate.annotations.OnDeleteAction; | ||||
| import ovh.herisson.Clyde.Tables.Course; | ||||
| import ovh.herisson.Clyde.Tables.RequestState; | ||||
| import ovh.herisson.Clyde.Tables.User; | ||||
|  | ||||
| @ -7,7 +7,6 @@ import ovh.herisson.Clyde.Tables.RequestState; | ||||
| import ovh.herisson.Clyde.Tables.User; | ||||
|  | ||||
| import java.util.Date; | ||||
| import java.util.Map; | ||||
|  | ||||
| @Entity | ||||
| public class ScholarshipRequest { | ||||
|  | ||||
| @ -3,7 +3,6 @@ package ovh.herisson.Clyde.Tables.Inscription; | ||||
| import jakarta.persistence.*; | ||||
| import ovh.herisson.Clyde.Tables.Curriculum; | ||||
| import ovh.herisson.Clyde.Tables.RequestState; | ||||
| import ovh.herisson.Clyde.Tables.User; | ||||
|  | ||||
| import java.util.Date; | ||||
|  | ||||
|  | ||||
| @ -50,6 +50,7 @@ Delete=Delete | ||||
| Modify=Modify | ||||
| Create=Créer | ||||
| requestType=Request Type | ||||
| lessonType=Course Type | ||||
| day=Day | ||||
| start=Start | ||||
| end=End | ||||
|  | ||||
| @ -50,6 +50,7 @@ Delete=Supprimer | ||||
| Modify=Modifier | ||||
| Create=Créer | ||||
| requestType=Type de Requête | ||||
| lessonType=Type de cours | ||||
| day=Jour | ||||
| start=Début | ||||
| end=Fin | ||||
| @ -287,4 +288,4 @@ cursusprereq=Le cursus que vous avez selectionné a des prérequis assurez vous | ||||
| imposecurriculum=Imposer un cursusgotimposed | ||||
| impose=Imposer | ||||
| gotimposed=Le cursus selectionné a été imposé | ||||
| DifferentLanguage=Langues différentes | ||||
| DifferentLanguage=Langues différentes | ||||
|  | ||||
| @ -1,14 +1,13 @@ | ||||
| <script setup> | ||||
|   import { toast } from 'vue3-toastify'; | ||||
|   import { ref } from 'vue' | ||||
|   import i18n, { setLang } from './i18n.js' | ||||
|   import { isLogged, getSelf } from '@/rest/Users.js' | ||||
| 	import { notifications, fetchNotifications, archiveNotification } from '@/rest/notifications.js' | ||||
|  | ||||
|   import {postMock} from "@/rest/restConsumer.js"; | ||||
|   import { appList, currentView } from '@/rest/apps.js' | ||||
| 		var prevURL; | ||||
| 		var currentURL = window.location.hash; | ||||
|  | ||||
| postMock() | ||||
| window.onhashchange = function() { | ||||
|     prevURL = currentURL; | ||||
|     currentURL = window.location.hash; | ||||
| @ -42,7 +41,7 @@ window.addEventListener('hashchange', () => { | ||||
|     <div class="topBar"> | ||||
|       <ul class="horizontal"> | ||||
|         <li title=home> | ||||
|             <a class="icon" href="#home"> | ||||
|             <a  class="icon" href="#home"> | ||||
|                 <img class="clyde" src="/Clyde.png" style="width: 40px; height: auto; margin-top:4px"> | ||||
|             </a></li> | ||||
|         <li title=home> | ||||
|  | ||||
| @ -32,6 +32,7 @@ async function createResearcher(){ | ||||
|   toCreate.user = user.value | ||||
|   await postResearcher(toCreate) | ||||
|   creating.value = false | ||||
|   allResearcher.value = await fetchAllResearchers() | ||||
|   for (let i = 0; i < allResearcher.value.length; i++) { | ||||
|     if (user.value.regNo === allResearcher.value[i].user.regNo){ | ||||
|       researcher.value = allResearcher.value[i] | ||||
| @ -147,8 +148,7 @@ async function modify(){ | ||||
|   column-gap:2.7%; | ||||
|   row-gap:45px; | ||||
|   grid-template-areas: | ||||
|   "profilPic globalInfos" | ||||
|   "minfos minfos"; | ||||
|   "profilPic globalInfos"; | ||||
| } | ||||
|  | ||||
| .profilPic{ | ||||
| @ -167,7 +167,8 @@ async function modify(){ | ||||
|   display:flex; | ||||
|   align-items:center; | ||||
|   justify-content:center; | ||||
|   margin-top:5%; | ||||
|   margin-right: auto; | ||||
|   margin-left: auto; | ||||
| } | ||||
|  | ||||
| .subContainer{ | ||||
|  | ||||
| @ -18,7 +18,7 @@ const AcceptMod = ref(false); | ||||
| const moreInfosMod = ref(false); | ||||
| const requestTypes = ["Create", "Modify", "Delete"] | ||||
| const editElementID = ref(''); | ||||
| const chosenLocal = ref(""); | ||||
| const chosenLocal = ref(); | ||||
| const locals = ["A0B1","A1B1","A2B1","A0B2"]; | ||||
| const moreInfos = ref({}); | ||||
|  | ||||
| @ -30,6 +30,7 @@ const moreInfos = ref({}); | ||||
| async function upPage(id,review){ | ||||
|   await changeRequestState(id, review) ; | ||||
|   requests.value = await getAllRequests(); | ||||
|   chosenLocal.value = null; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  | ||||
| @ -168,11 +168,9 @@ | ||||
|     </div> | ||||
|  | ||||
|     <div v-if="!createMod && !deleteMod" v-for="item in curriculum" :key="item.title" style="width:50%;margin-left:auto; margin-right:auto;"> | ||||
|       <div  v-if="editElementID !== item.title && editAddCourse !== item.title" style ="padding:15px 15px 15px 15px;"> | ||||
|         <button   @click="editElementID = item.title; editAddCourse = ''; setModify(item); "> | ||||
|         {{i18n("courses.modify")}} | ||||
|         </button> | ||||
|         <button v-if="self.role !== 'Teacher'"@click="editAddCourse = item.title; editElementID ='';setAddToCurriculum(item)">Add to a new Curriculum</button> | ||||
|       <div  v-if="editElementID !== item.title && editAddCourse !== item.title" style="display:flex;"> | ||||
|         <button   @click="editElementID = item.title; editAddCourse = ''; setModify(item);">{{i18n("courses.modify")}}</button> | ||||
|         <button v-if="self.role !== 'Teacher'"@click="editAddCourse = item.title; editElementID ='';setAddToCurriculum(item)">{{i18n("courses.AddToCurriculum")}}</button> | ||||
|       </div> | ||||
|       <div v-if="editElementID == item.title"> | ||||
|         <button @click="editElementID= '';patchCourse(item)"> {{i18n("courses.confirm")}} </button> | ||||
|  | ||||
| @ -221,6 +221,8 @@ async function setCourses(){ | ||||
|     lessonBuffer.value = Object.assign({}, pattern); | ||||
|     lessonFinder.value = null; | ||||
|     lessonCreatorBuffer.value = Object.assign({},lessonCreator) | ||||
|     allSchedules.value = await getAllSchedule(); | ||||
|     schedule.value = null;  | ||||
|     trueSchedule.value = null; | ||||
|  | ||||
|   } | ||||
|  | ||||
| @ -93,12 +93,14 @@ | ||||
|    | ||||
|   async function ChangeInfos(){ | ||||
|     for (let element in toModify){ | ||||
|       console.log(element) | ||||
|       console.log(toModify[element]) | ||||
|          if (element ==="email" && (toModify[element] !== null)){ | ||||
|           await  alterSelf(user.value.regNo,{email : toModify[element]}); | ||||
|         }       | ||||
|  | ||||
|         if (element ==="profilPictureUrl" && (toModify[element] !== null)){ | ||||
|           await  alterSelf(user.value.regNo,{ profilPictureUrl : toModify[element]}); | ||||
|         if (element ==="profilePictureUrl" && (toModify[element] !== null)){ | ||||
|           await  alterSelf(user.value.regNo,{ profilePictureUrl : toModify[element]}); | ||||
|         } | ||||
|         else if(element === "address" && (toModify[element] !== null)){ | ||||
|           await  alterSelf(user.value.regNo,{address : toModify[element]}); | ||||
| @ -116,7 +118,7 @@ | ||||
|      toModify.address = item.address; | ||||
|      toModify.profilPictureUrl = item.profilPictureUrl; | ||||
|      toModify.email= item.email; | ||||
|      toModify.password= item.password; | ||||
|      toModify.password= item.password | ||||
|   } | ||||
|  | ||||
|   function getPP(){ | ||||
| @ -176,6 +178,13 @@ | ||||
|     } | ||||
|   } | ||||
|  | ||||
|  | ||||
|   async function getProfilePic(data){ | ||||
|     const pp= await uploadProfilePicture(data) | ||||
|     toModify.profilePictureUrl = pp.url | ||||
|   } | ||||
|  | ||||
|  | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
| @ -306,7 +315,7 @@ | ||||
|         <div v-else-if="windowState === 1" class="infosContainer"> | ||||
|           <div> | ||||
|             {{i18n("profile.picture")}}: | ||||
|             <input type="file" @change="user.profilPicture = uploadProfilePicture($event.target.files);" accept="image/*"> | ||||
|             <input type="file" @change="getProfilePic($event.target.files)" accept="image/*"> | ||||
|           </div> | ||||
|           <div> | ||||
|             {{ i18n("login.guest.email")}} | ||||
|  | ||||
| @ -136,8 +136,10 @@ const emit = defineEmits(["modified"]); | ||||
| <style scoped> | ||||
|  | ||||
| #researches{ | ||||
|   padding-top: 15px; | ||||
|   width: 100%; | ||||
|   height: 100%; | ||||
|   overflow: scroll; | ||||
| } | ||||
| #search{ | ||||
|   width: 100%; | ||||
| @ -222,4 +224,4 @@ a{ | ||||
| #toggledResearchButton:hover{ | ||||
|   background: #ff2d55; | ||||
| } | ||||
| </style> | ||||
| </style> | ||||
| @ -50,8 +50,8 @@ function getPP(){ | ||||
|  | ||||
| <template> <div class="body"><div id="main"> | ||||
|     <ResearchPostComponent :allResearcher="allResearcher" :researcher="researcher" :isOpen="isPostResearchOpened" @modal-close="isPostResearchOpened = false" @posted="modifiedResearch"></ResearchPostComponent> | ||||
|     <div id="profilePicture"> | ||||
|       <img :src=getPP() /> | ||||
|     <div id="profilePicture" > | ||||
|       <img :src=getPP() style="border-radius: 20%"/> | ||||
|     </div> | ||||
|     <div id="researcherInfos"> | ||||
|       <div class="surrounded" v-if="!changing">{{researcher.user.lastName}} {{researcher.user.firstName}}</div> | ||||
| @ -82,7 +82,7 @@ function getPP(){ | ||||
|  | ||||
|  | ||||
|     </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> | ||||
| </template> | ||||
| @ -181,4 +181,4 @@ a{ | ||||
|   text-decoration: underline; | ||||
|   cursor: pointer; | ||||
| } | ||||
| </style> | ||||
| </style> | ||||
| @ -103,7 +103,7 @@ async function articleClicked(){ | ||||
|         </ul> | ||||
|           <div id="downloads" v-if="article.pdfLocation !== null && !manage"> | ||||
|             <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("See.BibTex")}}</a> </div> | ||||
|             <a v-if="article.bibTexLocation !== null" :href=downloadBibTex() @click.stop="emit('modal-close')"  target="_blank">{{i18n("SeeBibTex")}}</a> </div> | ||||
|         </div> | ||||
|         <div v-if="manage" id="manage"> | ||||
|           <div> | ||||
|  | ||||
| @ -78,7 +78,7 @@ function update(){ | ||||
| <template> | ||||
|   <div id="main"> | ||||
|     <div id="profilePicture"> | ||||
|       <img :src=getPP() /> | ||||
|       <img :src=getPP() style="border-radius: 20%"/> | ||||
|     </div> | ||||
|     <div id="researcherInfos"> | ||||
|       <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 "/> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div id="researches"><list-researches :researchList="researchList"></list-researches></div> | ||||
|     <div id="researches" style="margin-top: -15px"><list-researches :researchList="researchList"></list-researches></div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
|  | ||||
| @ -27,6 +27,9 @@ export function restPatch(endPoint, data) { | ||||
| 	return _rest(endPoint, {method: "PATCH", credentials: 'include', body: JSON.stringify(data)}); | ||||
| } | ||||
|  | ||||
| export function postMock(){ | ||||
| 	return restPost("/mock") | ||||
| } | ||||
| /** | ||||
|  * backbone for the request made by the frontend | ||||
|  * | ||||
|  | ||||
		Reference in New Issue
	
	Block a user