Commit 9fe11179 authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174232 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4a201cb8
......@@ -360,7 +360,7 @@ p {
/* padding: 8px; */
/* padding: 8px; */
right: 25px;
top: 15px;
top: 25px;
/* height: 40px; */
/* width: 40px; */
cursor: pointer;
......@@ -379,7 +379,7 @@ p {
.close-icon{
color: inherit;
font-size: 22px;
/* font-size: 22px; */
position: relative;
box-shadow: 0px 0px 3px 1px lightgrey;
border-radius: 100%;
......
......@@ -67,7 +67,7 @@
</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="close-icon" (click)="removeFromWishlist.emit()">close</md-icon>
</div>
......
......@@ -26,7 +26,6 @@ import { Item } from '../ecm-model/product-model';
import { ECMHeaderComponent } from '../ecm-header/ecm-header.component';
import { Reviews } from '../ecm-model/product-review.model';
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 { Breadcrumbs } from '../ecm-breadcrumbs/ecm-breadcrumbs.component';
......@@ -166,35 +165,8 @@ export class EcmProductDetailsComponent implements OnInit {
}
this.router.navigate(['/checkout']);
}
else if( activity == 'WRITE_REVIEW') {
if(this.checkUser() !== 'undefined' && this.checkUser() !== null && this.checkUser() !== 'null')
{
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();
}
else if(activity == 'SHOW_SIGNIN_PANEL'){
this.showSignInPanel();
}
}
......
......@@ -167,7 +167,7 @@
}
.ecm-write-review {
position: absolute;
/* position: absolute; */
/*bottom: 0;*/
right: 0;
}
......@@ -200,7 +200,7 @@
vertical-align: middle;
height: 50px;
width: 190px;
max-width: 190px;
/* max-width: 190px; */
text-align: center;
line-height: 50px;
color: mediumvioletred;
......@@ -209,6 +209,7 @@
box-shadow: 0 0px 5px 1px rgba(0,0,0,.1);
line-height: 15px;
font-size: 15px;
right: calc(50% - 95px);
}
.ecm-review-card {
......@@ -265,6 +266,7 @@ hr {
margin-left: 25%;
margin-right: 25%;
float: inherit;
right: inherit;
}
.ecm-write-review {
......
......@@ -8,23 +8,28 @@
<div class="ratings-section">
<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="star-rating-block">
<rating [rate]="itemAvgRating"></rating>
<rating [rate]="itemAvgRating" [isSmallRatings]="true"></rating>
</span>
<span class="ecm-total-ratings" *ngIf="itemAvgRating"> {{itemAvgRating}} Ratings </span>
<span class="ecm-total-ratings" *ngIf="!itemAvgRating"> 0 Ratings </span>
</div>
<div *ngIf="itemDetail" class="large-6 columns">
<div *ngIf="itemDetail" class="large-5 columns">
<rating [ratingDetail]="itemDetail.itemRatings" (filterBy)="filter($event);"></rating>
</div>
<div class="large-3 columns ecm-write-review">
<button md-button class="write-review-button" (click)="doActivity.emit({activity:'WRITE_REVIEW', data: {} });">
<div class="large-5 columns ecm-write-review">
<button *ngIf="!editMode" md-button class="write-review-button" (click)="showEditMode();">
<i class="material-icons edit">&#xE254;</i>
<span md-button class="write-review-text"> Write a Review </span>
</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>
......
......@@ -5,6 +5,7 @@ import { ItemDetail } from '../ecm-model/product-detail-model';
import { MdDialog, MdDialogRef, MdDialogConfig, MD_DIALOG_DATA } from '@angular/material';
import { FormBuilder, Validators,NgForm } from '@angular/forms';
import { UserReviewService } from '../user-review/ecm-user-review.service';
@Component( {
selector: 'ecm-product-review',
templateUrl: './ecm-product-review.component.html',
......@@ -27,6 +28,7 @@ export class EcmProductReviewComponent implements OnChanges {
itemAvgRating;
itemCode;
userReview: Reviews;
editMode: boolean = false;
sortTypes = [
{ value: 'productRating:[5 TO 5]', viewValue: '5 Stars' },
......@@ -36,7 +38,7 @@ export class EcmProductReviewComponent implements OnChanges {
{ 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){
this.itemDetail = itemDetail;
......@@ -149,55 +151,25 @@ export class EcmProductReviewComponent implements OnChanges {
this.fetchReviews();
}
}
@Component( {
selector: 'ecm-write-review-dialog',
templateUrl: 'ecm-write-review-dialog.html',
styleUrls: ['./ecm-product-review.component.css']
})
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();
showEditMode(){
if(this.checkUser()){
this.userReviewService.itemCode = this.itemCode;
this.editMode = true;
}else {
this.doActivity.emit( { activity: 'SHOW_SIGNIN_PANEL'} );
}
}
public ngOnInit() {
this.detail = this.data.detail;
this.reviewData.productRating = 0;
this.reviewData.productRemarks = "";
this.reviewData.productComments = "";
this.userReview = this.data.userReview;
console.log(this.userReview+'User Review');
if(this.userReview)
checkUser(){
var userInfo = localStorage.getItem( 'userInfo' );
if ( userInfo !== 'undefined' && userInfo !== null && userInfo !== 'null' )
{
this.reviewData.productRating = this.userReview.rating;
this.reviewData.productRemarks = this.userReview.remarks;
this.reviewData.productComments = this.userReview.comments;
return userInfo;
}
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 @@
<span class="seller-name">{{itemDetail.itemDetail1?.sellerInfo.name}}</span><br>
<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
</span>
......@@ -43,7 +43,7 @@
<rating [rate]="itemDetail.itemRatings.AVG_RATING" [isSmallRatings]=true></rating>
<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" (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>
</a>
......
......@@ -13,7 +13,6 @@ import { Store } from '@ngrx/store';
import { AppState } from '../../ecm-store/reducers';
import { EcmRecentViewComponent } from '../../ecm-view/ecm-recent-view/ecm-recent-view.component';
import { ECMWriteReviewDialog } from '../ecm-product-review.component';
@Component( {
selector: 'ecm-handicraft',
......
......@@ -35,7 +35,7 @@
<span class="seller-name">{{itemDetail.itemDetail1?.sellerInfo.name}}</span><br>
<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
</span>
......@@ -43,7 +43,7 @@
<rating [rate]="itemDetail.itemRatings.AVG_RATING" [isSmallRatings]=true></rating>
<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" (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>
</a>
......
......@@ -118,6 +118,9 @@ export class EcmUserOptionComponent implements OnInit {
}
else if ( result.Response.status == 'error' ) {
this.userData = null;
this.store.dispatch(this.cartAction.resetCart());
this.store.dispatch(this.cartAction.loadCartItems());
}
let openRoutePath = this.route.snapshot.url[0].path;
......@@ -131,7 +134,7 @@ export class EcmUserOptionComponent implements OnInit {
console.log( 'comp errorMessage[' + errorMessage + ']' );
}
);
this.store.dispatch(this.cartAction.loadCartItems());
}
updateLocation() {
......
......@@ -20,7 +20,6 @@
<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-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'">
<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