|
|
|
@@ -1,8 +1,10 @@ |
|
|
|
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; |
|
|
|
import {ActivatedRoute} from "@angular/router"; |
|
|
|
import { |
|
|
|
PartnerFollowJsonld, PartnerFollowService, |
|
|
|
PartnerJsonld, PartnerService |
|
|
|
PartnerFollowJsonld, |
|
|
|
PartnerFollowService, |
|
|
|
PartnerJsonld, |
|
|
|
PartnerService |
|
|
|
} from "@app/core/api/v1"; |
|
|
|
import {Subscription} from "rxjs"; |
|
|
|
import {environment} from "@environments/environment"; |
|
|
|
@@ -25,25 +27,22 @@ import {DocumentListComponent} from "@app/_views/documents/document-list/documen |
|
|
|
}) |
|
|
|
export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
|
|
|
|
@ViewChild("toggleProducts", { static: true }) toggleProducts!: ToggleComponent; |
|
|
|
@ViewChild("productListComponent", { static: false }) productsComponent!: ProductListComponent; |
|
|
|
@ViewChild("toggleContacts", { static: true }) toggleContacts!: ToggleComponent; |
|
|
|
@ViewChild("contactListComponent", { static: false }) contactsComponent!: ContactListComponent; |
|
|
|
@ViewChild("toggleTasks", { static: true }) toggleTasks!: ToggleComponent; |
|
|
|
@ViewChild("taskListComponent", { static: false }) taskListComponent!: TaskListComponent; |
|
|
|
@ViewChild("togglePosts", { static: true }) togglePosts!: ToggleComponent; |
|
|
|
@ViewChild("postListComponent", { static: false }) postsComponent!: PostListComponent; |
|
|
|
@ViewChild("toggleSales", { static: true }) toggleSales!: ToggleComponent; |
|
|
|
@ViewChild("salesListComponent", { static: false }) salesListComponent!: SaleListComponent; |
|
|
|
@ViewChild("toggleDocuments", { static: true }) toggleDocuments!: ToggleComponent; |
|
|
|
@ViewChild("documentsListComponent", { static: false }) documentsListComponent!: DocumentListComponent; |
|
|
|
|
|
|
|
protected user: User | null; |
|
|
|
@ViewChild("toggleProducts", {static: true}) toggleProducts!: ToggleComponent; |
|
|
|
@ViewChild("productListComponent", {static: false}) productsComponent!: ProductListComponent; |
|
|
|
@ViewChild("toggleContacts", {static: true}) toggleContacts!: ToggleComponent; |
|
|
|
@ViewChild("contactListComponent", {static: false}) contactsComponent!: ContactListComponent; |
|
|
|
@ViewChild("toggleTasks", {static: true}) toggleTasks!: ToggleComponent; |
|
|
|
@ViewChild("taskListComponent", {static: false}) taskListComponent!: TaskListComponent; |
|
|
|
@ViewChild("togglePosts", {static: true}) togglePosts!: ToggleComponent; |
|
|
|
@ViewChild("postListComponent", {static: false}) postsComponent!: PostListComponent; |
|
|
|
@ViewChild("toggleSales", {static: true}) toggleSales!: ToggleComponent; |
|
|
|
@ViewChild("salesListComponent", {static: false}) salesListComponent!: SaleListComponent; |
|
|
|
@ViewChild("toggleDocuments", {static: true}) toggleDocuments!: ToggleComponent; |
|
|
|
@ViewChild("documentsListComponent", {static: false}) documentsListComponent!: DocumentListComponent; |
|
|
|
|
|
|
|
protected readonly environment = environment; |
|
|
|
protected user: User | null; |
|
|
|
protected partnerId!: string; |
|
|
|
|
|
|
|
protected partnerDetailSub: Subscription; |
|
|
|
protected partner!: PartnerJsonld; |
|
|
|
protected partnerFollowSub: Subscription; |
|
|
|
protected partnerFollow: PartnerFollowJsonld | null; |
|
|
|
@@ -55,11 +54,8 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
private partnerFollowService: PartnerFollowService, |
|
|
|
protected appHelperService: AppHelperService |
|
|
|
) { |
|
|
|
this.partnerDetailSub = new Subscription(); |
|
|
|
|
|
|
|
this.partnerFollowSub = new Subscription(); |
|
|
|
this.partnerFollow = null; |
|
|
|
|
|
|
|
this.user = this.accountService.userValue; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -80,7 +76,7 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
} |
|
|
|
|
|
|
|
getPartnerData = () => { |
|
|
|
this.partnerDetailSub = this.partnerService.partnersIdGet( |
|
|
|
this.partnerService.partnersIdGet( |
|
|
|
this.partnerId |
|
|
|
).subscribe( |
|
|
|
data => { |
|
|
|
@@ -130,6 +126,6 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { |
|
|
|
} |
|
|
|
|
|
|
|
openModalEditPartner() { |
|
|
|
this.appHelperService.openModal(NewPartnerComponent, { 'partner': this.partner }, this.getData); |
|
|
|
this.appHelperService.openModal(NewPartnerComponent, {'partner': this.partner}, this.getData); |
|
|
|
} |
|
|
|
} |