mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ACS-5703] Comment List code and styles cleanup (#8787)
* remove useless locale * remove useless id values, update tests * code cleanup * fix formatting * css cleanup * code cleanup * style cleanup * fix css scope * cleanup styles * remove sanitise and don't bind to innerHTML * reduce ng-container * move model specific logic to Comment Model * update tests, remove sanitise tests * drop carma coverage to 72 as code removed * drop selection animation as selection operations are not supported by the component itself * cleanup css * fix tests and lint * update stories and tests * fix line breaks * move e2e to unit test * disable search tests * disable search tests * disable search tests
This commit is contained in:
@@ -24,6 +24,33 @@ export class CommentModel {
|
||||
createdBy: User;
|
||||
isSelected: boolean;
|
||||
|
||||
get hasAvatarPicture(): boolean {
|
||||
return !!(this.createdBy['pictureId'] || this.createdBy['avatarId']);
|
||||
}
|
||||
|
||||
get userDisplayName(): string {
|
||||
let result = '';
|
||||
|
||||
if (this.createdBy) {
|
||||
result = `${this.createdBy.firstName || ''} ${this.createdBy.lastName || ''}`;
|
||||
}
|
||||
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
get userInitials(): string {
|
||||
let result = '';
|
||||
if (this.createdBy) {
|
||||
if (this.createdBy.firstName) {
|
||||
result = this.createdBy.firstName[0];
|
||||
}
|
||||
if (this.createdBy.lastName) {
|
||||
result += this.createdBy.lastName[0];
|
||||
}
|
||||
}
|
||||
return result.toUpperCase();
|
||||
}
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.id = obj.id;
|
||||
|
Reference in New Issue
Block a user