[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:
Denys Vuika
2023-07-31 19:23:46 +01:00
committed by GitHub
parent 312562889c
commit 3f3e83057d
21 changed files with 237 additions and 401 deletions

View File

@@ -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;