Commit 66079450 authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174550 ce508802-f39f-4f6c-b175-0d175dae99d5
parent efd112b7
...@@ -15,9 +15,11 @@ import { Store } from '@ngrx/store'; ...@@ -15,9 +15,11 @@ import { Store } from '@ngrx/store';
export class AppComponent { export class AppComponent {
title = 'Proteus ECM'; title = 'Proteus ECM';
location: Location; location: Location;
locationPath: string = "";
constructor(location: Location, private store: Store<AppState>, private cartAction: CartActions, private categoryAction: CategoryActions, private menuAction:MenuActions, private wishListAction: WishListActions, public hostUrlService : HostUrlService) { constructor(location: Location, private store: Store<AppState>, private cartAction: CartActions, private categoryAction: CategoryActions, private menuAction:MenuActions, private wishListAction: WishListActions, public hostUrlService : HostUrlService) {
this.location = location; this.location = location;
console.log( ' this.location.path(true)[' + this.location.path(true) + ']'); this.locationPath = this.location.path(true);
console.log( ' this.locationPath[' + this.locationPath + ']');
var url = ''; var url = '';
if( document.getElementById("hostUrl") ){ if( document.getElementById("hostUrl") ){
url= (<HTMLInputElement>document.getElementById("hostUrl")).value; url= (<HTMLInputElement>document.getElementById("hostUrl")).value;
...@@ -41,7 +43,7 @@ export class AppComponent { ...@@ -41,7 +43,7 @@ export class AppComponent {
} }
get(name){ get(name){
var retVal = 'undefined'; var retVal = 'undefined';
if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(this.location.path(true))) if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(this.locationPath))
{ {
console.log( 'name[' + name + '] decodeURIComponent(name[1]) [' + decodeURIComponent(name[1]) + ']'); console.log( 'name[' + name + '] decodeURIComponent(name[1]) [' + decodeURIComponent(name[1]) + ']');
retVal = decodeURIComponent(name[1]); retVal = decodeURIComponent(name[1]);
......
...@@ -37,7 +37,7 @@ export class ItemActions { ...@@ -37,7 +37,7 @@ export class ItemActions {
getItem(itemCode): Action { getItem(itemCode): Action {
return { return {
type: ItemActions.GET_ITEM, type: ItemActions.GET_ITEM,
payload: itemCode payload: itemCode.toString()
}; };
} }
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<div class="item-card-overlay" (click)="isInCart(_item.itemCode) ? goToCart() : addToCart(_item) "> <div class="item-card-overlay" (click)="isInCart(_item.itemCode) ? goToCart() : addToCart(_item) ">
<span class="item-card-overlay-action"> <span class="item-card-overlay-action">
<i class="material-icons">shopping_cart</i> <i class="material-icons">shopping_cart</i>
{{ (_item.itemCode.indexOf('L2D014') == 0 ) ? {{ (_item.itemCode.toString().indexOf('L2D014') == 0 ) ?
( isInCart(_item.itemCode) ? 'Go To Cart' : 'Add to Cart') : ( isInCart(_item.itemCode) ? 'Go To Cart' : 'Add to Cart') :
'Enroll Now' 'Enroll Now'
}} }}
......
...@@ -75,13 +75,41 @@ export class EcmProductComponent implements OnInit { ...@@ -75,13 +75,41 @@ export class EcmProductComponent implements OnInit {
console.log("this.items -->",this.items , this.items.length); console.log("this.items -->",this.items , this.items.length);
console.log("this.items.length -->", this.filterOptions); console.log("this.items.length -->", this.filterOptions);
} }
if(this.items[0]){ let itemDetailObj = this.items[0];
console.log('Items:[',this.items[0]); if(itemDetailObj)
{
console.log('Items:[',itemDetailObj);
let breadcrumb; let breadcrumb;
if(this.items[0].itemCategory.catCode == 'CAT0000005') if( ! itemDetailObj.subCategory)
breadcrumb = [{label: 'Home', url: '/home'}, {label: this.items[0].itemCategory.shDescr,url: 'javascript:void(0)'}]; {
breadcrumb = [
{
label: 'Home',
url: '/home'
},
{
label: itemDetailObj.itemCategory.shDescr,
url: 'javascript:void(0)'
}
];
}
else else
breadcrumb = [{label: 'Home', url: '/home'}, {label: this.items[0].itemCategory.shDescr,url: '/categories/' + this.items[0].itemSubCategory.catCode}, {label: this.items[0].itemSubCategory.shDescr,url: 'javascript:void(0)'}]; {
breadcrumb = [
{
label: 'Home',
url: '/home'
},
{
label: itemDetailObj.itemCategory.shDescr,
url: '/categories/' + itemDetailObj.itemSubCategory.catCode
},
{
label: itemDetailObj.itemSubCategory.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