| @@ -1,5 +1,5 @@ | |||||
| import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; | |||||
| import {DocumentJsonld, DocumentService} from "@app/core/api/v1"; | |||||
| import {AfterViewInit, Component, Input, OnInit, ViewChild} from '@angular/core'; | |||||
| import {DocumentJsonld, DocumentService, PartnerJsonld, ProductJsonld} from "@app/core/api/v1"; | |||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | import {AppHelperService} from "@app/_helpers/app-helper.service"; | ||||
| import {MatSort, Sort} from "@angular/material/sort"; | import {MatSort, Sort} from "@angular/material/sort"; | ||||
| import {Subscription} from "rxjs"; | import {Subscription} from "rxjs"; | ||||
| @@ -15,6 +15,8 @@ import {NewDocumentComponent} from "@app/_views/documents/new-document/new-docum | |||||
| }) | }) | ||||
| export class DocumentListComponent implements OnInit, AfterViewInit { | export class DocumentListComponent implements OnInit, AfterViewInit { | ||||
| @Input() public product!: ProductJsonld; | |||||
| @Input() public partner!: PartnerJsonld; | |||||
| @ViewChild(MatSort) sort; | @ViewChild(MatSort) sort; | ||||
| @ViewChild("pagingComponent", { static: false }) pagingComponent!: PagingComponent; | @ViewChild("pagingComponent", { static: false }) pagingComponent!: PagingComponent; | ||||
| @@ -49,7 +51,13 @@ export class DocumentListComponent implements OnInit, AfterViewInit { | |||||
| getData = () => { | getData = () => { | ||||
| this.documentsSub = this.documentService.documentsGetCollection( | this.documentsSub = this.documentService.documentsGetCollection( | ||||
| this.pagingComponent.getPageIndex(), | this.pagingComponent.getPageIndex(), | ||||
| this.pagingComponent.getPageSize() | |||||
| this.pagingComponent.getPageSize(), | |||||
| undefined, | |||||
| undefined, | |||||
| this.partner !== undefined ? this.partner.id : undefined, | |||||
| undefined, | |||||
| this.product !== undefined ? this.product.id : undefined | |||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| this.documents = data["hydra:member"]; | this.documents = data["hydra:member"]; | ||||
| @@ -132,8 +132,6 @@ export class PartnerListComponent implements OnInit, AfterViewInit { | |||||
| } | } | ||||
| getPartnerProducts = (searchValue = undefined) => { | getPartnerProducts = (searchValue = undefined) => { | ||||
| console.log(this.partnerType); | |||||
| console.log(searchValue); | |||||
| this.partnersSub = this.partnerProductService.partnerProductsGetCollection( | this.partnersSub = this.partnerProductService.partnerProductsGetCollection( | ||||
| this.pagingComponent.getPageIndex(), | this.pagingComponent.getPageIndex(), | ||||
| this.pagingComponent.getPageSize(), | this.pagingComponent.getPageSize(), | ||||
| @@ -84,3 +84,9 @@ | |||||
| > | > | ||||
| </app-sale-list> | </app-sale-list> | ||||
| </app-toggle> | </app-toggle> | ||||
| <app-toggle #toggleDocuments [headline]="'basic.documents' | translate"> | |||||
| <app-document-list *ngIf="toggleDocuments.isOpened" #documentsListComponent | |||||
| [partner]="partner" | |||||
| > | |||||
| </app-document-list> | |||||
| </app-toggle> | |||||
| @@ -16,6 +16,7 @@ import {ContactListComponent} from "@app/_views/contacts/contact-list/contact-li | |||||
| import {TaskListComponent} from "@app/_views/tasks/task-list/task-list.component"; | import {TaskListComponent} from "@app/_views/tasks/task-list/task-list.component"; | ||||
| import {ProductListComponent} from "@app/_views/products/product-list/product-list.component"; | import {ProductListComponent} from "@app/_views/products/product-list/product-list.component"; | ||||
| import {SaleListComponent} from "@app/_views/sales/sale-list/sale-list.component"; | import {SaleListComponent} from "@app/_views/sales/sale-list/sale-list.component"; | ||||
| import {DocumentListComponent} from "@app/_views/documents/document-list/document-list.component"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-partners-detail', | selector: 'app-partners-detail', | ||||
| @@ -34,6 +35,8 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| @ViewChild("postListComponent", { static: false }) postsComponent!: PostListComponent; | @ViewChild("postListComponent", { static: false }) postsComponent!: PostListComponent; | ||||
| @ViewChild("toggleSales", { static: true }) toggleSales!: ToggleComponent; | @ViewChild("toggleSales", { static: true }) toggleSales!: ToggleComponent; | ||||
| @ViewChild("salesListComponent", { static: false }) salesListComponent!: SaleListComponent; | @ViewChild("salesListComponent", { static: false }) salesListComponent!: SaleListComponent; | ||||
| @ViewChild("toggleDocuments", { static: true }) toggleDocuments!: ToggleComponent; | |||||
| @ViewChild("documentsListComponent", { static: false }) documentsListComponent!: DocumentListComponent; | |||||
| protected user: User | null; | protected user: User | null; | ||||
| @@ -19,10 +19,10 @@ | |||||
| </div> | </div> | ||||
| <div class="col-12 col-sm-6 col-lg-4 has-image"> | <div class="col-12 col-sm-6 col-lg-4 has-image"> | ||||
| <img *ngIf="product.imageUrl !== null && product.imageUrl !== undefined" | <img *ngIf="product.imageUrl !== null && product.imageUrl !== undefined" | ||||
| src="{{product.imageUrl}}" width="247" height="94" | |||||
| alt="{{product.name}}" title="{{product.name}}" /> | |||||
| src="{{product.imageUrl}}" width="247" height="94" | |||||
| alt="{{product.name}}" title="{{product.name}}"/> | |||||
| <img *ngIf="product.imageUrl === null || product.imageUrl === undefined" | <img *ngIf="product.imageUrl === null || product.imageUrl === undefined" | ||||
| src="/assets/images/icons/dummy-product.png" width="247" height="94" alt="" /> | |||||
| src="/assets/images/icons/dummy-product.png" width="247" height="94" alt=""/> | |||||
| </div> | </div> | ||||
| <span class="position-absolute bi p-2" | <span class="position-absolute bi p-2" | ||||
| [class.bi-heart]="userProduct === null" | [class.bi-heart]="userProduct === null" | ||||
| @@ -60,7 +60,13 @@ | |||||
| </app-toggle> | </app-toggle> | ||||
| <app-toggle #toggleSales [headline]="'basic.sales' | translate"> | <app-toggle #toggleSales [headline]="'basic.sales' | translate"> | ||||
| <app-sale-list *ngIf="toggleSales.isOpened" #salesListComponent | <app-sale-list *ngIf="toggleSales.isOpened" #salesListComponent | ||||
| [product]="product" | |||||
| [product]="product" | |||||
| > | > | ||||
| </app-sale-list> | </app-sale-list> | ||||
| </app-toggle> | |||||
| <app-toggle #toggleDocuments [headline]="'basic.documents' | translate"> | |||||
| <app-document-list *ngIf="toggleDocuments.isOpened" #documentsListComponent | |||||
| [product]="product" | |||||
| > | |||||
| </app-document-list> | |||||
| </app-toggle> | </app-toggle> | ||||