|
|
|
@@ -6,7 +6,7 @@ import { |
|
|
|
CommentJsonld, |
|
|
|
ContactJsonld, |
|
|
|
ContactService, PartnerFollowJsonld, PartnerFollowService, |
|
|
|
PartnerJsonld, |
|
|
|
PartnerJsonld, PartnerProductJsonld, PartnerProductService, |
|
|
|
PartnerService, |
|
|
|
PostJsonld, |
|
|
|
PostService, TaskJsonld, TaskNoteJsonld, TaskService |
|
|
|
@@ -48,6 +48,9 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
protected partnerDetailSub: Subscription; |
|
|
|
protected partner: PartnerJsonld; |
|
|
|
|
|
|
|
protected partnerProductSub: Subscription; |
|
|
|
protected partnerProducts: Array<PartnerProductJsonld>; |
|
|
|
|
|
|
|
protected partnerFollowSub: Subscription; |
|
|
|
protected partnerFollow: PartnerFollowJsonld | null; |
|
|
|
|
|
|
|
@@ -88,6 +91,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
private modalService: NgbModal, |
|
|
|
private route: ActivatedRoute, |
|
|
|
private partnerService: PartnerService, |
|
|
|
private partnerProductService: PartnerProductService, |
|
|
|
private partnerFollowService: PartnerFollowService, |
|
|
|
private contactService: ContactService, |
|
|
|
private postService: PostService, |
|
|
|
@@ -98,6 +102,9 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
this.partnerDetailSub = new Subscription(); |
|
|
|
this.partner = {} as PartnerJsonld; |
|
|
|
|
|
|
|
this.partnerProductSub = new Subscription(); |
|
|
|
this.partnerProducts = []; |
|
|
|
|
|
|
|
this.partnerFollowSub = new Subscription(); |
|
|
|
this.partnerFollow = null; |
|
|
|
|
|
|
|
@@ -138,6 +145,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
this.id = params['id']; |
|
|
|
}); |
|
|
|
this.getPartnerData(); |
|
|
|
this.getPartnerProducts(); |
|
|
|
this.getContactsData(); |
|
|
|
this.getPostsData(); |
|
|
|
this.getTasksData(); |
|
|
|
@@ -156,7 +164,18 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
).subscribe( |
|
|
|
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); |
|
|
|
let posting: PostJsonld = {} as PostJsonld; |
|
|
|
posting.partner = this.partner.id ?? null; |
|
|
|
// TODO: REAL PRODUCT |
|
|
|
posting.product = "/api/products/101"; |
|
|
|
modalRefPosting.componentInstance.posting = posting; |
|
|
|
modalRefPosting.componentInstance.submit.subscribe((modalStatus: ModalStatus) => { |
|
|
|
if (modalStatus === ModalStatus.Submitted) { |
|
|
|
|