| @@ -20,7 +20,7 @@ | |||||
| <div class="spt-border col-8"> | <div class="spt-border col-8"> | ||||
| <h2 class="m-0">{{ post.headline }}</h2> | <h2 class="m-0">{{ post.headline }}</h2> | ||||
| <p class="m-0" [innerHTML]="appHelperService.getSafeLongtext(post.message)"></p> | <p class="m-0" [innerHTML]="appHelperService.getSafeLongtext(post.message)"></p> | ||||
| <span *ngIf="post.owner === user?.id" class="position-absolute bi bi-pencil p-2" | |||||
| <span *ngIf="post.owner === currentUser?.id" class="position-absolute bi bi-pencil p-2" | |||||
| data-type="user-tool" | data-type="user-tool" | ||||
| data-action="edit" (click)="openModalEditPost(post)"></span> | data-action="edit" (click)="openModalEditPost(post)"></span> | ||||
| <div class="spt-comments-box d-flex justify-content-end mt-1 position-absolute"> | <div class="spt-comments-box d-flex justify-content-end mt-1 position-absolute"> | ||||
| @@ -47,7 +47,7 @@ | |||||
| <div> | <div> | ||||
| <p [innerHTML]="appHelperService.getSafeLongtext(comment.message)"></p> | <p [innerHTML]="appHelperService.getSafeLongtext(comment.message)"></p> | ||||
| </div> | </div> | ||||
| <span *ngIf="comment.owner === user?.id" class="position-absolute bi bi-pencil p-2" | |||||
| <span *ngIf="comment.owner === currentUser?.id" class="position-absolute bi bi-pencil p-2" | |||||
| data-type="user-tool" data-action="edit" (click)="openModalEditComment(comment)"></span> | data-type="user-tool" data-action="edit" (click)="openModalEditComment(comment)"></span> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -15,6 +15,8 @@ import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap"; | |||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | import {AppHelperService} from "@app/_helpers/app-helper.service"; | ||||
| import {PagingComponent} from "@app/_components/paging/paging.component"; | import {PagingComponent} from "@app/_components/paging/paging.component"; | ||||
| import {NewCommentComponent} from "@app/_views/posts/new-comment/new-comment.component"; | import {NewCommentComponent} from "@app/_views/posts/new-comment/new-comment.component"; | ||||
| import {User} from "@app/_models"; | |||||
| import {AccountService} from "@app/_services"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-post-list', | selector: 'app-post-list', | ||||
| @@ -32,6 +34,7 @@ export class PostListComponent implements OnInit, AfterViewInit { | |||||
| @ViewChild("pagingComponent", { static: false }) pagingComponent!: PagingComponent; | @ViewChild("pagingComponent", { static: false }) pagingComponent!: PagingComponent; | ||||
| protected currentUser: User | null; | |||||
| protected postsSub: Subscription; | protected postsSub: Subscription; | ||||
| protected posts: Array<PostJsonld>; | protected posts: Array<PostJsonld>; | ||||
| protected partnerProductsSub: Subscription; | protected partnerProductsSub: Subscription; | ||||
| @@ -41,6 +44,7 @@ export class PostListComponent implements OnInit, AfterViewInit { | |||||
| constructor( | constructor( | ||||
| private postService: PostService, | private postService: PostService, | ||||
| private accountService: AccountService, | |||||
| protected appHelperService: AppHelperService | protected appHelperService: AppHelperService | ||||
| ) { | ) { | ||||
| this.postsSub = new Subscription(); | this.postsSub = new Subscription(); | ||||
| @@ -49,6 +53,7 @@ export class PostListComponent implements OnInit, AfterViewInit { | |||||
| this.partnerProducts = []; | this.partnerProducts = []; | ||||
| this.dataSource = new MatTableDataSource<PostJsonld>(this.posts); | this.dataSource = new MatTableDataSource<PostJsonld>(this.posts); | ||||
| this.commentsVisibility = new Map<string, boolean>(); | this.commentsVisibility = new Map<string, boolean>(); | ||||
| this.currentUser = this.accountService.userValue; | |||||
| } | } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| @@ -8,6 +8,40 @@ | |||||
| > | > | ||||
| <div class="tasks-box"> | <div class="tasks-box"> | ||||
| <div class="tasks pb-1" *ngFor="let task of tasks"> | <div class="tasks pb-1" *ngFor="let task of tasks"> | ||||
| <div class="card p-3"> | |||||
| <div class="row pb-1"> | |||||
| <div class="col-12"> | |||||
| <div style="display: flex;justify-content: flex-start;align-items: center;"> | |||||
| <span class="importance" [attr.data-importance]="task.prio"></span> | |||||
| <span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span> | |||||
| <h3 class="m-0 ps-3" *ngIf="task.partner"><img src="/assets/images/icons/{{task.partnerType}}.svg" class="icon-mini" alt="" /><a href="/{{task.partnerType}}/{{this.appHelperService.extractId(task.partner)}}">{{task.partnerName}}</a></h3> | |||||
| <h3 class="m-0 ps-3" *ngIf="task.product"><img src="/assets/images/icons/product.svg" class="icon-mini" alt="" /><a href="/product/{{this.appHelperService.extractId(task.product)}}">{{task.productName}}</a></h3> | |||||
| <p class="m-0 ps-3"><img src="/assets/images/icons/profile.svg" class="icon-mini" alt="" />{{ task.assignedToName }}</p> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <div class="row"> | |||||
| <div class="col-4"> | |||||
| <h2 class="m-0">{{ task.headline }}</h2> | |||||
| </div> | |||||
| <div class="col-8"> | |||||
| <p class="m-0 mb-3 mt-2" [innerHTML]="appHelperService.getSafeLongtext(task.description)"></p> | |||||
| <span *ngIf="task.createdBy === currentUser?.id" class="position-absolute bi bi-pencil p-2" | |||||
| data-type="user-tool" data-action="edit" (click)="openModalEditTask(task)"></span> | |||||
| <div class="spt-comments-box d-flex justify-content-end mt-1 position-absolute"> | |||||
| <span *ngIf="task.taskNotes?.length !== 0" role="button" class="spt-btn-low badge bg-secondary p-2 me-2" | |||||
| (click)="showTaskNotes(task)"> | |||||
| <ng-container | |||||
| *ngIf="task.id && taskNotesVisibility.get(task.id)">{{ 'basic.hide-comments' | translate }}</ng-container> | |||||
| <ng-container | |||||
| *ngIf="task.id && !taskNotesVisibility.get(task.id)">{{ 'basic.show-comments' | translate }}</ng-container> | |||||
| </span> | |||||
| <span role="button" class="badge bg-secondary p-2" | |||||
| (click)="openModalNewTaskNote(task)">{{ 'basic.comment-it' | translate }}</span> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <div class="card p-3"> | <div class="card p-3"> | ||||
| <div class="row"> | <div class="row"> | ||||
| <div class="col-4"> | <div class="col-4"> | ||||