AW-1881 Avatar
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
535f6bd064
commit
ece6096064
@ -1 +1,9 @@
|
||||
<ngx-avatar [size]="size" [round]="round" name="getName()" (clickOnAvatar)="onClick()"></ngx-avatar>
|
||||
<span [title]="user.name">
|
||||
<ngx-avatar
|
||||
[size]="size"
|
||||
[round]="round"
|
||||
[name]="getName()"
|
||||
[src]="getAvatar()"
|
||||
(clickOnAvatar)="onClick()">
|
||||
</ngx-avatar>
|
||||
</span>
|
@ -1,5 +1,6 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { IUser } from '../../models/user';
|
||||
import { AppConfig } from '../../shared/app.config';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-avatar',
|
||||
@ -16,11 +17,18 @@ export class AvatarComponent implements OnInit {
|
||||
|
||||
@Output() click = new EventEmitter();
|
||||
|
||||
constructor() { }
|
||||
constructor(private appConfig: AppConfig) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
getAvatar():string {
|
||||
if (!this.user) return null;
|
||||
const apiEndpoint = this.appConfig.getConfig("apiEndPoint");
|
||||
return `${apiEndpoint}/api/v1/users//${this.user.code}/avatar`;
|
||||
}
|
||||
|
||||
getName():string {
|
||||
if (!this.user) return null;
|
||||
if (this.user.firstName && this.user.lastName)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div>
|
||||
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user}">
|
||||
<span *ngIf="user"><span [title]="user.name">{{getLetter()}}</span></span>
|
||||
<span *ngIf="user"><fm-avatar [user]="user"></fm-avatar></span>
|
||||
<div class="menu hidden" [ngClass]="{'hidden':!showMenu}">
|
||||
<div class="card" *ngIf="user">
|
||||
<div class="card-body">
|
||||
|
Loading…
Reference in New Issue
Block a user