Commit c78e10d4 authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174494 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4adbe65f
...@@ -360,7 +360,7 @@ p { ...@@ -360,7 +360,7 @@ p {
/* padding: 8px; */ /* padding: 8px; */
/* padding: 8px; */ /* padding: 8px; */
right: 25px; right: 25px;
top: 15px; top: 25px;
/* height: 40px; */ /* height: 40px; */
/* width: 40px; */ /* width: 40px; */
cursor: pointer; cursor: pointer;
...@@ -379,7 +379,7 @@ p { ...@@ -379,7 +379,7 @@ p {
.close-icon{ .close-icon{
color: inherit; color: inherit;
font-size: 22px; /* font-size: 22px; */
position: relative; position: relative;
box-shadow: 0px 0px 3px 1px lightgrey; box-shadow: 0px 0px 3px 1px lightgrey;
border-radius: 100%; border-radius: 100%;
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</div> </div>
</div> </div>
</div> </div>
<div [ngClass]="inWishlist ? 'inwishlist' : ''" class="ecm-wishlist-button"> <div [ngClass]="inWishlist ? 'inwishlist' : ''" [style.top]="IS_WISHLIST ? '25px' : '15px'" class="ecm-wishlist-button">
<md-icon *ngIf="!IS_WISHLIST" class="favourite-icon" (click)="inWishlist ? removeFromWishlist.emit() : addToWishlist.emit()">favorite</md-icon> <md-icon *ngIf="!IS_WISHLIST" class="favourite-icon" (click)="inWishlist ? removeFromWishlist.emit() : addToWishlist.emit()">favorite</md-icon>
<md-icon *ngIf="IS_WISHLIST" class="close-icon" (click)="removeFromWishlist.emit()">close</md-icon> <md-icon *ngIf="IS_WISHLIST" class="close-icon" (click)="removeFromWishlist.emit()">close</md-icon>
</div> </div>
......
...@@ -26,7 +26,6 @@ import { Item } from '../ecm-model/product-model'; ...@@ -26,7 +26,6 @@ import { Item } from '../ecm-model/product-model';
import { ECMHeaderComponent } from '../ecm-header/ecm-header.component'; import { ECMHeaderComponent } from '../ecm-header/ecm-header.component';
import { Reviews } from '../ecm-model/product-review.model'; import { Reviews } from '../ecm-model/product-review.model';
import { MdDialog, MdDialogRef, MdDialogConfig, MD_DIALOG_DATA } from '@angular/material'; import { MdDialog, MdDialogRef, MdDialogConfig, MD_DIALOG_DATA } from '@angular/material';
import { ECMWriteReviewDialog } from './ecm-product-review.component';
import { EcmPanelComponent } from '../ecm-view/ecm-panel/ecm-panel.component'; import { EcmPanelComponent } from '../ecm-view/ecm-panel/ecm-panel.component';
import { Breadcrumbs } from '../ecm-breadcrumbs/ecm-breadcrumbs.component'; import { Breadcrumbs } from '../ecm-breadcrumbs/ecm-breadcrumbs.component';
...@@ -166,35 +165,8 @@ export class EcmProductDetailsComponent implements OnInit { ...@@ -166,35 +165,8 @@ export class EcmProductDetailsComponent implements OnInit {
} }
this.router.navigate(['/checkout']); this.router.navigate(['/checkout']);
} }
else if( activity == 'WRITE_REVIEW') { else if(activity == 'SHOW_SIGNIN_PANEL'){
if(this.checkUser() !== 'undefined' && this.checkUser() !== null && this.checkUser() !== 'null') this.showSignInPanel();
{
if(data.firstReview)
{
if( this.clientWidth < 640 )
{
this.ecmPanel.open({ type: 'overlay', option: 'WRITE_REVIEW_OPT', top:'0px', left: '0px', width:'100%', height: '100%', data: { detail: this.itemDetail,userId: JSON.parse(this.checkUser()).LOGIN_CODE } });
}
else
{
this.ecmPanel.open({ type: 'overlay', option: 'WRITE_REVIEW_OPT', hideClose: true, top:'100px', left: '20%', width:'60%', height: '535px', data: { detail: this.itemDetail,userId: JSON.parse(this.checkUser()).LOGIN_CODE } });
}
}
else
{
this.productreviewService.getUserReview(this.itemDetail.itemCode).subscribe(
userReview => {
this.userReview = userReview;
if(this.userReview)
this.openReviewDialog(this.checkUser());
});
}
}
else
{
this.showSignInPanel();
}
} }
} }
......
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
} }
.ecm-write-review { .ecm-write-review {
position: absolute; /* position: absolute; */
/*bottom: 0;*/ /*bottom: 0;*/
right: 0; right: 0;
} }
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
vertical-align: middle; vertical-align: middle;
height: 50px; height: 50px;
width: 190px; width: 190px;
max-width: 190px; /* max-width: 190px; */
text-align: center; text-align: center;
line-height: 50px; line-height: 50px;
color: mediumvioletred; color: mediumvioletred;
...@@ -209,6 +209,7 @@ ...@@ -209,6 +209,7 @@
box-shadow: 0 0px 5px 1px rgba(0,0,0,.1); box-shadow: 0 0px 5px 1px rgba(0,0,0,.1);
line-height: 15px; line-height: 15px;
font-size: 15px; font-size: 15px;
right: calc(50% - 95px);
} }
.ecm-review-card { .ecm-review-card {
...@@ -265,6 +266,7 @@ hr { ...@@ -265,6 +266,7 @@ hr {
margin-left: 25%; margin-left: 25%;
margin-right: 25%; margin-right: 25%;
float: inherit; float: inherit;
right: inherit;
} }
.ecm-write-review { .ecm-write-review {
......
...@@ -8,23 +8,28 @@ ...@@ -8,23 +8,28 @@
<div class="ratings-section"> <div class="ratings-section">
<div class="row header-content"> <div class="row header-content">
<div class="large-3 columns ecm-total-reviews"> <div class="large-2 columns ecm-total-reviews">
<span class="ecm-avg-rating"> {{itemAvgRating}} </span> <span class="ecm-avg-rating"> {{itemAvgRating}} </span>
<span class="star-rating-block"> <span class="star-rating-block">
<rating [rate]="itemAvgRating"></rating> <rating [rate]="itemAvgRating" [isSmallRatings]="true"></rating>
</span> </span>
<span class="ecm-total-ratings" *ngIf="itemAvgRating"> {{itemAvgRating}} Ratings </span> <span class="ecm-total-ratings" *ngIf="itemAvgRating"> {{itemAvgRating}} Ratings </span>
<span class="ecm-total-ratings" *ngIf="!itemAvgRating"> 0 Ratings </span> <span class="ecm-total-ratings" *ngIf="!itemAvgRating"> 0 Ratings </span>
</div> </div>
<div *ngIf="itemDetail" class="large-6 columns"> <div *ngIf="itemDetail" class="large-5 columns">
<rating [ratingDetail]="itemDetail.itemRatings" (filterBy)="filter($event);"></rating> <rating [ratingDetail]="itemDetail.itemRatings" (filterBy)="filter($event);"></rating>
</div> </div>
<div class="large-3 columns ecm-write-review"> <div class="large-5 columns ecm-write-review">
<button md-button class="write-review-button" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {} });"> <button *ngIf="!editMode" md-button class="write-review-button" (click)="showEditMode();">
<i class="material-icons edit">&#xE254;</i> <i class="material-icons edit">&#xE254;</i>
<span md-button class="write-review-text"> Write a Review </span> <span md-button class="write-review-text"> Write a Review </span>
</button> </button>
<!-- <ecm-edit-review *ngIf="editMode" [itemDetail]="itemDetail" [userId]="userId" (closePanel)="editMode = false"> </ecm-edit-review> -->
<user-review *ngIf="editMode" [editMode]="'E'" [isDetailPage]="true" (onCancel)="editMode = false"></user-review>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -5,6 +5,7 @@ import { ItemDetail } from '../ecm-model/product-detail-model'; ...@@ -5,6 +5,7 @@ import { ItemDetail } from '../ecm-model/product-detail-model';
import { MdDialog, MdDialogRef, MdDialogConfig, MD_DIALOG_DATA } from '@angular/material'; import { MdDialog, MdDialogRef, MdDialogConfig, MD_DIALOG_DATA } from '@angular/material';
import { FormBuilder, Validators,NgForm } from '@angular/forms'; import { FormBuilder, Validators,NgForm } from '@angular/forms';
import { UserReviewService } from '../user-review/ecm-user-review.service';
@Component( { @Component( {
selector: 'ecm-product-review', selector: 'ecm-product-review',
templateUrl: './ecm-product-review.component.html', templateUrl: './ecm-product-review.component.html',
...@@ -27,6 +28,7 @@ export class EcmProductReviewComponent implements OnChanges { ...@@ -27,6 +28,7 @@ export class EcmProductReviewComponent implements OnChanges {
itemAvgRating; itemAvgRating;
itemCode; itemCode;
userReview: Reviews; userReview: Reviews;
editMode: boolean = false;
sortTypes = [ sortTypes = [
{ value: 'productRating:[5 TO 5]', viewValue: '5 Stars' }, { value: 'productRating:[5 TO 5]', viewValue: '5 Stars' },
...@@ -36,7 +38,7 @@ export class EcmProductReviewComponent implements OnChanges { ...@@ -36,7 +38,7 @@ export class EcmProductReviewComponent implements OnChanges {
{ value: 'productRating:[1 TO 1]', viewValue: '1 Star' } { value: 'productRating:[1 TO 1]', viewValue: '1 Star' }
]; ];
constructor( private productreviewService: EcmProductReviewService, public dialog: MdDialog ) { } constructor( private productreviewService: EcmProductReviewService, private userReviewService:UserReviewService, public dialog: MdDialog ) { }
loadReviews(itemDetail){ loadReviews(itemDetail){
this.itemDetail = itemDetail; this.itemDetail = itemDetail;
...@@ -149,55 +151,25 @@ export class EcmProductReviewComponent implements OnChanges { ...@@ -149,55 +151,25 @@ export class EcmProductReviewComponent implements OnChanges {
this.fetchReviews(); this.fetchReviews();
} }
} showEditMode(){
if(this.checkUser()){
@Component( { this.userReviewService.itemCode = this.itemCode;
selector: 'ecm-write-review-dialog', this.editMode = true;
templateUrl: 'ecm-write-review-dialog.html', }else {
styleUrls: ['./ecm-product-review.component.css'] this.doActivity.emit( { activity: 'SHOW_SIGNIN_PANEL'} );
}) }
export class ECMWriteReviewDialog {
@Input() public detail: ItemDetail;
@Input() public data;
@Output() closePanel = new EventEmitter();
@ViewChild('reviewForm') currentForm: NgForm;
public reviewData: Reviews;
public userReview;
constructor(private productreviewService: EcmProductReviewService)
{
this.reviewData = new Reviews();
} }
public ngOnInit() { checkUser(){
var userInfo = localStorage.getItem( 'userInfo' );
this.detail = this.data.detail; if ( userInfo !== 'undefined' && userInfo !== null && userInfo !== 'null' )
this.reviewData.productRating = 0;
this.reviewData.productRemarks = "";
this.reviewData.productComments = "";
this.userReview = this.data.userReview;
console.log(this.userReview+'User Review');
if(this.userReview)
{ {
this.reviewData.productRating = this.userReview.rating; return userInfo;
this.reviewData.productRemarks = this.userReview.remarks; }
this.reviewData.productComments = this.userReview.comments; else
{
return userInfo;
} }
this.reviewData.item_code = this.detail.itemCode;
this.reviewData.reviewBy = this.data.userId;
}
updateRate(updatedRate) {
console.log('Updated Rate: '+updatedRate);
this.reviewData.productRating = updatedRate;
} }
submitReview() {
this.productreviewService.submitReview(this.reviewData);
this.closePanel.emit();
}
} }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<span class="seller-name">{{itemDetail.itemDetail1?.sellerInfo.name}}</span><br> <span class="seller-name">{{itemDetail.itemDetail1?.sellerInfo.name}}</span><br>
<a class="link-reviews"> <a class="link-reviews">
<span *ngIf="itemDetail.itemRatings.AVG_RATING == 0 && itemDetail.itemRatings.NO_OF_REVIEWS == 0 " class="review-msg-title" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {'firstReview': true} });"> <span *ngIf="itemDetail.itemRatings.AVG_RATING == 0 && itemDetail.itemRatings.NO_OF_REVIEWS == 0 " class="review-msg-title">
Be the first to Review this product Be the first to Review this product
</span> </span>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<rating [rate]="itemDetail.itemRatings.AVG_RATING" [isSmallRatings]=true></rating> <rating [rate]="itemDetail.itemRatings.AVG_RATING" [isSmallRatings]=true></rating>
<span class="ecm-itemAvgRating">{{itemDetail.itemRatings.AVG_RATING}} Ratings</span> <span class="ecm-itemAvgRating">{{itemDetail.itemRatings.AVG_RATING}} Ratings</span>
<span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS != 0" class="ecm-itemNumOfReviews">{{itemDetail.itemRatings.NO_OF_REVIEWS}} Reviews</span> <span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS != 0" class="ecm-itemNumOfReviews">{{itemDetail.itemRatings.NO_OF_REVIEWS}} Reviews</span>
<span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS == 0" class="ecm-itemNumOfReviews" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {'firstReview': true} });">Be the first to Review this product</span> <!-- <span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS == 0" class="ecm-itemNumOfReviews" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {'firstReview': true} });">Be the first to Review this product</span> -->
</span> </span>
</a> </a>
......
...@@ -13,7 +13,6 @@ import { Store } from '@ngrx/store'; ...@@ -13,7 +13,6 @@ import { Store } from '@ngrx/store';
import { AppState } from '../../ecm-store/reducers'; import { AppState } from '../../ecm-store/reducers';
import { EcmRecentViewComponent } from '../../ecm-view/ecm-recent-view/ecm-recent-view.component'; import { EcmRecentViewComponent } from '../../ecm-view/ecm-recent-view/ecm-recent-view.component';
import { ECMWriteReviewDialog } from '../ecm-product-review.component';
@Component( { @Component( {
selector: 'ecm-handicraft', selector: 'ecm-handicraft',
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<span class="seller-name">{{itemDetail.itemDetail1?.sellerInfo.name}}</span><br> <span class="seller-name">{{itemDetail.itemDetail1?.sellerInfo.name}}</span><br>
<a class="link-reviews"> <a class="link-reviews">
<span *ngIf="itemDetail.itemRatings.AVG_RATING == 0 && itemDetail.itemRatings.NO_OF_REVIEWS == 0 " class="review-msg-title" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {'firstReview': true} });"> <span *ngIf="itemDetail.itemRatings.AVG_RATING == 0 && itemDetail.itemRatings.NO_OF_REVIEWS == 0 " class="review-msg-title">
Be the first to Review this product Be the first to Review this product
</span> </span>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<rating [rate]="itemDetail.itemRatings.AVG_RATING" [isSmallRatings]=true></rating> <rating [rate]="itemDetail.itemRatings.AVG_RATING" [isSmallRatings]=true></rating>
<span class="ecm-itemAvgRating">{{itemDetail.itemRatings.AVG_RATING}} Ratings</span> <span class="ecm-itemAvgRating">{{itemDetail.itemRatings.AVG_RATING}} Ratings</span>
<span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS != 0" class="ecm-itemNumOfReviews">{{itemDetail.itemRatings.NO_OF_REVIEWS}} Reviews</span> <span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS != 0" class="ecm-itemNumOfReviews">{{itemDetail.itemRatings.NO_OF_REVIEWS}} Reviews</span>
<span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS == 0" class="ecm-itemNumOfReviews" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {'firstReview': true} });">Review this product</span> <!-- <span *ngIf="itemDetail.itemRatings.NO_OF_REVIEWS == 0" class="ecm-itemNumOfReviews" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {'firstReview': true} });">Review this product</span> -->
</span> </span>
</a> </a>
......
...@@ -118,6 +118,9 @@ export class EcmUserOptionComponent implements OnInit { ...@@ -118,6 +118,9 @@ export class EcmUserOptionComponent implements OnInit {
} }
else if ( result.Response.status == 'error' ) { else if ( result.Response.status == 'error' ) {
this.userData = null; this.userData = null;
this.store.dispatch(this.cartAction.resetCart());
this.store.dispatch(this.cartAction.loadCartItems());
} }
let openRoutePath = this.route.snapshot.url[0].path; let openRoutePath = this.route.snapshot.url[0].path;
...@@ -131,7 +134,7 @@ export class EcmUserOptionComponent implements OnInit { ...@@ -131,7 +134,7 @@ export class EcmUserOptionComponent implements OnInit {
console.log( 'comp errorMessage[' + errorMessage + ']' ); console.log( 'comp errorMessage[' + errorMessage + ']' );
} }
); );
this.store.dispatch(this.cartAction.loadCartItems());
} }
updateLocation() { updateLocation() {
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
<ecm-cart *ngSwitchCase="'CART_OPT'" [isMiniCart] = 'true' (closePanel)="dialogRef.close();" ></ecm-cart> <ecm-cart *ngSwitchCase="'CART_OPT'" [isMiniCart] = 'true' (closePanel)="dialogRef.close();" ></ecm-cart>
<ecm-user-option *ngSwitchCase="'USER_OPT'" (closePanel)="dialogRef.close();" (updateProfileImages) = "updateProfileImages();" ></ecm-user-option> <ecm-user-option *ngSwitchCase="'USER_OPT'" (closePanel)="dialogRef.close();" (updateProfileImages) = "updateProfileImages();" ></ecm-user-option>
<ecm-nav-menu *ngSwitchCase="'MENU_OPT'" (closePanel)="dialogRef.close();"> </ecm-nav-menu> <ecm-nav-menu *ngSwitchCase="'MENU_OPT'" (closePanel)="dialogRef.close();"> </ecm-nav-menu>
<ecm-write-review-dialog *ngSwitchCase="'WRITE_REVIEW_OPT'" [data]="dialogData.data" (closePanel)="dialogRef.close();"> </ecm-write-review-dialog>
<div *ngSwitchCase="'SEARCH_OPT'"> <div *ngSwitchCase="'SEARCH_OPT'">
<span style="float:left;"> <span style="float:left;">
......
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