mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Compare commits
6 Commits
bugfix/453
...
fix/4544-H
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
793a345b57 | ||
|
|
e832feebc5 | ||
|
|
08580d782d | ||
|
|
2d07556341 | ||
|
|
9ad1256019 | ||
|
|
250002f057 |
@@ -81,8 +81,11 @@
|
||||
*ngIf="group?.orderType !== undefined && (item.features?.orderType === 'Abholung' || item.features?.orderType === 'Rücklage')"
|
||||
>
|
||||
<ng-container *ngIf="item?.destination?.data?.targetBranch?.data; let targetBranch">
|
||||
<ng-container *ngIf="i === 0 || targetBranch.id !== group.items[i - 1].destination?.data?.targetBranch?.data.id">
|
||||
<div class="flex flex-row items-center px-5 pt-0 pb-[0.875rem] -mt-2 bg-[#F5F7FA]">
|
||||
<ng-container *ngIf="i === 0 || checkIfMultipleDestinationsForOrderTypeExist(targetBranch, group, i)">
|
||||
<div
|
||||
class="flex flex-row items-center px-5 pt-0 pb-[0.875rem] -mt-2 bg-[#F5F7FA]"
|
||||
[class.multiple-destinations]="checkIfMultipleDestinationsForOrderTypeExist(targetBranch, group, i)"
|
||||
>
|
||||
<span class="branch-name">{{ targetBranch?.name }} | {{ targetBranch | branchAddress }}</span>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
@@ -105,6 +105,10 @@ h1 {
|
||||
}
|
||||
}
|
||||
|
||||
.multiple-destinations {
|
||||
@apply py-[0.875rem] mt-0;
|
||||
}
|
||||
|
||||
.icon-order-type {
|
||||
@apply text-black mr-2;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Router } from '@angular/router';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { DomainAvailabilityService } from '@domain/availability';
|
||||
import { DomainCheckoutService } from '@domain/checkout';
|
||||
import { AvailabilityDTO, DestinationDTO, ShoppingCartItemDTO } from '@swagger/checkout';
|
||||
import { AvailabilityDTO, BranchDTO, DestinationDTO, ShoppingCartItemDTO } from '@swagger/checkout';
|
||||
import { UiMessageModalComponent, UiModalService } from '@ui/modal';
|
||||
import { PrintModalData, PrintModalComponent } from '@modal/printer';
|
||||
import { delay, first, map, switchMap, takeUntil, tap } from 'rxjs/operators';
|
||||
@@ -254,6 +254,10 @@ export class CheckoutReviewComponent implements OnInit, OnDestroy, AfterViewInit
|
||||
});
|
||||
}
|
||||
|
||||
checkIfMultipleDestinationsForOrderTypeExist(targetBranch: BranchDTO, group: { items: ShoppingCartItemDTO[] }, i: number) {
|
||||
return i === 0 ? false : targetBranch.id !== group.items[i - 1].destination?.data?.targetBranch?.data.id;
|
||||
}
|
||||
|
||||
async refreshAvailabilities() {
|
||||
this.checkingOla$.next(true);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import { CustomerOrderSearchComponent } from './customer-order-search.component'
|
||||
import { CustomerOrderSearchFilterComponent, OrderBranchIdInputComponent } from './customer-order-search-filter';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { UiSpinnerModule } from '@ui/spinner';
|
||||
import { CustomerOrderSearchStore } from './customer-order-search.store';
|
||||
import { IconComponent, IconModule } from '@shared/components/icon';
|
||||
import { FilterModule } from '@shared/components/filter';
|
||||
import { CustomerOrderSearchMainModule } from './search-main';
|
||||
@@ -22,7 +21,6 @@ import { CustomerOrderSearchMainModule } from './search-main';
|
||||
CustomerOrderSearchMainModule,
|
||||
],
|
||||
exports: [CustomerOrderSearchComponent],
|
||||
providers: [CustomerOrderSearchStore],
|
||||
declarations: [CustomerOrderSearchComponent, CustomerOrderSearchFilterComponent],
|
||||
})
|
||||
export class CustomerOrderSearchModule {}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Filter } from '@shared/components/filter';
|
||||
import { BranchDTO, ListResponseArgsOfOrderItemListItemDTO, OrderItemListItemDTO, QuerySettingsDTO } from '@swagger/oms';
|
||||
import { isResponseArgs } from '@utils/object';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { switchMap, tap, withLatestFrom } from 'rxjs/operators';
|
||||
import { switchMap, takeUntil, tap, withLatestFrom } from 'rxjs/operators';
|
||||
|
||||
export interface CustomerOrderSearchState {
|
||||
defaultSettings?: QuerySettingsDTO;
|
||||
@@ -125,6 +125,8 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
|
||||
|
||||
searchStarted = new Subject<{ clear?: boolean; silentReload?: boolean }>();
|
||||
|
||||
cancelSearch$ = new Subject<void>();
|
||||
|
||||
constructor(private _domainGoodsInService: DomainCustomerOrderService, private _cache: CacheService) {
|
||||
super({
|
||||
fetching: false,
|
||||
@@ -192,6 +194,11 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
|
||||
});
|
||||
}
|
||||
|
||||
cancelSearchRequest() {
|
||||
this.cancelSearch$.next();
|
||||
this.patchState({ fetching: false, silentFetching: false });
|
||||
}
|
||||
|
||||
search = this.effect((options$: Observable<{ clear?: boolean; siletReload?: boolean }>) =>
|
||||
options$.pipe(
|
||||
tap((_) => {
|
||||
@@ -238,6 +245,7 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
|
||||
}
|
||||
|
||||
return this._domainGoodsInService.search(queryToken).pipe(
|
||||
takeUntil(this.cancelSearch$),
|
||||
tapResponse(
|
||||
(res) => {
|
||||
let _results: OrderItemListItemDTO[] = [];
|
||||
|
||||
@@ -17,10 +17,7 @@ import { ApplicationService } from '@core/application';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CustomerOrderSearchMainComponent implements OnInit, OnDestroy {
|
||||
filter$ = this._customerOrderSearchStore.filter$.pipe(
|
||||
filter((f) => !!f),
|
||||
take(1)
|
||||
);
|
||||
filter$ = this._customerOrderSearchStore.filter$.pipe(filter((f) => !!f));
|
||||
|
||||
loading$ = this._customerOrderSearchStore.fetching$;
|
||||
|
||||
|
||||
@@ -364,25 +364,6 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
|
||||
return clean;
|
||||
}
|
||||
|
||||
async removeBreadcrumbs(processId: number) {
|
||||
const editCrumbs = await this._breadcrumb.getBreadcrumbsByKeyAndTags$(processId, ['customer-order', 'edit']).pipe(first()).toPromise();
|
||||
|
||||
const historyCrumbs = await this._breadcrumb
|
||||
.getBreadcrumbsByKeyAndTags$(processId, ['customer-order', 'history'])
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
|
||||
editCrumbs.forEach((crumb) => {
|
||||
this._breadcrumb.removeBreadcrumb(crumb.id, true);
|
||||
});
|
||||
|
||||
historyCrumbs.forEach((crumb) => {
|
||||
this._breadcrumb.removeBreadcrumb(crumb.id, true);
|
||||
});
|
||||
|
||||
await this.removeDetailsBreadcrumb(processId);
|
||||
}
|
||||
|
||||
async removeDetailsBreadcrumb(processId: number) {
|
||||
const detailsCrumbs = await this._breadcrumb
|
||||
.getBreadcrumbsByKeyAndTags$(processId, ['customer-order', 'details'])
|
||||
@@ -394,7 +375,19 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
|
||||
});
|
||||
}
|
||||
|
||||
async createMainBreadcrumb(processId: number, params: Record<string, string>) {
|
||||
await this._breadcrumb.addBreadcrumbIfNotExists({
|
||||
key: processId,
|
||||
name: 'Kundenbestellung',
|
||||
path: this._navigationService.getCustomerOrdersBasePath(processId).path,
|
||||
params,
|
||||
tags: ['customer-order', 'main', 'filter'],
|
||||
section: 'customer',
|
||||
});
|
||||
}
|
||||
|
||||
async createBreadcrumb(processId: number, params: Record<string, string>) {
|
||||
await this.createMainBreadcrumb(processId, params);
|
||||
await this._breadcrumb.addOrUpdateBreadcrumbIfNotExists({
|
||||
key: processId,
|
||||
name: this.getBreadcrumbName(params),
|
||||
|
||||
@@ -9,12 +9,14 @@ import { BranchDTO } from '@swagger/checkout';
|
||||
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
import { Observable, Subject, fromEvent } from 'rxjs';
|
||||
import { first, map, switchMap, takeUntil, withLatestFrom } from 'rxjs/operators';
|
||||
import { CustomerOrderSearchStore } from './customer-order-search';
|
||||
|
||||
@Component({
|
||||
selector: 'page-customer-order',
|
||||
templateUrl: 'customer-order.component.html',
|
||||
styleUrls: ['customer-order.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: [CustomerOrderSearchStore],
|
||||
})
|
||||
export class CustomerOrderComponent implements OnInit {
|
||||
@ViewChild(BreadcrumbComponent, { read: ElementRef }) breadcrumbRef: ElementRef<HTMLElement>;
|
||||
@@ -39,13 +41,24 @@ export class CustomerOrderComponent implements OnInit {
|
||||
private _uiModal: UiModalService,
|
||||
private _renderer: Renderer2,
|
||||
private _environmentService: EnvironmentService,
|
||||
public auth: AuthService
|
||||
public auth: AuthService,
|
||||
private _store: CustomerOrderSearchStore
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.selectedBranch$ = this.application.activatedProcessId$.pipe(
|
||||
switchMap((processId) => this.application.getSelectedBranch$(Number(processId)))
|
||||
);
|
||||
|
||||
/* Ticket #4544 - Suchrequest abbrechen bei Prozesswechsel
|
||||
/ um zu verhindern, dass die Suche in einen anderen Kundenbestellungen Prozess übernommen wird
|
||||
/ bei Prozesswechsel zwischen 2 Kundenbestellungen Prozessen
|
||||
*/
|
||||
this.processId$.pipe(takeUntil(this._onDestroy$)).subscribe((processId) => {
|
||||
if (Number(processId) !== this._store.processId) {
|
||||
this._store.cancelSearchRequest();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
|
||||
@@ -67,7 +67,9 @@ export abstract class PickupShelfBaseComponent implements OnInit {
|
||||
|
||||
// der debounce soll verhindern, dass die breadcrumb zu oft aktualisiert,
|
||||
// besonders bei asynchronen calls kommt es sonst zu fehlern
|
||||
@debounce(500)
|
||||
// @debounce(500)
|
||||
// Auskommentiert, da es zu anderen Problemen führt, siehe z.B. Ticket #4538 oder #4540
|
||||
// Ursprungsproblem des Tickets #4533 konnte anders gelöst werden, somit wird debounce hier nicht mehr benötigt
|
||||
private _runChecks() {
|
||||
const processId = this._checkAndUpdateProcessId();
|
||||
const queryParams = this._checkAndUpdateQueryParams();
|
||||
|
||||
@@ -17,17 +17,25 @@
|
||||
(updateDate)="updateDate($event)"
|
||||
(editClick)="navigateToEditPage($event)"
|
||||
></page-pickup-shelf-details-header>
|
||||
<page-pickup-shelf-details-item
|
||||
*ngIf="selectedItem$ | async; let item"
|
||||
class="mb-px-2"
|
||||
[orderItem]="item"
|
||||
[selected]="true"
|
||||
(historyClick)="navigateToHistoryPage($event)"
|
||||
[order]="order$ | async"
|
||||
(specialCommentChanged)="updateSpecialComment(item, $event)"
|
||||
(sharedOnInit)="fetchNotifications(item)"
|
||||
></page-pickup-shelf-details-item>
|
||||
|
||||
<ng-container *ngIf="selectedItem$ | async; let item">
|
||||
<page-pickup-shelf-details-items-group
|
||||
[orderType]="selectedItemOrderType$ | async"
|
||||
[groupedItems]="[item]"
|
||||
></page-pickup-shelf-details-items-group>
|
||||
<page-pickup-shelf-details-item
|
||||
class="mb-px-2"
|
||||
[orderItem]="item"
|
||||
[selected]="true"
|
||||
(historyClick)="navigateToHistoryPage($event)"
|
||||
[order]="order$ | async"
|
||||
(specialCommentChanged)="updateSpecialComment(item, $event)"
|
||||
(sharedOnInit)="fetchNotifications(item)"
|
||||
></page-pickup-shelf-details-item>
|
||||
</ng-container>
|
||||
|
||||
<page-pickup-shelf-details-tags class="mb-px-2" *ngIf="showTagsComponent$ | async"></page-pickup-shelf-details-tags>
|
||||
|
||||
<page-pickup-shelf-details-covers
|
||||
*ngIf="(coverOrderItems$ | async)?.length > 0"
|
||||
[coverItems]="coverOrderItems$ | async"
|
||||
|
||||
@@ -16,6 +16,7 @@ import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/
|
||||
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RunCheckTrigger } from '../../trigger';
|
||||
import { PickUpShelfDetailsItemsGroupComponent } from '../../shared/pickup-shelf-details-items-group/pickup-shelf-details-items-group.component';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-in-details',
|
||||
@@ -32,6 +33,7 @@ import { RunCheckTrigger } from '../../trigger';
|
||||
PickUpShelfDetailsItemComponent,
|
||||
PickUpShelfDetailsTagsComponent,
|
||||
PickUpShelfDetailsCoversComponent,
|
||||
PickUpShelfDetailsItemsGroupComponent,
|
||||
PickupShelfAddToPreviousCompartmentCodeLabelPipe,
|
||||
UiSpinnerModule,
|
||||
OnInitDirective,
|
||||
@@ -74,6 +76,8 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
|
||||
selectedItem$ = this.store.selectedOrderItem$;
|
||||
|
||||
selectedItemOrderType$ = this.selectedItem$.pipe(map((item) => item?.features?.orderType));
|
||||
|
||||
coverOrderItems$ = this.store.coverOrderItems$;
|
||||
|
||||
displayedCompartmentInfo$ = this.store.compartmentInfo$;
|
||||
|
||||
@@ -9,13 +9,12 @@ import { NavigationRoute, PickUpShelfOutNavigationService } from '@shared/servic
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import { DBHOrderItemListItemDTO } from '@swagger/oms';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { skipWhile, take } from 'rxjs/operators';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { provideActionHandlers } from '@core/command';
|
||||
import { ActionHandlerServices } from '@domain/oms';
|
||||
import { ActionHandlerService } from '../services/action-handler.service';
|
||||
import { FilterAutocompleteProvider } from '@shared/components/filter';
|
||||
import { PickUpShelfOutAutocompleteProvider } from './providers/pickup-shelf-out-autocomplete.provider';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-out',
|
||||
@@ -63,44 +62,12 @@ export class PickupShelfOutComponent extends PickupShelfBaseComponent {
|
||||
return this._pickupShelfOutNavigationService.defaultRoute({ processId: data.processId });
|
||||
}
|
||||
|
||||
private _getLatestList(): Promise<DBHOrderItemListItemDTO[]> {
|
||||
return this.listStore.list$
|
||||
.pipe(
|
||||
takeUntilDestroyed(this.destroyRef),
|
||||
skipWhile((list) => list.length === 0),
|
||||
take(1)
|
||||
)
|
||||
.toPromise();
|
||||
}
|
||||
|
||||
async getNameForListBreadcrumb(data: GetNameForBreadcrumbData): Promise<string> {
|
||||
const mainQs = data.queryParams?.main_qs;
|
||||
|
||||
if (!mainQs) {
|
||||
return 'Alle';
|
||||
getNameForListBreadcrumb(data: GetNameForBreadcrumbData): string | Promise<string> {
|
||||
if (data.queryParams?.main_qs) {
|
||||
return data.queryParams.main_qs;
|
||||
}
|
||||
|
||||
/**
|
||||
* #4533
|
||||
* Wenn ein Abholschein gescennt wird dann beinhaltet dieser einen Prefix "ORD:".
|
||||
* Wenn dieser Prefix vorhanden ist, dann soll der Name des Kunden angezeigt werden.
|
||||
*/
|
||||
if (mainQs.startsWith('ORD:')) {
|
||||
const items = await this._getLatestList();
|
||||
const item = items[0];
|
||||
|
||||
if (item) {
|
||||
let name = `${item.lastName} ${item.firstName}`.trim();
|
||||
|
||||
if (item.organisation) {
|
||||
name = name.length === 0 ? item.organisation : `${name} - ${item.organisation}`;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
return mainQs;
|
||||
return 'Alle';
|
||||
}
|
||||
|
||||
getPathFoListBreadcrumb(data: GetPathForBreadcrumbData): NavigationRoute | Promise<NavigationRoute> {
|
||||
|
||||
@@ -113,7 +113,13 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
|
||||
}
|
||||
|
||||
setQueryParams(queryParams: Record<string, string> | undefined) {
|
||||
this.patchState({ queryParams });
|
||||
// #4533 Wenn ein Abholschein gescannt wird, soll ORD: nicht in der Suchbox stehen und somit auch nicht in der Breadcrumb enthalten sein
|
||||
const isScannedPickUpCode = queryParams?.main_qs?.includes('ORD:');
|
||||
if (isScannedPickUpCode) {
|
||||
this.patchState({ queryParams: { ...queryParams, main_qs: queryParams?.main_qs?.replace('ORD:', '') } });
|
||||
} else {
|
||||
this.patchState({ queryParams });
|
||||
}
|
||||
}
|
||||
|
||||
cancelListRequests() {
|
||||
|
||||
@@ -98,7 +98,8 @@
|
||||
class="side-menu-group-item"
|
||||
(click)="closeSideMenu(); resetBranch(); focusSearchBox()"
|
||||
[routerLink]="customerOrdersRoutePath$ | async"
|
||||
routerLinkActive="active"
|
||||
sharedRegexRouterLinkActive="active"
|
||||
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/order"
|
||||
(isActiveChange)="focusSearchBox()"
|
||||
>
|
||||
<span class="side-menu-group-item-icon">
|
||||
|
||||
Reference in New Issue
Block a user