mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-7427] Process Services improvements and cleanup (#9664)
This commit is contained in:
@@ -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>
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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 {}
|
||||
|
@@ -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';
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -34,4 +34,4 @@ export class User {
|
||||
Object.assign(this, user);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user