Commit 4464a26b authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174230 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 74f7e1a1
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</a> </a>
</div> </div>
<div *ngIf="_subcategory.list.length > 4"> <div *ngIf="_subcategory.list.length > 4">
<span class="view-all" (click)="viewAllProducts(_subcategory);">View All</span> <span class="view-all" (click)="viewAllProducts(_subcategory, hoverIdx);">View All</span>
</div> </div>
</div> </div>
......
...@@ -66,14 +66,16 @@ export class ECMNavMenuComponent implements OnInit { ...@@ -66,14 +66,16 @@ export class ECMNavMenuComponent implements OnInit {
} }
} }
viewAllProducts(subcategory) { viewAllProducts(subcategory, hoverIdx) {
console.log('viewAllProducts'); console.log('viewAllProducts for subcat:',subcategory);
//this.closePanel.emit(); //this.closePanel.emit();
//this.store.dispatch( this.subCategoryAction.getSubCategorySuccess(subcategory) ); //this.store.dispatch( this.subCategoryAction.getSubCategorySuccess(subcategory) );
//let category = this.categoryList.find( category => category.catCode === subcategory.catCode); //let category = this.categoryList.find( category => category.catCode === subcategory.catCode);
//this.store.dispatch(this.categoryAction.getCategorySuccess(category)); //this.store.dispatch(this.categoryAction.getCategorySuccess(category));
this.closePanel.emit(); this.closePanel.emit();
this.store.dispatch( this.subCategoryAction.resetSubCategoryList() );
this.store.dispatch( this.subCategoryAction.loadSubCategories( this.categoryList[hoverIdx].catCode ) );
this.store.dispatch( this.itemAction.resetItemList() ); this.store.dispatch( this.itemAction.resetItemList() );
this.store.dispatch( this.itemAction.loadItems( subcategory.scatCode ) ); this.store.dispatch( this.itemAction.loadItems( subcategory.scatCode ) );
this.router.navigate( ['/products', subcategory.scatCode] ); this.router.navigate( ['/products', subcategory.scatCode] );
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<div class="row"> <div class="row">
<div class="ecm-section-info"> <div class="ecm-section-info">
<span class="ecm-section-info-title">{{subcategory?.shDescr}}</span> <span class="ecm-section-info-title">{{subcategory?.shDescr}}</span>
<span class="ecm-total-items">( {{(items | async)?.length}} Items )</span> <span class="ecm-total-items">( {{items?.length}} Items )</span>
<!-- <span class="ecm-section-info-subhead">{{subcategory?.descr}}</span> --> <!-- <span class="ecm-section-info-subhead">{{subcategory?.descr}}</span> -->
</div> </div>
<div class="ecm-item-card-detail"> <div class="ecm-item-card-detail">
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<span *ngIf="category" class="ecm-section-info-title">{{category?.shDescr}}</span> <span *ngIf="category" class="ecm-section-info-title">{{category?.shDescr}}</span>
<span *ngIf="category" class="ecm-section-info-subhead">{{category?.descr}}</span> <span *ngIf="category" class="ecm-section-info-subhead">{{category?.descr}}</span>
</div> </div>
<div class="small-12 medium-6 large-4 column end " *ngFor="let _subcategory of subcategories | async"> <div class="small-12 medium-6 large-4 column end " *ngFor="let _subcategory of subcategories">
<ecm-card (storeData)="storeSubCategory(_subcategory)" [subcategory]="_subcategory"></ecm-card> <ecm-card (storeData)="storeSubCategory(_subcategory)" [subcategory]="_subcategory"></ecm-card>
</div> </div>
</div> </div>
......
...@@ -28,7 +28,7 @@ export class EcmSubCategoryComponent implements OnInit { ...@@ -28,7 +28,7 @@ export class EcmSubCategoryComponent implements OnInit {
this.position = window.pageYOffset; this.position = window.pageYOffset;
} }
private subcategories: Observable<SubCategory[]>; private subcategories;
private extra_param = { "catCode": '', "catShDesc": '', scatDesc: '' }; private extra_param = { "catCode": '', "catShDesc": '', scatDesc: '' };
private category: Category; private category: Category;
...@@ -50,14 +50,17 @@ export class EcmSubCategoryComponent implements OnInit { ...@@ -50,14 +50,17 @@ export class EcmSubCategoryComponent implements OnInit {
} }
getSubCategories( catCode: string ) { getSubCategories( catCode: string ) {
this.subcategories = this.store.select( 'subcategories' ); this.store.select( 'subcategories' ).subscribe(
subcategories => {
this.subcategories = subcategories;
}
);
let categories: Observable<Category[]> = this.store.select('categories'); let categories: Observable<Category[]> = this.store.select('categories');
let category;
categories.subscribe( items => { categories.subscribe( items => {
category = items.find(x => x.catCode === catCode); this.category = items.find(x => x.catCode === catCode);
if(category){ if(this.category){
let breadcrumb = [{label: 'Home', url: '/home'}, {label: category.shDescr, url: 'javascript:void(0)'}]; let breadcrumb = [{label: 'Home', url: '/home'}, {label: this.category.shDescr, url: 'javascript:void(0)'}];
this.breadcrumbSerivce.breadcrumbs = breadcrumb; this.breadcrumbSerivce.breadcrumbs = breadcrumb;
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment