Compare commits

...

7 Commits

Author SHA1 Message Date
96965bde97 Merge pull request 'master' (#187) from Maxime/Clyde:master into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m24s
deploy to production / deploy-backend (push) Failing after 43s
Build and test FrontEnd / Build-frontend (push) Successful in 31s
Reviewed-on: #187
2024-04-22 22:13:49 +02:00
302e0b555c Merge remote-tracking branch 'origin/master'
All checks were successful
Build and test backend / Build-backend (pull_request) Successful in 1m23s
Build and test FrontEnd / Build-frontend (pull_request) Successful in 32s
2024-04-22 22:12:57 +02:00
1f66ac5a4d Merge remote-tracking branch 'origin/master' 2024-04-22 18:26:31 +02:00
730a72dba3 added profile picture handling 2024-04-22 13:19:08 +02:00
34e537ff02 fixed push of researcher 2024-04-22 12:19:21 +02:00
364f39c4bc put the about user in the middle 2024-04-22 11:58:42 +02:00
f2675ed764 Merge remote-tracking branch 'origin/master' 2024-04-22 11:42:48 +02:00
4 changed files with 20 additions and 10 deletions

View File

@ -32,6 +32,7 @@ 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]
@ -147,8 +148,7 @@ 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,7 +167,8 @@ async function modify(){
display:flex; display:flex;
align-items:center; align-items:center;
justify-content:center; justify-content:center;
margin-top:5%; margin-right: auto;
margin-left: auto;
} }
.subContainer{ .subContainer{

View File

@ -93,12 +93,14 @@
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 ==="profilPictureUrl" && (toModify[element] !== null)){ if (element ==="profilePictureUrl" && (toModify[element] !== null)){
await alterSelf(user.value.regNo,{ profilPictureUrl : toModify[element]}); await alterSelf(user.value.regNo,{ profilePictureUrl : 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]});
@ -116,7 +118,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(){
@ -176,6 +178,13 @@
} }
} }
async function getProfilePic(data){
const pp= await uploadProfilePicture(data)
toModify.profilePictureUrl = pp.url
}
</script> </script>
<template> <template>
@ -306,7 +315,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="user.profilPicture = uploadProfilePicture($event.target.files);" accept="image/*"> <input type="file" @change="getProfilePic($event.target.files)" accept="image/*">
</div> </div>
<div> <div>
{{ i18n("login.guest.email")}} {{ i18n("login.guest.email")}}

View File

@ -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() /> <img :src=getPP() style="border-radius: 20%"/>
</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>

View File

@ -78,7 +78,7 @@ function update(){
<template> <template>
<div id="main"> <div id="main">
<div id="profilePicture"> <div id="profilePicture">
<img :src=getPP() /> <img :src=getPP() style="border-radius: 20%"/>
</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>