mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
add temporary vification on profile picture
This commit is contained in:
@@ -48,15 +48,14 @@
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> -->
|
||||
|
||||
<div *ngIf="profilePicture == ''" class="profile-image">
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image"
|
||||
<!-- <img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image"
|
||||
src='assets/images/presidente.png'>
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image"
|
||||
src='assets/images/ministro.png'>
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
|
||||
src='assets/images/secretaria_geral.png'>
|
||||
src='assets/images/secretaria_geral.png'> -->
|
||||
|
||||
<ion-icon
|
||||
*ngIf="loggeduser.RoleDescription != 'Presidente da República'&& loggeduser.RoleDescription != 'Ministro e Director do Gabinete do PR' && loggeduser.RoleDescription != 'Secretário Geral' "
|
||||
class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
|
||||
</div>
|
||||
|
||||
@@ -212,15 +211,14 @@
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> -->
|
||||
|
||||
<div *ngIf="profilePicture == ''" class="profile-image">
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image"
|
||||
<!-- <img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image"
|
||||
src='assets/images/presidente.png'>
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image"
|
||||
src='assets/images/ministro.png'>
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
|
||||
src='assets/images/secretaria_geral.png'>
|
||||
src='assets/images/secretaria_geral.png'> -->
|
||||
|
||||
<ion-icon
|
||||
*ngIf="loggeduser.RoleDescription != 'Presidente da República'&& loggeduser.RoleDescription != 'Ministro e Director do Gabinete do PR' && loggeduser.RoleDescription != 'Secretário Geral' "
|
||||
class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -102,26 +102,29 @@ export class HeaderPage implements OnInit {
|
||||
|
||||
getProfilpicture() {
|
||||
|
||||
this.attachmentService.getUserProfilePhoto(this.SessionStore.user.UserPhoto).subscribe((base) => {
|
||||
if(this.SessionStore.user.UserPhoto) {
|
||||
this.attachmentService.getUserProfilePhoto(this.SessionStore.user.UserPhoto).subscribe((base) => {
|
||||
|
||||
this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,' + base).then((value) => {
|
||||
this.profilePicture = 'data:image/jpeg;base64,' + base;
|
||||
|
||||
console.log('picture saved', value)
|
||||
}).catch((error) => {
|
||||
console.log('picture not saved')
|
||||
});
|
||||
}, (error) => {
|
||||
console.log('profile picture errro: ', error)
|
||||
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
|
||||
console.log(picture)
|
||||
this.profilePicture = picture
|
||||
}).catch((error) => {
|
||||
this.profilePicture = "";
|
||||
this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,' + base).then((value) => {
|
||||
this.profilePicture = 'data:image/jpeg;base64,' + base;
|
||||
|
||||
console.log('picture saved', value)
|
||||
}).catch((error) => {
|
||||
console.log('picture not saved')
|
||||
});
|
||||
}, (error) => {
|
||||
console.log('profile picture errro: ', error)
|
||||
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
|
||||
console.log(picture)
|
||||
this.profilePicture = picture
|
||||
}).catch((error) => {
|
||||
this.profilePicture = "";
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
} else {
|
||||
this.profilePicture = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user