mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Compare commits
4 Commits
4.1
...
bugfix/453
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c43ddef51c | ||
|
|
9dbb251254 | ||
|
|
1e776f8d14 | ||
|
|
0777f2c910 |
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user