Loading carrier/mobile-ionic/src/pages/main/drive-to-warehouse/drive-to-warehouse.html +10 −6 Original line number Diff line number Diff line Loading @@ -6,12 +6,11 @@ <span class="right-text">{{ carrierUserDistance + 'km' }}</span> </div> <div class="buttons"> <div class="button-bar" *ngIf="!workTaken"> <button *ngIf="!selectedOrder?.isCancelled" class="button button-brand" (click)="takeWork()" <div class="button-bar" *ngIf="!workTaken && !selectedOrder?.isCancelled" > <button class="button button-brand" (click)="takeWork()"> {{ 'DRIVE_TO_WAREHOUSE_VIEW.TAKE_WORK' | translate }} </button> Loading @@ -36,5 +35,10 @@ {{ 'DRIVE_TO_WAREHOUSE_VIEW.CANCEL' | translate }} </button> </div> <div class="button-bar" *ngIf="selectedOrder?.isCancelled"> <button class="button button-assertive" (click)="unselectOrder()"> {{ 'OK' | translate }} </button> </div> </div> </div> carrier/mobile-ionic/src/pages/main/drive-to-warehouse/drive-to-warehouse.ts +9 −13 Original line number Diff line number Diff line Loading @@ -124,10 +124,6 @@ export class DriveToWarehousePage { ]); this.unselectOrder(); this.router.navigateByUrl('/main/home', { skipLocationChange: false }); } } Loading Loading @@ -161,10 +157,6 @@ export class DriveToWarehousePage { [this.selectedOrder['id']] ); this.unselectOrder(); this.router.navigateByUrl('/main/home', { skipLocationChange: false }); } } } Loading @@ -174,6 +166,15 @@ export class DriveToWarehousePage { this.unsubscribeAll(); } unselectOrder() { this.store.selectedOrder = null; localStorage.removeItem('orderId'); this.router.navigateByUrl('/main/home', { skipLocationChange: false }); } private unsubscribeAll() { if (this.carrier$) { this.carrier$.unsubscribe(); Loading @@ -183,11 +184,6 @@ export class DriveToWarehousePage { } } private unselectOrder() { this.store.selectedOrder = null; localStorage.removeItem('orderId'); } private unselectDriveToWarehouseFrom() { localStorage.removeItem('driveToWarehouseFrom'); } Loading carrier/mobile-ionic/src/pages/main/home/home.ts +10 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,16 @@ export class HomePage { if (carrier.status === CarrierStatus.Online) { this.order$ = this.geoLocationOrdersService .getOrderForWork(dbGeoInput, carrier.skippedOrderIds) .getOrderForWork( dbGeoInput, carrier.skippedOrderIds, null, { byRegex: [ { key: 'isCancelled', value: 'false' } ] } ) .subscribe(async (order) => { if (order || this.store.orderId) { Loading carrier/mobile-ionic/src/services/geo-location-order.service.ts +5 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,8 @@ export class GeoLocationOrdersService { getOrderForWork( geoLocation: IGeoLocation, skippedOrderIds: string[] = [], options: { sort: string } = { sort: 'asc' } options: { sort: string } = { sort: 'asc' }, searchObj?: { byRegex: Array<{ key: string; value: string }> } ) { return this.apollo .watchQuery<{ getOrderForWork: Order }>({ Loading @@ -21,17 +22,19 @@ export class GeoLocationOrdersService { $geoLocation: GeoLocationFindInput! $skippedOrderIds: [String!]! $options: GeoLocationOrdersOptions $searchObj: SearchOrdersForWork ) { getOrderForWork( geoLocation: $geoLocation skippedOrderIds: $skippedOrderIds options: $options searchObj: $searchObj ) { id } } `, variables: { geoLocation, skippedOrderIds, options }, variables: { geoLocation, skippedOrderIds, options, searchObj }, pollInterval: 2000 }) .valueChanges.pipe( Loading Loading
carrier/mobile-ionic/src/pages/main/drive-to-warehouse/drive-to-warehouse.html +10 −6 Original line number Diff line number Diff line Loading @@ -6,12 +6,11 @@ <span class="right-text">{{ carrierUserDistance + 'km' }}</span> </div> <div class="buttons"> <div class="button-bar" *ngIf="!workTaken"> <button *ngIf="!selectedOrder?.isCancelled" class="button button-brand" (click)="takeWork()" <div class="button-bar" *ngIf="!workTaken && !selectedOrder?.isCancelled" > <button class="button button-brand" (click)="takeWork()"> {{ 'DRIVE_TO_WAREHOUSE_VIEW.TAKE_WORK' | translate }} </button> Loading @@ -36,5 +35,10 @@ {{ 'DRIVE_TO_WAREHOUSE_VIEW.CANCEL' | translate }} </button> </div> <div class="button-bar" *ngIf="selectedOrder?.isCancelled"> <button class="button button-assertive" (click)="unselectOrder()"> {{ 'OK' | translate }} </button> </div> </div> </div>
carrier/mobile-ionic/src/pages/main/drive-to-warehouse/drive-to-warehouse.ts +9 −13 Original line number Diff line number Diff line Loading @@ -124,10 +124,6 @@ export class DriveToWarehousePage { ]); this.unselectOrder(); this.router.navigateByUrl('/main/home', { skipLocationChange: false }); } } Loading Loading @@ -161,10 +157,6 @@ export class DriveToWarehousePage { [this.selectedOrder['id']] ); this.unselectOrder(); this.router.navigateByUrl('/main/home', { skipLocationChange: false }); } } } Loading @@ -174,6 +166,15 @@ export class DriveToWarehousePage { this.unsubscribeAll(); } unselectOrder() { this.store.selectedOrder = null; localStorage.removeItem('orderId'); this.router.navigateByUrl('/main/home', { skipLocationChange: false }); } private unsubscribeAll() { if (this.carrier$) { this.carrier$.unsubscribe(); Loading @@ -183,11 +184,6 @@ export class DriveToWarehousePage { } } private unselectOrder() { this.store.selectedOrder = null; localStorage.removeItem('orderId'); } private unselectDriveToWarehouseFrom() { localStorage.removeItem('driveToWarehouseFrom'); } Loading
carrier/mobile-ionic/src/pages/main/home/home.ts +10 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,16 @@ export class HomePage { if (carrier.status === CarrierStatus.Online) { this.order$ = this.geoLocationOrdersService .getOrderForWork(dbGeoInput, carrier.skippedOrderIds) .getOrderForWork( dbGeoInput, carrier.skippedOrderIds, null, { byRegex: [ { key: 'isCancelled', value: 'false' } ] } ) .subscribe(async (order) => { if (order || this.store.orderId) { Loading
carrier/mobile-ionic/src/services/geo-location-order.service.ts +5 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,8 @@ export class GeoLocationOrdersService { getOrderForWork( geoLocation: IGeoLocation, skippedOrderIds: string[] = [], options: { sort: string } = { sort: 'asc' } options: { sort: string } = { sort: 'asc' }, searchObj?: { byRegex: Array<{ key: string; value: string }> } ) { return this.apollo .watchQuery<{ getOrderForWork: Order }>({ Loading @@ -21,17 +22,19 @@ export class GeoLocationOrdersService { $geoLocation: GeoLocationFindInput! $skippedOrderIds: [String!]! $options: GeoLocationOrdersOptions $searchObj: SearchOrdersForWork ) { getOrderForWork( geoLocation: $geoLocation skippedOrderIds: $skippedOrderIds options: $options searchObj: $searchObj ) { id } } `, variables: { geoLocation, skippedOrderIds, options }, variables: { geoLocation, skippedOrderIds, options, searchObj }, pollInterval: 2000 }) .valueChanges.pipe( Loading