[ACS-7427] Process Services improvements and cleanup (#9664)

This commit is contained in:
Denys Vuika
2024-05-20 16:08:47 -04:00
committed by GitHub
parent 96e607b4de
commit e71e2a749a
174 changed files with 1736 additions and 3933 deletions

View File

@@ -6,7 +6,7 @@
<div *ngIf="!comment.hasAvatarPicture" class="adf-comment-user-icon">{{ comment.userInitials }}</div>
<img *ngIf="comment.hasAvatarPicture" class="adf-people-img"
[alt]="'COMMENTS.PROFILE_IMAGE' | translate"
[src]="getUserImage(comment.createdBy)" />
[src]="getUserImage(comment.createdBy.id.toString())" />
</div>
<div class="adf-comment-contents">
<div matLine class="adf-comment-user-name">{{ comment.userDisplayName }}</div>

View File

@@ -17,7 +17,6 @@
import { Component, EventEmitter, Input, Output, ViewEncapsulation, inject } from '@angular/core';
import { CommentModel } from '../../models/comment.model';
import { User } from '../../models/general-user.model';
import { CommentsService } from '../interfaces/comments-service.interface';
import { ADF_COMMENTS_SERVICE } from '../interfaces/comments.token';
@@ -28,7 +27,6 @@ import { ADF_COMMENTS_SERVICE } from '../interfaces/comments.token';
encapsulation: ViewEncapsulation.None
})
export class CommentListComponent {
/** The comments data used to populate the list. */
@Input()
comments: CommentModel[];
@@ -43,7 +41,7 @@ export class CommentListComponent {
this.clickRow.emit(comment);
}
getUserImage(user: User): string {
return this.commentsService.getUserImage(user);
getUserImage(userId: string): string {
return this.commentsService.getUserImage(userId);
}
}

View File

@@ -27,6 +27,7 @@ import { FormsModule } from '@angular/forms';
import { PipeModule } from '../../pipes/pipe.module';
import { CommentListComponent } from './comment-list.component';
import { TimeAgoPipe } from '../../pipes';
@NgModule({
imports: [
@@ -38,14 +39,10 @@ import { CommentListComponent } from './comment-list.component';
MatFormFieldModule,
MatInputModule,
MatListModule,
MatLineModule
MatLineModule,
TimeAgoPipe
],
declarations: [
CommentListComponent
],
exports: [
CommentListComponent
]
declarations: [CommentListComponent],
exports: [CommentListComponent]
})
export class CommentListModule {
}
export class CommentListModule {}

View File

@@ -18,7 +18,7 @@
import { CommentsService } from '../../interfaces/comments-service.interface';
export class CommentListServiceMock implements Partial<CommentsService> {
getUserImage(_user: any): string {
getUserImage(_userId: string): string {
return 'mock-user-image-path';
}
}

View File

@@ -21,5 +21,5 @@ import { CommentModel } from '../../models/comment.model';
export interface CommentsService {
get(id: string): Observable<CommentModel[]>;
add(id: string, message: string): Observable<CommentModel>;
getUserImage(user: any): string;
getUserImage(userId: string): string;
}

View File

@@ -51,12 +51,12 @@ export class CommentModel {
return result.toUpperCase();
}
constructor(obj?: Partial<CommentModel>) {
constructor(obj?: any) {
if (obj) {
this.id = obj.id;
this.message = obj.message;
this.created = obj.created;
this.createdBy = obj.createdBy;
this.createdBy = new User(obj.createdBy);
this.isSelected = obj.isSelected ? obj.isSelected : false;
}
}

View File

@@ -34,4 +34,4 @@ export class User {
Object.assign(this, user);
}
}
};
}