Loading packages/shop-web-angular/src/app/+orders/order/order.component.ts +10 −7 Original line number Diff line number Diff line import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit, NgZone } from '@angular/core'; import Order from '@modules/server.common/entities/Order'; import { animate, Loading Loading @@ -64,7 +64,8 @@ export class OrderComponent implements OnInit { private readonly carrierRouter: CarrierRouter, private readonly _productLocalesService: ProductLocalesService, private translateService: TranslateService, private dialog: MatDialog private dialog: MatDialog, private readonly ngZone: NgZone ) {} openDialog(): void { Loading Loading @@ -119,6 +120,7 @@ export class OrderComponent implements OnInit { .get(this.order.warehouseId, false) .pipe(first()) .subscribe((store) => { this.ngZone.run(() => { this.warehouse = store; this.orderCancelationCheck( Loading @@ -126,6 +128,7 @@ export class OrderComponent implements OnInit { this.order ); }); }); if (this.order.carrierId) { this.carrierRouter Loading packages/shop-web-angular/src/app/+orders/orders.container.component.ts +14 −4 Original line number Diff line number Diff line import { Component } from '@angular/core'; import { Component, NgZone } from '@angular/core'; import { UserOrdersRouter } from '@modules/client.common.angular2/routers/user-orders-router.service'; import Order from '@modules/server.common/entities/Order'; import { Store } from 'app/services/store'; @Component({ selector: 'orders-container', template: '<orders *ngIf="orders " [orders]="orders"></orders>', template: ` <orders *ngIf="orders" [orders]="orders"></orders> <div *ngIf="!orders.length" style="text-align:center; font-size:28px;margin:20px 0" > There is no orders ... </div> `, }) export class OrdersContainerComponent { // TODO: add correct type of orders variable! Loading @@ -15,13 +23,15 @@ export class OrdersContainerComponent { constructor( private readonly userOrdersRouter: UserOrdersRouter, private readonly ngZone: NgZone, private readonly store: Store ) { const userId = store.userId; // During testing: this.userOrdersRouter.getOrderedProducts('23'); this.userOrdersRouter.get(userId).subscribe((res) => { this.ngZone.run(() => { this.orders = res.filter((r) => !r.isCancelled); res = res.filter((r) => !r.isCancelled); }); }); } } Loading
packages/shop-web-angular/src/app/+orders/order/order.component.ts +10 −7 Original line number Diff line number Diff line import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit, NgZone } from '@angular/core'; import Order from '@modules/server.common/entities/Order'; import { animate, Loading Loading @@ -64,7 +64,8 @@ export class OrderComponent implements OnInit { private readonly carrierRouter: CarrierRouter, private readonly _productLocalesService: ProductLocalesService, private translateService: TranslateService, private dialog: MatDialog private dialog: MatDialog, private readonly ngZone: NgZone ) {} openDialog(): void { Loading Loading @@ -119,6 +120,7 @@ export class OrderComponent implements OnInit { .get(this.order.warehouseId, false) .pipe(first()) .subscribe((store) => { this.ngZone.run(() => { this.warehouse = store; this.orderCancelationCheck( Loading @@ -126,6 +128,7 @@ export class OrderComponent implements OnInit { this.order ); }); }); if (this.order.carrierId) { this.carrierRouter Loading
packages/shop-web-angular/src/app/+orders/orders.container.component.ts +14 −4 Original line number Diff line number Diff line import { Component } from '@angular/core'; import { Component, NgZone } from '@angular/core'; import { UserOrdersRouter } from '@modules/client.common.angular2/routers/user-orders-router.service'; import Order from '@modules/server.common/entities/Order'; import { Store } from 'app/services/store'; @Component({ selector: 'orders-container', template: '<orders *ngIf="orders " [orders]="orders"></orders>', template: ` <orders *ngIf="orders" [orders]="orders"></orders> <div *ngIf="!orders.length" style="text-align:center; font-size:28px;margin:20px 0" > There is no orders ... </div> `, }) export class OrdersContainerComponent { // TODO: add correct type of orders variable! Loading @@ -15,13 +23,15 @@ export class OrdersContainerComponent { constructor( private readonly userOrdersRouter: UserOrdersRouter, private readonly ngZone: NgZone, private readonly store: Store ) { const userId = store.userId; // During testing: this.userOrdersRouter.getOrderedProducts('23'); this.userOrdersRouter.get(userId).subscribe((res) => { this.ngZone.run(() => { this.orders = res.filter((r) => !r.isCancelled); res = res.filter((r) => !r.isCancelled); }); }); } }