From f41285aca296fae580fc5dc0f700bd327f4f2434 Mon Sep 17 00:00:00 2001 From: YavorGrancharov Date: Tue, 14 Jul 2020 22:09:56 +0300 Subject: [PATCH 1/6] fix: carriers not showing on merchant --- .../src/pages/+carriers/carriers.ts | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts index bfdcc216e..b27a8fdbe 100644 --- a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts +++ b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts @@ -18,6 +18,8 @@ import { CarrierTrackPopup } from './carrier-track-popup/carrier-track-popup'; import { Router } from '@angular/router'; import { ConfirmDeletePopupPage } from 'components/confirm-delete-popup/confirm-delete-popup'; import { WarehouseRouter } from '@modules/client.common.angular2/routers/warehouse-router.service'; +import { CarrierRouter } from '@modules/client.common.angular2/routers/carrier-router.service'; +import { WarehouseOrdersRouter } from '@modules/client.common.angular2/routers/warehouse-orders-router.service'; @Component({ selector: 'page-carriers', @@ -35,10 +37,11 @@ export class CarriersPage implements OnInit, OnDestroy { constructor( private readonly router: Router, public modalCtrl: ModalController, - private readonly warehouseCarriersRouter: WarehouseCarriersRouter, private readonly _translateService: TranslateService, private readonly store: Store, - private warehouseRouter: WarehouseRouter + private warehouseRouter: WarehouseRouter, + private readonly carrierRouter: CarrierRouter, + private warehouseOrdersRouter: WarehouseOrdersRouter ) {} get deviceId() { @@ -128,18 +131,41 @@ export class CarriersPage implements OnInit, OnDestroy { this.sourceSmartTable.load(carriersVM); }; - this.warehouseCarriersRouter - .get(this.warehouseId) + let usedCarriers = []; + + this.warehouseOrdersRouter + .get(this.store.warehouseId) .pipe(takeUntil(this._ngDestroy$)) - .subscribe((carriers) => { - this.carriers = carriers; + .subscribe((orders) => { + orders = orders.filter((order) => order.isCancelled === false); + orders.forEach((o) => { + usedCarriers.push(o.carrier); + }); + this.carrierRouter + .getAllActive() + .subscribe((carriers: Carrier[]) => { + this.carriers = carriers.filter((c: Carrier) => + usedCarriers.includes(c.id) + ); + loadData(this.carriers); + this.carriers.length === 0 + ? (this.showNoDeliveryIcon = true) + : (this.showNoDeliveryIcon = false); + }); + }); - loadData(this.carriers); + // this.warehouseCarriersRouter + // .get(this.warehouseId) + // .pipe(takeUntil(this._ngDestroy$)) + // .subscribe((carriers) => { + // this.carriers = carriers; - this.carriers.length === 0 - ? (this.showNoDeliveryIcon = true) - : (this.showNoDeliveryIcon = false); - }); + // loadData(this.carriers); + + // this.carriers.length === 0 + // ? (this.showNoDeliveryIcon = true) + // : (this.showNoDeliveryIcon = false); + // }); } goToTrackPage() { From 4c5e69e281fa050892a43c3ee879fd5af7b4a911 Mon Sep 17 00:00:00 2001 From: YavorGrancharov Date: Tue, 14 Jul 2020 22:14:46 +0300 Subject: [PATCH 2/6] fix: removed unused import --- packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts index b27a8fdbe..84def51b5 100644 --- a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts +++ b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts @@ -9,7 +9,6 @@ import { AddressesComponent } from '../../components/carriers-table/addresses'; import { StatusComponent } from '../../components/carriers-table/status'; import { DeliveriesComponent } from '../../components/carriers-table/deliveries'; import { ImageComponent } from '../../components/carriers-table/image'; -import { WarehouseCarriersRouter } from '@modules/client.common.angular2/routers/warehouse-carriers-router.service'; import { Store } from '../../../src/services/store.service'; import { ModalController } from '@ionic/angular'; import { AddCarriersPopupPage } from './add-carriers-popup/add-carriers-popup'; From 69e5e92e1cfa0faf55f67230ddfc131c68cc153a Mon Sep 17 00:00:00 2001 From: Yavor Grancharov Date: Wed, 5 Aug 2020 17:34:15 +0300 Subject: [PATCH 3/6] fix: show active carriers on merchant --- .../warehouse-carriers-router.service.ts | 10 +++ .../src/routers/IWarehouseCarriersRouter.ts | 1 + .../warehouses-carriers.types.graphql | 1 + .../warehouses/WarehousesCarriersService.ts | 36 ++++++++ .../src/pages/+carriers/carriers.ts | 83 ++++++++++++------- 5 files changed, 100 insertions(+), 31 deletions(-) diff --git a/packages/common-angular/src/routers/warehouse-carriers-router.service.ts b/packages/common-angular/src/routers/warehouse-carriers-router.service.ts index 6b88af229..7a2424fd2 100644 --- a/packages/common-angular/src/routers/warehouse-carriers-router.service.ts +++ b/packages/common-angular/src/routers/warehouse-carriers-router.service.ts @@ -25,6 +25,16 @@ export class WarehouseCarriersRouter implements IWarehouseCarriersRouter { ); } + getUsedCarriers(warehouseId: string): Observable { + return this.router + .runAndObserve('getUsedCarriers', warehouseId) + .pipe( + map((carriers) => + _.map(carriers, (carrier) => this._carrierFactory(carrier)) + ) + ); + } + async updatePassword(id: string, password: string): Promise { await this.router.run('updatePassword', id, password); } diff --git a/packages/common/src/routers/IWarehouseCarriersRouter.ts b/packages/common/src/routers/IWarehouseCarriersRouter.ts index d8f88e799..bc160fe50 100644 --- a/packages/common/src/routers/IWarehouseCarriersRouter.ts +++ b/packages/common/src/routers/IWarehouseCarriersRouter.ts @@ -4,6 +4,7 @@ import Carrier from '../entities/Carrier'; interface IWarehouseCarriersRouter { get(warehouseId: Warehouse['id']): Observable; + getUsedCarriers(warehouseId: Warehouse['id']): Observable; updatePassword(id: Carrier['id'], password: string): Promise; } diff --git a/packages/core/src/graphql/warehouses-carriers/warehouses-carriers.types.graphql b/packages/core/src/graphql/warehouses-carriers/warehouses-carriers.types.graphql index ef89662dc..e0050393c 100644 --- a/packages/core/src/graphql/warehouses-carriers/warehouses-carriers.types.graphql +++ b/packages/core/src/graphql/warehouses-carriers/warehouses-carriers.types.graphql @@ -1,3 +1,4 @@ type Query { getStoreCarriers(storeId: String!): [Carrier!] + getUsedCarriers(storeId: String!): [Carrier!] } diff --git a/packages/core/src/services/warehouses/WarehousesCarriersService.ts b/packages/core/src/services/warehouses/WarehousesCarriersService.ts index 3eda29eba..83fb18386 100644 --- a/packages/core/src/services/warehouses/WarehousesCarriersService.ts +++ b/packages/core/src/services/warehouses/WarehousesCarriersService.ts @@ -83,6 +83,42 @@ export class WarehousesCarriersService implements IWarehouseCarriersRouter { ); } + /** + * Get Carriers assigned to given Store + * Returns all if warehouse.hasRestrictedCarriers + * @param {String} warehouseId + * @returns {Observable} + */ + @observableListener() + getUsedCarriers( + warehouseId: Warehouse['id'] + ): Observable { + return this.warehousesService.get(warehouseId).pipe( + map((warehouse) => { + if (!warehouse.hasRestrictedCarriers) { + throw new NoWarehouseRestrictedCarriersError(); + } + console.log(warehouse.carriersIds); + + return warehouse.carriersIds; + }), + distinctUntilChanged((carrierIds1, carrierIds2) => { + return _.isEqual(carrierIds1.sort(), carrierIds2.sort()); + }), + exhaustMap((carrierIds) => { + return this.carriersService.getMultipleByIds(carrierIds); + }), + switchMap((carriers) => carriers), + catchError((err) => { + if (!(err instanceof NoWarehouseRestrictedCarriersError)) { + throw err; + } + + return of(null); + }) + ); + } + /** * Update carrier password * diff --git a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts index 2b0290b27..3087bcabd 100644 --- a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts +++ b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts @@ -19,6 +19,9 @@ import { ConfirmDeletePopupPage } from 'components/confirm-delete-popup/confirm- import { WarehouseRouter } from '@modules/client.common.angular2/routers/warehouse-router.service'; import { CarrierRouter } from '@modules/client.common.angular2/routers/carrier-router.service'; import { WarehouseOrdersRouter } from '@modules/client.common.angular2/routers/warehouse-orders-router.service'; +import { WarehouseCarriersRouter } from '@modules/client.common.angular2/routers/warehouse-carriers-router.service'; +import { CarrierService } from 'services/carrier.service'; +import { computeStackId } from '@ionic/angular/directives/navigation/stack-utils'; @Component({ selector: 'page-carriers', @@ -40,7 +43,9 @@ export class CarriersPage implements OnInit, OnDestroy { private readonly store: Store, private warehouseRouter: WarehouseRouter, private readonly carrierRouter: CarrierRouter, - private warehouseOrdersRouter: WarehouseOrdersRouter + private readonly carrierService: CarrierService, + private warehouseOrdersRouter: WarehouseOrdersRouter, + private readonly warehouseCarriersRouter: WarehouseCarriersRouter ) {} get deviceId() { @@ -129,40 +134,56 @@ export class CarriersPage implements OnInit, OnDestroy { this.sourceSmartTable.load(carriersVM); }; - let usedCarriers = []; + this.warehouseRouter + .get(this.warehouseId) + .subscribe(async (warehouse) => { + if (warehouse.hasRestrictedCarriers) { + this.carriers = + (await this.warehouseCarriersRouter + .getUsedCarriers(this.warehouseId) + .pipe(first()) + .toPromise()) || + (await this.warehouseCarriersRouter + .get(this.warehouseId) + .pipe(first()) + .toPromise()); - this.warehouseOrdersRouter - .get(this.store.warehouseId) - .pipe(takeUntil(this._ngDestroy$)) - .subscribe((orders) => { - orders = orders.filter((order) => order.isCancelled === false); - orders.forEach((o) => { - usedCarriers.push(o.carrier); - }); - this.carrierRouter - .getAllActive() - .subscribe((carriers: Carrier[]) => { - this.carriers = carriers.filter((c: Carrier) => - usedCarriers.includes(c.id) - ); - loadData(this.carriers); - this.carriers.length === 0 - ? (this.showNoDeliveryIcon = true) - : (this.showNoDeliveryIcon = false); - }); + loadData(this.carriers); + this.carriers.length === 0 + ? (this.showNoDeliveryIcon = true) + : (this.showNoDeliveryIcon = false); + } else { + this.carrierRouter + .getAllActive() + .subscribe((carriers: Carrier[]) => { + this.carriers = carriers; + loadData(this.carriers); + this.carriers.length === 0 + ? (this.showNoDeliveryIcon = true) + : (this.showNoDeliveryIcon = false); + }); + } }); - // this.warehouseCarriersRouter - // .get(this.warehouseId) + // this.warehouseOrdersRouter + // .get(this.store.warehouseId) // .pipe(takeUntil(this._ngDestroy$)) - // .subscribe((carriers) => { - // this.carriers = carriers; - - // loadData(this.carriers); - - // this.carriers.length === 0 - // ? (this.showNoDeliveryIcon = true) - // : (this.showNoDeliveryIcon = false); + // .subscribe((orders) => { + // orders = orders.filter((order) => order.isCancelled === false); + // orders.forEach((o) => { + // usedCarriers.push(o.carrier); + // }); + // this.carrierRouter + // .getAllActive() + // .subscribe((carriers: Carrier[]) => { + // this.carriers = carriers.filter((c: Carrier) => + // usedCarriers.includes(c.id) + // ); + // loadData(this.carriers); + // this.carriers.length === 0 + // ? (this.showNoDeliveryIcon = true) + // : (this.showNoDeliveryIcon = false); + // }); // }); } From 25192d8cadaf726c23656a75b56b10b15d12e8d4 Mon Sep 17 00:00:00 2001 From: Yavor Grancharov Date: Thu, 6 Aug 2020 18:09:25 +0300 Subject: [PATCH 4/6] fix: autoselect specific carriers added from merchant --- .../warehouses/WarehousesCarriersService.ts | 9 +++-- .../add-carriers-popup/add-carriers-popup.ts | 3 ++ .../src/pages/+carriers/carriers.ts | 39 ++++--------------- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/packages/core/src/services/warehouses/WarehousesCarriersService.ts b/packages/core/src/services/warehouses/WarehousesCarriersService.ts index 83fb18386..6cc5edbf0 100644 --- a/packages/core/src/services/warehouses/WarehousesCarriersService.ts +++ b/packages/core/src/services/warehouses/WarehousesCarriersService.ts @@ -85,7 +85,7 @@ export class WarehousesCarriersService implements IWarehouseCarriersRouter { /** * Get Carriers assigned to given Store - * Returns all if warehouse.hasRestrictedCarriers + * Returns all used if warehouse.hasRestrictedCarriers * @param {String} warehouseId * @returns {Observable} */ @@ -98,9 +98,12 @@ export class WarehousesCarriersService implements IWarehouseCarriersRouter { if (!warehouse.hasRestrictedCarriers) { throw new NoWarehouseRestrictedCarriersError(); } - console.log(warehouse.carriersIds); + const usedCarriers = []; - return warehouse.carriersIds; + usedCarriers.push(...warehouse.carriersIds); + usedCarriers.push(...warehouse.usedCarriersIds); + + return usedCarriers; }), distinctUntilChanged((carrierIds1, carrierIds2) => { return _.isEqual(carrierIds1.sort(), carrierIds2.sort()); diff --git a/packages/merchant-tablet-ionic/src/pages/+carriers/add-carriers-popup/add-carriers-popup.ts b/packages/merchant-tablet-ionic/src/pages/+carriers/add-carriers-popup/add-carriers-popup.ts index 5bc55f713..429b7ddd0 100644 --- a/packages/merchant-tablet-ionic/src/pages/+carriers/add-carriers-popup/add-carriers-popup.ts +++ b/packages/merchant-tablet-ionic/src/pages/+carriers/add-carriers-popup/add-carriers-popup.ts @@ -147,6 +147,9 @@ export class AddCarriersPopupPage implements OnInit, OnDestroy { warehouse.usedCarriersIds.push(carrier.id); } else if (this.choiced === 'existing') { warehouse.hasRestrictedCarriers = true; + warehouse.carriersIds.push( + ...this.carriersCatalog.selecteCarriers.map((c) => c.id) + ); warehouse.usedCarriersIds.push( ...this.carriersCatalog.selecteCarriers.map((c) => c.id) ); diff --git a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts index 3087bcabd..e6e7653f6 100644 --- a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts +++ b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts @@ -137,16 +137,14 @@ export class CarriersPage implements OnInit, OnDestroy { this.warehouseRouter .get(this.warehouseId) .subscribe(async (warehouse) => { - if (warehouse.hasRestrictedCarriers) { - this.carriers = - (await this.warehouseCarriersRouter - .getUsedCarriers(this.warehouseId) - .pipe(first()) - .toPromise()) || - (await this.warehouseCarriersRouter - .get(this.warehouseId) - .pipe(first()) - .toPromise()); + if ( + warehouse.carriersIds.length || + warehouse.hasRestrictedCarriers + ) { + this.carriers = await this.warehouseCarriersRouter + .getUsedCarriers(this.warehouseId) + .pipe(first()) + .toPromise(); loadData(this.carriers); this.carriers.length === 0 @@ -164,27 +162,6 @@ export class CarriersPage implements OnInit, OnDestroy { }); } }); - - // this.warehouseOrdersRouter - // .get(this.store.warehouseId) - // .pipe(takeUntil(this._ngDestroy$)) - // .subscribe((orders) => { - // orders = orders.filter((order) => order.isCancelled === false); - // orders.forEach((o) => { - // usedCarriers.push(o.carrier); - // }); - // this.carrierRouter - // .getAllActive() - // .subscribe((carriers: Carrier[]) => { - // this.carriers = carriers.filter((c: Carrier) => - // usedCarriers.includes(c.id) - // ); - // loadData(this.carriers); - // this.carriers.length === 0 - // ? (this.showNoDeliveryIcon = true) - // : (this.showNoDeliveryIcon = false); - // }); - // }); } goToTrackPage() { From e6445250888c3a999ae1f192db6a8bdb3f645af6 Mon Sep 17 00:00:00 2001 From: YavorGrancharov Date: Fri, 7 Aug 2020 16:41:37 +0300 Subject: [PATCH 5/6] fix: show carriers on merchant --- .../carrier-orders-status.component.ts | 14 +++++++++++++- .../warehouse-manage.component.ts | 1 + .../drive-to-warehouse/drive-to-warehouse.ts | 16 +++++++++++++++- packages/common-angular/package.json | 2 +- packages/common/package.json | 2 +- packages/core/package.json | 2 +- .../add-carriers-popup/add-carriers-popup.ts | 5 +---- .../src/pages/+carriers/carriers.ts | 5 +---- 8 files changed, 34 insertions(+), 13 deletions(-) diff --git a/packages/admin-web-angular/src/app/pages/+carriers/+carrier/carrier-orders-status/carrier-orders-status.component.ts b/packages/admin-web-angular/src/app/pages/+carriers/+carrier/carrier-orders-status/carrier-orders-status.component.ts index 6fc13dbe3..0fa8783a8 100644 --- a/packages/admin-web-angular/src/app/pages/+carriers/+carrier/carrier-orders-status/carrier-orders-status.component.ts +++ b/packages/admin-web-angular/src/app/pages/+carriers/+carrier/carrier-orders-status/carrier-orders-status.component.ts @@ -11,6 +11,9 @@ import { CarrierOrdersRouter } from '@modules/client.common.angular2/routers/car import OrderCarrierStatus from '@modules/server.common/enums/OrderCarrierStatus'; import _ from 'lodash'; import { OrderRouter } from '@modules/client.common.angular2/routers/order-router.service'; +import Warehouse from '@modules/server.common/entities/Warehouse'; +import { WarehouseRouter } from '@modules/client.common.angular2/routers/warehouse-router.service'; +import { first } from 'rxjs/operators'; @Component({ selector: 'ea-carrier-orders-status', @@ -39,7 +42,8 @@ export class CarrierOrdersStatusComponent implements OnDestroy { constructor( private carrierOrdersRouter: CarrierOrdersRouter, - private orderRouter: OrderRouter + private orderRouter: OrderRouter, + public warehouseRouter: WarehouseRouter ) { this.enumOrderCarrierStatus = OrderCarrierStatus; } @@ -54,6 +58,14 @@ export class CarrierOrdersStatusComponent implements OnDestroy { } async selectOrdersForDelivery() { + const warehouse: Warehouse = await this.warehouseRouter + .get(this.selectedOrder.warehouse['id']) + .pipe(first()) + .toPromise(); + + warehouse.usedCarriersIds.push(this.selectedCarrier.id); + this.warehouseRouter.save(warehouse); + this.pageBtnStates.isSelectOrdersForDeliveryAvailable = false; this.selectedOrder.carrierStatus = this.enumOrderCarrierStatus.CarrierSelectedOrder; diff --git a/packages/admin-web-angular/src/app/pages/+warehouses/+warehouse/+warehouse-manage/warehouse-manage.component.ts b/packages/admin-web-angular/src/app/pages/+warehouses/+warehouse/+warehouse-manage/warehouse-manage.component.ts index d12c604e6..1a0454c9b 100644 --- a/packages/admin-web-angular/src/app/pages/+warehouses/+warehouse/+warehouse-manage/warehouse-manage.component.ts +++ b/packages/admin-web-angular/src/app/pages/+warehouses/+warehouse/+warehouse-manage/warehouse-manage.component.ts @@ -72,6 +72,7 @@ export class WarehouseManageComponent implements OnInit { ...this._currentWarehouse, ...tabsInfoRaw.basicInfo, ...tabsInfoRaw.contactInfo, + usedCarriersIds: this._currentWarehouse.usedCarriersIds, geoLocation: tabsInfoRaw.location, deliveryAreas: tabsInfoRaw.deliveryAreas, isPaymentEnabled: tabsInfoRaw.isPaymentEnabled, diff --git a/packages/carrier-mobile-ionic/src/pages/main/drive-to-warehouse/drive-to-warehouse.ts b/packages/carrier-mobile-ionic/src/pages/main/drive-to-warehouse/drive-to-warehouse.ts index 5019a3bbd..0ac8c9cd0 100644 --- a/packages/carrier-mobile-ionic/src/pages/main/drive-to-warehouse/drive-to-warehouse.ts +++ b/packages/carrier-mobile-ionic/src/pages/main/drive-to-warehouse/drive-to-warehouse.ts @@ -16,6 +16,9 @@ import { MapComponent } from '../common/map/map.component'; import { Router } from '@angular/router'; import { NavController, Platform } from '@ionic/angular'; import { getIdFromTheDate } from '@modules/server.common/utils'; +import Warehouse from '@modules/server.common/entities/Warehouse'; +import { WarehouseRouter } from '@modules/client.common.angular2/routers/warehouse-router.service'; +import { first } from 'rxjs/operators'; declare var google: any; @@ -36,6 +39,7 @@ export class DriveToWarehousePage implements OnInit { selectedOrderID: string; orderCarrierCompetition: boolean; isTakenFromAnotherCarrier: boolean = false; + warehouseId: string; carrier$; order$; @@ -49,7 +53,8 @@ export class DriveToWarehousePage implements OnInit { private geolocation: Geolocation, private router: Router, private navCtrl: NavController, - public platform: Platform + public platform: Platform, + public warehouseRouter: WarehouseRouter ) {} ngOnInit(): void { @@ -88,6 +93,7 @@ export class DriveToWarehousePage implements OnInit { populateWarehouse: true, }) .subscribe((order) => { + this.warehouseId = order.warehouseId; this.orderCarrierCompetition = order.warehouse['carrierCompetition']; @@ -135,6 +141,14 @@ export class DriveToWarehousePage implements OnInit { async takeWork() { if (this.carrier && this.selectedOrder) { + const warehouse: Warehouse = await this.warehouseRouter + .get(this.warehouseId) + .pipe(first()) + .toPromise(); + + warehouse.usedCarriersIds.push(this.carrier['id']); + this.warehouseRouter.save(warehouse); + return await this.carrierOrdersRouter.selectedForDelivery( this.carrier['id'], [this.selectedOrder['id']] diff --git a/packages/common-angular/package.json b/packages/common-angular/package.json index 33c6eb923..5234bc486 100644 --- a/packages/common-angular/package.json +++ b/packages/common-angular/package.json @@ -2,7 +2,7 @@ "name": "@ever-platform/common-angular", "description": "Ever Platform Shared Angular Core", "license": "AGPL-3.0", - "version": "0.3.6", + "version": "0.3.7", "homepage": "https://ever.co", "repository": { "type": "git", diff --git a/packages/common/package.json b/packages/common/package.json index 9571b660c..5eebcb1ae 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -2,7 +2,7 @@ "name": "@ever-platform/common", "description": "Ever Platform Shared Core", "license": "AGPL-3.0", - "version": "0.3.24", + "version": "0.3.25", "homepage": "https://ever.co", "repository": { "type": "git", diff --git a/packages/core/package.json b/packages/core/package.json index 1668a5eca..d8124f9dc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -2,7 +2,7 @@ "name": "@ever-platform/core", "description": "Ever Platform Headless Framework", "license": "AGPL-3.0", - "version": "0.3.29", + "version": "0.3.30", "homepage": "https://ever.co", "repository": { "type": "git", diff --git a/packages/merchant-tablet-ionic/src/pages/+carriers/add-carriers-popup/add-carriers-popup.ts b/packages/merchant-tablet-ionic/src/pages/+carriers/add-carriers-popup/add-carriers-popup.ts index 429b7ddd0..2d45f30be 100644 --- a/packages/merchant-tablet-ionic/src/pages/+carriers/add-carriers-popup/add-carriers-popup.ts +++ b/packages/merchant-tablet-ionic/src/pages/+carriers/add-carriers-popup/add-carriers-popup.ts @@ -144,15 +144,12 @@ export class AddCarriersPopupPage implements OnInit, OnDestroy { }); warehouse.hasRestrictedCarriers = true; - warehouse.usedCarriersIds.push(carrier.id); + warehouse.carriersIds.push(carrier.id); } else if (this.choiced === 'existing') { warehouse.hasRestrictedCarriers = true; warehouse.carriersIds.push( ...this.carriersCatalog.selecteCarriers.map((c) => c.id) ); - warehouse.usedCarriersIds.push( - ...this.carriersCatalog.selecteCarriers.map((c) => c.id) - ); } this.warehouseRouter.save(warehouse); diff --git a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts index e6e7653f6..6828aabce 100644 --- a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts +++ b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts @@ -137,10 +137,7 @@ export class CarriersPage implements OnInit, OnDestroy { this.warehouseRouter .get(this.warehouseId) .subscribe(async (warehouse) => { - if ( - warehouse.carriersIds.length || - warehouse.hasRestrictedCarriers - ) { + if (warehouse.hasRestrictedCarriers) { this.carriers = await this.warehouseCarriersRouter .getUsedCarriers(this.warehouseId) .pipe(first()) From 0fcfbd53a6b91aeda547b55ded911d8b5c8a41db Mon Sep 17 00:00:00 2001 From: YavorGrancharov Date: Fri, 7 Aug 2020 16:47:39 +0300 Subject: [PATCH 6/6] fix: removed unused import --- packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts index 6828aabce..5b517cc92 100644 --- a/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts +++ b/packages/merchant-tablet-ionic/src/pages/+carriers/carriers.ts @@ -21,7 +21,6 @@ import { CarrierRouter } from '@modules/client.common.angular2/routers/carrier-r import { WarehouseOrdersRouter } from '@modules/client.common.angular2/routers/warehouse-orders-router.service'; import { WarehouseCarriersRouter } from '@modules/client.common.angular2/routers/warehouse-carriers-router.service'; import { CarrierService } from 'services/carrier.service'; -import { computeStackId } from '@ionic/angular/directives/navigation/stack-utils'; @Component({ selector: 'page-carriers',