Loading packages/admin-web-angular/src/app/@core/data/geo-location.service.ts +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ export class GeoLocationService { }) .valueChanges.pipe( map((res) => res.data.geoLocationProducts.filter( res.data.geoLocationProducts.filter(Boolean).filter( (p) => p.warehouseProduct.isProductAvailable === true ) ), Loading packages/admin-web-angular/src/app/pages/+customers/+customer/customer.component.html +2 −3 Original line number Diff line number Diff line <toaster-container> </toaster-container> <div *ngIf="user$ | async as user" class="row"> <div *ngIf="(user$ | async) as user" class="row"> <div class="col-md-8"> <nb-card> <nb-card-header class="row"> Loading Loading @@ -64,8 +64,7 @@ 'CUSTOMERS_VIEW.NEARBY_STORES' | translate }}" > <ea-customer-stores [currentUser]="selectedUser"> </ea-customer-stores> <ea-customer-stores [currentUser]="selectedUser"></ea-customer-stores> </nb-tab> </nb-tabset> </nb-card-body> Loading packages/admin-web-angular/src/app/pages/+customers/+customer/customer.module.ts +3 −7 Original line number Diff line number Diff line Loading @@ -8,9 +8,7 @@ import { HighlightModule } from 'ngx-highlightjs'; import { ThemeModule } from '../../../@theme'; import { CustomerComponent } from './customer.component'; import { CustomerInfoComponent } from './ea-customer-info/ea-customer-info.component'; import { CustomerProductsComponent } from './ea-customer-products/ea-customer-products/ea-customer-products.component'; // duplicate CustomerProductsComponent import { CustomerProductsComponent as RootCustomerProductsComponent } from './ea-customer-products/ea-customer-products.component'; import { CustomerProductsComponent } from './ea-customer-products/ea-customer-products.component'; import { CustomerLocationComponent } from './ea-customer-location/ea-customer-location.component'; import { CustomerStoresComponent } from './ea-customer-stores/ea-customer-stores.component'; import { CustomerOrdersTableModule } from '../../../@shared/render-component/customer-orders-table/customer-orders-table.module'; Loading Loading @@ -64,10 +62,8 @@ const routes = [ CustomerLocationComponent, CustomerInfoComponent, CustomerProductsComponent, RootCustomerProductsComponent, CustomerStoresComponent, CustomerMetricsComponent, ], entryComponents: [], CustomerMetricsComponent ] }) export class CustomerModule {} packages/admin-web-angular/src/app/pages/+customers/+customer/ea-customer-products/ea-customer-products/ea-customer-products.component.html→packages/admin-web-angular/src/app/pages/+customers/+customer/ea-customer-products/ea-customer-products.component.html +0 −0 File moved. View file packages/admin-web-angular/src/app/pages/+customers/+customer/ea-customer-products/ea-customer-products.component.ts +10 −23 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router'; import { LocalDataSource } from 'ng2-smart-table'; import Warehouse from '@modules/server.common/entities/Warehouse'; import { UserRouter } from '@modules/client.common.angular2/routers/user-router.service'; import { first, takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators'; import { DomSanitizer } from '@angular/platform-browser'; import { WarehousesService } from '../../../../@core/data/warehouses.service'; import ProductInfo from '@modules/server.common/entities/ProductInfo'; Loading @@ -12,21 +12,12 @@ import { StoreOrderProductsComponent } from '../../../../@shared/render-componen import { OrderBtnOrderProductsComponent } from '../../../../@shared/render-component/customer-products-table/order-btn-order-products/order-btn-order-products.component'; import { GeoLocationService } from '../../../../@core/data/geo-location.service'; import { TranslateService } from '@ngx-translate/core'; import { forkJoin, Observable, Subject } from 'rxjs'; import { firstValueFrom, forkJoin, Observable, Subject } from 'rxjs'; @Component({ selector: 'ea-customer-products', styleUrls: ['./ea-customer-products.scss'], template: ` <nb-card> <nb-card-body> <ng2-smart-table [settings]="settingsSmartTable" [source]="sourceSmartTable" ></ng2-smart-table> </nb-card-body> </nb-card> `, templateUrl: './ea-customer-products.component.html', styleUrls: ['./ea-customer-products.scss'] }) export class CustomerProductsComponent implements OnDestroy, OnInit { private ngDestroy$ = new Subject<void>(); Loading @@ -51,15 +42,12 @@ export class CustomerProductsComponent implements OnDestroy, OnInit { ) { this.params$ = this._router.params.subscribe(async (res) => { this.userId = res.id; const user = await this.userRouter .get(this.userId) .pipe(first()) .toPromise(); const user = await firstValueFrom( this.userRouter.get(this.userId) ); if (user == null) { throw new Error(`User can't be found (id: ${this.userId})`); } this.availableProductsSubscription$ = this.geoLocationProductService .getGeoLocationProducts(user.geoLocation) .subscribe((products) => { Loading Loading @@ -159,10 +147,9 @@ export class CustomerProductsComponent implements OnDestroy, OnInit { } private async _loadWarehouses() { this.warehouses = await this._warehousesService .getStores() .pipe(first()) .toPromise(); this.warehouses = await firstValueFrom( this._warehousesService.getStores() ); } ngOnDestroy(): void { Loading Loading
packages/admin-web-angular/src/app/@core/data/geo-location.service.ts +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ export class GeoLocationService { }) .valueChanges.pipe( map((res) => res.data.geoLocationProducts.filter( res.data.geoLocationProducts.filter(Boolean).filter( (p) => p.warehouseProduct.isProductAvailable === true ) ), Loading
packages/admin-web-angular/src/app/pages/+customers/+customer/customer.component.html +2 −3 Original line number Diff line number Diff line <toaster-container> </toaster-container> <div *ngIf="user$ | async as user" class="row"> <div *ngIf="(user$ | async) as user" class="row"> <div class="col-md-8"> <nb-card> <nb-card-header class="row"> Loading Loading @@ -64,8 +64,7 @@ 'CUSTOMERS_VIEW.NEARBY_STORES' | translate }}" > <ea-customer-stores [currentUser]="selectedUser"> </ea-customer-stores> <ea-customer-stores [currentUser]="selectedUser"></ea-customer-stores> </nb-tab> </nb-tabset> </nb-card-body> Loading
packages/admin-web-angular/src/app/pages/+customers/+customer/customer.module.ts +3 −7 Original line number Diff line number Diff line Loading @@ -8,9 +8,7 @@ import { HighlightModule } from 'ngx-highlightjs'; import { ThemeModule } from '../../../@theme'; import { CustomerComponent } from './customer.component'; import { CustomerInfoComponent } from './ea-customer-info/ea-customer-info.component'; import { CustomerProductsComponent } from './ea-customer-products/ea-customer-products/ea-customer-products.component'; // duplicate CustomerProductsComponent import { CustomerProductsComponent as RootCustomerProductsComponent } from './ea-customer-products/ea-customer-products.component'; import { CustomerProductsComponent } from './ea-customer-products/ea-customer-products.component'; import { CustomerLocationComponent } from './ea-customer-location/ea-customer-location.component'; import { CustomerStoresComponent } from './ea-customer-stores/ea-customer-stores.component'; import { CustomerOrdersTableModule } from '../../../@shared/render-component/customer-orders-table/customer-orders-table.module'; Loading Loading @@ -64,10 +62,8 @@ const routes = [ CustomerLocationComponent, CustomerInfoComponent, CustomerProductsComponent, RootCustomerProductsComponent, CustomerStoresComponent, CustomerMetricsComponent, ], entryComponents: [], CustomerMetricsComponent ] }) export class CustomerModule {}
packages/admin-web-angular/src/app/pages/+customers/+customer/ea-customer-products/ea-customer-products/ea-customer-products.component.html→packages/admin-web-angular/src/app/pages/+customers/+customer/ea-customer-products/ea-customer-products.component.html +0 −0 File moved. View file
packages/admin-web-angular/src/app/pages/+customers/+customer/ea-customer-products/ea-customer-products.component.ts +10 −23 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router'; import { LocalDataSource } from 'ng2-smart-table'; import Warehouse from '@modules/server.common/entities/Warehouse'; import { UserRouter } from '@modules/client.common.angular2/routers/user-router.service'; import { first, takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators'; import { DomSanitizer } from '@angular/platform-browser'; import { WarehousesService } from '../../../../@core/data/warehouses.service'; import ProductInfo from '@modules/server.common/entities/ProductInfo'; Loading @@ -12,21 +12,12 @@ import { StoreOrderProductsComponent } from '../../../../@shared/render-componen import { OrderBtnOrderProductsComponent } from '../../../../@shared/render-component/customer-products-table/order-btn-order-products/order-btn-order-products.component'; import { GeoLocationService } from '../../../../@core/data/geo-location.service'; import { TranslateService } from '@ngx-translate/core'; import { forkJoin, Observable, Subject } from 'rxjs'; import { firstValueFrom, forkJoin, Observable, Subject } from 'rxjs'; @Component({ selector: 'ea-customer-products', styleUrls: ['./ea-customer-products.scss'], template: ` <nb-card> <nb-card-body> <ng2-smart-table [settings]="settingsSmartTable" [source]="sourceSmartTable" ></ng2-smart-table> </nb-card-body> </nb-card> `, templateUrl: './ea-customer-products.component.html', styleUrls: ['./ea-customer-products.scss'] }) export class CustomerProductsComponent implements OnDestroy, OnInit { private ngDestroy$ = new Subject<void>(); Loading @@ -51,15 +42,12 @@ export class CustomerProductsComponent implements OnDestroy, OnInit { ) { this.params$ = this._router.params.subscribe(async (res) => { this.userId = res.id; const user = await this.userRouter .get(this.userId) .pipe(first()) .toPromise(); const user = await firstValueFrom( this.userRouter.get(this.userId) ); if (user == null) { throw new Error(`User can't be found (id: ${this.userId})`); } this.availableProductsSubscription$ = this.geoLocationProductService .getGeoLocationProducts(user.geoLocation) .subscribe((products) => { Loading Loading @@ -159,10 +147,9 @@ export class CustomerProductsComponent implements OnDestroy, OnInit { } private async _loadWarehouses() { this.warehouses = await this._warehousesService .getStores() .pipe(first()) .toPromise(); this.warehouses = await firstValueFrom( this._warehousesService.getStores() ); } ngOnDestroy(): void { Loading