mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-10777] Move services from Core in Content the right place (#8242)
Clean core services and directive
This commit is contained in:
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { User } from '../models/general-user.model';
|
||||
import { UserLike } from './user-like.interface';
|
||||
|
||||
@Pipe({ name: 'fullName' })
|
||||
export class FullNamePipe implements PipeTransform {
|
||||
|
||||
transform(user: User): string {
|
||||
transform(user: UserLike): string {
|
||||
return this.buildFullName(user) ? this.buildFullName(user) : this.buildFromUsernameOrEmail(user);
|
||||
}
|
||||
|
||||
buildFullName(user: User): string {
|
||||
buildFullName(user: UserLike): string {
|
||||
const fullName: string[] = [];
|
||||
|
||||
fullName.push(user?.firstName);
|
||||
@@ -34,7 +34,7 @@ export class FullNamePipe implements PipeTransform {
|
||||
return fullName.join(' ').trim();
|
||||
}
|
||||
|
||||
buildFromUsernameOrEmail(user: User): string {
|
||||
buildFromUsernameOrEmail(user: UserLike): string {
|
||||
return (user?.username || user?.email) ?? '' ;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user