mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
HIMA-989 filtering articles lists and improve url params
This commit is contained in:
@@ -35,6 +35,8 @@ export class AppService implements OnDestroy {
|
||||
remissionReminder$ = new Subject();
|
||||
openStartedRemissionLeavingDialog$ = new Subject();
|
||||
timerClear$ = new Subject();
|
||||
|
||||
private remissionReminderActivate = false;
|
||||
constructor(
|
||||
private ssoService: SsoService,
|
||||
private store: Store,
|
||||
@@ -167,10 +169,11 @@ export class AppService implements OnDestroy {
|
||||
this.store
|
||||
.select(RemissionSelectors.shouldRemindForRemission)
|
||||
.pipe(
|
||||
filter(data => !isNullOrUndefined(data)),
|
||||
filter(data => !isNullOrUndefined(data) && !this.remissionReminderActivate),
|
||||
take(1)
|
||||
)
|
||||
.subscribe(status => {
|
||||
this.remissionReminderActivate = true;
|
||||
const shouldRemind = this.checkRemissionReminder(status);
|
||||
if (shouldRemind) {
|
||||
this.registerNotIdleRemissionReminder();
|
||||
|
||||
@@ -60,10 +60,9 @@ export class CustomerOrderItemRowComponent implements OnInit {
|
||||
}
|
||||
|
||||
const subItem = this.order.items.find(t => t.id === id).data.subsetItems[0].data;
|
||||
|
||||
const path = `/shelf/edit/${subItem.compartmentCode ? subItem.compartmentCode : this.order.id}/${this.order.id}/${
|
||||
subItem.processingStatus
|
||||
}/${subItem.compartmentCode ? 'c' : 'o'}/customer/${this.customerId}/0`;
|
||||
}/${subItem.compartmentCode ? 'c' : 'o'}/customer/${this.customerId}/${subItem.id}`;
|
||||
this.store.dispatch(
|
||||
new AddBreadcrumb(
|
||||
<Breadcrumb>{
|
||||
|
||||
@@ -13,13 +13,13 @@ import { takeUntil, switchMap, catchError, concatMap, delay, debounceTime } from
|
||||
|
||||
export enum FieldType {
|
||||
item,
|
||||
subsetItem,
|
||||
subsetItem
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-order-overview-edit',
|
||||
templateUrl: './order-overview-edit.component.html',
|
||||
styleUrls: ['./order-overview-edit.component.scss'],
|
||||
styleUrls: ['./order-overview-edit.component.scss']
|
||||
})
|
||||
export class OrderOverviewEditComponent implements OnInit, OnDestroy {
|
||||
@Input() set _order(val: OrderDTO) {
|
||||
@@ -73,6 +73,7 @@ export class OrderOverviewEditComponent implements OnInit, OnDestroy {
|
||||
let pickUpDate = '';
|
||||
if (
|
||||
model.order.items &&
|
||||
model.order.items[0] &&
|
||||
model.order.items[0].data &&
|
||||
model.order.items[0].data.subsetItems &&
|
||||
model.order.items[0].data.subsetItems[0].data &&
|
||||
@@ -87,6 +88,7 @@ export class OrderOverviewEditComponent implements OnInit, OnDestroy {
|
||||
let status: number;
|
||||
if (
|
||||
model.order.items &&
|
||||
model.order.items[0] &&
|
||||
model.order.items[0].data &&
|
||||
model.order.items[0].data.subsetItems &&
|
||||
model.order.items[0].data.subsetItems[0].data &&
|
||||
@@ -102,11 +104,11 @@ export class OrderOverviewEditComponent implements OnInit, OnDestroy {
|
||||
compartmentCode: [model.compartmentCode ? model.compartmentCode : '', Validators.required],
|
||||
processingStatus: fb.group({
|
||||
key: [status ? status : null],
|
||||
value: [status ? orderStatusMapper[status] : null],
|
||||
value: [status ? orderStatusMapper[status] : null]
|
||||
}),
|
||||
order_number: [model.order.orderNumber, Validators.required],
|
||||
order_date: [orderDate, Validators.required],
|
||||
compartmentStop: [pickUpDate, Validators.required],
|
||||
compartmentStop: [pickUpDate, Validators.required]
|
||||
});
|
||||
this.orderForm.disable();
|
||||
}
|
||||
@@ -230,7 +232,7 @@ export class OrderOverviewEditComponent implements OnInit, OnDestroy {
|
||||
orderId: this.order.id,
|
||||
orderItemId: item.id,
|
||||
orderItemSubsetId: orderItemSubsetId,
|
||||
orderItemSubsetDTO: orderItemsubset,
|
||||
orderItemSubsetDTO: orderItemsubset
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -314,7 +316,7 @@ export class OrderOverviewEditComponent implements OnInit, OnDestroy {
|
||||
return { ...item, data: { ...item.data, subsetItems: [{ ...item.data.subsetItems[0], data: orderItemSubset }] } };
|
||||
}
|
||||
return item;
|
||||
}),
|
||||
})
|
||||
};
|
||||
this.store.dispatch(new SetEditOrder(this.order));
|
||||
this.initializeData();
|
||||
|
||||
@@ -3,20 +3,18 @@ import { Select, Store } from '@ngxs/store';
|
||||
import { CollectingShelfSelectors } from 'apps/sales/src/app/core/store/selectors/collecting-shelf.selector';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { OrderDTO } from 'swagger/lib/oms/models/order-dto';
|
||||
import { takeUntil, filter, take } from 'rxjs/operators';
|
||||
import { takeUntil, filter, take, map } from 'rxjs/operators';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import { Router, ActivatedRoute, Params } from '@angular/router';
|
||||
import { ChangeCurrentRoute } from 'apps/sales/src/app/core/store/actions/process.actions';
|
||||
import { AddBreadcrumb, PopBreadcrumbsAfterCurrent } from 'apps/sales/src/app/core/store/actions/breadcrumb.actions';
|
||||
import { Breadcrumb } from 'apps/sales/src/app/core/models/breadcrumb.model';
|
||||
import { PopBreadcrumbsAfterCurrent } from 'apps/sales/src/app/core/store/actions/breadcrumb.actions';
|
||||
import { CollectingShelfService } from 'apps/sales/src/app/core/services/collecting-shelf.service';
|
||||
import { SetEditOrder } from 'apps/sales/src/app/core/store/actions/collecting-shelf.action';
|
||||
import { SetBranchProcessCurrentPath } from 'apps/sales/src/app/core/store/actions/branch-process.actions';
|
||||
|
||||
@Component({
|
||||
selector: 'app-shelf-edit-order',
|
||||
templateUrl: './shelf-edit-order.component.html',
|
||||
styleUrls: ['./shelf-edit-order.component.scss'],
|
||||
styleUrls: ['./shelf-edit-order.component.scss']
|
||||
})
|
||||
export class ShelfEditOrderComponent implements OnInit, OnDestroy {
|
||||
@Select(CollectingShelfSelectors.getShelfEditOrder) order$: Observable<OrderDTO>;
|
||||
@@ -33,13 +31,6 @@ export class ShelfEditOrderComponent implements OnInit, OnDestroy {
|
||||
constructor(private store: Store, private router: Router, private route: ActivatedRoute, private shelfService: CollectingShelfService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.order$
|
||||
.pipe(
|
||||
takeUntil(this.destroy$),
|
||||
filter(data => !isNullOrUndefined(data))
|
||||
)
|
||||
.subscribe(this.orderSubscriber$);
|
||||
|
||||
this.route.params.pipe(take(1)).subscribe(this.routeParamsSubscriber$);
|
||||
}
|
||||
|
||||
@@ -55,8 +46,19 @@ export class ShelfEditOrderComponent implements OnInit, OnDestroy {
|
||||
this.orderId = params['orderId'];
|
||||
this.origin = params['origin'];
|
||||
this.customerId = params['customerId'];
|
||||
this.itemId = params['itemId'];
|
||||
this.itemId = +params['itemId'];
|
||||
}
|
||||
|
||||
this.order$
|
||||
.pipe(
|
||||
takeUntil(this.destroy$),
|
||||
filter(data => !isNullOrUndefined(data)),
|
||||
map(order => ({
|
||||
...order,
|
||||
items: order.items.filter(item => item.data.subsetItems.some(subsetItem => subsetItem.id === this.itemId))
|
||||
}))
|
||||
)
|
||||
.subscribe(this.orderSubscriber$);
|
||||
};
|
||||
|
||||
orderSubscriber$ = (order: OrderDTO) => {
|
||||
|
||||
18
package-lock.json
generated
18
package-lock.json
generated
@@ -1071,25 +1071,25 @@
|
||||
}
|
||||
},
|
||||
"@isa/catsearch-api": {
|
||||
"version": "0.0.39",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/catsearch-api/-/catsearch-api-0.0.39.tgz",
|
||||
"integrity": "sha1-s9xckW2vWGanSljXQkwUcgNWvQc=",
|
||||
"version": "0.0.46",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/catsearch-api/-/catsearch-api-0.0.46.tgz",
|
||||
"integrity": "sha1-ZBTOkJSidN2g3PmMKoCxXqiwKT8=",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"@isa/print-api": {
|
||||
"version": "0.0.39",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/print-api/-/print-api-0.0.39.tgz",
|
||||
"integrity": "sha1-8dE6/ORRHt9U8OyO3eGV037SDY8=",
|
||||
"version": "0.0.46",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/print-api/-/print-api-0.0.46.tgz",
|
||||
"integrity": "sha1-wV3YoblEjeiiL2NyTYkMbMrIgKM=",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"@isa/remi-api": {
|
||||
"version": "0.0.39",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/remi-api/-/remi-api-0.0.39.tgz",
|
||||
"integrity": "sha1-AuZxxDFal+RjOA/o4H2a+RmBpuM=",
|
||||
"version": "0.0.46",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/remi-api/-/remi-api-0.0.46.tgz",
|
||||
"integrity": "sha1-Z3K47vyA82L7+7oaCkzQ0lmf464=",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
"@cmf/core": "^0.1.12",
|
||||
"@cmf/inventory-api": "^0.1.12",
|
||||
"@cmf/trade-api": "^0.1.12",
|
||||
"@isa/catsearch-api": "^0.0.39",
|
||||
"@isa/print-api": "^0.0.39",
|
||||
"@isa/remi-api": "^0.0.39",
|
||||
"@isa/catsearch-api": "^0.0.46",
|
||||
"@isa/print-api": "^0.0.46",
|
||||
"@isa/remi-api": "^0.0.46",
|
||||
"@isa/remission": "^0.2.17",
|
||||
"@ng-idle/core": "^8.0.0-beta.4",
|
||||
"@ng-idle/keepalive": "^8.0.0-beta.4",
|
||||
@@ -92,4 +92,4 @@
|
||||
"tslint": "~5.11.0",
|
||||
"typescript": "~3.2.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user