mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 952: Merge release/1.5 into develop
Merge release/1.5 into develop Related work items: #882, #1985, #2244, #2331
This commit is contained in:
@@ -6,7 +6,7 @@ import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class ArticleSearchMainAutocompleteProvider extends UiFilterAutocompleteProvider {
|
||||
for = 'main';
|
||||
for = 'catalog';
|
||||
|
||||
constructor(private domainCatalogSearch: DomainCatalogService) {
|
||||
super();
|
||||
|
||||
@@ -168,8 +168,8 @@ export abstract class CustomerSearch implements OnInit, OnDestroy {
|
||||
private initAutocomplete() {
|
||||
this.autocompleteResult$ = this.inputChange$.pipe(
|
||||
takeUntil(this.destroy$),
|
||||
debounceTime(300),
|
||||
distinctUntilChanged(),
|
||||
debounceTime(200),
|
||||
switchMap((queryString) => {
|
||||
if (queryString.length >= 3) {
|
||||
return this.customerSearch.complete(queryString, this.getSelecteFiltersAsDictionary()).pipe(
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="container">
|
||||
<shared-goods-in-out-order-edit (navigation)="navigateToDetailsPage()" [items]="items$ | async"></shared-goods-in-out-order-edit>
|
||||
<shared-goods-in-out-order-edit (navigation)="navigateToDetailsPage($event)" [items]="items$ | async"></shared-goods-in-out-order-edit>
|
||||
</div>
|
||||
|
||||
@@ -45,10 +45,10 @@ export class GoodsInEditComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
navigateToDetailsPage() {
|
||||
navigateToDetailsPage({ options }: { options?: { processingStatus?: number } }) {
|
||||
const orderNumber = this._activatedRoute.snapshot.params.orderNumber;
|
||||
const orderItemId = this._activatedRoute.snapshot.params.orderItemId;
|
||||
const processingStatus = this._activatedRoute.snapshot.params.processingStatus;
|
||||
const processingStatus = options?.processingStatus ? options.processingStatus : this._activatedRoute.snapshot.params.processingStatus;
|
||||
this._router.navigate([`/goods/in/details/order/${encodeURIComponent(orderNumber)}/item/${orderItemId}/${processingStatus}`]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class GoodsInSearchMainAutocompleteProvider extends UiFilterAutocompleteProvider {
|
||||
for = 'main';
|
||||
for = 'goods-in';
|
||||
|
||||
constructor(private domainGoodsInService: DomainGoodsService) {
|
||||
super();
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="container" *ngIf="items$ | async; let items">
|
||||
<shared-goods-in-out-order-edit (navigation)="navigateToDetailsPage()" [items]="items"></shared-goods-in-out-order-edit>
|
||||
<shared-goods-in-out-order-edit (navigation)="navigateToDetailsPage($event)" [items]="items"></shared-goods-in-out-order-edit>
|
||||
</div>
|
||||
|
||||
@@ -59,10 +59,10 @@ export class GoodsOutEditComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
navigateToDetailsPage() {
|
||||
navigateToDetailsPage({ options }: { options?: { processingStatus?: number } }) {
|
||||
const orderNumber = this._activatedRoute.snapshot.params.orderNumber;
|
||||
const compartmentCode = this._activatedRoute.snapshot.params.compartmentCode;
|
||||
const processingStatus = this._activatedRoute.snapshot.params.processingStatus;
|
||||
const processingStatus = options?.processingStatus ? options.processingStatus : this._activatedRoute.snapshot.params.processingStatus;
|
||||
compartmentCode
|
||||
? this._router.navigate([`/goods/out/details/compartment/${encodeURIComponent(compartmentCode)}/${processingStatus}`])
|
||||
: this._router.navigate([`/goods/out/details/order/${encodeURIComponent(orderNumber)}/${processingStatus}`]);
|
||||
|
||||
@@ -105,7 +105,7 @@ export class GoodsOutSearchFilterComponent implements OnInit, OnDestroy {
|
||||
|
||||
getDetailsPath(item: OrderItemListItemDTO) {
|
||||
return item?.compartmentCode
|
||||
? `/goods/out/details/compartment/${item?.compartmentCode}/${item?.processingStatus}`
|
||||
: `/goods/out/details/order/${item?.orderNumber}/${item?.processingStatus}`;
|
||||
? `/goods/out/details/compartment/${encodeURIComponent(item?.compartmentCode)}/${item?.processingStatus}`
|
||||
: `/goods/out/details/order/${encodeURIComponent(item?.orderNumber)}/${item?.processingStatus}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class GoodsOutSearchMainAutocompleteProvider extends UiFilterAutocompleteProvider {
|
||||
for = 'main';
|
||||
for = 'goods-out';
|
||||
|
||||
constructor(private domainGoodsInService: DomainGoodsService) {
|
||||
super();
|
||||
|
||||
@@ -82,9 +82,9 @@ export class GoodsOutSearchMainComponent implements OnInit, OnDestroy {
|
||||
if (result.hits === 1) {
|
||||
const orderItem = result.result[0];
|
||||
this._router.navigate([this.getDetailsPath(orderItem)]);
|
||||
} else {
|
||||
this._router.navigate(['goods', 'out', 'results'], { queryParams: this._goodsOutSearchStore.filter.getQueryParams() });
|
||||
}
|
||||
|
||||
this._router.navigate(['goods', 'out', 'results'], { queryParams: this._goodsOutSearchStore.filter.getQueryParams() });
|
||||
} else {
|
||||
this.message = 'keine Suchergebnisse';
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="cta-close" (click)="navigateBack()" type="button">Abbrechen</button>
|
||||
<button class="cta-close" (click)="navigateBack({})" type="button">Abbrechen</button>
|
||||
<button class="cta-save" [disabled]="control.invalid || control.disabled" type="submit">Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -33,7 +33,7 @@ import { validateSsc } from '../validators/ssc.validator';
|
||||
})
|
||||
export class SharedGoodsInOutOrderEditComponent implements OnChanges, OnDestroy {
|
||||
@Output()
|
||||
navigation = new EventEmitter<void>();
|
||||
navigation = new EventEmitter<{ options?: { processingStatus?: number } }>();
|
||||
|
||||
@Input()
|
||||
items: OrderItemListItemDTO[];
|
||||
@@ -190,8 +190,8 @@ export class SharedGoodsInOutOrderEditComponent implements OnChanges, OnDestroy
|
||||
item.estimatedShippingDate = estimatedShippingDate;
|
||||
}
|
||||
|
||||
navigateBack() {
|
||||
this.navigation.emit();
|
||||
navigateBack({ processingStatus }: { processingStatus?: number }) {
|
||||
processingStatus ? this.navigation.emit({ options: { processingStatus } }) : this.navigation.emit({});
|
||||
}
|
||||
|
||||
async submit() {
|
||||
@@ -209,14 +209,29 @@ export class SharedGoodsInOutOrderEditComponent implements OnChanges, OnDestroy
|
||||
try {
|
||||
await this.omsService.updateNotifications(orderId, this.notificationsGroup.getRawValue()).toPromise();
|
||||
} catch (error) {
|
||||
this._modal.open({ content: UiErrorModalComponent, data: error, title: 'Fehler beim aktualisieren der Benachrichtigung' });
|
||||
this._modal.open({ content: UiErrorModalComponent, data: error, title: 'Fehler beim Aktualisieren der Benachrichtigung' });
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
let newProcessingStatus: number;
|
||||
for (const itemCtrl of control.items) {
|
||||
const orderItemId = itemCtrl.orderItemId;
|
||||
const orderItemSubsetId = itemCtrl.orderItemSubsetId;
|
||||
|
||||
try {
|
||||
const currentItem = this.items?.find((i) => i.orderItemSubsetId === orderItemSubsetId);
|
||||
if (itemCtrl.ssc !== currentItem?.ssc) {
|
||||
const response = await this.omsService
|
||||
.changeStockStatusCode([{ id: orderItemSubsetId, ssc: itemCtrl.ssc, quantity: currentItem.quantity }])
|
||||
.toPromise();
|
||||
newProcessingStatus = response[0].item1.processingStatus;
|
||||
}
|
||||
} catch (error) {
|
||||
this._modal.open({ content: UiErrorModalComponent, data: error, title: 'Fehler beim Aktualisieren der Meldenummer' });
|
||||
throw error;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.omsService
|
||||
.patchOrderItem({
|
||||
@@ -233,7 +248,7 @@ export class SharedGoodsInOutOrderEditComponent implements OnChanges, OnDestroy
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
} catch (error) {
|
||||
this._modal.open({ content: UiErrorModalComponent, data: error, title: 'Fehler beim aktualisieren des Bestellpostens' });
|
||||
this._modal.open({ content: UiErrorModalComponent, data: error, title: 'Fehler beim Aktualisieren des Bestellpostens' });
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -259,11 +274,11 @@ export class SharedGoodsInOutOrderEditComponent implements OnChanges, OnDestroy
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
} catch (error) {
|
||||
this._modal.open({ content: UiErrorModalComponent, data: error, title: 'Fehler beim aktualisieren des Bestellpostens' });
|
||||
this._modal.open({ content: UiErrorModalComponent, data: error, title: 'Fehler beim Aktualisieren des Bestellpostens' });
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
this.navigateBack();
|
||||
this.navigateBack({ processingStatus: newProcessingStatus });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
this.enableControlFields();
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { UiAutocompleteComponent } from '@ui/autocomplete';
|
||||
import { Observable, Subject, Subscription } from 'rxjs';
|
||||
import { filter, switchMap, tap } from 'rxjs/operators';
|
||||
import { debounceTime, distinctUntilChanged, filter, switchMap, tap } from 'rxjs/operators';
|
||||
import { UiFilterAutocomplete, UiFilterAutocompleteProvider, UiFilterScanProvider } from '../../providers';
|
||||
import { IUiInputGroup, UiInput, UiInputGroup } from '../../tree';
|
||||
|
||||
@@ -80,7 +80,7 @@ export class UiFilterInputGroupMainComponent implements OnInit, OnDestroy, After
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this._autocompleteProvider = this.autocompleteProviders?.find((provider) => provider.for === 'main');
|
||||
this._autocompleteProvider = this.autocompleteProviders.find((provider) => !!provider);
|
||||
this._scanProvider = this.scanProviders?.find((provider) => provider.for === 'main');
|
||||
}
|
||||
|
||||
@@ -109,6 +109,8 @@ export class UiFilterInputGroupMainComponent implements OnInit, OnDestroy, After
|
||||
|
||||
initAutocomplete() {
|
||||
this.autocompleteResults$ = this.complete.asObservable().pipe(
|
||||
debounceTime(this._debounceTimeAutocompleteMilliseconds()),
|
||||
distinctUntilChanged(),
|
||||
switchMap(() => this.autocompleteProvider.complete(this.uiInput)),
|
||||
tap((complete) => {
|
||||
if (complete.length > 0) {
|
||||
@@ -123,4 +125,27 @@ export class UiFilterInputGroupMainComponent implements OnInit, OnDestroy, After
|
||||
setAutocompleteProvider(provider: UiFilterAutocompleteProvider) {
|
||||
this._autocompleteProvider = provider;
|
||||
}
|
||||
|
||||
private _debounceTimeAutocompleteMilliseconds(): number {
|
||||
if (!this.autocompleteProvider) {
|
||||
return;
|
||||
}
|
||||
|
||||
let debounceTimeMilliseconds: number;
|
||||
switch (this.autocompleteProvider.for) {
|
||||
case 'catalog':
|
||||
debounceTimeMilliseconds = 250;
|
||||
break;
|
||||
case 'goods-in':
|
||||
debounceTimeMilliseconds = 300;
|
||||
break;
|
||||
case 'goods-out':
|
||||
debounceTimeMilliseconds = 300;
|
||||
break;
|
||||
default:
|
||||
debounceTimeMilliseconds = 300;
|
||||
break;
|
||||
}
|
||||
return debounceTimeMilliseconds;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user