From 4335340739bac0bda0c0b960c64ecd437b06f5f7 Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Wed, 17 Feb 2021 17:52:32 +0100
Subject: [PATCH] FIX #11228 TIME 0:15 Js error after uploaded user picture

---
 .../administration/user/user.component.scss   | 11 ----------
 .../app/profile/profile.component.scss        | 21 -------------------
 src/frontend/app/profile/profile.component.ts |  9 --------
 3 files changed, 41 deletions(-)

diff --git a/src/frontend/app/administration/user/user.component.scss b/src/frontend/app/administration/user/user.component.scss
index 06523365b0..001003544b 100644
--- a/src/frontend/app/administration/user/user.component.scss
+++ b/src/frontend/app/administration/user/user.component.scss
@@ -1,15 +1,4 @@
 
-.avatarProfile {
-  width: 65px;
-  height: 65px;
-  border-radius: 40px;
-  border: solid 3px #F99830;
-  background-size: cover;
-  background-repeat: no-repeat;
-  background-position: center;
-  transition: all 0.2s;
-}
-
 .no-result {
   height: 100%;
   display: flex;
diff --git a/src/frontend/app/profile/profile.component.scss b/src/frontend/app/profile/profile.component.scss
index c7c0ba6070..19d40030da 100644
--- a/src/frontend/app/profile/profile.component.scss
+++ b/src/frontend/app/profile/profile.component.scss
@@ -58,27 +58,6 @@
     position: relative;
 }
 
-.avatarProfile {
-    z-index: 2;
-    cursor: pointer;
-    position: absolute;
-    /*background: url(../../assets/user_sample.svg) $primary;*/
-    width: 65px;
-    height: 65px;
-    border-radius: 40px;
-    bottom: -20px;
-    border: solid 3px #F99830;
-    background-size: cover;
-    background-repeat: no-repeat;
-    background-position: center;
-    transition: all 0.2s;
-}
-
-.avatarProfile:active {
-    box-shadow: 0px 0px 5px 0px #656565;
-}
-
-
 .user {
     color: white;
     color: #F99830;
diff --git a/src/frontend/app/profile/profile.component.ts b/src/frontend/app/profile/profile.component.ts
index 6ad3229d83..384925aead 100644
--- a/src/frontend/app/profile/profile.component.ts
+++ b/src/frontend/app/profile/profile.component.ts
@@ -23,7 +23,6 @@ import { ModalController } from '@ionic/angular';
 export class ProfileComponent implements OnInit {
 
     @ViewChild('passwordContent') passwordContent: MatExpansionPanel;
-    @ViewChild('avatarProfile') avatarProfile: ElementRef;
     currentTool = 'info';
     profileInfo: any = {
         substitute: null,
@@ -129,8 +128,6 @@ export class ProfileComponent implements OnInit {
     }
 
     closeProfile() {
-        // this.renderer.setStyle(this.avatarProfile.nativeElement, 'transform', 'rotate(0deg)');
-        // this.renderer.setStyle(this.avatarProfile.nativeElement, 'content', '');
         setTimeout(() => {
             this.initProfileInfo();
         }, 200);
@@ -241,7 +238,6 @@ export class ProfileComponent implements OnInit {
                 this.msgButton = 'lang.validate';
                 this.setLang(this.preferenceInfo.lang);
                 this.cookieService.set('maarchParapheurLang', this.preferenceInfo.lang);
-                // this.renderer.setStyle(this.avatarProfile.nativeElement, 'transform', 'rotate(0deg)');
             }),
             exhaustMap(() => this.authService.authMode === 'default' ? this.http.put('../rest/users/' + this.authService.user.id, this.profileInfo) :  new Promise(resolve => {resolve(true); })),
             exhaustMap(() => {
@@ -285,10 +281,6 @@ export class ProfileComponent implements OnInit {
         this.http.put('../rest/users/' + this.authService.user.id + '/picture', this.avatarInfo).pipe(
             tap(() => {
                 this.authService.user.picture = this.avatarInfo.picture;
-                this.renderer.setStyle(this.avatarProfile.nativeElement, 'background-size', 'cover');
-                this.renderer.setStyle(this.avatarProfile.nativeElement, 'background-position', 'center');
-                this.renderer.setStyle(this.avatarProfile.nativeElement, 'transform', 'rotate(' + this.avatarInfo.pictureOrientation + 'deg)');
-                this.renderer.setStyle(this.avatarProfile.nativeElement, 'content', '\'' + this.avatarInfo.pictureOrientation + '\'');
                 this.notificationService.success('lang.profileUpdated');
             }),
             finalize(() => {
@@ -334,7 +326,6 @@ export class ProfileComponent implements OnInit {
             this.passwordContent.close();
         }
         const fileToUpload = files.item(0);
-        // this.renderer.setStyle(this.avatarProfile.nativeElement, 'content', '');
 
         if (fileToUpload.size <= 5000000) {
             if (['image/png', 'image/jpg', 'image/jpeg', 'image/gif'].indexOf(fileToUpload.type) !== -1) {
-- 
GitLab