Merge pull request 'master' (#187) from Maxime/Clyde:master into master
Reviewed-on: #187
This commit is contained in:
		@ -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{
 | 
			
		||||
 | 
			
		||||
@ -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")}}
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user