| @@ -6,8 +6,8 @@ export class ApiConverter { | |||||
| constructor(private sanitizer: DomSanitizer) {} | constructor(private sanitizer: DomSanitizer) {} | ||||
| public static extractId(iri: string | undefined): string { | |||||
| if (iri !== undefined) { | |||||
| public static extractId(iri: string | undefined | null): string { | |||||
| if (iri !== undefined && iri !== null) { | |||||
| const iriRegex = /\/(\d+)$/; | const iriRegex = /\/(\d+)$/; | ||||
| const match = iri.match(iriRegex); | const match = iri.match(iriRegex); | ||||
| if (match && match[1]) { | if (match && match[1]) { | ||||
| @@ -186,7 +186,7 @@ export class CommentService { | |||||
| /** | /** | ||||
| * Retrieves a Comment resource. | * Retrieves a Comment resource. | ||||
| * Retrieves a Comment resource. | * Retrieves a Comment resource. | ||||
| * @param id Comment identifier | |||||
| * @param id CommentApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -261,7 +261,7 @@ export class CommentService { | |||||
| /** | /** | ||||
| * Updates the Comment resource. | * Updates the Comment resource. | ||||
| * Updates the Comment resource. | * Updates the Comment resource. | ||||
| * @param id Comment identifier | |||||
| * @param id CommentApi identifier | |||||
| * @param comment The updated Comment resource | * @param comment The updated Comment resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -198,7 +198,7 @@ export class ContactService { | |||||
| /** | /** | ||||
| * Retrieves a Contact resource. | * Retrieves a Contact resource. | ||||
| * Retrieves a Contact resource. | * Retrieves a Contact resource. | ||||
| * @param id Contact identifier | |||||
| * @param id ContactApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -273,7 +273,7 @@ export class ContactService { | |||||
| /** | /** | ||||
| * Updates the Contact resource. | * Updates the Contact resource. | ||||
| * Updates the Contact resource. | * Updates the Contact resource. | ||||
| * @param id Contact identifier | |||||
| * @param id ContactApi identifier | |||||
| * @param contact The updated Contact resource | * @param contact The updated Contact resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -198,7 +198,7 @@ export class ContactPartnerProductService { | |||||
| /** | /** | ||||
| * Removes the ContactPartnerProduct resource. | * Removes the ContactPartnerProduct resource. | ||||
| * Removes the ContactPartnerProduct resource. | * Removes the ContactPartnerProduct resource. | ||||
| * @param id ContactPartnerProduct identifier | |||||
| * @param id ContactPartnerProductApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -269,7 +269,7 @@ export class ContactPartnerProductService { | |||||
| /** | /** | ||||
| * Retrieves a ContactPartnerProduct resource. | * Retrieves a ContactPartnerProduct resource. | ||||
| * Retrieves a ContactPartnerProduct resource. | * Retrieves a ContactPartnerProduct resource. | ||||
| * @param id ContactPartnerProduct identifier | |||||
| * @param id ContactPartnerProductApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -210,7 +210,7 @@ export class DocumentService { | |||||
| /** | /** | ||||
| * Retrieves a Document resource. | * Retrieves a Document resource. | ||||
| * Retrieves a Document resource. | * Retrieves a Document resource. | ||||
| * @param id Document identifier | |||||
| * @param id DocumentApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -285,7 +285,7 @@ export class DocumentService { | |||||
| /** | /** | ||||
| * Updates the Document resource. | * Updates the Document resource. | ||||
| * Updates the Document resource. | * Updates the Document resource. | ||||
| * @param id Document identifier | |||||
| * @param id DocumentApi identifier | |||||
| * @param document The updated Document resource | * @param document The updated Document resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -218,7 +218,7 @@ export class PartnerService { | |||||
| /** | /** | ||||
| * Retrieves a Partner resource. | * Retrieves a Partner resource. | ||||
| * Retrieves a Partner resource. | * Retrieves a Partner resource. | ||||
| * @param id Partner identifier | |||||
| * @param id PartnerApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -293,7 +293,7 @@ export class PartnerService { | |||||
| /** | /** | ||||
| * Updates the Partner resource. | * Updates the Partner resource. | ||||
| * Updates the Partner resource. | * Updates the Partner resource. | ||||
| * @param id Partner identifier | |||||
| * @param id PartnerApi identifier | |||||
| * @param partner The updated Partner resource | * @param partner The updated Partner resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -210,7 +210,7 @@ export class PartnerFollowService { | |||||
| /** | /** | ||||
| * Removes the PartnerFollow resource. | * Removes the PartnerFollow resource. | ||||
| * Removes the PartnerFollow resource. | * Removes the PartnerFollow resource. | ||||
| * @param id PartnerFollow identifier | |||||
| * @param id PartnerFollowApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -281,7 +281,7 @@ export class PartnerFollowService { | |||||
| /** | /** | ||||
| * Retrieves a PartnerFollow resource. | * Retrieves a PartnerFollow resource. | ||||
| * Retrieves a PartnerFollow resource. | * Retrieves a PartnerFollow resource. | ||||
| * @param id PartnerFollow identifier | |||||
| * @param id PartnerFollowApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -210,7 +210,7 @@ export class PartnerProductService { | |||||
| /** | /** | ||||
| * Removes the PartnerProduct resource. | * Removes the PartnerProduct resource. | ||||
| * Removes the PartnerProduct resource. | * Removes the PartnerProduct resource. | ||||
| * @param id PartnerProduct identifier | |||||
| * @param id PartnerProductApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -281,7 +281,7 @@ export class PartnerProductService { | |||||
| /** | /** | ||||
| * Retrieves a PartnerProduct resource. | * Retrieves a PartnerProduct resource. | ||||
| * Retrieves a PartnerProduct resource. | * Retrieves a PartnerProduct resource. | ||||
| * @param id PartnerProduct identifier | |||||
| * @param id PartnerProductApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -240,7 +240,7 @@ export class PostService { | |||||
| /** | /** | ||||
| * Retrieves a Post resource. | * Retrieves a Post resource. | ||||
| * Retrieves a Post resource. | * Retrieves a Post resource. | ||||
| * @param id Post identifier | |||||
| * @param id PostingApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -315,7 +315,7 @@ export class PostService { | |||||
| /** | /** | ||||
| * Updates the Post resource. | * Updates the Post resource. | ||||
| * Updates the Post resource. | * Updates the Post resource. | ||||
| * @param id Post identifier | |||||
| * @param id PostingApi identifier | |||||
| * @param postPostingPatch The updated Post resource | * @param postPostingPatch The updated Post resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -196,7 +196,7 @@ export class ProductService { | |||||
| /** | /** | ||||
| * Retrieves a Product resource. | * Retrieves a Product resource. | ||||
| * Retrieves a Product resource. | * Retrieves a Product resource. | ||||
| * @param id Product identifier | |||||
| * @param id ProductApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -271,7 +271,7 @@ export class ProductService { | |||||
| /** | /** | ||||
| * Updates the Product resource. | * Updates the Product resource. | ||||
| * Updates the Product resource. | * Updates the Product resource. | ||||
| * @param id Product identifier | |||||
| * @param id ProductApi identifier | |||||
| * @param product The updated Product resource | * @param product The updated Product resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -210,7 +210,7 @@ export class SaleService { | |||||
| /** | /** | ||||
| * Retrieves a Sale resource. | * Retrieves a Sale resource. | ||||
| * Retrieves a Sale resource. | * Retrieves a Sale resource. | ||||
| * @param id Sale identifier | |||||
| * @param id SaleApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -285,7 +285,7 @@ export class SaleService { | |||||
| /** | /** | ||||
| * Updates the Sale resource. | * Updates the Sale resource. | ||||
| * Updates the Sale resource. | * Updates the Sale resource. | ||||
| * @param id Sale identifier | |||||
| * @param id SaleApi identifier | |||||
| * @param sale The updated Sale resource | * @param sale The updated Sale resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -222,7 +222,7 @@ export class TaskService { | |||||
| /** | /** | ||||
| * Retrieves a Task resource. | * Retrieves a Task resource. | ||||
| * Retrieves a Task resource. | * Retrieves a Task resource. | ||||
| * @param id Task identifier | |||||
| * @param id TaskApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -297,7 +297,7 @@ export class TaskService { | |||||
| /** | /** | ||||
| * Updates the Task resource. | * Updates the Task resource. | ||||
| * Updates the Task resource. | * Updates the Task resource. | ||||
| * @param id Task identifier | |||||
| * @param id TaskApi identifier | |||||
| * @param task The updated Task resource | * @param task The updated Task resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -198,7 +198,7 @@ export class TaskNoteService { | |||||
| /** | /** | ||||
| * Retrieves a TaskNote resource. | * Retrieves a TaskNote resource. | ||||
| * Retrieves a TaskNote resource. | * Retrieves a TaskNote resource. | ||||
| * @param id TaskNote identifier | |||||
| * @param id TaskNoteApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -273,7 +273,7 @@ export class TaskNoteService { | |||||
| /** | /** | ||||
| * Updates the TaskNote resource. | * Updates the TaskNote resource. | ||||
| * Updates the TaskNote resource. | * Updates the TaskNote resource. | ||||
| * @param id TaskNote identifier | |||||
| * @param id TaskNoteApi identifier | |||||
| * @param taskNote The updated TaskNote resource | * @param taskNote The updated TaskNote resource | ||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| @@ -196,7 +196,7 @@ export class UserService { | |||||
| /** | /** | ||||
| * Retrieves a User resource. | * Retrieves a User resource. | ||||
| * Retrieves a User resource. | * Retrieves a User resource. | ||||
| * @param id User identifier | |||||
| * @param id UserApi identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| @@ -69,7 +69,7 @@ | |||||
| <div class="tasks mb-3" *ngFor="let task of tasks"> | <div class="tasks mb-3" *ngFor="let task of tasks"> | ||||
| <div class="card p-3"> | <div class="card p-3"> | ||||
| <div class="position-relative"> | <div class="position-relative"> | ||||
| <h3 class="m-0"><a *ngIf="task.partner" href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3> | |||||
| <h3 class="m-0" *ngIf="task.partner"><a href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3> | |||||
| <span class="info d-flex position-absolute"> | <span class="info d-flex position-absolute"> | ||||
| <span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span> | <span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span> | ||||
| <span class="importance" [attr.data-importance]="task.prio"></span> | <span class="importance" [attr.data-importance]="task.prio"></span> | ||||
| @@ -44,6 +44,13 @@ | |||||
| <p [innerHTML]="apiConverter.getSafeLongtext(partner.description)"></p> | <p [innerHTML]="apiConverter.getSafeLongtext(partner.description)"></p> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="card-body row" *ngIf="partnerProducts"> | |||||
| <div class="col-12"> | |||||
| <ul *ngFor="let partnerProduct of partnerProducts"> | |||||
| <li><a href="/products/{{ApiConverter.extractId(partnerProduct.product)}}">{{partnerProduct.productName}}</a></li> | |||||
| </ul> | |||||
| </div> | |||||
| </div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <app-toggle #toggleContacts [headline]="'basic.contacts' | translate"> | <app-toggle #toggleContacts [headline]="'basic.contacts' | translate"> | ||||
| @@ -94,7 +101,7 @@ | |||||
| <div class="tasks mb-3" *ngFor="let task of tasks"> | <div class="tasks mb-3" *ngFor="let task of tasks"> | ||||
| <div class="card p-3"> | <div class="card p-3"> | ||||
| <div class="position-relative"> | <div class="position-relative"> | ||||
| <h3 class="m-0"><a *ngIf="task.partner" href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3> | |||||
| <h3 class="m-0" *ngIf="task.partner"><a href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3> | |||||
| <span class="info d-flex position-absolute"> | <span class="info d-flex position-absolute"> | ||||
| <span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span> | <span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span> | ||||
| <span class="importance" [attr.data-importance]="task.prio"></span> | <span class="importance" [attr.data-importance]="task.prio"></span> | ||||
| @@ -6,7 +6,7 @@ import { | |||||
| CommentJsonld, | CommentJsonld, | ||||
| ContactJsonld, | ContactJsonld, | ||||
| ContactService, PartnerFollowJsonld, PartnerFollowService, | ContactService, PartnerFollowJsonld, PartnerFollowService, | ||||
| PartnerJsonld, | |||||
| PartnerJsonld, PartnerProductJsonld, PartnerProductService, | |||||
| PartnerService, | PartnerService, | ||||
| PostJsonld, | PostJsonld, | ||||
| PostService, TaskJsonld, TaskNoteJsonld, TaskService | PostService, TaskJsonld, TaskNoteJsonld, TaskService | ||||
| @@ -48,6 +48,9 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| protected partnerDetailSub: Subscription; | protected partnerDetailSub: Subscription; | ||||
| protected partner: PartnerJsonld; | protected partner: PartnerJsonld; | ||||
| protected partnerProductSub: Subscription; | |||||
| protected partnerProducts: Array<PartnerProductJsonld>; | |||||
| protected partnerFollowSub: Subscription; | protected partnerFollowSub: Subscription; | ||||
| protected partnerFollow: PartnerFollowJsonld | null; | protected partnerFollow: PartnerFollowJsonld | null; | ||||
| @@ -88,6 +91,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| private modalService: NgbModal, | private modalService: NgbModal, | ||||
| private route: ActivatedRoute, | private route: ActivatedRoute, | ||||
| private partnerService: PartnerService, | private partnerService: PartnerService, | ||||
| private partnerProductService: PartnerProductService, | |||||
| private partnerFollowService: PartnerFollowService, | private partnerFollowService: PartnerFollowService, | ||||
| private contactService: ContactService, | private contactService: ContactService, | ||||
| private postService: PostService, | private postService: PostService, | ||||
| @@ -98,6 +102,9 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| this.partnerDetailSub = new Subscription(); | this.partnerDetailSub = new Subscription(); | ||||
| this.partner = {} as PartnerJsonld; | this.partner = {} as PartnerJsonld; | ||||
| this.partnerProductSub = new Subscription(); | |||||
| this.partnerProducts = []; | |||||
| this.partnerFollowSub = new Subscription(); | this.partnerFollowSub = new Subscription(); | ||||
| this.partnerFollow = null; | this.partnerFollow = null; | ||||
| @@ -138,6 +145,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| this.id = params['id']; | this.id = params['id']; | ||||
| }); | }); | ||||
| this.getPartnerData(); | this.getPartnerData(); | ||||
| this.getPartnerProducts(); | |||||
| this.getContactsData(); | this.getContactsData(); | ||||
| this.getPostsData(); | this.getPostsData(); | ||||
| this.getTasksData(); | this.getTasksData(); | ||||
| @@ -156,7 +164,18 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.partner = data; | this.partner = data; | ||||
| console.log(this.partner); | |||||
| } | |||||
| ); | |||||
| } | |||||
| getPartnerProducts() { | |||||
| this.partnerProductSub = this.partnerProductService.partnerProductsGetCollection( | |||||
| this.contactsPageIndex + 1, | |||||
| this.contactsPageSize, | |||||
| this.id | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.partnerProducts = data["hydra:member"]; | |||||
| } | } | ||||
| ); | ); | ||||
| } | } | ||||
| @@ -296,8 +315,6 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| const modalRefPosting = this.modalService.open(NewPostingComponent, this.modalOptions); | const modalRefPosting = this.modalService.open(NewPostingComponent, this.modalOptions); | ||||
| let posting: PostJsonld = {} as PostJsonld; | let posting: PostJsonld = {} as PostJsonld; | ||||
| posting.partner = this.partner.id ?? null; | posting.partner = this.partner.id ?? null; | ||||
| // TODO: REAL PRODUCT | |||||
| posting.product = "/api/products/101"; | |||||
| modalRefPosting.componentInstance.posting = posting; | modalRefPosting.componentInstance.posting = posting; | ||||
| modalRefPosting.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { | modalRefPosting.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { | ||||
| if (modalStatus === ModalStatus.Submitted) { | if (modalStatus === ModalStatus.Submitted) { | ||||
| @@ -28,6 +28,7 @@ export class NewPostingComponent implements OnInit { | |||||
| ngOnInit(): void { | ngOnInit(): void { | ||||
| this.postForm = FormGroupInitializer.initFormGroup(this.postForm, this.posting); | this.postForm = FormGroupInitializer.initFormGroup(this.postForm, this.posting); | ||||
| console.log(this.posting); | |||||
| } | } | ||||
| onSubmit() { | onSubmit() { | ||||
| @@ -128,6 +128,7 @@ export class SalesDetailComponent implements OnInit, AfterViewInit { | |||||
| let posting: PostJsonld = {} as PostJsonld; | let posting: PostJsonld = {} as PostJsonld; | ||||
| posting.sale = this.sale.id ?? null; | posting.sale = this.sale.id ?? null; | ||||
| posting.partner = this.sale.partner ?? null; | posting.partner = this.sale.partner ?? null; | ||||
| posting.product = this.sale.product ?? null; | |||||
| modalRefPosting.componentInstance.posting = posting; | modalRefPosting.componentInstance.posting = posting; | ||||
| modalRefPosting.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { | modalRefPosting.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { | ||||
| if (modalStatus === ModalStatus.Submitted) { | if (modalStatus === ModalStatus.Submitted) { | ||||
| @@ -7,7 +7,7 @@ | |||||
| <div class="tasks mb-3" *ngFor="let task of tasks"> | <div class="tasks mb-3" *ngFor="let task of tasks"> | ||||
| <div class="card p-3"> | <div class="card p-3"> | ||||
| <div class="position-relative"> | <div class="position-relative"> | ||||
| <h3 class="m-0"><a *ngIf="task.partner" href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3> | |||||
| <h3 class="m-0" *ngIf="task.partner"><a href="/{{task.partnerType}}/{{ApiConverter.extractId(task.partner)}}">{{task.partnerName}}</a></h3> | |||||
| <span class="info d-flex position-absolute"> | <span class="info d-flex position-absolute"> | ||||
| <span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span> | <span class="due-date">{{ task.dueAt | date:'dd.MM.YYYY':'GMT+0000' }}</span> | ||||
| <span class="importance" [attr.data-importance]="task.prio"></span> | <span class="importance" [attr.data-importance]="task.prio"></span> | ||||