| @@ -39,7 +39,7 @@ | |||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| <h3>{{ post.headline }}</h3> | <h3>{{ post.headline }}</h3> | ||||
| <p>{{ post.message }}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(post.message)"></p> | |||||
| </div> | </div> | ||||
| <span *ngIf="post.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" | <span *ngIf="post.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" | ||||
| data-action="edit" (click)="openModalEditPosting(post)"></span> | data-action="edit" (click)="openModalEditPosting(post)"></span> | ||||
| @@ -53,7 +53,7 @@ | |||||
| <p>{{ comment.ownerName }}</p> | <p>{{ comment.ownerName }}</p> | ||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| <p>{{ comment.message }}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(comment.message)"></p> | |||||
| </div> | </div> | ||||
| <span *ngIf="comment.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" | <span *ngIf="comment.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" | ||||
| data-action="edit" (click)="openModalEditComment(comment)"></span> | data-action="edit" (click)="openModalEditComment(comment)"></span> | ||||
| @@ -46,7 +46,8 @@ export class ContactsDetailComponent implements OnInit, AfterViewInit { | |||||
| private accountService: AccountService, | private accountService: AccountService, | ||||
| private route: ActivatedRoute, | private route: ActivatedRoute, | ||||
| private postService: PostService, | private postService: PostService, | ||||
| private modalService: NgbModal | |||||
| private modalService: NgbModal, | |||||
| protected apiConverter: ApiConverter | |||||
| ) { | ) { | ||||
| this.user = this.accountService.userValue; | this.user = this.accountService.userValue; | ||||
| @@ -12,6 +12,7 @@ import {NewDocumentComponent} from "@app/documents/new-document/new-document.com | |||||
| import {TranslateModule} from "@ngx-translate/core"; | import {TranslateModule} from "@ngx-translate/core"; | ||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| import {NewCommentComponent} from "@app/postings/new-comment/new-comment.component"; | import {NewCommentComponent} from "@app/postings/new-comment/new-comment.component"; | ||||
| import {ApiConverter} from "@app/_helpers/api.converter"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-documents', | selector: 'app-documents', | ||||
| @@ -41,7 +42,8 @@ export class DocumentsComponent { | |||||
| constructor( | constructor( | ||||
| private router: Router, | private router: Router, | ||||
| private modalService: NgbModal, | private modalService: NgbModal, | ||||
| private documentService: DocumentService | |||||
| private documentService: DocumentService, | |||||
| protected apiConverter: ApiConverter | |||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.displayedColumns = ['pos', 'name', 'description', 'partnerName', 'productName', 'createdAt', 'createdByName', 'download', 'edit']; | this.displayedColumns = ['pos', 'name', 'description', 'partnerName', 'productName', 'createdAt', 'createdByName', 'download', 'edit']; | ||||
| @@ -9,7 +9,7 @@ | |||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="description" class="form-label">{{ 'form.description' | translate }}:</label> | <label for="description" class="form-label">{{ 'form.description' | translate }}:</label> | ||||
| <input type="text" class="form-control" id="description" formControlName="description"/> | |||||
| <textarea class="form-control" id="description" formControlName="description" cols="50" rows="5"></textarea> | |||||
| </div> | </div> | ||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| @@ -80,7 +80,7 @@ | |||||
| </div> | </div> | ||||
| <div class="collapse" id="collapse-{{ApiConverter.extractId(task.id)}}"> | <div class="collapse" id="collapse-{{ApiConverter.extractId(task.id)}}"> | ||||
| <div class="pt-3 pe-5 position-relative"> | <div class="pt-3 pe-5 position-relative"> | ||||
| <p class="m-0">{{task.description}}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(task.description)"></p> | |||||
| <p>Zugewiesen an: {{task.assignedToName}}</p> | <p>Zugewiesen an: {{task.assignedToName}}</p> | ||||
| <span *ngIf="task.createdBy === user?.id" class="position-absolute bi bi-pencil p-2" | <span *ngIf="task.createdBy === user?.id" class="position-absolute bi bi-pencil p-2" | ||||
| data-type="user-tool" data-action="edit" (click)="openModalEditTask(task)"></span> | data-type="user-tool" data-action="edit" (click)="openModalEditTask(task)"></span> | ||||
| @@ -57,7 +57,8 @@ export class HomeComponent implements OnInit, AfterViewInit { | |||||
| private accountService: AccountService, | private accountService: AccountService, | ||||
| private postService: PostService, | private postService: PostService, | ||||
| private userService: UserService, | private userService: UserService, | ||||
| private taskService: TaskService | |||||
| private taskService: TaskService, | |||||
| protected apiConverter: ApiConverter | |||||
| ) { | ) { | ||||
| this.user = this.accountService.userValue; | this.user = this.accountService.userValue; | ||||
| // this.accountService.user.subscribe(x => this.user = x); | // this.accountService.user.subscribe(x => this.user = x); | ||||
| @@ -108,7 +108,7 @@ | |||||
| </div> | </div> | ||||
| <div class="collapse" id="collapse-{{ApiConverter.extractId(task.id)}}"> | <div class="collapse" id="collapse-{{ApiConverter.extractId(task.id)}}"> | ||||
| <div class="pt-3 pe-5 position-relative"> | <div class="pt-3 pe-5 position-relative"> | ||||
| <p class="m-0">{{ task.description }}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(task.description)"></p> | |||||
| <p>Zugewiesen an: {{ task.assignedToName }}</p> | <p>Zugewiesen an: {{ task.assignedToName }}</p> | ||||
| <span *ngIf="task.createdBy === user?.id" class="position-absolute bi bi-pencil p-2" | <span *ngIf="task.createdBy === user?.id" class="position-absolute bi bi-pencil p-2" | ||||
| data-type="user-tool" data-action="edit" (click)="openModalEditTask(task)"></span> | data-type="user-tool" data-action="edit" (click)="openModalEditTask(task)"></span> | ||||
| @@ -168,7 +168,7 @@ | |||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| <h3>{{ post.headline }}</h3> | <h3>{{ post.headline }}</h3> | ||||
| <p>{{ post.message }}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(post.message)"></p> | |||||
| </div> | </div> | ||||
| <span *ngIf="post.owner === user?.id" class="position-absolute bi bi-pencil p-2" | <span *ngIf="post.owner === user?.id" class="position-absolute bi bi-pencil p-2" | ||||
| data-type="user-tool" | data-type="user-tool" | ||||
| @@ -183,7 +183,7 @@ | |||||
| <p>{{ comment.ownerName }}</p> | <p>{{ comment.ownerName }}</p> | ||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| <p>{{ comment.message }}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(comment.message)"></p> | |||||
| </div> | </div> | ||||
| <span *ngIf="comment.owner === user?.id" class="position-absolute bi bi-pencil p-2" | <span *ngIf="comment.owner === user?.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> | ||||
| @@ -4,7 +4,7 @@ | |||||
| <form [formGroup]="commentForm" (ngSubmit)="onSubmit()"> | <form [formGroup]="commentForm" (ngSubmit)="onSubmit()"> | ||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="message" class="form-label">{{'form.comment' | translate}}:</label> | <label for="message" class="form-label">{{'form.comment' | translate}}:</label> | ||||
| <input type="text" class="form-control" id="message" formControlName="message" /> | |||||
| <textarea class="form-control" id="message" formControlName="message" cols="50" rows="5"></textarea> | |||||
| <div class="form-text" *ngIf="commentForm.get('message')?.invalid && commentForm.get('message')?.touched"> | <div class="form-text" *ngIf="commentForm.get('message')?.invalid && commentForm.get('message')?.touched"> | ||||
| {{'form.comment' | translate}} {{'form.mandatory' | translate}}. | {{'form.comment' | translate}} {{'form.mandatory' | translate}}. | ||||
| </div> | </div> | ||||
| @@ -12,7 +12,7 @@ | |||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="message" class="form-label">{{'form.message' | translate}}:</label> | <label for="message" class="form-label">{{'form.message' | translate}}:</label> | ||||
| <input type="text" class="form-control" id="message" formControlName="message" /> | |||||
| <textarea class="form-control" id="message" formControlName="message" cols="50" rows="5"></textarea> | |||||
| <div class="form-text" *ngIf="postForm.get('message')?.invalid && postForm.get('message')?.touched"> | <div class="form-text" *ngIf="postForm.get('message')?.invalid && postForm.get('message')?.touched"> | ||||
| {{'form.message' | translate}} {{'form.mandatory' | translate}}. | {{'form.message' | translate}} {{'form.mandatory' | translate}}. | ||||
| </div> | </div> | ||||
| @@ -33,7 +33,7 @@ | |||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="comment" class="form-label">{{ 'form.comment' | translate }}:</label> | <label for="comment" class="form-label">{{ 'form.comment' | translate }}:</label> | ||||
| <input type="text" class="form-control" id="comment" formControlName="comment" /> | |||||
| <textarea class="form-control" id="comment" formControlName="comment" cols="50" rows="5"></textarea> | |||||
| </div> | </div> | ||||
| <!-- <div class="mb-3">--> | <!-- <div class="mb-3">--> | ||||
| @@ -13,11 +13,11 @@ | |||||
| <dt *ngIf="sale.profit">{{'overview.profit' | translate}}:</dt> | <dt *ngIf="sale.profit">{{'overview.profit' | translate}}:</dt> | ||||
| <dd *ngIf="sale.profit">{{ sale.profit }}</dd> | <dd *ngIf="sale.profit">{{ sale.profit }}</dd> | ||||
| <dt *ngIf="sale.comment">{{'overview.comment' | translate}}:</dt> | <dt *ngIf="sale.comment">{{'overview.comment' | translate}}:</dt> | ||||
| <dd *ngIf="sale.comment">{{ sale.comment }}</dd> | |||||
| <dd *ngIf="sale.comment" [innerHTML]="apiConverter.getSafeLongtext(sale.comment)"></dd> | |||||
| </dl> | </dl> | ||||
| </div> | </div> | ||||
| <div class="col-4"></div> | <div class="col-4"></div> | ||||
| <span class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit" | |||||
| <span *ngIf="sale.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" data-action="edit" | |||||
| (click)="openModalEditSale()"></span> | (click)="openModalEditSale()"></span> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -33,12 +33,12 @@ | |||||
| <div class="card"> | <div class="card"> | ||||
| <div class="card-body"> | <div class="card-body"> | ||||
| <div class="d-flex justify-content-between align-items-center"> | <div class="d-flex justify-content-between align-items-center"> | ||||
| <p>{{ post.createdAt | date:'dd.MM.YYYY HH:mm' }}</p> | |||||
| <p>{{ post.createdAt | date:'dd.MM.YYYY' }}</p> | |||||
| <p>{{ post.ownerName }}</p> | <p>{{ post.ownerName }}</p> | ||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| <h3>{{ post.headline }}</h3> | <h3>{{ post.headline }}</h3> | ||||
| <p>{{ post.message }}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(post.message)"></p> | |||||
| </div> | </div> | ||||
| <span *ngIf="post.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" | <span *ngIf="post.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" | ||||
| data-action="edit" (click)="openModalEditPosting(post)"></span> | data-action="edit" (click)="openModalEditPosting(post)"></span> | ||||
| @@ -48,11 +48,11 @@ | |||||
| <div class="card ms-5" *ngFor="let comment of post.comments"> | <div class="card ms-5" *ngFor="let comment of post.comments"> | ||||
| <div class="card-body"> | <div class="card-body"> | ||||
| <div class="d-flex justify-content-between align-items-center"> | <div class="d-flex justify-content-between align-items-center"> | ||||
| <p>{{ comment.createdAt | date:'dd.MM.YYYY HH:mm' }}</p> | |||||
| <p>{{ comment.createdAt | date:'dd.MM.YYYY' }}</p> | |||||
| <p>{{ comment.ownerName }}</p> | <p>{{ comment.ownerName }}</p> | ||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| <p>{{ comment.message }}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(comment.message)"></p> | |||||
| </div> | </div> | ||||
| <span *ngIf="comment.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" | <span *ngIf="comment.owner === user?.id" class="position-absolute bi bi-pencil p-2" data-type="user-tool" | ||||
| data-action="edit" (click)="openModalEditComment(comment)"></span> | data-action="edit" (click)="openModalEditComment(comment)"></span> | ||||
| @@ -12,6 +12,7 @@ import {NewCommentComponent} from "@app/postings/new-comment/new-comment.compone | |||||
| import {NewContactComponent} from "@app/contacts/new-contact/new-contact.component"; | import {NewContactComponent} from "@app/contacts/new-contact/new-contact.component"; | ||||
| import {NewSaleComponent} from "@app/sales/new-sale/new-sale.component"; | import {NewSaleComponent} from "@app/sales/new-sale/new-sale.component"; | ||||
| import {ActivatedRoute} from "@angular/router"; | import {ActivatedRoute} from "@angular/router"; | ||||
| import {ApiConverter} from "@app/_helpers/api.converter"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-sales-detail', | selector: 'app-sales-detail', | ||||
| @@ -45,7 +46,8 @@ export class SalesDetailComponent implements OnInit, AfterViewInit { | |||||
| private saleService: SaleService, | private saleService: SaleService, | ||||
| private route: ActivatedRoute, | private route: ActivatedRoute, | ||||
| private postService: PostService, | private postService: PostService, | ||||
| private modalService: NgbModal | |||||
| private modalService: NgbModal, | |||||
| protected apiConverter: ApiConverter | |||||
| ) { | ) { | ||||
| this.user = this.accountService.userValue; | this.user = this.accountService.userValue; | ||||
| @@ -82,6 +84,7 @@ export class SalesDetailComponent implements OnInit, AfterViewInit { | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.sale = data; | this.sale = data; | ||||
| this.getPostsData(); | |||||
| } | } | ||||
| ); | ); | ||||
| } | } | ||||
| @@ -96,10 +99,12 @@ export class SalesDetailComponent implements OnInit, AfterViewInit { | |||||
| undefined, | undefined, | ||||
| this.id, | this.id, | ||||
| undefined, | undefined, | ||||
| false | |||||
| undefined, | |||||
| true | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.posts = data["hydra:member"]; | this.posts = data["hydra:member"]; | ||||
| console.log(this.posts); | |||||
| this.postsLength = Number(data["hydra:totalItems"]); | this.postsLength = Number(data["hydra:totalItems"]); | ||||
| this.posts.forEach(posts => { | this.posts.forEach(posts => { | ||||
| if (posts.id) { | if (posts.id) { | ||||
| @@ -4,7 +4,7 @@ | |||||
| <form [formGroup]="taskNoteForm" (ngSubmit)="onSubmit()"> | <form [formGroup]="taskNoteForm" (ngSubmit)="onSubmit()"> | ||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="message" class="form-label">{{ 'form.comment' | translate }}:</label> | <label for="message" class="form-label">{{ 'form.comment' | translate }}:</label> | ||||
| <input type="text" class="form-control" id="message" formControlName="message"/> | |||||
| <textarea class="form-control" id="message" formControlName="message" cols="50" rows="5"></textarea> | |||||
| <div class="form-text" *ngIf="taskNoteForm.get('message')?.invalid && taskNoteForm.get('message')?.touched"> | <div class="form-text" *ngIf="taskNoteForm.get('message')?.invalid && taskNoteForm.get('message')?.touched"> | ||||
| {{ 'form.comment' | translate }} {{ 'form.mandatory' | translate }}. | {{ 'form.comment' | translate }} {{ 'form.mandatory' | translate }}. | ||||
| </div> | </div> | ||||
| @@ -12,7 +12,7 @@ | |||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="description" class="form-label">{{ 'form.description' | translate }}:</label> | <label for="description" class="form-label">{{ 'form.description' | translate }}:</label> | ||||
| <input type="text" class="form-control" id="description" formControlName="description"/> | |||||
| <textarea class="form-control" id="description" formControlName="description" cols="50" rows="5"></textarea> | |||||
| <div class="form-text" *ngIf="taskForm.get('description')?.invalid && taskForm.get('description')?.touched"> | <div class="form-text" *ngIf="taskForm.get('description')?.invalid && taskForm.get('description')?.touched"> | ||||
| {{ 'form.description' | translate }} {{ 'form.mandatory' | translate }}. | {{ 'form.description' | translate }} {{ 'form.mandatory' | translate }}. | ||||
| </div> | </div> | ||||
| @@ -18,7 +18,7 @@ | |||||
| </div> | </div> | ||||
| <div class="collapse" id="collapse-{{ApiConverter.extractId(task.id)}}"> | <div class="collapse" id="collapse-{{ApiConverter.extractId(task.id)}}"> | ||||
| <div class="pt-3 pe-5 position-relative"> | <div class="pt-3 pe-5 position-relative"> | ||||
| <p class="m-0">{{task.description}}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(task.description)"></p> | |||||
| <p>Zugewiesen an: {{task.assignedToName}}</p> | <p>Zugewiesen an: {{task.assignedToName}}</p> | ||||
| <span *ngIf="task.createdBy === user?.id" class="position-absolute bi bi-pencil p-2" | <span *ngIf="task.createdBy === user?.id" class="position-absolute bi bi-pencil p-2" | ||||
| data-type="user-tool" data-action="edit" (click)="openModalEditTask(task)"></span> | data-type="user-tool" data-action="edit" (click)="openModalEditTask(task)"></span> | ||||
| @@ -33,7 +33,7 @@ | |||||
| <p>{{ taskNote.ownerName }}</p> | <p>{{ taskNote.ownerName }}</p> | ||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| <p>{{ taskNote.message }}</p> | |||||
| <p class="m-0" [innerHTML]="apiConverter.getSafeLongtext(taskNote.message)"></p> | |||||
| </div> | </div> | ||||
| <span *ngIf="taskNote.owner === user?.id" class="position-absolute bi bi-pencil p-2" | <span *ngIf="taskNote.owner === user?.id" class="position-absolute bi bi-pencil p-2" | ||||
| data-type="user-tool" data-action="edit" (click)="openModalEditTaskNote(taskNote)"></span> | data-type="user-tool" data-action="edit" (click)="openModalEditTaskNote(taskNote)"></span> | ||||
| @@ -39,7 +39,8 @@ export class TasksComponent implements OnInit, AfterViewInit { | |||||
| constructor( | constructor( | ||||
| private modalService: NgbModal, | private modalService: NgbModal, | ||||
| private accountService: AccountService, | private accountService: AccountService, | ||||
| private taskService: TaskService | |||||
| private taskService: TaskService, | |||||
| protected apiConverter: ApiConverter | |||||
| ) { | ) { | ||||
| this.user = this.accountService.userValue; | this.user = this.accountService.userValue; | ||||