From 61debf8a1dc3939e2e1f9c2b360edf84728cb0fd Mon Sep 17 00:00:00 2001 From: Gopal B Shiimpi Date: Thu, 28 Jun 2018 14:25:57 +0530 Subject: [PATCH 01/72] Added payment integration & other fixes (#179) Why? Feature PayUBiz payment gateway integration(hosted page). Bug Fixes for address form( state_id & country_id). Removed static values for state & country ids. Order success page was throwing error, So unable to display order details. This change addresses the need by: Now user will able to process credit and debit card payments & many more using payubiz payment gatewayPayUbiz. Now user can select dynamic address with respect to state & country id. [delivers #158423568, #158522773, #158592706] --- package.json | 2 + .../add-address/add-address.component.html | 14 +++-- .../add-address/add-address.component.ts | 2 + .../address/services/address.service.ts | 2 - .../order-success.component.html | 2 +- .../order-success/order-success.component.ts | 4 +- .../cash-on-delivery.component.ts | 2 +- .../credit-card/credit-card.component.html | 20 +++++-- .../credit-card/credit-card.component.scss | 49 +++++++++++++++++ .../credit-card/credit-card.component.ts | 17 ++++-- .../payment-modes-list.component.html | 10 ++-- .../payment-modes-list.component.ts | 54 ++++++++++++++++++- .../checkout/payment/payment.component.html | 15 +++--- src/app/checkout/payment/payment.module.ts | 4 +- .../payment/services/payment.service.ts | 1 + src/app/core/services/checkout.service.ts | 46 ++++++++++------ .../product-details.component.ts | 10 ++-- .../order-detail/order-detail.component.ts | 3 +- src/app/user/services/user.service.ts | 8 ++- src/config/custom.example/custom.example.ts | 5 +- src/config/default/default.ts | 4 ++ yarn.lock | 8 +++ 22 files changed, 222 insertions(+), 60 deletions(-) diff --git a/package.json b/package.json index b2ff85b8..8f6429fe 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,10 @@ "@ngx-lite/input-star-rating": "^0.1.5", "@ngx-progressbar/core": "^5.0.1", "@ngx-progressbar/http": "^5.0.1", + "@types/crypto-js": "^3.1.40", "bootstrap": "^4.1.1", "core-js": "^2.5.7", + "crypto-js": "^3.1.9-1", "font-awesome": "^4.7.0", "immutable": "^3.8.2", "ng2-ui-auth": "^9.0.0-beta.2", diff --git a/src/app/checkout/address/add-address/add-address.component.html b/src/app/checkout/address/add-address/add-address.component.html index 2f7f653a..d55d3dff 100644 --- a/src/app/checkout/address/add-address/add-address.component.html +++ b/src/app/checkout/address/add-address/add-address.component.html @@ -3,39 +3,37 @@ - +

This is a mandatory field

-
- +

This is a mandatory field

- +

This is a mandatory field

- +

This is a mandatory field

@@ -43,14 +41,14 @@ - +

This is a mandatory field

- +

This is a mandatory field

diff --git a/src/app/checkout/address/add-address/add-address.component.ts b/src/app/checkout/address/add-address/add-address.component.ts index d0b67387..e0f2b113 100644 --- a/src/app/checkout/address/add-address/add-address.component.ts +++ b/src/app/checkout/address/add-address/add-address.component.ts @@ -44,9 +44,11 @@ export class AddAddressComponent implements OnInit, OnDestroy { for (const state of this.states) { if (state.name === address.state_name) { address['state_id'] = state.id; + address['country_id'] = state.country_id break; } } + if (this.isAuthenticated) { addressAttributes = this.addrService.createAddresAttributes(address); } else { diff --git a/src/app/checkout/address/services/address.service.ts b/src/app/checkout/address/services/address.service.ts index d335b270..43b8ec05 100644 --- a/src/app/checkout/address/services/address.service.ts +++ b/src/app/checkout/address/services/address.service.ts @@ -19,8 +19,6 @@ export class AddressService { 'city': ['', Validators.required], 'phone': ['', Validators.required], 'zipcode': ['', Validators.required], - 'state_id': ['', Validators.required], - 'country_id': ['', Validators.required], 'state_name': ['', Validators.required] }); } diff --git a/src/app/checkout/order-success/order-success.component.html b/src/app/checkout/order-success/order-success.component.html index 7bb976fd..78b12f1b 100644 --- a/src/app/checkout/order-success/order-success.component.html +++ b/src/app/checkout/order-success/order-success.component.html @@ -82,4 +82,4 @@

Shipping

- + \ No newline at end of file diff --git a/src/app/checkout/order-success/order-success.component.ts b/src/app/checkout/order-success/order-success.component.ts index c31271c9..4d9471f4 100644 --- a/src/app/checkout/order-success/order-success.component.ts +++ b/src/app/checkout/order-success/order-success.component.ts @@ -1,5 +1,4 @@ import { LineItem } from './../../core/models/line_item'; -import { environment } from './../../../environments/environment'; import { CheckoutActions } from './../actions/checkout.actions'; import { Store } from '@ngrx/store'; import { AppState } from './../../interfaces'; @@ -39,13 +38,12 @@ export class OrderSuccessComponent implements OnInit { .getOrderDetail(this.queryParams.orderReferance) .subscribe(order => { this.orderDetails = order - console.log(this.orderDetails) }) } getProductImageUrl(line_item: LineItem) { const image_url = line_item.variant.images[0].small_url; - return environment.apiEndpoint + image_url; + return image_url; } } diff --git a/src/app/checkout/payment/payment-modes-list/cash-on-delivery/cash-on-delivery.component.ts b/src/app/checkout/payment/payment-modes-list/cash-on-delivery/cash-on-delivery.component.ts index 2ca4d263..2e3c23e7 100644 --- a/src/app/checkout/payment/payment-modes-list/cash-on-delivery/cash-on-delivery.component.ts +++ b/src/app/checkout/payment/payment-modes-list/cash-on-delivery/cash-on-delivery.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { Component, OnInit, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'app-cash-on-delivery', diff --git a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.html b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.html index b0c68262..55da26ed 100644 --- a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.html +++ b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.html @@ -1,3 +1,17 @@ -

- credit-card works! -

\ No newline at end of file +
+
+ + Card Payment Using PayUbiz + + + We will Not save your card details. + +
+
+ NOTE: After clicking pay button you will be redirected to payUbiz +
+
+ +
+ +
\ No newline at end of file diff --git a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss index e69de29b..50eea55b 100644 --- a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss +++ b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss @@ -0,0 +1,49 @@ +@import '../../../../shared/scss/selected_theme_variables'; +.cod-block { + .section-help { + padding: 23px 0px 36px!important; + text-transform: uppercase; + width: 100%!important; + border-bottom: 1px solid #f5f5f6!important; + height: 66px; + .lbl { + color: #535766; + font-size: 16px; + display: block; + font-weight: 600; + font-family: $primary-font;; + } + .sub-lbl { + display: block; + font-size: 12px; + color: #696e79; + text-transform: none; + } + } + .cod-info { + padding: 10px 10px 10px 0; + font-weight: 600; + color: #29303f; + font-size: 14px; + margin-bottom: 20px; + margin-top: 20px; + font-family: $primary-font;; + } +} + +.pay-btn-wrap { + .pay-btn { + font-size: 14px; + font-weight: 600; + font-family: $primary-font;; + height: 48px; + background: #0bc6a0; + width: 100%; + margin-top: 15px; + border: none; + border-radius: 4px; + box-shadow: none; + width: 100%; + color: #fff; + } +} \ No newline at end of file diff --git a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.ts b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.ts index 63e969b1..150f6ded 100644 --- a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.ts +++ b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.ts @@ -1,4 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Output, EventEmitter } from '@angular/core'; +import { CheckoutService } from '../../../../core/services/checkout.service'; +import { CheckoutActions } from '../../../actions/checkout.actions'; +import { AppState } from '../../../../interfaces'; +import { Store } from '@ngrx/store'; @Component({ selector: 'app-credit-card', @@ -7,9 +11,16 @@ import { Component, OnInit, Input } from '@angular/core'; }) export class CreditCardComponent implements OnInit { - constructor() { } + constructor(private checkoutService: CheckoutService, + private checkoutActions: CheckoutActions, + private store: Store + ) { } + + @Output() onPayNow: EventEmitter = new EventEmitter(); ngOnInit() { } - + payNow() { + this.onPayNow.emit(true); + } } diff --git a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.html b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.html index 6efe5b48..14fea3b3 100644 --- a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.html +++ b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.html @@ -1,14 +1,14 @@
-
+
{{mode.name}}
- - - -
+ + + +
\ No newline at end of file diff --git a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts index 47776ea2..e8df3333 100644 --- a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts +++ b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts @@ -9,6 +9,9 @@ import { PaymentMode } from './../../../core/models/payment_mode'; import { PaymentService } from './../services/payment.service'; import { CheckoutService } from './../../../core/services/checkout.service'; import { Component, OnInit, Input } from '@angular/core'; +import { environment } from '../../../../environments/environment'; +import * as CryptoJS from 'crypto-js'; +import { Address } from '../../../core/models/address'; @Component({ selector: 'app-payment-modes-list', @@ -19,6 +22,8 @@ export class PaymentModesListComponent implements OnInit { @Input() paymentAmount: number; @Input() orderNumber: number; + @Input() address: Address; + paymentModes: PaymentMode[]; selectedMode: PaymentMode = new PaymentMode; isAuthenticated: boolean; @@ -62,6 +67,54 @@ export class PaymentModesListComponent implements OnInit { .subscribe(); } + makePaymentPayubiz() { + const paymentModeId = this.selectedMode.id; + const payUbizSalt = environment.config.payuBizSalt; + const payUbizKey = environment.config.payuBizKey; + const successUrl = `${environment.apiEndpoint}auth/handle_payment`; + const failureUrl = `${environment.apiEndpoint}auth/canceled_payment`; + + const hashParams = { + key: payUbizKey, + txnid: `${this.orderNumber}`, + amount: this.paymentAmount, + productinfo: `${environment.appName}-Product`, + firstname: this.address.firstname, + email: JSON.parse(localStorage.getItem('user')).email, + } + + const paramsList = `${hashParams.key}|${hashParams.txnid}|${hashParams.amount}|${hashParams.productinfo}|${hashParams.firstname}|${hashParams.email}|||||||||||${payUbizSalt}`; + const encryptedHash = CryptoJS.SHA512(paramsList); + const hashString = CryptoJS.enc.Hex.stringify(encryptedHash) + + const paramsToPost = { + key: hashParams.key, + txnid: hashParams.txnid, + amount: hashParams.amount, + productinfo: hashParams.productinfo, + firstname: hashParams.firstname, + email: hashParams.email, + phone: this.address.phone, + surl: successUrl, + furl: failureUrl, + hash: hashString + } + + this.checkoutService.makePayment(paramsToPost) + .subscribe(response => { + response = response + this.checkoutService.createNewPayment(paymentModeId, this.paymentAmount).pipe( + tap(() => { + this.store.dispatch(this.checkoutActions.orderCompleteSuccess()); + this.checkoutService.createEmptyOrder() + .subscribe(); + }) + ) + .subscribe(res => { + window.open(response.url, "_self"); + }); + }) + } private redirectToNewPage() { if (this.isAuthenticated) { this.router.navigate(['checkout', 'order-success'], @@ -70,5 +123,4 @@ export class PaymentModesListComponent implements OnInit { this.router.navigate(['/']); } } - } diff --git a/src/app/checkout/payment/payment.component.html b/src/app/checkout/payment/payment.component.html index 4db1643f..38e9c2e1 100644 --- a/src/app/checkout/payment/payment.component.html +++ b/src/app/checkout/payment/payment.component.html @@ -8,7 +8,7 @@
- +
@@ -28,14 +28,13 @@ Total Payable ${{totalCartValue$ | async | number:'1.2-2'}}
-
+
DELIVER TO
-
{{(address$ | async).full_name}}
-
{{(address$ | async).address1}}
-
{{(address$ | async).address2}}
-
{{(address$ | async).city}} - {{(address$ | async).zipcode}}
- -
Mobile: {{(address$ | async).phone}}
+
{{address.full_name}}
+
{{address.address1}}
+
{{address.address2}}
+
{{address.city}} - {{address.zipcode}}
+
Mobile: {{address.phone}}
\ No newline at end of file diff --git a/src/app/checkout/payment/payment.module.ts b/src/app/checkout/payment/payment.module.ts index 7580dcca..909b8cc8 100644 --- a/src/app/checkout/payment/payment.module.ts +++ b/src/app/checkout/payment/payment.module.ts @@ -9,6 +9,7 @@ import { PaymentModeComponent } from './payment-modes-list/payment-mode/payment- import { CreditCardComponent } from './payment-modes-list/credit-card/credit-card.component'; import { NetBankingComponent } from './payment-modes-list/net-banking/net-banking.component'; import { CashOnDeliveryComponent } from './payment-modes-list/cash-on-delivery/cash-on-delivery.component'; +import { TabsModule } from 'ngx-bootstrap/tabs'; @NgModule({ declarations: [ @@ -24,7 +25,8 @@ import { CashOnDeliveryComponent } from './payment-modes-list/cash-on-delivery/c RouterModule, CommonModule, FormsModule, - ReactiveFormsModule + ReactiveFormsModule, + TabsModule.forRoot() ], providers: [ PaymentService diff --git a/src/app/checkout/payment/services/payment.service.ts b/src/app/checkout/payment/services/payment.service.ts index 7b47b51b..67249ddf 100644 --- a/src/app/checkout/payment/services/payment.service.ts +++ b/src/app/checkout/payment/services/payment.service.ts @@ -9,6 +9,7 @@ export class PaymentService { if (mode.name === 'Check') { selectedMode = mode; } + }); return selectedMode; } diff --git a/src/app/core/services/checkout.service.ts b/src/app/core/services/checkout.service.ts index a39727aa..f1e766cd 100644 --- a/src/app/core/services/checkout.service.ts +++ b/src/app/core/services/checkout.service.ts @@ -1,5 +1,5 @@ import { map, tap } from 'rxjs/operators'; -import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { getOrderNumber } from './../../checkout/reducers/selectors'; import { CheckoutActions } from './../../checkout/actions/checkout.actions'; import { Injectable } from '@angular/core'; @@ -25,10 +25,8 @@ export class CheckoutService { private http: HttpClient, private actions: CheckoutActions, private store: Store, - private toastyService: ToastrService - ) { - this.store - .select(getOrderNumber) + private toastyService: ToastrService) { + this.store.select(getOrderNumber) .subscribe(number => (this.orderNumber = number)); } @@ -42,11 +40,9 @@ export class CheckoutService { */ createNewLineItem(variant_id: number, quantity: number) { const params = { - line_item: { variant_id: variant_id, quantity: quantity } - }, - url = `api/v1/orders/${ - this.orderNumber - }/line_items?order_token=${this.getOrderToken()}`; + line_item: { variant_id: variant_id, quantity: quantity } + }, + url = `api/v1/orders/${this.orderNumber}/line_items?order_token=${this.getOrderToken()}`; return this.http.post(url, params).pipe( tap( @@ -133,7 +129,7 @@ export class CheckoutService { deleteLineItem(lineItem: LineItem) { const url = `api/v1/orders/${this.orderNumber}/line_items/${ lineItem.id - }?order_token=${this.getOrderToken()}`; + }?order_token=${this.getOrderToken()}`; return this.http .delete(url) .pipe( @@ -153,7 +149,7 @@ export class CheckoutService { changeOrderState() { const url = `api/v1/checkouts/${ this.orderNumber - }/next.json?order_token=${this.getOrderToken()}`; + }/next.json?order_token=${this.getOrderToken()}`; return this.http .put(url, {}) .pipe( @@ -174,7 +170,7 @@ export class CheckoutService { updateOrder(params: any) { const url = `api/v1/checkouts/${ this.orderNumber - }.json?order_token=${this.getOrderToken()}`; + }.json?order_token=${this.getOrderToken()}`; return this.http .put(url, params) .pipe( @@ -194,7 +190,7 @@ export class CheckoutService { availablePaymentMethods() { const url = `api/v1/orders/${ this.orderNumber - }/payments/new?order_token=${this.getOrderToken()}`; + }/payments/new?order_token=${this.getOrderToken()}`; return this.http.get(url); } @@ -210,7 +206,7 @@ export class CheckoutService { return this.http .post( `api/v1/orders/${ - this.orderNumber + this.orderNumber }/payments?order_token=${this.getOrderToken()}`, { payment: { @@ -222,6 +218,26 @@ export class CheckoutService { .pipe(map(_ => this.changeOrderState().subscribe())); } + makePayment(params: any) { + const header = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded') + let body = new HttpParams(); + body = body.set('key', params.key); + body = body.set('txnid', params.txnid); + body = body.set('amount', params.amount); + body = body.set('productinfo', params.productinfo) + body = body.set('firstname', params.firstname) + body = body.set('email', params.email) + body = body.set('phone', params.phone) + body = body.set('surl', params.surl) + body = body.set('furl', params.furl) + body = body.set('hash', params.hash) + + return this.http.post(`https://test.payu.in/_payment`, + body, { headers: header, responseType: 'text', observe: 'response' } + ).pipe(map(resp => { + return resp; + }), error => { return error }) + } /** * * diff --git a/src/app/product/components/product-detail-page/product-details/product-details.component.ts b/src/app/product/components/product-detail-page/product-details/product-details.component.ts index 7024fc0c..72335e60 100644 --- a/src/app/product/components/product-detail-page/product-details/product-details.component.ts +++ b/src/app/product/components/product-detail-page/product-details/product-details.component.ts @@ -22,7 +22,7 @@ import { import { Product } from './../../../../core/models/product'; import { VariantParserService } from './../../../../core/services/variant-parser.service'; import { ProductService } from './../../../../core/services/product.service'; -import { forEach } from '@angular/router/src/utils/collection'; +import { CheckoutService } from '../../../../core/services/checkout.service'; @Component({ selector: 'app-product-details', @@ -30,9 +30,8 @@ import { forEach } from '@angular/router/src/utils/collection'; styleUrls: ['./product-details.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) -export class ProductDetailsComponent implements OnInit, OnChanges { +export class ProductDetailsComponent implements OnInit { @Input() product: Product; - dynamic = 50; customOptionTypesHash: any; currentSelectedOptions = {}; @@ -53,6 +52,7 @@ export class ProductDetailsComponent implements OnInit, OnChanges { similarProducts$: Observable; relatedProducts$: Observable; reviewProducts$: Observable; + constructor( private variantParser: VariantParserService, private variantRetriver: VariantRetriverService, @@ -79,11 +79,11 @@ export class ProductDetailsComponent implements OnInit, OnChanges { this.correspondingOptions = this.mainOptions; this.productID = this.product.id; - this.productService - .getRelatedProducts(this.productID) + this.productService.getRelatedProducts(this.productID) .subscribe(productdata => { this.productdata = productdata; }); + if (this.product.taxon_ids[0]) { this.store.dispatch( this.searchActions.getProductsByTaxon(`id=${this.product.taxon_ids[0]}`) diff --git a/src/app/user/components/orders/order-detail/order-detail.component.ts b/src/app/user/components/orders/order-detail/order-detail.component.ts index f2e176fe..8386c89f 100644 --- a/src/app/user/components/orders/order-detail/order-detail.component.ts +++ b/src/app/user/components/orders/order-detail/order-detail.component.ts @@ -39,8 +39,7 @@ export class OrderDetailComponent implements OnInit, OnDestroy { } getProductImageUrl(line_item: LineItem) { - const image_url = line_item.variant.images[0].small_url; - return environment.apiEndpoint + image_url; + return line_item.variant.images[0].small_url; } ngOnDestroy() { diff --git a/src/app/user/services/user.service.ts b/src/app/user/services/user.service.ts index 85fb0cc3..fe22c25c 100644 --- a/src/app/user/services/user.service.ts +++ b/src/app/user/services/user.service.ts @@ -7,6 +7,7 @@ import { Order } from '../../core/models/order'; import { Response } from '@angular/http'; import { User } from '../../core/models/user'; import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; @Injectable() export class UserService { @@ -24,7 +25,12 @@ export class UserService { * * @memberof UserService */ - getOrders(): Observable> { return this.http.get>('api/orders') } + getOrders(): Observable> { + return this.http.get<{ orders: Array }>('api/orders?per_page=2') + .pipe( + map(data => data.orders) + ) + } /** * diff --git a/src/config/custom.example/custom.example.ts b/src/config/custom.example/custom.example.ts index 178bd3e8..ba0845a2 100644 --- a/src/config/custom.example/custom.example.ts +++ b/src/config/custom.example/custom.example.ts @@ -12,5 +12,8 @@ export const CUSTOM_EXAMPLE_CONFIG = { }, searchPlaceholder: 'Search', showGithubRibon: false, - } + }, + //Following are the test crediantials for payubiz payment gateway. + payuBizSalt: 'eCwWELxi', + payuBizKey: 'gtKFFx', }; diff --git a/src/config/default/default.ts b/src/config/default/default.ts index 8da1af0e..2d5452f7 100644 --- a/src/config/default/default.ts +++ b/src/config/default/default.ts @@ -16,5 +16,9 @@ export const DEFAULT_CONFIG = { searchPlaceholder: 'Find good furniture for me', showGithubRibon: false }, + //Following are the test crediantials for payubiz payment gateway. + payuBizSalt: 'eCwWELxi', + payuBizKey: 'gtKFFx', + ...DEFAULT_APP_DATA }; diff --git a/yarn.lock b/yarn.lock index 6113000e..19709c58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -349,6 +349,10 @@ semver "^5.3.0" semver-intersect "^1.1.2" +"@types/crypto-js@^3.1.40": + version "3.1.40" + resolved "https://registry.yarnpkg.com/@types/crypto-js/-/crypto-js-3.1.40.tgz#4ce5f484af057b3013798bc28cd0516deba950d1" + "@types/fs-extra@^5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.2.tgz#235a7e2b56452cc0a6a4809b53e1d1eaffff9c96" @@ -1765,6 +1769,10 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" +crypto-js@^3.1.9-1: + version "3.1.9-1" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.1.9-1.tgz#fda19e761fc077e01ffbfdc6e9fdfc59e8806cd8" + crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" From 4f9d0f65247fe0d3c4a1c9ffdced87fadd835d6d Mon Sep 17 00:00:00 2001 From: Gopal B Shiimpi Date: Sat, 30 Jun 2018 16:07:00 +0530 Subject: [PATCH 02/72] Search page fiexs. (#184) Why? Bug: Category wise brands now displayed. This change addresses the need by: Now we can get category-wise brands. [delivers #158687916] --- src/app/core/services/product.service.ts | 2 +- .../content-header/content-header.component.html | 3 +-- .../content-header/content-header.component.ts | 2 +- src/app/home/home.component.html | 8 ++++---- src/app/home/home.component.ts | 15 ++++++++------- src/app/home/reducers/search.actions.ts | 14 ++++++++++++++ src/app/home/reducers/search.reducers.ts | 6 ++++++ src/app/home/reducers/search.state.ts | 4 +++- src/app/home/reducers/selectors.ts | 5 +++++ .../brand-filter/brand-filter.component.html | 16 ++++++++-------- .../brand-filter/brand-filter.component.ts | 1 + .../sidebar/categories/categories.component.html | 12 ++++++------ .../sidebar/categories/categories.component.ts | 9 ++++----- 13 files changed, 62 insertions(+), 35 deletions(-) diff --git a/src/app/core/services/product.service.ts b/src/app/core/services/product.service.ts index 52e540dc..a8d85c44 100644 --- a/src/app/core/services/product.service.ts +++ b/src/app/core/services/product.service.ts @@ -152,7 +152,7 @@ export class ProductService { tap( _ => _, _ => - this.toastrService.error('something went wrong (reviws)', 'ERROR!!') + this.toastrService.error('something went wrong (reviews)', 'ERROR!!') ) ); } diff --git a/src/app/home/content/content-header/content-header.component.html b/src/app/home/content/content-header/content-header.component.html index b8811755..06bad27a 100644 --- a/src/app/home/content/content-header/content-header.component.html +++ b/src/app/home/content/content-header/content-header.component.html @@ -10,7 +10,7 @@

Showing {{productsCount}} of {{productsTotal_count
-
diff --git a/src/app/home/content/content-header/content-header.component.ts b/src/app/home/content/content-header/content-header.component.ts index d66febfa..f70fc64c 100644 --- a/src/app/home/content/content-header/content-header.component.ts +++ b/src/app/home/content/content-header/content-header.component.ts @@ -27,7 +27,7 @@ export class ContentHeaderComponent implements OnInit { queryMap = { Newest: 'updated_at+asc', Relevance: '', - 'A To Z': 'ascend_by_master_price', + 'A To Z': 'name+asc', 'Z To A': 'name+desc', } diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 7a4cc369..28dbb8b3 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -1,16 +1,16 @@
-
+
- +
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 27774501..ead3f3f6 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -6,7 +6,8 @@ import { getChildTaxons, categeoryLevel, taxonomiByName, - getPaginationData + getPaginationData, + searchFilterStatus } from './reducers/selectors'; import { ProductActions } from './../product/actions/product-actions'; import { AppState } from './../interfaces'; @@ -31,7 +32,7 @@ export class HomeComponent implements OnInit { categoryLevel$: Observable; products$: Observable; pagination$: Observable; - isFilterOn = false; + isFilterOn$: Observable; isBrandOpen = false; isCategoryOpen = true; screenwidth; @@ -41,15 +42,15 @@ export class HomeComponent implements OnInit { private actions: ProductActions, private searchActions: SearchActions, private productService: ProductService) { - // Get all products for the product list component this.store.dispatch(this.actions.getAllProducts(1)); this.store.dispatch(this.actions.getAllTaxonomies()); - // this.products$ = this.store.select(getProducts); this.taxonomies$ = this.store.select(getTaxonomies); this.brands$ = this.store.select(getTaxonomies); this.selectedTaxonIds$ = this.store.select(getSelectedTaxonIds); this.products$ = this.store.select(getProductsByKeyword); this.pagination$ = this.store.select(getPaginationData); + this.isFilterOn$ = this.store.select(searchFilterStatus) + } // tslint:disable-next-line:member-ordering @@ -79,16 +80,16 @@ export class HomeComponent implements OnInit { OnCategeorySelected(category) { // TODO: Here taxonomies_id is hardcoded for now. - this.store.dispatch(this.searchActions.getChildTaxons('5', category.id)); + this.store.dispatch(this.searchActions.getChildTaxons('1', category.id)); this.taxonomies$ = this.store.select(getChildTaxons) this.categoryLevel$ = this.store.select(categeoryLevel) // ToDo: Here Brands are hardcoded For now. this.store.dispatch(this.searchActions.getTaxonomiesByName('Brands', category.name)); this.brands$ = this.store.select(taxonomiByName) - this.isFilterOn = true + this.store.dispatch(this.searchActions.setSearchFilterOn()) } showAll() { - this.isFilterOn = false + this.store.dispatch(this.searchActions.setSearchFilterOff()) } isOpenChangeaccourdian() { diff --git a/src/app/home/reducers/search.actions.ts b/src/app/home/reducers/search.actions.ts index 98f1d597..a910a9ae 100644 --- a/src/app/home/reducers/search.actions.ts +++ b/src/app/home/reducers/search.actions.ts @@ -13,6 +13,8 @@ export class SearchActions { static CLEAR_SELECTED_CATAGEORY = 'CLEAR_SELECTED_CATAGEORY' static GET_TAXONOMIES_BY_NAME = 'GET_TAXONOMIES_BY_NAME' static GET_TAXONOMIES_BY_NAME_SUCCESS = 'GET_TAXONOMIES_BY_NAME_SUCCESS' + static SET_SEARCH_FILTER_ON = 'SET_SEARCH_FILTER_ON' + static SET_SEARCH_FILTER_OFF = 'SET_SEARCH_FILTER_OFF' category: any; /** @@ -106,4 +108,16 @@ export class SearchActions { payload: { taxonomiList, category } } } + + setSearchFilterOn() { + return { + type: SearchActions.SET_SEARCH_FILTER_ON + } + } + + setSearchFilterOff() { + return { + type: SearchActions.SET_SEARCH_FILTER_OFF + } + } } diff --git a/src/app/home/reducers/search.reducers.ts b/src/app/home/reducers/search.reducers.ts index 12fb5a5f..e2dcd92b 100644 --- a/src/app/home/reducers/search.reducers.ts +++ b/src/app/home/reducers/search.reducers.ts @@ -103,6 +103,12 @@ export function reducer(state = initialState, { type, payload }: any): SearchSta taxonomiByName: _taxonomiByName }) as SearchState; + case SearchActions.SET_SEARCH_FILTER_ON: + return state.merge({ searchFilter: true }) as SearchState; + + case SearchActions.SET_SEARCH_FILTER_OFF: + return state.merge({ searchFilter: false }) as SearchState; + default: return state; } diff --git a/src/app/home/reducers/search.state.ts b/src/app/home/reducers/search.state.ts index 8a075a5e..ec24ce76 100644 --- a/src/app/home/reducers/search.state.ts +++ b/src/app/home/reducers/search.state.ts @@ -21,6 +21,7 @@ export interface SearchState extends Map { categeoryLevel: List; taxonomiByName: List; paginationData: Map; + searchFilter: boolean; } export const SearchStateRecord = Record({ @@ -30,5 +31,6 @@ export const SearchStateRecord = Record({ getChildTaxons: List([]), categeoryLevel: List([]), taxonomiByName: List([]), - paginationData: Map({}) + paginationData: Map({}), + searchFilter: false }); diff --git a/src/app/home/reducers/selectors.ts b/src/app/home/reducers/selectors.ts index d9be98b6..4dc6544b 100644 --- a/src/app/home/reducers/selectors.ts +++ b/src/app/home/reducers/selectors.ts @@ -38,6 +38,10 @@ function fetchTaxonomiByName(state: SearchState) { function fetchPaginationData(state: SearchState) { return state.paginationData.toJS(); } + +function fetchSearchFliterStatus(state: SearchState) { + return state.searchFilter; +} /******************* Public Selector API's ******************/ export const getFilters = createSelector(getSearchState, fetchSelectedFilters); export const getSelectedTaxonIds = createSelector(getSearchState, fetchSelectedTaxonIds); @@ -46,4 +50,5 @@ export const getPaginationData = createSelector(getSearchState, fetchPaginationD export const getChildTaxons = createSelector(getSearchState, fetchChildTaxons); export const categeoryLevel = createSelector(getSearchState, fetchCategeoryLevel); export const taxonomiByName = createSelector(getSearchState, fetchTaxonomiByName); +export const searchFilterStatus = createSelector(getSearchState, fetchSearchFliterStatus); diff --git a/src/app/home/sidebar/brand-filter/brand-filter.component.html b/src/app/home/sidebar/brand-filter/brand-filter.component.html index 614e7045..59976244 100644 --- a/src/app/home/sidebar/brand-filter/brand-filter.component.html +++ b/src/app/home/sidebar/brand-filter/brand-filter.component.html @@ -7,12 +7,12 @@

Brands

-
- -
+
+ +
\ No newline at end of file diff --git a/src/app/home/sidebar/brand-filter/brand-filter.component.ts b/src/app/home/sidebar/brand-filter/brand-filter.component.ts index 2e75c9b1..1684b401 100644 --- a/src/app/home/sidebar/brand-filter/brand-filter.component.ts +++ b/src/app/home/sidebar/brand-filter/brand-filter.component.ts @@ -13,6 +13,7 @@ import { URLSearchParams } from '@angular/http' export class BrandFilterComponent implements OnInit { @Input() taxonomiList; @Input() isFilterOn; + queryParams: any; constructor( private searchActions: SearchActions, diff --git a/src/app/home/sidebar/categories/categories.component.html b/src/app/home/sidebar/categories/categories.component.html index 8d73e2e1..6abb9a66 100644 --- a/src/app/home/sidebar/categories/categories.component.html +++ b/src/app/home/sidebar/categories/categories.component.html @@ -1,20 +1,20 @@ + - -
+

    {{taxonomiList.pretty_name}}

    Catgeories

    -
  • +
  • @@ -23,9 +23,9 @@

    Catgeories

  • - + {{levels.name}} - +
  • diff --git a/src/app/home/sidebar/categories/categories.component.ts b/src/app/home/sidebar/categories/categories.component.ts index 464a89ef..119643e5 100644 --- a/src/app/home/sidebar/categories/categories.component.ts +++ b/src/app/home/sidebar/categories/categories.component.ts @@ -4,7 +4,7 @@ import { Store } from '@ngrx/store'; import { SearchActions } from './../../reducers/search.actions'; import { Component, OnInit, Input, EventEmitter, Output, OnChanges } from '@angular/core'; import { URLSearchParams } from '@angular/http' -import { getChildTaxons } from '../../reducers/selectors'; +import { searchFilterStatus } from '../../reducers/selectors'; @Component({ @@ -40,9 +40,8 @@ export class CategoriesComponent implements OnInit { } } showAllCategory() { - window.location.reload(); - this.isFilterOn = false this.showAll.emit() + window.location.reload(); } /** @@ -59,8 +58,8 @@ export class CategoriesComponent implements OnInit { this.store.dispatch(this.searchActions.getProductsByTaxon(search.toString())); } - emitSelection() { + emitSelection(rootId) { this.catgeoryFilter() - this.onSelected.emit({ id: this.queryParams.id, name: this.queryParams['q[name_cont]'] }); + this.onSelected.emit({ id: this.queryParams.id, name: this.queryParams['q[name_cont]'], root: rootId }); } } From 3950de495eaad5b60fbf3d9ee435dc614cde22fc Mon Sep 17 00:00:00 2001 From: jaypal412 <39181626+jaypal412@users.noreply.github.com> Date: Mon, 2 Jul 2018 11:01:42 +0530 Subject: [PATCH 03/72] Work on the forgot passward page (#185) Why? Feature: Work on forgot a password. Work on the Update password page. Work on the profile page Work on the checkout flow This change addresses the need by: These changes are done using bootstrap and HTML [delivers #158683303] --- .../forget-password.component.html | 70 ++++++----- .../forget-password.component.scss | 53 +++++--- .../components/login/login.component.scss | 1 + .../components/sign-up/sign-up.component.scss | 2 +- .../update-password.component.html | 4 +- .../update-password.component.scss | 59 +++++---- .../checkout/address/address.component.html | 6 +- .../checkout/address/address.component.scss | 10 +- .../delivery-address.component.scss | 11 ++ .../line-item/line-item.component.scss | 3 +- .../order-success.component.html | 119 +++++++++--------- .../order-success.component.scss | 28 +++++ .../credit-card/credit-card.component.scss | 12 +- .../payment-modes-list.component.scss | 14 ++- .../payment-modes-list.component.ts | 3 +- .../checkout/payment/payment.component.html | 74 +++++------ .../checkout/payment/payment.component.scss | 28 +++-- .../profile-dropdown.component.html | 4 +- .../profile-dropdown.component.scss | 14 ++- .../product-price-info.component.html | 2 +- .../components/orders/orders.component.html | 25 ++-- src/app/user/user.component.html | 39 +++--- 22 files changed, 354 insertions(+), 227 deletions(-) diff --git a/src/app/auth/components/forget-password/forget-password.component.html b/src/app/auth/components/forget-password/forget-password.component.html index 25ea7521..046b1d15 100644 --- a/src/app/auth/components/forget-password/forget-password.component.html +++ b/src/app/auth/components/forget-password/forget-password.component.html @@ -1,36 +1,46 @@ -
diff --git a/src/app/auth/components/forget-password/forget-password.component.scss b/src/app/auth/components/forget-password/forget-password.component.scss index dac04e56..77ddea81 100644 --- a/src/app/auth/components/forget-password/forget-password.component.scss +++ b/src/app/auth/components/forget-password/forget-password.component.scss @@ -1,10 +1,17 @@ @import "../../../shared/scss/selected_theme_variables"; +.loginwindow { + margin: 6em auto 0; + overflow: hidden; + padding: 10px 0; +} + .panel { margin-bottom: 20px; - background-color: $white; + background-color: $gray-200; border: none; - border-radius: 0; - box-shadow: 0 2px 15px rgba(0, 0, 0, .1); + border-radius: 4px; + border: 1px solid $gray-10; + box-shadow: none; .panel-heading { padding: 30px 0 0; border-bottom: 1px solid transparent; @@ -16,7 +23,7 @@ margin-top: 0; margin-bottom: 0; font-size: 28px; - color: $gray-800; + color: $gray-900; font-weight: 400; } } @@ -27,6 +34,7 @@ border: 1px solid $gray-10; border-radius: 5px; padding: 0; + background-color: $white; } fieldset { @@ -52,7 +60,6 @@ fieldset { box-sizing: border-box; text-align: center; position: relative; - padding-bottom: 40px; } .login-user-input-email { @@ -101,7 +108,7 @@ input { } fieldset { - border: 1px solid $gray-200; + border: 1px solid $gray-10; margin: 0 2px; padding: .35em .625em .75em; } @@ -113,8 +120,8 @@ fieldset { } .login-login-button { - font-size: 13px; - font-weight: 500; + font-size: 14px; + font-weight: bold; letter-spacing: 2px; padding: 15px; display: block; @@ -122,15 +129,20 @@ fieldset { border: 0; text-transform: uppercase; border-radius: 3px; + background-color: $theme-action-color - 50; + color: $white; } .login-link-container { - text-align: left; - padding: 20px; + text-align: right; + padding: 0px 20px 12px; + font-size: 14px; } .login-link { text-decoration: none; + font-size: 15px; + color: $theme-action-color !important; } .login-right-links { @@ -138,15 +150,10 @@ fieldset { } .login-info-text { - color: $gray-800; + color: $gray-700; font-size: 12px; } -.login-link-container { - text-align: left; - padding: 20px; -} - .login-create-account-link { margin-left: 5px; } @@ -165,7 +172,7 @@ a { } .login-info-text { - color: $gray-800; + color: $gray-700; font-size: 12px; } @@ -193,7 +200,7 @@ a { } .login-button { - max-width: 162px; + width: 100%; padding-left: 18%; position: relative; font-size: 13px; @@ -304,7 +311,13 @@ p { .login-input-container { &:hover { - border: 1px solid $danger; - box-shadow: 0 2px 5px $danger + 100; + border: 1px solid $theme-main-color; + box-shadow: 0.1px 0.2px 0.4px $theme-main-color - 100; } +} + +.createacc { + display: flex; + align-items: center; + padding-left: 3rem; } \ No newline at end of file diff --git a/src/app/auth/components/login/login.component.scss b/src/app/auth/components/login/login.component.scss index fe002641..6d492c8f 100644 --- a/src/app/auth/components/login/login.component.scss +++ b/src/app/auth/components/login/login.component.scss @@ -309,6 +309,7 @@ p { } .login-input-container { + background-color: $white; &:hover { border: 1px solid $theme-main-color; box-shadow: 0.1px 0.2px 0.4px $theme-main-color - 100; diff --git a/src/app/auth/components/sign-up/sign-up.component.scss b/src/app/auth/components/sign-up/sign-up.component.scss index 8895db42..52dcb71a 100644 --- a/src/app/auth/components/sign-up/sign-up.component.scss +++ b/src/app/auth/components/sign-up/sign-up.component.scss @@ -53,7 +53,7 @@ border: 0; text-transform: uppercase; border-radius: 3px; - background-color: $theme-main-color; + background-color: $theme-action-color - 50; } .register-input-item { diff --git a/src/app/auth/components/update-password/update-password.component.html b/src/app/auth/components/update-password/update-password.component.html index c4d175cd..1171d42a 100644 --- a/src/app/auth/components/update-password/update-password.component.html +++ b/src/app/auth/components/update-password/update-password.component.html @@ -1,4 +1,4 @@ -
+
@@ -29,7 +29,7 @@

Password Changed!

- +
diff --git a/src/app/auth/components/update-password/update-password.component.scss b/src/app/auth/components/update-password/update-password.component.scss index 411c6ae8..c47a5383 100644 --- a/src/app/auth/components/update-password/update-password.component.scss +++ b/src/app/auth/components/update-password/update-password.component.scss @@ -1,11 +1,11 @@ @import "../../../shared/scss/selected_theme_variables"; - .panel { margin-bottom: 20px; - background-color: $white; + background-color: $gray-200; border: none; - border-radius: 0; - box-shadow: 0 2px 15px rgba(0,0,0,.1); + border-radius: 4px; + border: 1px solid $gray-10; + box-shadow: none; .panel-heading { padding: 30px 0 0; border-bottom: 1px solid transparent; @@ -28,6 +28,11 @@ border: 1px solid $gray-10; border-radius: 5px; padding: 0; + background-color: $white; + &:hover { + border: 1px solid $theme-main-color; + box-shadow: 0.1px 0.2px 0.4px $theme-main-color - 100; + } } .register-register-button-container { @@ -46,6 +51,8 @@ border: 0; text-transform: uppercase; border-radius: 3px; + color:$white; + background-color: $theme-action-color - 50; } .register-input-item { @@ -126,7 +133,8 @@ legend { margin-right: 5px; } -[type=checkbox], [type=radio] { +[type=checkbox], +[type=radio] { box-sizing: border-box; padding: 0; } @@ -211,29 +219,43 @@ a { text-align: left; } -[type=reset], [type=submit], button, html [type=button] { +[type=reset], +[type=submit], +button, +html [type=button] { -webkit-appearance: button; } -[type=button], [type=reset], [type=submit], button { +[type=button], +[type=reset], +[type=submit], +button { cursor: pointer; } + /* For Firefox */ + input[type='number'] { - -moz-appearance:textfield; + -moz-appearance: textfield; } + /* Webkit browsers like Safari and Chrome */ + input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; + -webkit-appearance: none; + margin: 0; } -button, select { +button, +select { text-transform: none; } -button, input, select, textarea { +button, +input, +select, +textarea { font: inherit; } @@ -267,7 +289,8 @@ button, input, select, textarea { top: 10px; } -.register-fb-logo, .register-gplus-logo { +.register-fb-logo, +.register-gplus-logo { height: 29px; position: absolute; left: 15px; @@ -312,8 +335,8 @@ button, input, select, textarea { transition-property: all; -webkit-transition-duration: .5s; transition-duration: .5s; - -webkit-transition-timing-function: cubic-bezier(0,1,.5,1); - transition-timing-function: cubic-bezier(0,1,.5,1); + -webkit-transition-timing-function: cubic-bezier(0, 1, .5, 1); + transition-timing-function: cubic-bezier(0, 1, .5, 1); } .register-gender-error-icon { @@ -326,9 +349,3 @@ button, input, select, textarea { margin-bottom: 0; } -.register-input-container { - &:hover { - border: 1px solid $danger; - box-shadow: 0 2px 5px $danger + 100; - } -} diff --git a/src/app/checkout/address/address.component.html b/src/app/checkout/address/address.component.html index bd6e9dc8..52834767 100644 --- a/src/app/checkout/address/address.component.html +++ b/src/app/checkout/address/address.component.html @@ -1,6 +1,6 @@
-
-
+
+
Select Delivery Address @@ -8,7 +8,7 @@
-
+
diff --git a/src/app/checkout/address/address.component.scss b/src/app/checkout/address/address.component.scss index 32cae8e9..2737b924 100644 --- a/src/app/checkout/address/address.component.scss +++ b/src/app/checkout/address/address.component.scss @@ -7,7 +7,11 @@ display: inline-block; border-right: 1px solid $gray-10; vertical-align: top; - min-height: 521px; + @media screen and(min-width: 320px) and(max-width: 768px) { + min-height:auto; + border-right: 0 solid $gray-10; + padding: 0; + } .add-address { padding: 20px 10px 20px 0; border-bottom: 1px solid $gray-10; @@ -17,7 +21,6 @@ font-size: 14px; font-weight: 600; font-family: $primary-font; - } } .edit-address { @@ -37,6 +40,9 @@ display: inline-block; vertical-align: top; padding-left: 35px; + @media screen and(min-width: 320px) and(max-width: 768px) { + padding: 0; + } .pay-btn { border: none; border-radius: 3px; diff --git a/src/app/checkout/address/delivery-address/delivery-address.component.scss b/src/app/checkout/address/delivery-address/delivery-address.component.scss index 27f5c814..33c253fc 100644 --- a/src/app/checkout/address/delivery-address/delivery-address.component.scss +++ b/src/app/checkout/address/delivery-address/delivery-address.component.scss @@ -12,6 +12,17 @@ margin-right: 25px; border-radius: 4px; position: relative; + + @media screen and(min-width: 320px) and(max-width: 768px) { + height: auto; + width: 100%; + margin-right: 0px; + border-radius: 4px; + position: relative; + min-height: auto; + border-radius: 0; + padding: 1.4em 3em 1.4em 3em; + } cursor: pointer; .name { font-family: $primary-font; diff --git a/src/app/checkout/cart/components/line-item-list/line-item/line-item.component.scss b/src/app/checkout/cart/components/line-item-list/line-item/line-item.component.scss index 54e461c8..f719df87 100644 --- a/src/app/checkout/cart/components/line-item-list/line-item/line-item.component.scss +++ b/src/app/checkout/cart/components/line-item-list/line-item/line-item.component.scss @@ -51,8 +51,6 @@ color: $gray-400; text-align: right; .size-qty { - margin: 0 0 4px; - padding-right: 10px; display: inline-block; .size, .qty { @@ -130,6 +128,7 @@ font-size: 2.4em; line-height: 1.3em; text-align: center; + width: 1em; } a.disabled { cursor: default; diff --git a/src/app/checkout/order-success/order-success.component.html b/src/app/checkout/order-success/order-success.component.html index 78b12f1b..52b52f6d 100644 --- a/src/app/checkout/order-success/order-success.component.html +++ b/src/app/checkout/order-success/order-success.component.html @@ -1,8 +1,8 @@
-
+

Thank you for your order!

- +

Your order has been placed and is being processed. When the item(s) are shipped,you will receive an email with the @@ -10,58 +10,66 @@

Thank you for your order!

- -
-
-

Order Details

- - - - - - - - - - - - - - - - - -
Order ID:{{orderDetails.number}}({{orderDetails.total_quantity}} Item(s))
Order Date:{{orderDetails.created_at}}
Total Amount:{{orderDetails.display_total}} through {{orderDetails.payments[0].payment_method.name}}
Payment Status: - {{orderDetails.payment_state}} -
-
-
-

Delivery Address

- - - - - - - - - - - - - - - - - - - - - -
Name: {{orderDetails.ship_address.full_name}}
Address:{{orderDetails.ship_address.address1}}, {{orderDetails.ship_address.address2}}, {{orderDetails.ship_address.city}}
Pincode:{{orderDetails.ship_address.zipcode}}
Phone:{{orderDetails.ship_address.phone}}
Email:{{orderDetails.email}}
+
+
+
+

Order Details

+ + + + + + + + + + + + + + + + + +
Order ID:{{orderDetails.number}}({{orderDetails.total_quantity}} Item(s))
Order Date:{{orderDetails.created_at}}
Total Amount:{{orderDetails.display_total}} tdrough {{orderDetails.payments[0].payment_method.name}}
Payment Status: + {{orderDetails.payment_state}} +
+
+
+

Delivery Address

+ + + + + + + + + + + + + + + + + + + + + +
Name: {{orderDetails.ship_address.full_name}}
Address:{{orderDetails.ship_address.address1}}, {{orderDetails.ship_address.address2}}, {{orderDetails.ship_address.city}}
Pincode:{{orderDetails.ship_address.zipcode}}
Phone:{{orderDetails.ship_address.phone}}
Email:{{orderDetails.email}}
+
+
+

Shipping

+
+

Shipping Status:

+ {{orderDetails.shipment_state}} +
+
-
+

Item(s)

@@ -74,12 +82,5 @@

Item(s)

-
-

Shipping

-
-

Shipping Status:

- {{orderDetails.shipment_state}} -
-
\ No newline at end of file diff --git a/src/app/checkout/order-success/order-success.component.scss b/src/app/checkout/order-success/order-success.component.scss index e69de29b..d7d0f291 100644 --- a/src/app/checkout/order-success/order-success.component.scss +++ b/src/app/checkout/order-success/order-success.component.scss @@ -0,0 +1,28 @@ +@import '../../shared/scss/selected_theme_variables'; +.thankyou { + padding: 2em; + background-color: $gray-100; + h1 { + font-size: 1.7em; + text-transform: capitalize; + } +} + +.order { + @extend .thankyou; + h3 { + font-size: 1.7em; + color: $gray-600; + } + td { + font-size: 14px; + } +} + +.order-items { + @extend .thankyou; + h3 { + font-size: 1.7em; + color: $gray-600; + } +} \ No newline at end of file diff --git a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss index 50eea55b..ff393911 100644 --- a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss +++ b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss @@ -4,10 +4,10 @@ padding: 23px 0px 36px!important; text-transform: uppercase; width: 100%!important; - border-bottom: 1px solid #f5f5f6!important; + border-bottom: 1px solid $gray-10!important; height: 66px; .lbl { - color: #535766; + color: $gray-900; font-size: 16px; display: block; font-weight: 600; @@ -16,14 +16,14 @@ .sub-lbl { display: block; font-size: 12px; - color: #696e79; + color: $gray-900; text-transform: none; } } .cod-info { padding: 10px 10px 10px 0; font-weight: 600; - color: #29303f; + color: $gray-900; font-size: 14px; margin-bottom: 20px; margin-top: 20px; @@ -37,13 +37,13 @@ font-weight: 600; font-family: $primary-font;; height: 48px; - background: #0bc6a0; + background: $theme-action-color; width: 100%; margin-top: 15px; border: none; border-radius: 4px; box-shadow: none; width: 100%; - color: #fff; + color: $white; } } \ No newline at end of file diff --git a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.scss b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.scss index 8bb8f4ae..1523749c 100644 --- a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.scss +++ b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.scss @@ -2,6 +2,10 @@ .pay-modes { display: inline-block; width: 32%; + @media screen and(min-width: 320px) and(max-width: 768px) { + padding: 0; + width: 100%; + } background: $gray-200; .mode { cursor: pointer; @@ -9,13 +13,17 @@ font-size: 14px; font-weight: 600; font-family: $primary-font; - ; text-transform: uppercase; color: $gray-800; padding-top: 22px; padding-left: 20px; border-left: 1px solid $gray-10; border-bottom: 1px solid $gray-10; + @media screen and(min-width: 320px) and(max-width: 768px) { + width: 50%; + float:left; + border-right: 1px solid $gray-10; + } } .selected { background-color: $white; @@ -29,4 +37,8 @@ width: 67%; vertical-align: top; padding-left: 40px; + @media screen and(min-width: 320px) and(max-width: 768px) { + padding: 0; + width: 100%; + } } \ No newline at end of file diff --git a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts index e8df3333..f1568dd5 100644 --- a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts +++ b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts @@ -83,6 +83,7 @@ export class PaymentModesListComponent implements OnInit { email: JSON.parse(localStorage.getItem('user')).email, } + // tslint:disable-next-line:max-line-length const paramsList = `${hashParams.key}|${hashParams.txnid}|${hashParams.amount}|${hashParams.productinfo}|${hashParams.firstname}|${hashParams.email}|||||||||||${payUbizSalt}`; const encryptedHash = CryptoJS.SHA512(paramsList); const hashString = CryptoJS.enc.Hex.stringify(encryptedHash) @@ -111,7 +112,7 @@ export class PaymentModesListComponent implements OnInit { }) ) .subscribe(res => { - window.open(response.url, "_self"); + window.open(response.url, '_self'); }); }) } diff --git a/src/app/checkout/payment/payment.component.html b/src/app/checkout/payment/payment.component.html index 38e9c2e1..318602a3 100644 --- a/src/app/checkout/payment/payment.component.html +++ b/src/app/checkout/payment/payment.component.html @@ -1,40 +1,44 @@ -
-
-
- Choose Payment Mode - - You Pay - ${{totalCartValue$ | async | number:'1.2-2'}} - -
-
- -
-
-
-
-
ORDER SUMMARY
-
{{totalCartItems$ | async}} ITEMS
-
- Order Total - ${{totalCartValue$ | async | number:'1.2-2'}} +
+
+
+
+
+ Choose Payment Mode + + You Pay + ${{totalCartValue$ | async | number:'1.2-2'}} + +
+
+ +
-
- Delivery - FREE +
+
+
ORDER SUMMARY
+
{{totalCartItems$ | async}} ITEMS
+
+ Order Total + ${{totalCartValue$ | async | number:'1.2-2'}} +
+
+ Delivery + FREE +
+
+
+ Total Payable + ${{totalCartValue$ | async | number:'1.2-2'}} +
+
+
DELIVER TO
+
{{address.full_name}}
+
{{address.address1}}
+
{{address.address2}}
+
{{address.city}} - {{address.zipcode}}
+
Mobile: {{address.phone}}
+
-
- Total Payable - ${{totalCartValue$ | async | number:'1.2-2'}} -
-
-
DELIVER TO
-
{{address.full_name}}
-
{{address.address1}}
-
{{address.address2}}
-
{{address.city}} - {{address.zipcode}}
-
Mobile: {{address.phone}}
-
\ No newline at end of file diff --git a/src/app/checkout/payment/payment.component.scss b/src/app/checkout/payment/payment.component.scss index 1e9da57c..60f812a6 100644 --- a/src/app/checkout/payment/payment.component.scss +++ b/src/app/checkout/payment/payment.component.scss @@ -1,13 +1,15 @@ @import '../../shared/scss/selected_theme_variables'; .payment-section { - width: 980px; margin: 9px auto; .left { - width: 70%; - display: inline-block; vertical-align: top; border-right: 1px solid $gray-10; padding-right: 30px; + @media screen and(min-width: 320px) and(max-width: 768px) { + padding:0; + border-radius: 0px; + border-right: 0px; + } .payment-header { background: $white; padding: 10px 0; @@ -18,7 +20,10 @@ font-size: 16px; color: $gray-800; font-family: $primary-font; - ; + @media screen and(min-width: 320px) and(max-width: 768px) { + font-weight: 200; + font-size: 13px; + } } .amt.you-pay { float: right; @@ -27,7 +32,10 @@ font-weight: 600; font-size: 14px; font-family: $primary-font; - ; + @media screen and(min-width: 320px) and(max-width: 768px) { + font-weight: 200; + font-size: 13px; + } } .amt { padding-right: 10px; @@ -44,10 +52,12 @@ } } .right { - width: 29%; - display: inline-block; padding-left: 30px; padding-top: 15px; + @media screen and(min-width: 320px) and(max-width: 768px) { + width:100%; + padding: 0; + } .mini-bag-summary { position: relative; padding: none; @@ -56,7 +66,6 @@ font-size: 12px; font-weight: 600; font-family: $primary-font; - ; color: $gray-700; height: 35px; line-height: 48px; @@ -65,7 +74,6 @@ font-size: 12px; font-weight: 600; font-family: $primary-font; - ; padding-top: 5px; } .order-total, @@ -114,14 +122,12 @@ padding-top: 30px; padding-bottom: 5px; font-family: $primary-font; - ; } .name { color: $gray-900; margin-top: 5px; font-weight: 600; font-family: $primary-font; - ; } .add-info { color: $gray-700; diff --git a/src/app/layout/header/components/profile-dropdown/profile-dropdown.component.html b/src/app/layout/header/components/profile-dropdown/profile-dropdown.component.html index dd8d1e3a..04432121 100644 --- a/src/app/layout/header/components/profile-dropdown/profile-dropdown.component.html +++ b/src/app/layout/header/components/profile-dropdown/profile-dropdown.component.html @@ -67,7 +67,6 @@
diff --git a/src/app/user/components/orders/orders.component.html b/src/app/user/components/orders/orders.component.html index a0f3210b..d001da01 100644 --- a/src/app/user/components/orders/orders.component.html +++ b/src/app/user/components/orders/orders.component.html @@ -1,13 +1,16 @@ -
-
- -
-
- -
-
-
You have'nt ordered anything yet.
- +
+
+
+ +
- + + +
+
+
You have'nt ordered anything yet.
+ +
+
+
diff --git a/src/app/user/user.component.html b/src/app/user/user.component.html index 791a8ad4..d25bebd0 100644 --- a/src/app/user/user.component.html +++ b/src/app/user/user.component.html @@ -1,20 +1,23 @@ -
-
-

My Account

-
-
- - -
- +
+
+
+

My Account

+
+
+ + + +
+ +
-
+
\ No newline at end of file From 891d91f2fe47a33bf9925a2750d3effadf804727 Mon Sep 17 00:00:00 2001 From: Gopal B Shiimpi Date: Mon, 2 Jul 2018 11:48:42 +0530 Subject: [PATCH 04/72] Product details with options (#186) Why? Features: Product Options on product detail page. User is able to select the options for product(if any). This change addresses the need by: Now user can select the options for product (if any) like size, color etc. Selected option will bring the product(variant). [delivers #158716631] --- .../order-total-summary.component.ts | 1 - src/app/core/services/checkout.service.ts | 3 +- .../filter-mobile-menu.component.ts | 4 +- src/app/home/home.component.ts | 13 ++- src/app/home/reducers/search.actions.ts | 1 + .../product-details.component.html | 7 +- .../product-details.component.ts | 81 +++---------------- .../product-price-info.component.html | 4 +- .../product-price-info.component.ts | 24 ++++-- .../product-variants.component.html | 16 +++- .../product-variants.component.ts | 53 +++++++++--- .../write-product-review.component.ts | 6 -- src/app/product/reducers/product-reducer.ts | 4 +- src/app/product/reducers/product-state.ts | 5 +- src/app/product/reducers/selectors.ts | 7 +- src/config/default/default.ts | 1 + 16 files changed, 108 insertions(+), 122 deletions(-) diff --git a/src/app/checkout/cart/components/order-total-summary/order-total-summary.component.ts b/src/app/checkout/cart/components/order-total-summary/order-total-summary.component.ts index 27df5166..61bd7d42 100644 --- a/src/app/checkout/cart/components/order-total-summary/order-total-summary.component.ts +++ b/src/app/checkout/cart/components/order-total-summary/order-total-summary.component.ts @@ -55,7 +55,6 @@ export class OrderTotalSummaryComponent implements OnInit, OnDestroy, OnChanges if (this.totalCartValue < 699) { this.enableshipping = true; this.shippingProgress = (this.totalCartValue / 699) * 100; - console.log('Aftervalue', this.shippingProgress); } else { this.enableshipping = false; this.shippingProgress = 100; diff --git a/src/app/core/services/checkout.service.ts b/src/app/core/services/checkout.service.ts index f1e766cd..dc3f367e 100644 --- a/src/app/core/services/checkout.service.ts +++ b/src/app/core/services/checkout.service.ts @@ -8,6 +8,7 @@ import { AppState } from './../../interfaces'; import { Store } from '@ngrx/store'; import { Order } from '../models/order'; import { ToastrService } from 'ngx-toastr'; +import { environment } from '../../../environments/environment'; @Injectable() export class CheckoutService { @@ -232,7 +233,7 @@ export class CheckoutService { body = body.set('furl', params.furl) body = body.set('hash', params.hash) - return this.http.post(`https://test.payu.in/_payment`, + return this.http.post(`${environment.config.payuBizUrl}`, body, { headers: header, responseType: 'text', observe: 'response' } ).pipe(map(resp => { return resp; diff --git a/src/app/home/filter-mobile-menu/filter-mobile-menu.component.ts b/src/app/home/filter-mobile-menu/filter-mobile-menu.component.ts index 7880146e..dbc47098 100644 --- a/src/app/home/filter-mobile-menu/filter-mobile-menu.component.ts +++ b/src/app/home/filter-mobile-menu/filter-mobile-menu.component.ts @@ -74,9 +74,7 @@ export class FilterMobileMenuComponent implements OnInit { this.showChild = !this.showChild; } listClick(event, newValue) { - console.log(newValue); - this.selectedItem = newValue; // don't forget to update the model here - // ... do other stuff here ... + this.selectedItem = newValue; } ngOnInit() { diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index ead3f3f6..283d08c4 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,4 +1,3 @@ -import { ProductService } from './../core/services/product.service'; import { SearchActions } from './reducers/search.actions'; import { getSelectedTaxonIds, @@ -11,7 +10,7 @@ import { } from './reducers/selectors'; import { ProductActions } from './../product/actions/product-actions'; import { AppState } from './../interfaces'; -import { getTaxonomies } from './../product/reducers/selectors'; +import { getTaxonomies, rootTaxonomyId } from './../product/reducers/selectors'; import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; import { Component, OnInit, ViewChild, ChangeDetectionStrategy } from '@angular/core'; @@ -37,11 +36,11 @@ export class HomeComponent implements OnInit { isCategoryOpen = true; screenwidth; isMobile; + rootTaxonomyId: any; constructor( private store: Store, private actions: ProductActions, - private searchActions: SearchActions, - private productService: ProductService) { + private searchActions: SearchActions) { this.store.dispatch(this.actions.getAllProducts(1)); this.store.dispatch(this.actions.getAllTaxonomies()); this.taxonomies$ = this.store.select(getTaxonomies); @@ -50,7 +49,8 @@ export class HomeComponent implements OnInit { this.products$ = this.store.select(getProductsByKeyword); this.pagination$ = this.store.select(getPaginationData); this.isFilterOn$ = this.store.select(searchFilterStatus) - + this.store.select(rootTaxonomyId) + .subscribe(id => this.rootTaxonomyId = id) } // tslint:disable-next-line:member-ordering @@ -79,8 +79,7 @@ export class HomeComponent implements OnInit { } OnCategeorySelected(category) { - // TODO: Here taxonomies_id is hardcoded for now. - this.store.dispatch(this.searchActions.getChildTaxons('1', category.id)); + this.store.dispatch(this.searchActions.getChildTaxons(this.rootTaxonomyId, category.id)); this.taxonomies$ = this.store.select(getChildTaxons) this.categoryLevel$ = this.store.select(categeoryLevel) // ToDo: Here Brands are hardcoded For now. diff --git a/src/app/home/reducers/search.actions.ts b/src/app/home/reducers/search.actions.ts index a910a9ae..54f0c598 100644 --- a/src/app/home/reducers/search.actions.ts +++ b/src/app/home/reducers/search.actions.ts @@ -16,6 +16,7 @@ export class SearchActions { static SET_SEARCH_FILTER_ON = 'SET_SEARCH_FILTER_ON' static SET_SEARCH_FILTER_OFF = 'SET_SEARCH_FILTER_OFF' + category: any; /** * @method getAllFtilers diff --git a/src/app/product/components/product-detail-page/product-details/product-details.component.html b/src/app/product/components/product-detail-page/product-details/product-details.component.html index 8a4f9e16..f1558630 100644 --- a/src/app/product/components/product-detail-page/product-details/product-details.component.html +++ b/src/app/product/components/product-detail-page/product-details/product-details.component.html @@ -4,9 +4,9 @@
- + -
@@ -30,5 +30,4 @@

- - + \ No newline at end of file diff --git a/src/app/product/components/product-detail-page/product-details/product-details.component.ts b/src/app/product/components/product-detail-page/product-details/product-details.component.ts index 72335e60..d4054b42 100644 --- a/src/app/product/components/product-detail-page/product-details/product-details.component.ts +++ b/src/app/product/components/product-detail-page/product-details/product-details.component.ts @@ -8,7 +8,6 @@ import { Router } from '@angular/router'; import { AppState } from './../../../../interfaces'; import { Store } from '@ngrx/store'; import { CheckoutActions } from './../../../../checkout/actions/checkout.actions'; -import { Variant } from './../../../../core/models/variant'; import { VariantRetriverService } from './../../../../core/services/variant-retriver.service'; import { @@ -16,13 +15,11 @@ import { OnInit, Input, ChangeDetectionStrategy, - OnChanges } from '@angular/core'; import { Product } from './../../../../core/models/product'; import { VariantParserService } from './../../../../core/services/variant-parser.service'; import { ProductService } from './../../../../core/services/product.service'; -import { CheckoutService } from '../../../../core/services/checkout.service'; @Component({ selector: 'app-product-details', @@ -31,24 +28,14 @@ import { CheckoutService } from '../../../../core/services/checkout.service'; changeDetection: ChangeDetectionStrategy.OnPush }) export class ProductDetailsComponent implements OnInit { + @Input() product: Product; - dynamic = 50; - customOptionTypesHash: any; - currentSelectedOptions = {}; + description: any; images: any; - mainOptions: any; - correspondingOptions: any; variantId: any; productID: any; productdata: any; - ratingOneStar: any = 0; - ratingTwoStar: any = 0; - ratingThreeStar: any = 0; - ratingFourStar: any = 0; - ratingFivwStar: any = 0; - ratingTodal: any = 0; - percent: number[] = new Array(5); similarProducts$: Observable; relatedProducts$: Observable; reviewProducts$: Observable; @@ -63,20 +50,12 @@ export class ProductDetailsComponent implements OnInit { private toastrService: ToastrService, private searchActions: SearchActions, private productsActions: ProductActions - ) {} + ) { } ngOnInit() { this.description = this.product.description; this.images = this.product.master.images; this.variantId = this.product.master.id; - this.customOptionTypesHash = this.variantParser.getOptionsToDisplay( - this.product.variants, - this.product.option_types - ); - this.mainOptions = this.makeGlobalOptinTypesHash( - this.customOptionTypesHash - ); - this.correspondingOptions = this.mainOptions; this.productID = this.product.id; this.productService.getRelatedProducts(this.productID) @@ -97,50 +76,8 @@ export class ProductDetailsComponent implements OnInit { this.store.dispatch(this.productsActions.getProductReviews(this.productID)); this.reviewProducts$ = this.store.select(productReviews); } - ngOnChanges() {} - - /** - * @param: option: { key: "small", - * value: {optionValue: {etc etc}, - * variantIds: [1,2,3] }} - */ - onOptionClick(option) { - const result = new VariantRetriverService().getVariant( - this.currentSelectedOptions, - this.customOptionTypesHash, - option, - this.product - ); - - this.createNewCorrespondingOptions( - result.newCorrespondingOptions, - option.value.optionValue.option_type_name - ); - - this.currentSelectedOptions = result.newSelectedoptions; - const newVariant: Variant = result.variant; - this.variantId = newVariant.id; - this.description = newVariant.description; - this.images = newVariant.images; - } - makeGlobalOptinTypesHash(customOptionTypes) { - const temp = {}; - for (const key in customOptionTypes) { - if (customOptionTypes.hasOwnProperty(key)) { - temp[key] = Object.keys(customOptionTypes[key]); - } - } - return temp; - } - - createNewCorrespondingOptions(newOptions, optionKey) { - for (const key in this.correspondingOptions) { - if (this.correspondingOptions.hasOwnProperty(key) && key !== optionKey) { - this.correspondingOptions[key] = newOptions[key]; - } - } - } + ngOnChanges() { } addToCart(quantitiy) { this.store.dispatch( @@ -148,18 +85,20 @@ export class ProductDetailsComponent implements OnInit { ); } - // TO DO (to add the daynamic quantity) - buyNow() { - this.store.dispatch(this.checkoutActions.addToCart(this.variantId, 1)); - } markAsFavorite() { this.productService.markAsFavorite(this.product.id).subscribe(res => { this.toastrService.info(res['message'], 'info'); }); } + showReviewForm() { this.router.navigate([this.product.slug, 'write_review'], { queryParams: { prodId: this.productID } }); } + + selectedVariant(variant) { + this.images = variant.images + this.variantId = variant.id + } } diff --git a/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.html b/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.html index 07bc9247..b07f8f0e 100644 --- a/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.html +++ b/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.html @@ -31,7 +31,7 @@

{{product.name}}

Price:

- {{product.currency}}{{product.price}} + {{product.display_price}} FREE 1-2 Day Shipping on this item @@ -48,11 +48,9 @@

{{product.name}}

-
diff --git a/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.ts b/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.ts index 04941fd3..bc2d55e9 100644 --- a/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.ts +++ b/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.ts @@ -12,6 +12,7 @@ export class ProductPriceInfoComponent implements OnInit { @Input() product; @Output() onAddToCart = new EventEmitter(); @Output() onMarkAsFavorites = new EventEmitter(); + @Output() selectedVariant = new EventEmitter(); customOptionTypesHash: any; currentSelectedOptions = {}; @@ -20,9 +21,9 @@ export class ProductPriceInfoComponent implements OnInit { mainOptions: any; correspondingOptions: any; variantId: any; + selectedVariantPrice: any; constructor(private variantParser: VariantParserService, - private variantRetriver: VariantRetriverService, ) { } ngOnInit() { @@ -36,19 +37,25 @@ export class ProductPriceInfoComponent implements OnInit { } onOptionClick(option) { - const result = new VariantRetriverService() - .getVariant(this.currentSelectedOptions, + const result = new VariantRetriverService().getVariant( + this.currentSelectedOptions, this.customOptionTypesHash, - option, this.product); + option, + this.product + ); - this.createNewCorrespondingOptions(result.newCorrespondingOptions, - option.value.optionValue.option_type_name); + this.createNewCorrespondingOptions( + result.newCorrespondingOptions, + option.value.optionValue.option_type_name + ); this.currentSelectedOptions = result.newSelectedoptions; const newVariant: Variant = result.variant; this.variantId = newVariant.id; this.description = newVariant.description; this.images = newVariant.images; + this.product.display_price = result.variant.display_price + this.getSelectedVariant(result.variant); } makeGlobalOptinTypesHash(customOptionTypes) { @@ -57,7 +64,7 @@ export class ProductPriceInfoComponent implements OnInit { if (customOptionTypes.hasOwnProperty(key)) { temp[key] = Object.keys(customOptionTypes[key]); } - }; + } return temp; } @@ -77,6 +84,9 @@ export class ProductPriceInfoComponent implements OnInit { this.onMarkAsFavorites.emit() } + getSelectedVariant(variant) { + this.selectedVariant.emit(variant) + } get discount() { return this.product.master.cost_price - this.product.price; } diff --git a/src/app/product/components/product-detail-page/product-variants/product-variants.component.html b/src/app/product/components/product-detail-page/product-variants/product-variants.component.html index 555bf007..9211af2a 100644 --- a/src/app/product/components/product-detail-page/product-variants/product-variants.component.html +++ b/src/app/product/components/product-detail-page/product-variants/product-variants.component.html @@ -1,8 +1,8 @@ -
+ +
+
+
{{ variant.key }}
+
+
\ No newline at end of file diff --git a/src/app/product/components/product-detail-page/product-variants/product-variants.component.ts b/src/app/product/components/product-detail-page/product-variants/product-variants.component.ts index 0406945f..e134e1b5 100644 --- a/src/app/product/components/product-detail-page/product-variants/product-variants.component.ts +++ b/src/app/product/components/product-detail-page/product-variants/product-variants.component.ts @@ -1,16 +1,45 @@ -import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; -import { Product } from './../../../../core/models/product'; -import { VariantParserService } from './../../../../core/services/variant-parser.service'; +// import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; +// import { Product } from './../../../../core/models/product'; +// import { VariantParserService } from './../../../../core/services/variant-parser.service'; -interface CurrentSelectedOptionsType { - [key: string]: String; -}; +// interface CurrentSelectedOptionsType { +// [key: string]: String; +// }; +// @Component({ +// selector: 'app-product-variants', +// templateUrl: './product-variants.component.html', +// styleUrls: ['./product-variants.component.scss'], +// changeDetection: ChangeDetectionStrategy.OnPush +// }) +// export class ProductVariantsComponent implements OnInit { +// @Input() customOptionTypesHash: any; +// @Input() currentSelectedOptions = {}; +// @Input() mainOptions; +// @Input() correspondingOptions; +// @Output() onOptionClickEvent = new EventEmitter(); +// selectedItem: any; +// constructor() { +// } + +// ngOnInit() { +// } + +// listClick(event, newValue) { +// this.selectedItem = newValue; // don't forget to update the model here +// } + +// isDisabled(arrayTocheck, value) { +// return (arrayTocheck.indexOf(value) === -1); +// } + +// } + +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'app-product-variants', templateUrl: './product-variants.component.html', - styleUrls: ['./product-variants.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + styleUrls: ['./product-variants.component.scss'] }) export class ProductVariantsComponent implements OnInit { @Input() customOptionTypesHash: any; @@ -18,19 +47,19 @@ export class ProductVariantsComponent implements OnInit { @Input() mainOptions; @Input() correspondingOptions; @Output() onOptionClickEvent = new EventEmitter(); - selectedItem: any; + constructor() { } ngOnInit() { } - listClick(event, newValue) { - this.selectedItem = newValue; // don't forget to update the model here + onOptionClick(option) { + this.onOptionClickEvent.emit(option); } isDisabled(arrayTocheck, value) { return (arrayTocheck.indexOf(value) === -1); } -} +} \ No newline at end of file diff --git a/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.ts b/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.ts index 030c5147..79533fdb 100644 --- a/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.ts +++ b/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.ts @@ -43,17 +43,11 @@ export class WriteProductReviewComponent implements OnInit { .subscribe(response => { this.product = response this.images = this.product.master.images.product_url; - console.log(this.product); } ); }) - // this.store.dispatch(this.productsActions.getReviewsProduct(this.queryParams.prodId)) - // this.store.select(getSelectedProduct) - // .subscribe(data => console.log(data)) - // }); } - initForm() { const rating = ''; const name = ''; diff --git a/src/app/product/reducers/product-reducer.ts b/src/app/product/reducers/product-reducer.ts index 4b22bfbe..89c91bea 100644 --- a/src/app/product/reducers/product-reducer.ts +++ b/src/app/product/reducers/product-reducer.ts @@ -2,7 +2,6 @@ import { Taxonomy } from './../../core/models/taxonomy'; import { Product } from './../../core/models/product'; import { ProductActions } from './../actions/product-actions'; import { ProductState, ProductStateRecord } from './product-state'; -import { Action, ActionReducer } from '@ngrx/store'; export const initialState: ProductState = new ProductStateRecord() as ProductState; @@ -33,7 +32,8 @@ export function reducer(state = initialState, { type, payload }: any): ProductSt case ProductActions.GET_ALL_TAXONOMIES_SUCCESS: const _taxonomies: Taxonomy[] = payload.taxonomies.taxonomies; return state.merge({ - taxonomies: _taxonomies + taxonomies: _taxonomies, + rootTaxonomyId: payload.taxonomies.taxonomies[0].id }) as ProductState; case ProductActions.GET_RELATED_PRODUCT_SUCCESS: diff --git a/src/app/product/reducers/product-state.ts b/src/app/product/reducers/product-state.ts index f56ef272..c67b7a0e 100644 --- a/src/app/product/reducers/product-state.ts +++ b/src/app/product/reducers/product-state.ts @@ -1,5 +1,4 @@ import { Taxonomy } from './../../core/models/taxonomy'; -import { Taxon } from './../../core/models/taxon'; /** * Read more about Immutable Records here * 1. https://coderwall.com/p/vxk_tg/using-immutable-js-in-typescript @@ -20,6 +19,7 @@ export interface ProductState extends Map { showAllProducts: List; relatedProducts: List; productReviews: List; + rootTaxonomyId: number; } export const ProductStateRecord = Record({ @@ -30,5 +30,6 @@ export const ProductStateRecord = Record({ taxonomies: List([]), showAllProducts: List([]), relatedProducts: List([]), - productReviews: List([]) + productReviews: List([]), + rootTaxonomyId: 0 }); diff --git a/src/app/product/reducers/selectors.ts b/src/app/product/reducers/selectors.ts index 80d2c437..d771818b 100644 --- a/src/app/product/reducers/selectors.ts +++ b/src/app/product/reducers/selectors.ts @@ -1,4 +1,3 @@ -import { Product } from './../../core/models/product'; import { AppState } from './../../interfaces'; import { ProductState } from './product-state'; import { createSelector } from 'reselect'; @@ -35,6 +34,10 @@ const fetchProductReviews = function (state: ProductState) { return state.productReviews.toJS(); }; +const fetchRootTaxonId = function (state: ProductState) { + return state.rootTaxonomyId; +}; + // *************************** PUBLIC API's **************************** export const getSelectedProduct = createSelector(getProductState, fetchSelectedProduct); export const getProducts = createSelector(getProductState, fetchProducts); @@ -42,3 +45,5 @@ export const getTaxonomies = createSelector(getProductState, fetchAllTaxonomies) export const showAllProducts = createSelector(getProductState, fetchAllProductSearch); export const relatedProducts = createSelector(getProductState, fetchReletedProducts); export const productReviews = createSelector(getProductState, fetchProductReviews); +export const rootTaxonomyId = createSelector(getProductState, fetchRootTaxonId); + diff --git a/src/config/default/default.ts b/src/config/default/default.ts index 2d5452f7..23b0bc48 100644 --- a/src/config/default/default.ts +++ b/src/config/default/default.ts @@ -19,6 +19,7 @@ export const DEFAULT_CONFIG = { //Following are the test crediantials for payubiz payment gateway. payuBizSalt: 'eCwWELxi', payuBizKey: 'gtKFFx', + payuBizUrl: 'https://test.payu.in/_payment', ...DEFAULT_APP_DATA }; From c35aa238a7c7d0bd96ac45f17f5416573f12fcdf Mon Sep 17 00:00:00 2001 From: Pankaj Rawat Date: Mon, 2 Jul 2018 11:50:37 +0530 Subject: [PATCH 05/72] added webkit animation plugin --- package.json | 33 ++++++----- src/polyfills.ts | 2 +- yarn.lock | 148 ++++++++++++++++++++--------------------------- 3 files changed, 82 insertions(+), 101 deletions(-) diff --git a/package.json b/package.json index 8f6429fe..a87ee5be 100644 --- a/package.json +++ b/package.json @@ -24,16 +24,17 @@ }, "private": true, "dependencies": { - "@angular/animations": "^6.0.3", - "@angular/common": "^6.0.3", - "@angular/compiler": "^6.0.3", - "@angular/core": "^6.0.3", - "@angular/forms": "^6.0.3", - "@angular/http": "^6.0.3", - "@angular/platform-browser": "^6.0.3", - "@angular/platform-browser-dynamic": "^6.0.3", + "@angular/animations": "^6.0.7", + "@angular/common": "^6.0.7", + "@angular/compiler": "^6.0.7", + "@angular/core": "^6.0.7", + "@angular/forms": "^6.0.7", + "@angular/http": "^6.0.7", + "@angular/platform-browser": "^6.0.7", + "@angular/platform-browser-dynamic": "^6.0.7", "@angular/pwa": "^0.6.8", - "@angular/router": "^6.0.3", + "@angular/router": "^6.0.7", + "@angular/service-worker": "^6.0.7", "@ngrx/core": "^1.2.0", "@ngrx/effects": "^6.0.1", "@ngrx/router-store": "^6.0.1", @@ -52,16 +53,16 @@ "ngx-drag-scroll": "^1.8.0", "ngx-toastr": "^8.7.3", "reselect": "^3.0.1", - "rxjs": "^6.2.0", + "rxjs": "^6.2.1", + "web-animations-js": "^2.3.1", "webpack-bundle-analyzer": "^2.11.1", - "zone.js": "^0.8.24", - "@angular/service-worker": "^6.0.3" + "zone.js": "^0.8.24" }, "devDependencies": { "@angular-devkit/build-angular": "~0.5.0", - "@angular/cli": "^6.0.7", - "@angular/compiler-cli": "^6.0.3", - "@angular/language-service": "^6.0.3", + "@angular/cli": "^6.0.8", + "@angular/compiler-cli": "^6.0.7", + "@angular/language-service": "^6.0.7", "@angularclass/hmr": "^1.2.2", "@compodoc/compodoc": "^1.1.3", "@ngrx/store-devtools": "^6.0.1", @@ -94,4 +95,4 @@ "main": "index.js", "repository": "git@github.com:aviabird/angularspree.git", "author": "Pankaj Rawat " -} \ No newline at end of file +} diff --git a/src/polyfills.ts b/src/polyfills.ts index 53bdaf1b..60d94782 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -46,7 +46,7 @@ import 'core-js/es7/reflect'; /** ALL Firefox browsers require the following to support `@angular/animation`. **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. +import 'web-animations-js'; // Run `npm install --save web-animations-js`. diff --git a/yarn.lock b/yarn.lock index 19709c58..1ed10c5d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,11 +9,11 @@ "@angular-devkit/core" "0.5.11" rxjs "^6.0.0" -"@angular-devkit/architect@0.6.7": - version "0.6.7" - resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.6.7.tgz#ef1182dde3fc97ed20be7f5abe96cbb7d00c30ff" +"@angular-devkit/architect@0.6.8": + version "0.6.8" + resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.6.8.tgz#977acc605aba45d21b95ca704cc99492e14299dd" dependencies: - "@angular-devkit/core" "0.6.7" + "@angular-devkit/core" "0.6.8" rxjs "^6.0.0" "@angular-devkit/build-angular@~0.5.0": @@ -90,15 +90,6 @@ rxjs "^6.0.0" source-map "^0.5.6" -"@angular-devkit/core@0.6.7": - version "0.6.7" - resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-0.6.7.tgz#421ed3de40c6f203bc6a30cf5a13b57483230df2" - dependencies: - ajv "~6.4.0" - chokidar "^2.0.3" - rxjs "^6.0.0" - source-map "^0.5.6" - "@angular-devkit/core@0.6.8": version "0.6.8" resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-0.6.8.tgz#3b09d97bd2588f0091df11921f7ed772431806aa" @@ -108,13 +99,6 @@ rxjs "^6.0.0" source-map "^0.5.6" -"@angular-devkit/schematics@0.6.7": - version "0.6.7" - resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-0.6.7.tgz#7bd3c1d707cb04162bc199feacfbb1fb2ec6a5ab" - dependencies: - "@angular-devkit/core" "0.6.7" - rxjs "^6.0.0" - "@angular-devkit/schematics@0.6.8": version "0.6.8" resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-0.6.8.tgz#6360a0271f1f422862bf932a03b3741e76ac5ff0" @@ -122,21 +106,21 @@ "@angular-devkit/core" "0.6.8" rxjs "^6.0.0" -"@angular/animations@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.0.3.tgz#703f18c3b72d1df446a2b5059b8e51098fd5c899" +"@angular/animations@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.0.7.tgz#af9fd317556f3bf425f77905eb6a7f3281dca12a" dependencies: tslib "^1.9.0" -"@angular/cli@^6.0.7": - version "6.0.7" - resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-6.0.7.tgz#e4dc676c681cb875bc7196d9eff20aa865d7f2ea" +"@angular/cli@^6.0.8": + version "6.0.8" + resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-6.0.8.tgz#65070958b944be30053232c51f8449b7ddd4d92a" dependencies: - "@angular-devkit/architect" "0.6.7" - "@angular-devkit/core" "0.6.7" - "@angular-devkit/schematics" "0.6.7" - "@schematics/angular" "0.6.7" - "@schematics/update" "0.6.7" + "@angular-devkit/architect" "0.6.8" + "@angular-devkit/core" "0.6.8" + "@angular-devkit/schematics" "0.6.8" + "@schematics/angular" "0.6.8" + "@schematics/update" "0.6.8" opn "~5.3.0" resolve "^1.1.7" rxjs "^6.0.0" @@ -145,58 +129,58 @@ symbol-observable "^1.2.0" yargs-parser "^10.0.0" -"@angular/common@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.0.3.tgz#8b2af3bb74add35c10cd969a5d179cb6a8b21545" +"@angular/common@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.0.7.tgz#ce741587d94fee81bb1c9b79fd45690fae2ea7a8" dependencies: tslib "^1.9.0" -"@angular/compiler-cli@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.0.3.tgz#4cdda9f28e3387811423c980f3e195ac2322057d" +"@angular/compiler-cli@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.0.7.tgz#0f6ff586e7f7c5d37aa91d53521250bc02620a4f" dependencies: chokidar "^1.4.2" minimist "^1.2.0" reflect-metadata "^0.1.2" - tsickle "^0.27.2" + tsickle "^0.29.0" -"@angular/compiler@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.0.3.tgz#47e988012e94f9e3477a4c5557c997d7910a3b2d" +"@angular/compiler@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.0.7.tgz#8313251be50a4446653a52279d806de6582012a3" dependencies: tslib "^1.9.0" -"@angular/core@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.0.3.tgz#50502115105c3784d24338dd8ffb7dddcb55b58d" +"@angular/core@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.0.7.tgz#f4a577615ee284d47250a506f7ba98296c0f9d4e" dependencies: tslib "^1.9.0" -"@angular/forms@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-6.0.3.tgz#57328c9ec0ddf4ae7823ec807315501813c22752" +"@angular/forms@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-6.0.7.tgz#1c6740b3b6b88fadcb1dc48862d102575c8d0f6e" dependencies: tslib "^1.9.0" -"@angular/http@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/http/-/http-6.0.3.tgz#0fee74a820650700517fbc84185ee9b3bd17ebad" +"@angular/http@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/http/-/http-6.0.7.tgz#1d132eda965f4a0e3371c35cf1610f394537b996" dependencies: tslib "^1.9.0" -"@angular/language-service@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-6.0.3.tgz#7182f3824520fd5f5f6173fdee80284356d29d08" +"@angular/language-service@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-6.0.7.tgz#047dcd762be8a6c24e7309905e468ca82bcf91ec" -"@angular/platform-browser-dynamic@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.0.3.tgz#b27e26c06df4ce34879cefd818e7ff394764f834" +"@angular/platform-browser-dynamic@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.0.7.tgz#1c5f63f62eef1ca564e4db62f8e8419f402f044b" dependencies: tslib "^1.9.0" -"@angular/platform-browser@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.0.3.tgz#67941ac1dc0e89c1a18bb97ef17d574f469be6d2" +"@angular/platform-browser@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.0.7.tgz#53470304671534b545c2b00385b9d6dfe5dbb722" dependencies: tslib "^1.9.0" @@ -209,15 +193,15 @@ "@schematics/angular" "0.6.8" typescript "~2.6.2" -"@angular/router@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-6.0.3.tgz#c2b63401c30788b78c90e4209cd06a653eae6428" +"@angular/router@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-6.0.7.tgz#53ce5dba1bb0f033687caca1451a12489a615415" dependencies: tslib "^1.9.0" -"@angular/service-worker@^6.0.3": - version "6.0.6" - resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-6.0.6.tgz#db9633124c857886fdc65456156afc819ba7131d" +"@angular/service-worker@^6.0.7": + version "6.0.7" + resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-6.0.7.tgz#33e61f8818dcfd1814deb346a2337962be0d88ef" dependencies: tslib "^1.9.0" @@ -322,14 +306,6 @@ dependencies: tslib "^1.9.0" -"@schematics/angular@0.6.7": - version "0.6.7" - resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-0.6.7.tgz#21e74f4e9ce3854923b347e97f30a285b3c22fe7" - dependencies: - "@angular-devkit/core" "0.6.7" - "@angular-devkit/schematics" "0.6.7" - typescript ">=2.6.2 <2.8" - "@schematics/angular@0.6.8": version "0.6.8" resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-0.6.8.tgz#a8d1afc33e77160296b0a8b3d02f0ee4dfe9d1d2" @@ -338,12 +314,12 @@ "@angular-devkit/schematics" "0.6.8" typescript ">=2.6.2 <2.8" -"@schematics/update@0.6.7": - version "0.6.7" - resolved "https://registry.yarnpkg.com/@schematics/update/-/update-0.6.7.tgz#38995daf573a834a02a428b26a50e1f0cd06c95f" +"@schematics/update@0.6.8": + version "0.6.8" + resolved "https://registry.yarnpkg.com/@schematics/update/-/update-0.6.8.tgz#3b4f897dd3b28335acc53a49d9f0dc10ebd934a7" dependencies: - "@angular-devkit/core" "0.6.7" - "@angular-devkit/schematics" "0.6.7" + "@angular-devkit/core" "0.6.8" + "@angular-devkit/schematics" "0.6.8" npm-registry-client "^8.5.1" rxjs "^6.0.0" semver "^5.3.0" @@ -6241,9 +6217,9 @@ rxjs@^6.0.0: dependencies: tslib "^1.9.0" -rxjs@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.0.tgz#e024d0e180b72756a83c2aaea8f25423751ba978" +rxjs@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.1.tgz#246cebec189a6cbc143a3ef9f62d6f4c91813ca1" dependencies: tslib "^1.9.0" @@ -7212,9 +7188,9 @@ ts-simple-ast@11.2.0: tslib "^1.9.0" typescript "2.8.3" -tsickle@^0.27.2: - version "0.27.5" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.27.5.tgz#41e1a41a5acf971cbb2b0558a9590779234d591f" +tsickle@^0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.29.0.tgz#812806554bb46c1aa16eb0fe2a051da95ca8f5a4" dependencies: minimist "^1.2.0" mkdirp "^0.5.1" @@ -7619,6 +7595,10 @@ wcwidth@^1.0.0: dependencies: defaults "^1.0.3" +web-animations-js@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/web-animations-js/-/web-animations-js-2.3.1.tgz#3a6d9bc15196377a90f8e2803fa5262165b04510" + webdriver-js-extender@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-1.0.0.tgz#81c533a9e33d5bfb597b4e63e2cdb25b54777515" From 99a3286d428facda10427bb9f0be32dafe6ffe05 Mon Sep 17 00:00:00 2001 From: jaypal412 <39181626+jaypal412@users.noreply.github.com> Date: Wed, 4 Jul 2018 19:47:12 +0530 Subject: [PATCH 06/72] Nebugfixes 158620631 (#187) Why? Bugs : Work on the variants buttons. Work on the star default color. Work on the cart page Alignment in the write review page This change addresses the need by: These changes are done using bootstrap and HTML [delivers #158620631] --- src/app/app.component.scss | 4 ++-- .../checkout/address/address.component.scss | 1 + src/app/checkout/cart/cart.component.html | 1 - .../empty-cart/empty-cart.component.html | 2 +- .../empty-cart/empty-cart.component.scss | 4 ++++ .../order-total-summary.component.scss | 1 + .../order-success/order-success.component.html | 2 +- .../order-success/order-success.component.scss | 18 +++++++++++++----- .../cash-on-delivery.component.scss | 1 + .../credit-card/credit-card.component.scss | 1 + .../categories-details.component.html | 6 +++--- .../categories-menu-dropdown.component.html | 4 ++-- .../categories-menu-dropdown.component.scss | 17 ++++++++--------- .../categories-menu-dropdown.component.ts | 4 +++- .../product-price-info.component.html | 2 +- .../product-review.component.html | 2 +- .../product-variants.component.scss | 4 ++-- .../write-product-review.component.scss | 6 +++--- .../shared/scss/_selected_theme_variables.scss | 4 ++-- src/app/shared/scss/_themes.scss | 4 ++-- src/config/default/default.ts | 4 ++-- 21 files changed, 54 insertions(+), 38 deletions(-) diff --git a/src/app/app.component.scss b/src/app/app.component.scss index cc692368..5769f302 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -41,12 +41,12 @@ :host /deep/ngx-input-star-rating { display: inline-block; - --color-star-default: #a3d032; + --color-star-default: #ddd; --color-star-highlight: #fe9700; } :host /deep/ngx-input-star-rating { display: inline-block; - --color-star-default: #a3d032; + --color-star-default: #ddd; --color-star-highlight: #fe9700; } \ No newline at end of file diff --git a/src/app/checkout/address/address.component.scss b/src/app/checkout/address/address.component.scss index 2737b924..72d9b50c 100644 --- a/src/app/checkout/address/address.component.scss +++ b/src/app/checkout/address/address.component.scss @@ -44,6 +44,7 @@ padding: 0; } .pay-btn { + cursor: pointer; border: none; border-radius: 3px; height: 45px; diff --git a/src/app/checkout/cart/cart.component.html b/src/app/checkout/cart/cart.component.html index 4662afd1..0e7c0a37 100644 --- a/src/app/checkout/cart/cart.component.html +++ b/src/app/checkout/cart/cart.component.html @@ -20,7 +20,6 @@
-
diff --git a/src/app/checkout/cart/components/empty-cart/empty-cart.component.html b/src/app/checkout/cart/components/empty-cart/empty-cart.component.html index 3a11bf76..071aadb0 100644 --- a/src/app/checkout/cart/components/empty-cart/empty-cart.component.html +++ b/src/app/checkout/cart/components/empty-cart/empty-cart.component.html @@ -3,5 +3,5 @@
Your Shopping Bag is empty
- + diff --git a/src/app/checkout/cart/components/empty-cart/empty-cart.component.scss b/src/app/checkout/cart/components/empty-cart/empty-cart.component.scss index ae1e0869..45e56eb5 100644 --- a/src/app/checkout/cart/components/empty-cart/empty-cart.component.scss +++ b/src/app/checkout/cart/components/empty-cart/empty-cart.component.scss @@ -22,4 +22,8 @@ font-size: 16px; font-weight: 500; } + .empty-card-btn { + background-color:$theme-action-color - 50; + border: 1px solid $theme-action-color - 50; + } } \ No newline at end of file diff --git a/src/app/checkout/cart/components/order-total-summary/order-total-summary.component.scss b/src/app/checkout/cart/components/order-total-summary/order-total-summary.component.scss index 03d0d3f2..5f2f13f1 100644 --- a/src/app/checkout/cart/components/order-total-summary/order-total-summary.component.scss +++ b/src/app/checkout/cart/components/order-total-summary/order-total-summary.component.scss @@ -53,6 +53,7 @@ .place-order { text-align: right; .order-btn { + cursor: pointer; border: 1px solid $theme-action-color - 50; border-radius: 0.4rem; padding: 0.5rem; diff --git a/src/app/checkout/order-success/order-success.component.html b/src/app/checkout/order-success/order-success.component.html index 52b52f6d..ac84f557 100644 --- a/src/app/checkout/order-success/order-success.component.html +++ b/src/app/checkout/order-success/order-success.component.html @@ -5,7 +5,7 @@

Thank you for your order!

-

Your order has been placed and is being processed. When the item(s) are shipped,you will receive an email with the +

Your order has been placed and is being processed. When the item(s) are shipped, you will receive an email with the details.

diff --git a/src/app/checkout/order-success/order-success.component.scss b/src/app/checkout/order-success/order-success.component.scss index d7d0f291..77b57d5f 100644 --- a/src/app/checkout/order-success/order-success.component.scss +++ b/src/app/checkout/order-success/order-success.component.scss @@ -6,6 +6,14 @@ font-size: 1.7em; text-transform: capitalize; } + .fa-check-circle { + font-size: 40px; + } + .thankyoumsg { + padding: 0px 36px; + margin-left: 17px; + display: block; + } } .order { @@ -20,9 +28,9 @@ } .order-items { - @extend .thankyou; - h3 { - font-size: 1.7em; - color: $gray-600; - } + @extend .thankyou; + h3 { + font-size: 1.7em; + color: $gray-600; + } } \ No newline at end of file diff --git a/src/app/checkout/payment/payment-modes-list/cash-on-delivery/cash-on-delivery.component.scss b/src/app/checkout/payment/payment-modes-list/cash-on-delivery/cash-on-delivery.component.scss index 4cfda100..a7ea8fa3 100644 --- a/src/app/checkout/payment/payment-modes-list/cash-on-delivery/cash-on-delivery.component.scss +++ b/src/app/checkout/payment/payment-modes-list/cash-on-delivery/cash-on-delivery.component.scss @@ -35,6 +35,7 @@ .pay-btn-wrap { .pay-btn { + cursor: pointer; font-size: 14px; font-weight: 600; font-family: $primary-font; diff --git a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss index ff393911..01f0836a 100644 --- a/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss +++ b/src/app/checkout/payment/payment-modes-list/credit-card/credit-card.component.scss @@ -33,6 +33,7 @@ .pay-btn-wrap { .pay-btn { + cursor: pointer; font-size: 14px; font-weight: 600; font-family: $primary-font;; diff --git a/src/app/layout/header/components/categories-menu-dropdown/categories-components/categories-details/categories-details.component.html b/src/app/layout/header/components/categories-menu-dropdown/categories-components/categories-details/categories-details.component.html index cfbfed29..4b923471 100644 --- a/src/app/layout/header/components/categories-menu-dropdown/categories-components/categories-details/categories-details.component.html +++ b/src/app/layout/header/components/categories-menu-dropdown/categories-components/categories-details/categories-details.component.html @@ -5,7 +5,7 @@
@@ -19,9 +19,9 @@

Popular Brands

-
+
diff --git a/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.html b/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.html index 440801b0..37e6e532 100644 --- a/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.html +++ b/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.html @@ -15,8 +15,8 @@
    -
  • {{taxon.name}}
  • +
  • {{taxon.name}}
diff --git a/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.scss b/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.scss index 4d7ec150..b37365be 100644 --- a/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.scss +++ b/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.scss @@ -35,13 +35,13 @@ left: -2px; &:hover { background-color: $theme-main-color - 20; - box-shadow: 0 3px 5px rgba(0,0,0,.6); + box-shadow: 0 3px 5px rgba(0, 0, 0, .6); } } .open { background-color: $theme-main-color - 20; - box-shadow: 0 3px 5px rgba(0,0,0,.6); + box-shadow: 0 3px 5px rgba(0, 0, 0, .6); } .dpbtn .dropdown-toggle::after { @@ -70,12 +70,8 @@ ul { background-size: 10px; } &:hover::after { - color: $header-font-color; - } // &:hover { - // background-color: $white; - // color: $theme-main-color; - // border-radius: 4px 0px 0px 4px; - // } + color: $gray-800; + } ul>li { position: relative; left: 20%; @@ -85,6 +81,9 @@ ul { } } .active { + &::after { + color: $gray-800 + } background-color: $white !important; color: $gray-600 !important; border-radius: 4px 0px 0px 4px !important; @@ -230,4 +229,4 @@ label { .petdropdown .btn-group>.btn:first-child { margin-left: -17px; -} +} \ No newline at end of file diff --git a/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.ts b/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.ts index 9955f340..f670605e 100644 --- a/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.ts +++ b/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.ts @@ -44,7 +44,7 @@ export class CategoriesMenuDropdownComponent implements OnInit { isOpen: boolean; subIsopen: boolean; index: any; - selectedItem: any; + selectedItem: 0; get stateName() { return this.show ? 'show' : 'hide' } @@ -91,6 +91,8 @@ export class CategoriesMenuDropdownComponent implements OnInit { } onOpenChange(data: boolean): void { this.isOpen = !this.isOpen; + this.menuTaxons = this.taxonomies[0].root.taxons[0]; + this.selectedItem = 0; } } diff --git a/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.html b/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.html index b07f8f0e..b24e3290 100644 --- a/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.html +++ b/src/app/product/components/product-detail-page/product-price-info/product-price-info.component.html @@ -47,7 +47,7 @@

{{product.name}}

diff --git a/src/app/product/components/product-detail-page/product-review/product-review.component.html b/src/app/product/components/product-detail-page/product-review/product-review.component.html index 3b35b5ff..8a6e3f63 100644 --- a/src/app/product/components/product-detail-page/product-review/product-review.component.html +++ b/src/app/product/components/product-detail-page/product-review/product-review.component.html @@ -26,7 +26,7 @@

Customer Reviews

- {{rating.percentage}}% + {{rating.percentage | number: '1.0-0'}}%
diff --git a/src/app/product/components/product-detail-page/product-variants/product-variants.component.scss b/src/app/product/components/product-detail-page/product-variants/product-variants.component.scss index 91f1e4e5..0f540cee 100644 --- a/src/app/product/components/product-detail-page/product-variants/product-variants.component.scss +++ b/src/app/product/components/product-detail-page/product-variants/product-variants.component.scss @@ -37,8 +37,8 @@ &.active { color: $white; font-weight: 500; - background-color: $theme-action-sub-color4; - border: 1px solid $theme-main-sub-color3 +10 + background-color: $theme-action-color; + border: 1px solid $theme-action-color; } } diff --git a/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.scss b/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.scss index 5019b48d..b5c06c63 100644 --- a/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.scss +++ b/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.scss @@ -53,15 +53,15 @@ .guideline { background-color: $gray-100; border-radius: 4px; - padding: 10px; + padding: 1em; margin:0 15px; } h4{color: $gray-900;font-size: 1.2em;} h2{color: $gray-900;font-size: 1.7em;} ul { list-style: inside; - text-indent: 10px; - padding: 20px 10px; + text-indent: -22px; + padding: 1rem 0rem 1rem 1.4rem; line-height: 1.5em; li { padding-bottom: .5rem; diff --git a/src/app/shared/scss/_selected_theme_variables.scss b/src/app/shared/scss/_selected_theme_variables.scss index 77c4edd6..a67e2b7f 100644 --- a/src/app/shared/scss/_selected_theme_variables.scss +++ b/src/app/shared/scss/_selected_theme_variables.scss @@ -1,4 +1,4 @@ // Uncomment Active Variables // Used to import variables in components -@import "./custom_themes/default/theme_variables"; -// @import "./custom_themes/custom/theme_variables"; +// @import "./custom_themes/default/theme_variables"; +@import "./custom_themes/custom/theme_variables"; diff --git a/src/app/shared/scss/_themes.scss b/src/app/shared/scss/_themes.scss index 62e73a38..4b2fc0f9 100644 --- a/src/app/shared/scss/_themes.scss +++ b/src/app/shared/scss/_themes.scss @@ -1,3 +1,3 @@ // Uncomment Active themes -@import "./custom_themes/default/default"; -// @import "./custom_themes/custom/custom"; +// @import "./custom_themes/default/default"; +@import "./custom_themes/custom/custom"; diff --git a/src/config/default/default.ts b/src/config/default/default.ts index 23b0bc48..87b16ea9 100644 --- a/src/config/default/default.ts +++ b/src/config/default/default.ts @@ -13,10 +13,10 @@ export const DEFAULT_CONFIG = { height: '42', width: '140' }, - searchPlaceholder: 'Find good furniture for me', + searchPlaceholder: 'Find good food for me', showGithubRibon: false }, - //Following are the test crediantials for payubiz payment gateway. + // Following are the test crediantials for payubiz payment gateway. payuBizSalt: 'eCwWELxi', payuBizKey: 'gtKFFx', payuBizUrl: 'https://test.payu.in/_payment', From ee1b3192706f2aeae0f509f046cd51a1b6577201 Mon Sep 17 00:00:00 2001 From: Gopal B Shiimpi Date: Thu, 5 Jul 2018 08:59:27 +0530 Subject: [PATCH 07/72] Bug fixes (#189) Why? Bug Fixes: Fixes product write review. Payment Modes list. Option type error for product. Feature Added component for Category details page. This change addresses the need by: Authorised User can submit the review now. Removed bug for default payment modes list . Handled case when product variants dose not have uploaded image for options. Category wise details page(In progress). [delivers #158755485] --- .../line-item/line-item.component.ts | 4 +- .../order-success.component.html | 4 +- .../payment-mode/payment-mode.component.html | 4 +- .../payment-modes-list.component.html | 2 +- .../payment-modes-list.component.ts | 3 +- .../category-page.component.html | 17 +++++ .../category-page.component.scss | 0 .../category-page.component.spec.ts | 25 ++++++++ .../category-page/category-page.component.ts | 62 +++++++++++++++++++ src/app/home/home.routes.ts | 2 + src/app/home/index.ts | 3 + .../categories/categories.component.ts | 1 - .../landing/lp-brands/lp-brands.component.ts | 1 - .../categories-menu-dropdown.component.html | 8 ++- .../product-images.component.html | 2 +- .../product-review.component.html | 2 +- .../write-product-review.component.html | 8 +-- .../write-product-review.component.ts | 56 ++++++++--------- src/app/product/reducers/product-reducer.ts | 3 +- src/config/custom.example/app-data.ts | 4 ++ src/config/default/app-data.ts | 4 ++ 21 files changed, 167 insertions(+), 48 deletions(-) create mode 100644 src/app/home/category-page/category-page.component.html create mode 100644 src/app/home/category-page/category-page.component.scss create mode 100644 src/app/home/category-page/category-page.component.spec.ts create mode 100644 src/app/home/category-page/category-page.component.ts diff --git a/src/app/checkout/cart/components/line-item-list/line-item/line-item.component.ts b/src/app/checkout/cart/components/line-item-list/line-item/line-item.component.ts index 2da02e5f..8f4cc25d 100644 --- a/src/app/checkout/cart/components/line-item-list/line-item/line-item.component.ts +++ b/src/app/checkout/cart/components/line-item-list/line-item/line-item.component.ts @@ -28,7 +28,9 @@ export class LineItemComponent implements OnInit { ) { } ngOnInit() { - this.image = this.lineItem.variant.images[0].product_url; + if(this.lineItem.variant.images[0]){ + this.image = this.lineItem.variant.images[0].product_url; + } this.name = this.lineItem.variant.name; this.quantity = this.lineItem.quantity; this.amount = this.lineItem.display_amount; diff --git a/src/app/checkout/order-success/order-success.component.html b/src/app/checkout/order-success/order-success.component.html index ac84f557..d44d674e 100644 --- a/src/app/checkout/order-success/order-success.component.html +++ b/src/app/checkout/order-success/order-success.component.html @@ -25,7 +25,7 @@

Order Details

Total Amount: - {{orderDetails.display_total}} tdrough {{orderDetails.payments[0].payment_method.name}} + {{orderDetails.display_total}} through {{orderDetails.payments[0].payment_method.name}} Payment Status: @@ -62,7 +62,7 @@

Delivery Address

Shipping

-
+

Shipping Status:

{{orderDetails.shipment_state}}
diff --git a/src/app/checkout/payment/payment-modes-list/payment-mode/payment-mode.component.html b/src/app/checkout/payment/payment-modes-list/payment-mode/payment-mode.component.html index 4e8aaf31..96af0bb9 100644 --- a/src/app/checkout/payment/payment-modes-list/payment-mode/payment-mode.component.html +++ b/src/app/checkout/payment/payment-modes-list/payment-mode/payment-mode.component.html @@ -5,7 +5,7 @@ [value]="paymentMode.id" (change)="onSelectPaymentMode()">
--> -
+ \ No newline at end of file diff --git a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.html b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.html index 14fea3b3..1ec0a9aa 100644 --- a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.html +++ b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.html @@ -5,7 +5,7 @@
- + diff --git a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts index f1568dd5..05fd0681 100644 --- a/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts +++ b/src/app/checkout/payment/payment-modes-list/payment-modes-list.component.ts @@ -53,6 +53,7 @@ export class PaymentModesListComponent implements OnInit { this.paymentModes = payment.payment_methods; this.selectedMode = this.paymentService.setCODAsSelectedMode(this.paymentModes); }); + } makePayment() { @@ -76,7 +77,7 @@ export class PaymentModesListComponent implements OnInit { const hashParams = { key: payUbizKey, - txnid: `${this.orderNumber}`, + txnid: `${this.orderNumber}`, //To be replace using random number amount: this.paymentAmount, productinfo: `${environment.appName}-Product`, firstname: this.address.firstname, diff --git a/src/app/home/category-page/category-page.component.html b/src/app/home/category-page/category-page.component.html new file mode 100644 index 00000000..5876ac80 --- /dev/null +++ b/src/app/home/category-page/category-page.component.html @@ -0,0 +1,17 @@ +
+
+
+ +
+
+
+
+
+

{{taxon.name}}

+ +
+
+
+
+
+
diff --git a/src/app/home/category-page/category-page.component.scss b/src/app/home/category-page/category-page.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/home/category-page/category-page.component.spec.ts b/src/app/home/category-page/category-page.component.spec.ts new file mode 100644 index 00000000..8acb1dd9 --- /dev/null +++ b/src/app/home/category-page/category-page.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CategoryPageComponent } from './category-page.component'; + +describe('CategoryPageComponent', () => { + let component: CategoryPageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CategoryPageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CategoryPageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/home/category-page/category-page.component.ts b/src/app/home/category-page/category-page.component.ts new file mode 100644 index 00000000..021d4c1c --- /dev/null +++ b/src/app/home/category-page/category-page.component.ts @@ -0,0 +1,62 @@ +import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; +import { environment } from '../../../environments/environment'; +import { ActivatedRoute } from '@angular/router'; +import { AppState } from '../../interfaces'; +import { Store } from '@ngrx/store'; +import { getTaxonomies, rootTaxonomyId } from '../../product/reducers/selectors'; +import { SearchActions } from '../reducers/search.actions'; +import { Observable, forkJoin, of } from 'rxjs'; +import { getProductsByKeyword } from '../reducers/selectors'; +import { ProductService } from '../../core/services/product.service'; +import { tap, map, switchMap, reduce } from 'rxjs/operators'; + +@Component({ + selector: 'app-category-page', + templateUrl: './category-page.component.html', + styleUrls: ['./category-page.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class CategoryPageComponent implements OnInit { + + category_banner = environment.config.category_banner; + categeory_number: number; + id: any + selectedTaxons$: Observable + productList$: Observable + + constructor(private route: ActivatedRoute, + private store: Store, + private searchActions: SearchActions, + private productService: ProductService) { } + + ngOnInit() { + this.selectedTaxons$ = + this.store.select(getTaxonomies) + .pipe( + switchMap(taxonomies => { + const taxonomy = taxonomies[0]; + + return this.route.params.pipe( + map(params => { + const categeory_number = params.number + let taxons = []; + if (taxonomy) { taxons = taxonomy.root.taxons }; + return taxons.find(taxon => taxon.id === parseInt(categeory_number));; + }), + map(selectedTaxon => { + if (typeof selectedTaxon === 'undefined') { return of({}) }; + + const taxons = selectedTaxon.taxons; + + this.productList$ = forkJoin( + taxons.map(taxon => this.productService.getProductsByTaxon(`id=${taxon.id}`)) + ) + return selectedTaxon; + }) + ); + }) + ); + } + +} + diff --git a/src/app/home/home.routes.ts b/src/app/home/home.routes.ts index 7ac546d2..8b2edcfa 100644 --- a/src/app/home/home.routes.ts +++ b/src/app/home/home.routes.ts @@ -1,5 +1,7 @@ import { HomeComponent } from './home.component'; +import { CategoryPageComponent } from './category-page/category-page.component'; export const HomeRoutes = [ { path: 'search', component: HomeComponent }, + { path: 'c/:number', component: CategoryPageComponent} ]; diff --git a/src/app/home/index.ts b/src/app/home/index.ts index 4e5b416b..23d9aba2 100644 --- a/src/app/home/index.ts +++ b/src/app/home/index.ts @@ -14,6 +14,7 @@ import { AccordionModule } from 'ngx-bootstrap'; import { NgxInputStarRatingModule } from '@ngx-lite/input-star-rating'; // Components import { HomeComponent } from './home.component'; + // Breadcrumb components import { BreadcrumbComponent } from './breadcrumb/components/breadcrumb/breadcrumb.component'; @@ -33,6 +34,7 @@ import { HomeRoutes as routes } from './home.routes'; import { FilterPipe } from './content/product-list/product-filter.pipe'; import { reducers } from './reducers/index'; +import { CategoryPageComponent } from './category-page/category-page.component'; @NgModule({ declarations: [ // components @@ -49,6 +51,7 @@ import { reducers } from './reducers/index'; CategoriesComponent, BrandFilterComponent, FilterMobileMenuComponent, + CategoryPageComponent, // pipes FilterPipe diff --git a/src/app/home/sidebar/categories/categories.component.ts b/src/app/home/sidebar/categories/categories.component.ts index 119643e5..bb749f5b 100644 --- a/src/app/home/sidebar/categories/categories.component.ts +++ b/src/app/home/sidebar/categories/categories.component.ts @@ -4,7 +4,6 @@ import { Store } from '@ngrx/store'; import { SearchActions } from './../../reducers/search.actions'; import { Component, OnInit, Input, EventEmitter, Output, OnChanges } from '@angular/core'; import { URLSearchParams } from '@angular/http' -import { searchFilterStatus } from '../../reducers/selectors'; @Component({ diff --git a/src/app/landing/lp-brands/lp-brands.component.ts b/src/app/landing/lp-brands/lp-brands.component.ts index f97af80e..f3bfc814 100644 --- a/src/app/landing/lp-brands/lp-brands.component.ts +++ b/src/app/landing/lp-brands/lp-brands.component.ts @@ -1,4 +1,3 @@ -import { environment } from './../../../environments/environment'; import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core'; @Component({ diff --git a/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.html b/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.html index 37e6e532..b29ae2a4 100644 --- a/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.html +++ b/src/app/layout/header/components/categories-menu-dropdown/categories-menu-dropdown.component.html @@ -15,8 +15,12 @@
    -
  • {{taxon.name}}
  • +
  • + {{taxon.name}}
diff --git a/src/app/product/components/product-detail-page/product-images/product-images.component.html b/src/app/product/components/product-detail-page/product-images/product-images.component.html index feffd990..9b74cec0 100644 --- a/src/app/product/components/product-detail-page/product-images/product-images.component.html +++ b/src/app/product/components/product-detail-page/product-images/product-images.component.html @@ -7,7 +7,7 @@
-
+
diff --git a/src/app/product/components/product-detail-page/product-review/product-review.component.html b/src/app/product/components/product-detail-page/product-review/product-review.component.html index 8a6e3f63..2ea1efe9 100644 --- a/src/app/product/components/product-detail-page/product-review/product-review.component.html +++ b/src/app/product/components/product-detail-page/product-review/product-review.component.html @@ -18,7 +18,7 @@

Customer Reviews

- {{i}} Stars + {{rating.rating}} Stars
diff --git a/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.html b/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.html index 1e67cbfc..99dd4d20 100644 --- a/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.html +++ b/src/app/product/components/product-detail-page/write-product-review/write-product-review.component.html @@ -1,4 +1,4 @@ -
+

Write Review

@@ -10,7 +10,7 @@

Write Review

{{product.name}}

-
+
@@ -37,12 +37,12 @@

Thanks for your review!

Your review has been submitted.Please note that your review may take up to 48 hours to appear.

- +
-
+

Writing Guidelines