Compare commits

...

16 Commits

Author SHA1 Message Date
Lorenz Hilpert
bc16b841fb Kamera Overlay Größe
(cherry picked from commit d5dc4e053d)
2024-09-13 11:02:30 +02:00
Lorenz Hilpert
2118bd996a Merge branch 'release/3.1' 2024-09-04 17:52:55 +02:00
Lorenz Hilpert
8a6448cc17 Merge branch 'develop' into release/3.1 2024-08-19 15:01:59 +02:00
Lorenz Hilpert
f2c7d57ad6 Fix Remi Filter 2024-08-16 14:17:11 +02:00
Lorenz Hilpert
9c9ddfaeec #4774 Remi // Wannennummer nur einmal am Tag benutzbar 2024-08-14 15:45:39 +02:00
Lorenz Hilpert
6eaa347de5 Merge branch 'master' into develop 2024-08-13 11:04:36 +02:00
Lorenz Hilpert
a16f355396 Merge branch 'hotfix/scandit-lizenz-erneuern' 2024-08-13 11:02:16 +02:00
Lorenz Hilpert
8b8db6e335 Update Scandit Lizenz 2024-08-12 13:39:32 +02:00
Lorenz Hilpert
06e248d615 Kundensuche abbrechen 2024-06-27 15:47:41 +02:00
Lorenz Hilpert
c68706b54f Merged PR 1786: #4760 Fehler bei Abholpreisberechnung in Filiale Darmstadt Ernst-Ludwig-Straße
#4760 Fehler bei Abholpreisberechnung in Filiale Darmstadt Ernst-Ludwig-Straße
2024-06-10 12:22:36 +00:00
Lorenz Hilpert
b271ce9711 Merged PR 1785: Angular 17 Update + Cleanup Packages 2024-06-06 13:31:02 +00:00
Nino Righi
94888213b1 Merged PR 1784: #4758 Loading Indicator if Date gets Patched on OrderItemSubset
#4758 Loading Indicator if Date gets Patched on OrderItemSubset
2024-06-05 17:04:41 +00:00
Nino Righi
1041d92486 Merged PR 1783: #4750 Code improvements, Check if Icon gets loaded
#4750 Code improvements, Check if Icon gets loaded
2024-06-04 16:02:53 +00:00
Nino Righi
920b8eb8e3 Merged PR 1778: #4004 Changed Minimum Birth Date for Kubi Case
#4004 Changed Minimum Birth Date for Kubi Case
2024-05-06 12:00:58 +00:00
Nino Righi
4db28b1aa7 Merged PR 1777: Merge Develop -> Release/3.1
Merge Develop -> Release/3.1
2024-05-03 13:00:46 +00:00
Lorenz Hilpert
ed7dc10246 Bump Version 2024-04-09 10:43:39 +02:00
84 changed files with 7366 additions and 10767 deletions

1
.husky/pre-commit Normal file
View File

@@ -0,0 +1 @@
npm run pretty-quick

View File

@@ -1,4 +0,0 @@
- Neue Icon Module (z.B. mit SVG sprites)
- Breadcrumb Navigation (Neu)
- Remissions Produkt Liste (Refactoring / Neu)
- Angular Version (Upgrade)

View File

@@ -959,10 +959,10 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "isa-app:build:production"
"buildTarget": "isa-app:build:production"
},
"development": {
"browserTarget": "isa-app:build:development"
"buildTarget": "isa-app:build:development"
}
},
"defaultConfiguration": "development"
@@ -970,7 +970,7 @@
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "isa-app:build"
"buildTarget": "isa-app:build"
}
},
"test": {
@@ -1470,39 +1470,6 @@
}
}
}
},
"shell": {
"projectType": "library",
"root": "apps/shell",
"sourceRoot": "apps/shell/src",
"prefix": "shell",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "apps/shell/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "apps/shell/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "apps/shell/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": "apps/shell/tsconfig.spec.json",
"polyfills": [
"zone.js",
"zone.js/testing"
]
}
}
}
}
},
"cli": {

View File

@@ -4,12 +4,11 @@
.scanner-container {
width: 100vw;
max-width: 95vw;
max-height: calc(95vh - 120px);
height: 100vh;
}
.close-scanner {
@apply block px-6 py-4 bg-white text-brand border-2 border-solid border-brand rounded-full text-lg font-bold mx-auto mt-4;
@apply absolute bottom-12 left-[50%] -translate-x-[50%] block px-6 py-4 bg-white text-brand border-2 border-solid border-brand rounded-full text-lg font-bold mx-auto mt-4;
}
@screen desktop {

View File

@@ -36,7 +36,7 @@ export class DomainAvailabilityService {
private _logisticanService: LogisticianService,
private _stockService: StockService,
private _supplierService: StoreCheckoutSupplierService,
private _branchService: StoreCheckoutBranchService
private _branchService: StoreCheckoutBranchService,
) {}
@memorize({ ttl: 10000 })
@@ -48,7 +48,7 @@ export class DomainAvailabilityService {
getSuppliers(): Observable<SupplierDTO[]> {
return this._supplierService.StoreCheckoutSupplierGetSuppliers({}).pipe(
map((response) => response.result),
shareReplay(1)
shareReplay(1),
);
}
@@ -56,7 +56,7 @@ export class DomainAvailabilityService {
getTakeAwaySupplier(): Observable<SupplierDTO> {
return this._supplierService.StoreCheckoutSupplierGetSuppliers({}).pipe(
map(({ result }) => result?.find((supplier) => supplier?.supplierNumber === 'F')),
shareReplay(1)
shareReplay(1),
);
}
@@ -64,7 +64,7 @@ export class DomainAvailabilityService {
getBranches(): Observable<BranchDTO[]> {
return this._branchService.StoreCheckoutBranchGetBranches({}).pipe(
map((response) => response.result),
shareReplay(1)
shareReplay(1),
);
}
@@ -73,7 +73,7 @@ export class DomainAvailabilityService {
return this._stockService.StockGetStocksByBranch({ branchId }).pipe(
map((response) => response.result),
map((result) => result?.find((_) => true)),
shareReplay(1)
shareReplay(1),
);
}
@@ -81,7 +81,7 @@ export class DomainAvailabilityService {
getDefaultStock(): Observable<StockDTO> {
return this._stockService.StockCurrentStock().pipe(
map((response) => response.result),
shareReplay(1)
shareReplay(1),
);
}
@@ -105,7 +105,7 @@ export class DomainAvailabilityService {
status: response.result.status,
version: response.result.version,
})),
shareReplay(1)
shareReplay(1),
);
}
@@ -113,7 +113,7 @@ export class DomainAvailabilityService {
getLogisticians(): Observable<LogisticianDTO> {
return this._logisticanService.LogisticianGetLogisticians({}).pipe(
map((response) => response.result?.find((l) => l.logisticianNumber === '2470')),
shareReplay(1)
shareReplay(1),
);
}
@@ -146,7 +146,7 @@ export class DomainAvailabilityService {
});
return availabilities;
}),
shareReplay(1)
shareReplay(1),
);
}
@@ -167,13 +167,13 @@ export class DomainAvailabilityService {
this._stockService.StockInStock({ articleIds: [item.itemId], stockId: s.id }),
this.getTakeAwaySupplier(),
this.getDefaultBranch(),
])
]),
),
map(([response, supplier, defaultBranch]) => {
const price = item?.price;
return this._mapToTakeAwayAvailability({ response, supplier, branchId: branch?.id ?? defaultBranch?.id, quantity, price });
}),
shareReplay(1)
shareReplay(1),
);
}
@@ -196,7 +196,7 @@ export class DomainAvailabilityService {
map(([response, supplier]) => {
return this._mapToTakeAwayAvailability({ response, supplier, branchId: branch.id, quantity, price });
}),
shareReplay(1)
shareReplay(1),
);
}
@@ -218,7 +218,7 @@ export class DomainAvailabilityService {
map(([response, supplier, defaultBranch]) => {
return this._mapToTakeAwayAvailability({ response, supplier, branchId: branchId ?? defaultBranch.id, quantity, price });
}),
shareReplay(1)
shareReplay(1),
);
}
@@ -228,7 +228,7 @@ export class DomainAvailabilityService {
switchMap((s) => this._stockService.StockInStockByEAN({ eans: eansFiltered, stockId: s.id })),
withLatestFrom(this.getTakeAwaySupplier(), this.getDefaultBranch()),
map((response) => response[0].result),
shareReplay(1)
shareReplay(1),
);
}
@@ -254,7 +254,7 @@ export class DomainAvailabilityService {
])
.pipe(
map((r) => this._mapToPickUpAvailability(r.result)?.find((_) => true)),
shareReplay(1)
shareReplay(1),
);
}
@@ -270,7 +270,7 @@ export class DomainAvailabilityService {
]).pipe(
timeout(5000),
map((r) => this._mapToShippingAvailability(r.result)?.find((_) => true)),
shareReplay(1)
shareReplay(1),
);
}
@@ -305,7 +305,7 @@ export class DomainAvailabilityService {
priceMaintained: preferred?.priceMaintained,
};
}),
shareReplay(1)
shareReplay(1),
);
}
@@ -329,12 +329,12 @@ export class DomainAvailabilityService {
this.getPickUpAvailability({ item, quantity, branch: branch ?? defaultBranch }).pipe(
mergeMap((availability) =>
logistician$.pipe(
map((logistician) => ({ ...(availability?.length > 0 ? availability[0] : []), logistician: { id: logistician.id } }))
)
map((logistician) => ({ ...(availability?.length > 0 ? availability[0] : []), logistician: { id: logistician.id } })),
),
),
shareReplay(1)
)
)
shareReplay(1),
),
),
);
}
@@ -367,7 +367,7 @@ export class DomainAvailabilityService {
priceMaintained: preferred?.priceMaintained,
};
}),
shareReplay(1)
shareReplay(1),
);
}
@@ -378,7 +378,7 @@ export class DomainAvailabilityService {
switchMap((stockId) =>
stockId
? this._stockService.StockInStock({ articleIds: items.map((i) => i.id), stockId })
: of({ result: [] } as ResponseArgsOfIEnumerableOfStockInfoDTO)
: of({ result: [] } as ResponseArgsOfIEnumerableOfStockInfoDTO),
),
timeout(20000),
withLatestFrom(this.getTakeAwaySupplier()),
@@ -389,10 +389,10 @@ export class DomainAvailabilityService {
supplier,
quantity: 1,
price: items?.find((i) => i.id === stockInfo.itemId)?.price,
})
}),
);
}),
shareReplay(1)
shareReplay(1),
);
}
@@ -400,7 +400,7 @@ export class DomainAvailabilityService {
getPickUpAvailabilities(payload: AvailabilityRequestDTO[], preferred?: boolean) {
return this._availabilityService.AvailabilityStoreAvailability(payload).pipe(
timeout(20000),
map((response) => (preferred ? this._mapToPickUpAvailability(response.result) : response.result))
map((response) => (preferred ? this._mapToPickUpAvailability(response.result) : response.result)),
);
}
@@ -408,7 +408,7 @@ export class DomainAvailabilityService {
getDeliveryAvailabilities(payload: AvailabilityRequestDTO[]) {
return this.memorizedAvailabilityShippingAvailability(payload).pipe(
timeout(20000),
map((response) => this._mapToShippingAvailability(response.result))
map((response) => this._mapToShippingAvailability(response.result)),
);
}
@@ -416,7 +416,7 @@ export class DomainAvailabilityService {
getDigDeliveryAvailabilities(payload: AvailabilityRequestDTO[]) {
return this.memorizedAvailabilityShippingAvailability(payload).pipe(
timeout(20000),
map((response) => this._mapToShippingAvailability(response.result))
map((response) => this._mapToShippingAvailability(response.result)),
);
}
@@ -427,16 +427,16 @@ export class DomainAvailabilityService {
return this.getPickUpAvailabilities(payload, true).pipe(
timeout(20000),
switchMap((availability) =>
logistician$.pipe(map((logistician) => ({ availability: [...availability], logistician: { id: logistician.id } })))
logistician$.pipe(map((logistician) => ({ availability: [...availability], logistician: { id: logistician.id } }))),
),
shareReplay(1)
shareReplay(1),
);
}
getPriceForAvailability(
purchasingOption: string,
catalogAvailability: CatAvailabilityDTO | AvailabilityDTO,
availability: AvailabilityDTO
availability: AvailabilityDTO,
): PriceDTO {
switch (purchasingOption) {
case 'take-away':
@@ -567,12 +567,12 @@ export class DomainAvailabilityService {
if (!params.branchId) {
branchId$ = this.getDefaultBranch().pipe(
first(),
map((b) => b.id)
map((b) => b.id),
);
}
const stock$ = branchId$.pipe(
mergeMap((branchId) => this._stockService.StockGetStocksByBranch({ branchId }).pipe(map((response) => response.result?.[0])))
mergeMap((branchId) => this._stockService.StockGetStocksByBranch({ branchId }).pipe(map((response) => response.result?.[0]))),
);
return stock$.pipe(
@@ -589,17 +589,17 @@ export class DomainAvailabilityService {
acc[stockInfo.ean] = stockInfo;
return acc;
}, {});
})
)
)
}),
),
),
);
}
getInStock({ itemIds, branchId }: { itemIds: number[]; branchId: number }): Observable<StockInfoDTO[]> {
return this.getStockByBranch(branchId).pipe(
mergeMap((stock) =>
this._stockService.StockInStock({ articleIds: itemIds, stockId: stock.id }).pipe(map((response) => response.result))
)
this._stockService.StockInStock({ articleIds: itemIds, stockId: stock.id }).pipe(map((response) => response.result)),
),
);
}
}

View File

@@ -11,9 +11,12 @@ export class ThumbnailUrlPipe implements PipeTransform, OnDestroy {
private input$ = new BehaviorSubject<{ width?: number; height?: number; ean?: string }>(undefined);
private result: string;
private onDestroy$ = new Subject();
private onDestroy$ = new Subject<void>();
constructor(private domainCatalogThumbnailService: DomainCatalogThumbnailService, private cdr: ChangeDetectorRef) {}
constructor(
private domainCatalogThumbnailService: DomainCatalogThumbnailService,
private cdr: ChangeDetectorRef,
) {}
ngOnDestroy(): void {
this.onDestroy$.next();
@@ -27,7 +30,7 @@ export class ThumbnailUrlPipe implements PipeTransform, OnDestroy {
this.input$
.pipe(
takeUntil(this.onDestroy$),
switchMap((input) => this.domainCatalogThumbnailService.getThumnaulUrl(input))
switchMap((input) => this.domainCatalogThumbnailService.getThumnaulUrl(input)),
)
.subscribe((result) => {
this.result = result;

View File

@@ -28,7 +28,7 @@ export const metaReducers: MetaReducer<RootState>[] = !environment.production ?
imports: [
StoreModule.forRoot(rootReducer, { metaReducers }),
EffectsModule.forRoot([]),
StoreDevtoolsModule.instrument({ name: 'ISA Ngrx Application Store' }),
StoreDevtoolsModule.instrument({ name: 'ISA Ngrx Application Store', connectInZone: true }),
],
})
export class AppStoreModule {}

View File

@@ -1,18 +1,17 @@
import { DOCUMENT } from '@angular/common';
import { Component, HostListener, Inject, OnInit, Renderer2 } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { SwUpdate, UpdateAvailableEvent } from '@angular/service-worker';
import { SwUpdate } from '@angular/service-worker';
import { ApplicationService } from '@core/application';
import { Config } from '@core/config';
import { NotificationsHub } from '@hub/notifications';
import packageInfo from 'package';
import { asapScheduler, interval, Observable, Subscription } from 'rxjs';
import { asapScheduler, interval, Subscription } from 'rxjs';
import { UserStateService } from '@swagger/isa';
import { IsaLogProvider } from './providers';
import { EnvironmentService } from '@core/environment';
import { AuthService } from '@core/auth';
import { UiMessageModalComponent, UiModalService } from '@ui/modal';
import { tap } from 'rxjs/operators';
@Component({
selector: 'app-root',
@@ -21,10 +20,9 @@ import { tap } from 'rxjs/operators';
})
export class AppComponent implements OnInit {
private _checkForUpdates: number = this._config.get('checkForUpdates');
updateAvailableObs: Observable<UpdateAvailableEvent>;
get checkForUpdates(): number {
return this._checkForUpdates;
return this._checkForUpdates ?? 60 * 60 * 1000; // default 1 hour
}
// For Unit Testing
@@ -45,7 +43,7 @@ export class AppComponent implements OnInit {
private infoService: UserStateService,
private readonly _environment: EnvironmentService,
private readonly _authService: AuthService,
private readonly _modal: UiModalService
private readonly _modal: UiModalService,
) {
this.updateClient();
IsaLogProvider.InfoService = this.infoService;

View File

@@ -73,7 +73,7 @@
},
"checkForU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": "Keine Anrede",

View File

@@ -74,7 +74,7 @@
},
"checkForUpdates": 3600000,
"licence": {
"scandit": "Ae7z0WDdRDFqG6oYuAXzesYGJpDLDqt+xWtQHOESiOjaSkB7IEIDJAk534U+cg1zGnk++4hOEK9hXEGR01NLTjh76w1fDL0U63OUjo50EHBXIUvzAVSur3pRY+1ER7SvSEWaT0hDOLYvYrTpdECtt1graN9yMvJzXD38VJKUfssT92p+YENV2Hul3eXIvaVjHqXE/yvupF+MlOMMUMhX0/Km/yTU9H9SjBdsXYihZmYWbt2JotO3Zs1ojXb0+3La10xb01S1q0XdDN6El3XMVilEtdmrP3WoGois8vpQBvOCEvduxCfILFAqjeWXTZvXSut9u+kQKpK8uHW4rVV6iVClpZfPYqKJqTh78AI9gpnfb/zO9GfQEDS3g7wI5WbQKqaNRzhTVowFRri4Ep9R5TRC1bnd00RC4zVaMkbu5kBOA7YoRjgUiYWHKJpi/VokZWyN6u1lsi5mTUbQkm1ZWfX5I/iUVYBgyHZYl+8kfFkwLPXGZNrF4xqubjKiCZRQj0oyNjHOBeHqvAekzhk7scX2g/NN+liRQv4ur413b+uXacSiiYIrLhtGgzrz1KRrtu19uB5odk3LoerDoiYXat7wEg9zUYT/+uBfO2X+uS7L5LW0PMI3hV+joQVpDk5SlA2868Nx0KWtPWmMf7xCuFIhDskfBsXZNRTblqxkk0RzzSqtjx9ihGr+/Tuzm8Pm0s4OQqV7b+++/Zn+Vo4rCqMTwutjOO7dqhah5hbOT1MqY/6VcjCXyDad3BXXr+WYU4GtYTe8Ytjkm/ZTG3fImoDbMchEcqnCw3oxG5e/gkdurE8g/mZlFOtzAN7KkqIsg6qLaC5COjfLPXsi/A=="
"scandit": "Ac2kvx5ZOzjvFl/LuAd6wds3C30YJ4g8Cm6PX4sgUnKPePVMuH+rFQIyVNn1YdS3myORojEOBsIZWhMw2nRUGBtOnQ5FO+cRHgQu0pkP+VG6OYvt8ETUTn8Aa2f9bmfqclO3LI8WN8psWr+adkZEtqNTvCgyDL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TPcY0QDw21Dv3wNHNa9HbanJcb3/MuhZGlrKp7"
},
"gender": {
"0": "Keine Anrede",

View File

@@ -74,7 +74,7 @@
},
"checkForUpdates": 3600000,
"licence": {
"scandit": "Ae7z0WDdRDFqG6oYuAXzesYGJpDLDqt+xWtQHOESiOjaSkB7IEIDJAk534U+cg1zGnk++4hOEK9hXEGR01NLTjh76w1fDL0U63OUjo50EHBXIUvzAVSur3pRY+1ER7SvSEWaT0hDOLYvYrTpdECtt1graN9yMvJzXD38VJKUfssT92p+YENV2Hul3eXIvaVjHqXE/yvupF+MlOMMUMhX0/Km/yTU9H9SjBdsXYihZmYWbt2JotO3Zs1ojXb0+3La10xb01S1q0XdDN6El3XMVilEtdmrP3WoGois8vpQBvOCEvduxCfILFAqjeWXTZvXSut9u+kQKpK8uHW4rVV6iVClpZfPYqKJqTh78AI9gpnfb/zO9GfQEDS3g7wI5WbQKqaNRzhTVowFRri4Ep9R5TRC1bnd00RC4zVaMkbu5kBOA7YoRjgUiYWHKJpi/VokZWyN6u1lsi5mTUbQkm1ZWfX5I/iUVYBgyHZYl+8kfFkwLPXGZNrF4xqubjKiCZRQj0oyNjHOBeHqvAekzhk7scX2g/NN+liRQv4ur413b+uXacSiiYIrLhtGgzrz1KRrtu19uB5odk3LoerDoiYXat7wEg9zUYT/+uBfO2X+uS7L5LW0PMI3hV+joQVpDk5SlA2868Nx0KWtPWmMf7xCuFIhDskfBsXZNRTblqxkk0RzzSqtjx9ihGr+/Tuzm8Pm0s4OQqV7b+++/Zn+Vo4rCqMTwutjOO7dqhah5hbOT1MqY/6VcjCXyDad3BXXr+WYU4GtYTe8Ytjkm/ZTG3fImoDbMchEcqnCw3oxG5e/gkdurE8g/mZlFOtzAN7KkqIsg6qLaC5COjfLPXsi/A=="
"scandit": "Ac2kvx5ZOzjvFl/LuAd6wds3C30YJ4g8Cm6PX4sgUnKPePVMuH+rFQIyVNn1YdS3myORojEOBsIZWhMw2nRUGBtOnQ5FO+cRHgQu0pkP+VG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U9yyoUlxntSI42GHB/UttPc7Hj14V5+oJ+Yz+CZodmkXFg57Vx4NuxveNtO"
},
"gender": {
"0": "Keine Anrede",

View File

@@ -23,7 +23,7 @@
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
@@ -57,4 +57,3 @@ import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
import 'hammerjs';

View File

@@ -1,25 +1,12 @@
import { Injectable } from '@angular/core';
import {
Observable,
of,
BehaviorSubject,
Subject,
merge,
combineLatest,
} from 'rxjs';
import { Observable, of, BehaviorSubject, Subject, merge, combineLatest } from 'rxjs';
import { delay, distinctUntilChanged, map } from 'rxjs/operators';
import { createRandomStringId, createRandomId } from './util';
import {
product,
removeSourcePriceAndProductFromProduct,
} from './data/product';
import { product, removeSourcePriceAndProductFromProduct } from './data/product';
import { RemissionService } from '../services/remission.service';
import { RemissionProcess } from '../models/remission-process';
import { RemissionProduct } from '../models/remission-product';
import {
remissionProducts,
createRemissionProduct,
} from './data/remission-products';
import { remissionProducts, createRemissionProduct } from './data/remission-products';
import { remissionProcessTemplateMock } from './data/remission-process-template';
import { ShippingDocument } from '../models/shipping-document';
import { shippingDocument } from './data/shipping-document';
@@ -41,33 +28,21 @@ import { ActionResult, CapacityType } from '../models';
@Injectable({ providedIn: 'root' })
export class MockRemissionService extends RemissionService {
private delayInMs = 100;
private remissionSubjectStore = new Map<
number,
BehaviorSubject<RemissionProcess>
>();
private remissionSubjectStore = new Map<number, BehaviorSubject<RemissionProcess>>();
private remissionSubjectIdRef = new Map<number, number>();
private reloadProductsSubject = new Subject();
private productSubject = new BehaviorSubject<RemissionProduct[]>(
remissionProducts
);
private reloadProductsSubject = new Subject<void>();
private productSubject = new BehaviorSubject<RemissionProduct[]>(remissionProducts);
private getRemissionFromStore = (
remissionProcessId: number
): BehaviorSubject<RemissionProcess> => {
private getRemissionFromStore = (remissionProcessId: number): BehaviorSubject<RemissionProcess> => {
const remission =
this.remissionSubjectStore.get(remissionProcessId) ||
this.remissionSubjectStore.get(
this.remissionSubjectIdRef.get(remissionProcessId)
);
this.remissionSubjectStore.get(this.remissionSubjectIdRef.get(remissionProcessId));
return remission;
};
private saveRemissionInStore = (
remissionProcessId: number,
remissionSubject: BehaviorSubject<RemissionProcess>
) => {
private saveRemissionInStore = (remissionProcessId: number, remissionSubject: BehaviorSubject<RemissionProcess>) => {
this.remissionSubjectStore.set(remissionProcessId, remissionSubject);
};
@@ -80,27 +55,20 @@ export class MockRemissionService extends RemissionService {
return processSubject.pipe(distinctUntilChanged(), delay(this.delayInMs));
}
getRemissionProducts(params: {
remissionProcessId: number;
}): Observable<{
getRemissionProducts(params: { remissionProcessId: number }): Observable<{
skip?: number;
take?: number;
hits?: number;
items: RemissionProduct[];
completed: boolean;
}> {
const processSubject = this.getRemissionFromStore(
params.remissionProcessId
);
const processSubject = this.getRemissionFromStore(params.remissionProcessId);
if (!processSubject) {
throw new Error('Prozess nicht gefunden');
}
const process$ = merge(
processSubject,
this.reloadProductsSubject.pipe(map((_) => processSubject.value))
);
const process$ = merge(processSubject, this.reloadProductsSubject.pipe(map((_) => processSubject.value)));
const products$ = this.productSubject.asObservable();
@@ -126,24 +94,19 @@ export class MockRemissionService extends RemissionService {
const productGroupFilter = filter.filter['421228ce'] || [];
if (productGroupFilter.length > 0) {
result.items = result.items.filter((product) =>
productGroupFilter.some((s) => product.productGroup === s)
);
result.items = result.items.filter((product) => productGroupFilter.some((s) => product.productGroup === s));
}
const actionFilter = filter.filter['ce9ee0be'] || [];
result.hits = result.items.length;
result.items = result.items.slice(
result.skip,
result.skip + result.take
);
result.items = result.items.slice(result.skip, result.skip + result.take);
result.completed = result.skip + result.take >= result.hits;
return result;
})
}),
);
}
@@ -153,9 +116,7 @@ export class MockRemissionService extends RemissionService {
createShippingDocument?: boolean;
};
}): Observable<RemissionProcess> {
const processSubject = this.remissionSubjectStore.get(
params.remissionProcessId
);
const processSubject = this.remissionSubjectStore.get(params.remissionProcessId);
if (!processSubject) {
throw new Error('Prozess nicht gefunden');
@@ -214,12 +175,8 @@ export class MockRemissionService extends RemissionService {
}
}
completeRemission(params: {
remissionProcessId: number;
}): Observable<boolean> {
let processSubject = this.remissionSubjectStore.get(
params.remissionProcessId
);
completeRemission(params: { remissionProcessId: number }): Observable<boolean> {
let processSubject = this.remissionSubjectStore.get(params.remissionProcessId);
if (!processSubject) {
const refId = this.remissionSubjectIdRef.get(params.remissionProcessId);
@@ -236,9 +193,7 @@ export class MockRemissionService extends RemissionService {
}
}
getRemission(params: {
remissionProcessId: number;
}): Observable<RemissionProcess> {
getRemission(params: { remissionProcessId: number }): Observable<RemissionProcess> {
const remission = this.getRemissionFromStore(params.remissionProcessId);
if (!remission) {
@@ -248,11 +203,7 @@ export class MockRemissionService extends RemissionService {
return remission.pipe(distinctUntilChanged(), delay(this.delayInMs));
}
isPrintingRequired({
remissionProcessId,
}: {
remissionProcessId: number;
}): Observable<boolean> {
isPrintingRequired({ remissionProcessId }: { remissionProcessId: number }): Observable<boolean> {
const remission = this.getRemissionFromStore(remissionProcessId);
if (!remission) {
@@ -272,10 +223,7 @@ export class MockRemissionService extends RemissionService {
return of(printers).pipe(delay(this.delayInMs));
}
printRemissionList(params: {
remissionProcessId: number;
printerKey: string;
}): Observable<boolean> {
printRemissionList(params: { remissionProcessId: number; printerKey: string }): Observable<boolean> {
const remission = this.getRemissionFromStore(params.remissionProcessId);
if (!remission) {
@@ -285,11 +233,7 @@ export class MockRemissionService extends RemissionService {
return of(true).pipe(delay(this.delayInMs));
}
printShippingDocument(params: {
remissionProcessId: number;
shippingDocumentId?: number;
printerKey: string;
}): Observable<boolean> {
printShippingDocument(params: { remissionProcessId: number; shippingDocumentId?: number; printerKey: string }): Observable<boolean> {
const remission = this.getRemissionFromStore(params.remissionProcessId);
if (!remission || !params.printerKey) {
@@ -307,8 +251,7 @@ export class MockRemissionService extends RemissionService {
getFilters(params: { remissionProcessId: number }): Observable<Filter[]> {
const remission = this.getRemissionFromStore(params.remissionProcessId);
const filterForGivenSourceType =
remission.value.filter.source === 'zentral' ? filter : filterUeberlauf;
const filterForGivenSourceType = remission.value.filter.source === 'zentral' ? filter : filterUeberlauf;
return of(filterForGivenSourceType).pipe(delay(this.delayInMs));
}
@@ -327,38 +270,24 @@ export class MockRemissionService extends RemissionService {
return of(remissionSources).pipe(delay(this.delayInMs));
}
getShippingDocuments(params: {
remissionProcessId: number;
shippingDocumentId: number;
}): Observable<ShippingDocument> {
getShippingDocuments(params: { remissionProcessId: number; shippingDocumentId: number }): Observable<ShippingDocument> {
const remissionSub = this.getRemissionFromStore(params.remissionProcessId);
return remissionSub.pipe(
map((remission) =>
remission.shippingDocuments.find(
(shippingDoc) => shippingDoc.id === params.shippingDocumentId
)
),
map((remission) => remission.shippingDocuments.find((shippingDoc) => shippingDoc.id === params.shippingDocumentId)),
distinctUntilChanged(),
delay(this.delayInMs)
delay(this.delayInMs),
);
}
deleteProductFromRemissionList(input: {
remissionProcessId: number;
remissionProductId: number;
}): Observable<ActionResult<boolean>> {
deleteProductFromRemissionList(input: { remissionProcessId: number; remissionProductId: number }): Observable<ActionResult<boolean>> {
return of({
error: false,
result: true,
});
}
addProductToRemit(input: {
product: Product;
remissionReason: string;
remissionQuantity: number;
}): Observable<RemissionProduct> {
addProductToRemit(input: { product: Product; remissionReason: string; remissionQuantity: number }): Observable<RemissionProduct> {
const productToAdd = removeSourcePriceAndProductFromProduct({ ...product });
const newProduct = createRemissionProduct({
@@ -382,9 +311,7 @@ export class MockRemissionService extends RemissionService {
quantity?: number;
inStock?: number;
}): Observable<ActionResult<boolean>> {
const processSubject = this.getRemissionFromStore(
params.remissionProcessId
);
const processSubject = this.getRemissionFromStore(params.remissionProcessId);
const process = processSubject.value;
const products = this.productSubject.value;
@@ -392,22 +319,15 @@ export class MockRemissionService extends RemissionService {
throw new Error('Prozess nicht gefunden');
}
let productToAdd = products.find(
(product) => product.id === params.remissionProductId
);
let newProducts = products.filter(
(product) => product.id !== params.remissionProductId
);
let productToAdd = products.find((product) => product.id === params.remissionProductId);
let newProducts = products.filter((product) => product.id !== params.remissionProductId);
if (!!params.placementType || !!params.quantity) {
const productToUpdateInProductList = {
...productToAdd,
remissionQuantity: productToAdd.remissionQuantity - params.quantity,
};
newProducts =
productToAdd.remissionQuantity - params.quantity < 1
? newProducts
: [...newProducts, productToUpdateInProductList];
newProducts = productToAdd.remissionQuantity - params.quantity < 1 ? newProducts : [...newProducts, productToUpdateInProductList];
productToAdd = {
...productToAdd,
@@ -415,9 +335,7 @@ export class MockRemissionService extends RemissionService {
};
}
const shippingDocumentToUpdate = process.shippingDocuments.find(
(document) => document.id === params.shippingDocumentId
);
const shippingDocumentToUpdate = process.shippingDocuments.find((document) => document.id === params.shippingDocumentId);
const updatedShippingDocument = {
...shippingDocumentToUpdate,
products: [...shippingDocumentToUpdate.products, productToAdd],
@@ -426,9 +344,7 @@ export class MockRemissionService extends RemissionService {
const updatedProcess = {
...process,
shippingDocuments: [
...process.shippingDocuments.filter(
(document) => document.id !== params.shippingDocumentId
),
...process.shippingDocuments.filter((document) => document.id !== params.shippingDocumentId),
updatedShippingDocument,
],
};
@@ -448,9 +364,7 @@ export class MockRemissionService extends RemissionService {
remissionProductId: number;
placementType?: string;
}): Observable<boolean> {
const processSubject = this.getRemissionFromStore(
params.remissionProcessId
);
const processSubject = this.getRemissionFromStore(params.remissionProcessId);
const process = processSubject.value;
const products = this.productSubject.value;
@@ -458,44 +372,30 @@ export class MockRemissionService extends RemissionService {
throw new Error('Prozess nicht gefunden');
}
const shippingDocumentToUpdate = process.shippingDocuments.find(
(document) => document.id === params.shippingDocumentId
);
const shippingDocumentToUpdate = process.shippingDocuments.find((document) => document.id === params.shippingDocumentId);
const updatedShippingDocument = {
...shippingDocumentToUpdate,
products: shippingDocumentToUpdate.products.filter(
(product) => product.id !== params.remissionProductId
),
products: shippingDocumentToUpdate.products.filter((product) => product.id !== params.remissionProductId),
};
const productToRemove = shippingDocumentToUpdate.products.find(
(product) => product.id === params.remissionProductId
);
const productInProductList = products.find(
(product) => product.id === params.remissionProductId
);
const productToRemove = shippingDocumentToUpdate.products.find((product) => product.id === params.remissionProductId);
const productInProductList = products.find((product) => product.id === params.remissionProductId);
const updatedProductInProductList = !!productInProductList
? {
...productInProductList,
remissionQuantity:
Number(productInProductList.remissionQuantity) +
Number(productToRemove.remissionQuantity),
remissionQuantity: Number(productInProductList.remissionQuantity) + Number(productToRemove.remissionQuantity),
}
: productToRemove;
const updatedProcess = {
...process,
shippingDocuments: [
...process.shippingDocuments.filter(
(document) => document.id !== params.shippingDocumentId
),
...process.shippingDocuments.filter((document) => document.id !== params.shippingDocumentId),
updatedShippingDocument,
],
};
const updatedProducts = [
...this.productSubject.value.filter(
(product) => product.id !== updatedProductInProductList.id
),
...this.productSubject.value.filter((product) => product.id !== updatedProductInProductList.id),
updatedProductInProductList,
];
@@ -509,12 +409,8 @@ export class MockRemissionService extends RemissionService {
this.reloadProductsSubject.next();
}
createShippingDocument(params: {
remissionProcessId: number;
}): Observable<ShippingDocument> {
const processSubject = this.getRemissionFromStore(
params.remissionProcessId
);
createShippingDocument(params: { remissionProcessId: number }): Observable<ShippingDocument> {
const processSubject = this.getRemissionFromStore(params.remissionProcessId);
if (!processSubject) {
throw new Error('Prozess nicht gefunden');
@@ -526,10 +422,7 @@ export class MockRemissionService extends RemissionService {
id: createRandomId(),
shippingDocumentNumber: createRandomStringId(),
};
const updatedShippingDocuments = [
...process.shippingDocuments,
newShippingDocument,
];
const updatedShippingDocuments = [...process.shippingDocuments, newShippingDocument];
const updatedProcess = {
...process,
shippingDocuments: updatedShippingDocuments,
@@ -545,18 +438,14 @@ export class MockRemissionService extends RemissionService {
shippingDocumentId: number;
containerId: string;
}): Observable<ActionResult<boolean>> {
const processSubject = this.getRemissionFromStore(
params.remissionProcessId
);
const processSubject = this.getRemissionFromStore(params.remissionProcessId);
if (!processSubject) {
throw new Error('Prozess nicht gefunden');
}
const process = processSubject.value;
const shippingContainerToUpdate = process.shippingDocuments.find(
(document) => document.id === params.shippingDocumentId
);
const shippingContainerToUpdate = process.shippingDocuments.find((document) => document.id === params.shippingDocumentId);
const updatedShippingContainer = {
...shippingContainerToUpdate,
isCompleted: true,
@@ -564,9 +453,7 @@ export class MockRemissionService extends RemissionService {
const updatedProcess = {
...process,
shippingDocuments: [
...process.shippingDocuments.filter(
(document) => document.id !== params.shippingDocumentId
),
...process.shippingDocuments.filter((document) => document.id !== params.shippingDocumentId),
updatedShippingContainer,
],
};
@@ -579,9 +466,7 @@ export class MockRemissionService extends RemissionService {
}).pipe(delay(this.delayInMs));
}
completeRemissions(params: {
remissionProcessId: number;
}): Observable<boolean> {
completeRemissions(params: { remissionProcessId: number }): Observable<boolean> {
return;
}
@@ -605,9 +490,7 @@ export class MockRemissionService extends RemissionService {
return of(true);
}
deleteShippingDocument(): Observable<
ActionResult<{ deleted: boolean; completedRemissionsExist: boolean }>
> {
deleteShippingDocument(): Observable<ActionResult<{ deleted: boolean; completedRemissionsExist: boolean }>> {
return of({
result: {
deleted: true,
@@ -620,10 +503,7 @@ export class MockRemissionService extends RemissionService {
return;
}
getCapacities(params: {
selectedFilters?: { [filterId: string]: string[] };
supplierId: number;
}): Observable<CapacityType[]> {
getCapacities(params: { selectedFilters?: { [filterId: string]: string[] }; supplierId: number }): Observable<CapacityType[]> {
return of([]);
}
}

View File

@@ -58,11 +58,11 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
this.store.isDownloadAvailabilityAvailable$,
]).pipe(
map((values) => values.some((v) => v)),
shareReplay()
shareReplay(),
);
showDeliveryTruck$ = combineLatest([this.store.isDeliveryAvailabilityAvailable$, this.store.isDeliveryDigAvailabilityAvailable$]).pipe(
map(([delivery, digDelivery]) => delivery || digDelivery)
map(([delivery, digDelivery]) => delivery || digDelivery),
);
showDeliveryB2BTruck$ = combineLatest([
@@ -71,7 +71,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
]).pipe(map(([digDelivery, b2bDelivery]) => b2bDelivery && !digDelivery));
customerFeatures$ = this.applicationService.activatedProcessId$.pipe(
switchMap((processId) => this._domainCheckoutService.getCustomerFeatures({ processId }))
switchMap((processId) => this._domainCheckoutService.getCustomerFeatures({ processId })),
);
showSubscriptionBadge$ = this.store.item$.pipe(map((item) => item?.features?.find((i) => i.key === 'PFO')));
@@ -80,13 +80,13 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
promotionPoints$ = this.store.item$.pipe(map((item) => item?.redemptionPoints));
showPromotionBadge$ = combineLatest([this.hasPromotionFeature$, this.promotionPoints$]).pipe(
map(([hasPromotionFeature, promotionPoints]) => hasPromotionFeature && promotionPoints > 0)
map(([hasPromotionFeature, promotionPoints]) => hasPromotionFeature && promotionPoints > 0),
);
showArchivBadge$ = this.store.item$.pipe(map((item) => item?.features?.find((i) => i.key === 'ARC')));
isBadgeVisible$ = combineLatest([this.showSubscriptionBadge$, this.showPromotionBadge$, this.showArchivBadge$]).pipe(
map(([showSubscriptionBadge, showPromotionBadge, showArchivBadge]) => showSubscriptionBadge || showPromotionBadge || showArchivBadge)
map(([showSubscriptionBadge, showPromotionBadge, showArchivBadge]) => showSubscriptionBadge || showPromotionBadge || showArchivBadge),
);
contributors$ = this.store.item$.pipe(map((item) => item?.product?.contributors?.split(';').map((m) => m.trim())));
@@ -101,11 +101,11 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
}
return this._datePipe.transform(date, 'dd. MMMM y');
})
}),
);
selectedBranchId$ = this.applicationService.activatedProcessId$.pipe(
switchMap((processId) => this.applicationService.getSelectedBranch$(processId))
switchMap((processId) => this.applicationService.getSelectedBranch$(processId)),
);
get isTablet$() {
@@ -131,7 +131,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
return 'Sie sehen den Bestand einer anderen Filiale.';
}
return '';
})
}),
);
priceMaintained$ = combineLatest([
@@ -141,8 +141,8 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
this.store.deliveryB2BAvailability$,
]).pipe(
map((availabilities) => {
return availabilities?.some((availability) => availability?.priceMaintained) ?? false;
})
return availabilities?.some((availability) => (availability as any)?.priceMaintained) ?? false;
}),
);
price$ = combineLatest([
@@ -174,7 +174,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
}
return null;
})
}),
);
constructor(
@@ -193,7 +193,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
private _environment: EnvironmentService,
private _router: Router,
private _domainCheckoutService: DomainCheckoutService,
private _store: Store
private _store: Store,
) {}
ngOnInit() {
@@ -201,8 +201,8 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
.pipe(
debounceTime(0),
switchMap((params) =>
this.applicationService.getSelectedBranch$(Number(params.processId)).pipe(map((selectedBranch) => ({ params, selectedBranch })))
)
this.applicationService.getSelectedBranch$(Number(params.processId)).pipe(map((selectedBranch) => ({ params, selectedBranch }))),
),
)
.subscribe(({ params, selectedBranch }) => {
const processId = Number(params.processId);
@@ -221,13 +221,13 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
const id$ = this.activatedRoute.params.pipe(
tap((_) => (this.showRecommendations = false)),
map((params) => Number(params?.id) || undefined),
filter((f) => !!f)
filter((f) => !!f),
);
const ean$ = this.activatedRoute.params.pipe(
tap((_) => (this.showRecommendations = false)),
map((params) => params?.ean || undefined),
filter((f) => !!f)
filter((f) => !!f),
);
const more$ = this.activatedRoute.params.subscribe(() => (this.showMore = false));
@@ -241,9 +241,9 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
this.store.item$
.pipe(
withLatestFrom(this.isTablet$),
filter(([item, isTablet]) => !!item)
filter(([item, isTablet]) => !!item),
)
.subscribe(([item, isTablet]) => (isTablet ? this.updateBreadcrumb(item) : this.updateBreadcrumbDesktop(item)))
.subscribe(([item, isTablet]) => (isTablet ? this.updateBreadcrumb(item) : this.updateBreadcrumbDesktop(item))),
);
}
@@ -354,7 +354,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
if (result?.data) {
this.showPurchasingModal(result.data);
}
})
}),
);
}
@@ -425,7 +425,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
first(),
switchMap((customerFeatures) => {
return this._domainCheckoutService.canSetCustomer({ processId: this.applicationService.activatedProcessId, customerFeatures });
})
}),
)
.toPromise();
this._router.navigate(nav.path, {

View File

@@ -24,14 +24,14 @@ import { FilterAutocompleteProvider } from '@shared/components/filter';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ArticleSearchComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
private _processId$: Observable<number>;
constructor(
private _breadcrumb: BreadcrumbService,
private _articleSearch: ArticleSearchService,
private _activatedRoute: ActivatedRoute,
private _navigationService: ProductCatalogNavigationService
private _navigationService: ProductCatalogNavigationService,
) {}
ngOnInit() {

View File

@@ -58,14 +58,14 @@ export class ArticleSearchFilterComponent implements OnInit, OnDestroy {
}
}
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
constructor(
private articleSearch: ArticleSearchService,
private _environment: EnvironmentService,
private _activatedRoute: ActivatedRoute,
public application: ApplicationService,
private _navigationService: ProductCatalogNavigationService
private _navigationService: ProductCatalogNavigationService,
) {}
ngOnInit() {

View File

@@ -33,7 +33,7 @@ export class PageCatalogComponent implements OnInit, AfterViewInit, OnDestroy {
return `${this.breadcrumbRef?.nativeElement?.clientWidth}px`;
}
_onDestroy$ = new Subject<boolean>();
_onDestroy$ = new Subject<void>();
get isTablet$() {
return this._environmentService.matchTablet$;
@@ -60,7 +60,7 @@ export class PageCatalogComponent implements OnInit, AfterViewInit, OnDestroy {
public auth: AuthService,
private _environmentService: EnvironmentService,
private _renderer: Renderer2,
private _actions: ActionsSubject
private _actions: ActionsSubject,
) {}
ngOnInit() {
@@ -76,7 +76,7 @@ export class PageCatalogComponent implements OnInit, AfterViewInit, OnDestroy {
return 'Bitte wählen Sie eine Filiale aus, um den Bestand einer anderen Filiale zu sehen';
}
return '';
})
}),
);
}

View File

@@ -33,7 +33,7 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
private _toaster = inject(ToasterService);
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
processId = Date.now();
selectedDate = this.dateAdapter.today();
minDateDatepicker = this.dateAdapter.addCalendarDays(this.dateAdapter.today(), -1);
@@ -52,17 +52,17 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
// Ticket #4228 Für die korrekte Gruppierung der Items bei gleichem Bestellziel (Aufsplitten von Abholung und Rücklage)
const ordersWithMultipleFeatures = filteredOrders.filter((order) =>
order.items.find((item) => item.features.orderType !== order.features.orderType)
order.items.find((item) => item.features.orderType !== order.features.orderType),
);
if (!!ordersWithMultipleFeatures) {
for (let orderWithMultipleFeatures of ordersWithMultipleFeatures) {
if (orderWithMultipleFeatures?.items?.length > 1) {
const itemsWithOrderFeature = orderWithMultipleFeatures.items.filter(
(item) => item.features.orderType === orderWithMultipleFeatures.features.orderType
(item) => item.features.orderType === orderWithMultipleFeatures.features.orderType,
);
const itemsWithDifferentOrderFeature = orderWithMultipleFeatures.items.filter(
(item) => item.features.orderType !== orderWithMultipleFeatures.features.orderType
(item) => item.features.orderType !== orderWithMultipleFeatures.features.orderType,
);
filteredOrders = [...filteredOrders.filter((order) => order.id !== orderWithMultipleFeatures.id)];
@@ -85,20 +85,20 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
};
});
}),
shareReplay()
shareReplay(),
);
hasAbholung$ = this.displayOrders$.pipe(
map((displayOrders) => displayOrders.filter((order) => order.features?.orderType === 'Abholung')?.length > 0)
map((displayOrders) => displayOrders.filter((order) => order.features?.orderType === 'Abholung')?.length > 0),
);
totalItemCount$ = this.displayOrders$.pipe(
map((displayOrders) =>
displayOrders.reduce(
(total, displayOrder) => total + displayOrder?.items?.reduce((subTotal, order) => subTotal + order?.quantity, 0),
0
)
)
0,
),
),
);
totalReadingPoints$ = this.displayOrders$.pipe(
@@ -122,7 +122,7 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
} else {
return NEVER;
}
})
}),
);
totalPrice$ = this.displayOrders$.pipe(
@@ -130,9 +130,9 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
displayOrders.reduce(
(total, displayOrder) =>
total + displayOrder?.items?.reduce((subTotal, order) => subTotal + order?.price?.value?.value * order.quantity, 0),
0
)
)
0,
),
),
);
isPrinting$ = new BehaviorSubject(false);
@@ -142,20 +142,20 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
containsDeliveryOrder$ = this.displayOrders$.pipe(
map(
(displayOrders) =>
displayOrders.filter((o) => ['Versand', 'B2B-Versand', 'DIG-Versand'].indexOf(o.features?.orderType) > -1)?.length > 0
)
displayOrders.filter((o) => ['Versand', 'B2B-Versand', 'DIG-Versand'].indexOf(o.features?.orderType) > -1)?.length > 0,
),
);
customer$ = this.displayOrders$.pipe(
switchMap((o) => this.customerService.getCustomers(o[0].buyerNumber, { take: 5 })),
map((customers) => customers.result[0]),
shareReplay()
shareReplay(),
);
isB2BCustomer$ = this.customer$.pipe(map((customer) => customer?.features?.find((f) => f.key === 'b2b') != null));
takeNowOrders$ = this.displayOrders$.pipe(
map((displayOrders) => displayOrders.filter((o) => o.items.find((oi) => oi.features?.orderType === 'Rücklage') != null))
map((displayOrders) => displayOrders.filter((o) => o.items.find((oi) => oi.features?.orderType === 'Rücklage') != null)),
);
get isDesktop$() {
@@ -184,7 +184,7 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
private _productNavigationService: ProductCatalogNavigationService,
private _shelfOutNavigationService: PickUpShelfOutNavigationService,
private _environmentService: EnvironmentService,
private _cdr: ChangeDetectorRef
private _cdr: ChangeDetectorRef,
) {
this.breadcrumb
.getBreadcrumbsByKeyAndTags$(this.applicationService.activatedProcessId, ['checkout'])
@@ -319,7 +319,7 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
first(),
map((printers) => {
if (Array.isArray(printers)) return printers.find((printer) => printer.selected === true);
})
}),
)
.toPromise();

View File

@@ -78,12 +78,12 @@ export class CustomerOrderDetailsItemComponent extends ComponentStore<CustomerOr
switchMap((oi) =>
this._omsService
.getCompletedTasks({ orderId: oi.orderId, orderItemId: oi.orderItemId, orderItemSubsetId: oi.orderItemSubsetId, take: 4, skip: 0 })
.pipe(catchError(() => NEVER))
)
.pipe(catchError(() => NEVER)),
),
);
canChangeQuantity$ = combineLatest([this.orderItem$, this._store.fetchPartial$]).pipe(
map(([item, partialPickup]) => ([16, 8192].includes(item?.processingStatus) || partialPickup) && item.quantity > 1)
map(([item, partialPickup]) => ([16, 8192].includes(item?.processingStatus) || partialPickup) && item.quantity > 1),
);
get quantity() {
@@ -109,7 +109,7 @@ export class CustomerOrderDetailsItemComponent extends ComponentStore<CustomerOr
}
readonly selected$ = combineLatest([this.orderItem$, this._store.selectedeOrderItemSubsetIds$]).pipe(
map(([orderItem, selectedItems]) => selectedItems.includes(orderItem?.orderItemSubsetId))
map(([orderItem, selectedItems]) => selectedItems.includes(orderItem?.orderItemSubsetId)),
);
@Output()
@@ -120,7 +120,7 @@ export class CustomerOrderDetailsItemComponent extends ComponentStore<CustomerOr
}
readonly selectable$ = combineLatest([this._store.items$, this._store.itemsSelectable$, this._store.fetchPartial$]).pipe(
map(([orderItems, selectable, fetchPartial]) => orderItems.length > 1 && selectable && fetchPartial)
map(([orderItems, selectable, fetchPartial]) => orderItems.length > 1 && selectable && fetchPartial),
);
get receipts() {
@@ -141,7 +141,7 @@ export class CustomerOrderDetailsItemComponent extends ComponentStore<CustomerOr
more$ = this.select((s) => s.more);
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
get isNative() {
return this._environment.isNative();
@@ -152,7 +152,7 @@ export class CustomerOrderDetailsItemComponent extends ComponentStore<CustomerOr
private _domainReceiptService: DomainReceiptService,
private _omsService: DomainOmsService,
private _cdr: ChangeDetectorRef,
private _environment: EnvironmentService
private _environment: EnvironmentService,
) {
super({
more: false,
@@ -194,11 +194,11 @@ export class CustomerOrderDetailsItemComponent extends ComponentStore<CustomerOr
done?.([]);
}
},
() => {}
)
)
)
)
() => {},
),
),
),
),
);
async saveSpecialComment() {
@@ -254,12 +254,15 @@ export class CustomerOrderDetailsItemComponent extends ComponentStore<CustomerOr
// Macht aus einem String Array ein Array von Objekten mit den keys trackingProvider und trackingNumber
private _trackingTransformationHelper(trackingInformationPairs: string[]): Array<{ trackingProvider: string; trackingNumber: string }> {
return trackingInformationPairs.reduce((acc, current, index, array) => {
if (index % 2 === 0) {
acc.push({ trackingProvider: current, trackingNumber: array[index + 1] });
}
return acc;
}, [] as { trackingProvider: string; trackingNumber: string }[]);
return trackingInformationPairs.reduce(
(acc, current, index, array) => {
if (index % 2 === 0) {
acc.push({ trackingProvider: current, trackingNumber: array[index + 1] });
}
return acc;
},
[] as { trackingProvider: string; trackingNumber: string }[],
);
}
getTrackingNumberLink(trackingNumber: string) {

View File

@@ -22,7 +22,7 @@ export class CustomerOrderSearchFilterComponent implements OnInit, OnDestroy {
processId = Number(this._activatedRoute?.parent?.snapshot?.data?.processId);
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
@ViewChild(FilterComponent, { static: false })
uiFilter: FilterComponent;
@@ -79,7 +79,7 @@ export class CustomerOrderSearchFilterComponent implements OnInit, OnDestroy {
private _environment: EnvironmentService,
private _activatedRoute: ActivatedRoute,
public application: ApplicationService,
private _navigationService: CustomerOrdersNavigationService
private _navigationService: CustomerOrdersNavigationService,
) {}
ngOnInit() {

View File

@@ -23,7 +23,7 @@ import { CustomerOrdersNavigationService } from '@shared/services';
],
})
export class CustomerOrderSearchComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
private _processId$: Observable<number>;
get isTablet() {
@@ -35,7 +35,7 @@ export class CustomerOrderSearchComponent implements OnInit, OnDestroy {
private _navigationService: CustomerOrdersNavigationService,
private _breadcrumb: BreadcrumbService,
private _activatedRoute: ActivatedRoute,
private _environment: EnvironmentService
private _environment: EnvironmentService,
) {}
ngOnInit() {

View File

@@ -127,7 +127,10 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
cancelSearch$ = new Subject<void>();
constructor(private _domainGoodsInService: DomainCustomerOrderService, private _cache: CacheService) {
constructor(
private _domainGoodsInService: DomainCustomerOrderService,
private _cache: CacheService,
) {
super({
fetching: false,
silentFetching: false,
@@ -201,8 +204,8 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
search = this.effect((options$: Observable<{ clear?: boolean; siletReload?: boolean }>) =>
options$.pipe(
tap((_) => {
this.searchStarted.next();
tap((opt) => {
this.searchStarted.next(opt);
this.patchState({ message: undefined });
}),
withLatestFrom(this.results$, this.filter$, this.selectedBranch$),
@@ -289,10 +292,10 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
}
this.patchState({ fetching: false, silentFetching: false });
console.error('GoodsInSearchStore.search()', err);
}
)
},
),
);
})
)
}),
),
);
}

View File

@@ -42,8 +42,10 @@ export interface CustomerOrderSearchResultsState {
styleUrls: ['customer-order-search-results.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CustomerOrderSearchResultsComponent extends ComponentStore<CustomerOrderSearchResultsState>
implements OnInit, AfterViewInit, OnDestroy {
export class CustomerOrderSearchResultsComponent
extends ComponentStore<CustomerOrderSearchResultsState>
implements OnInit, AfterViewInit, OnDestroy
{
@ViewChildren(CustomerOrderItemComponent) listItems: QueryList<CustomerOrderItemComponent>;
@ViewChild(UiScrollContainerComponent) scrollContainer: UiScrollContainerComponent;
@@ -63,7 +65,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
listEmpty$ = combineLatest([this.loading$, this.hits$]).pipe(
map(([loading, hits]) => !loading && hits === 0),
shareReplay()
shareReplay(),
);
message$ = this._customerOrderSearchStore.message$;
@@ -76,9 +78,9 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
actions$ = combineLatest([this.items$, this.selectedOrderItemSubsetIds$]).pipe(
map(([items, selectedOrderItemSubsetIds]) =>
items?.find((item) => selectedOrderItemSubsetIds.find((orderItemSubsetId) => item.orderItemSubsetId === orderItemSubsetId))
items?.find((item) => selectedOrderItemSubsetIds.find((orderItemSubsetId) => item.orderItemSubsetId === orderItemSubsetId)),
),
map((item) => item?.actions?.filter((action) => this.selectionRules(action)))
map((item) => item?.actions?.filter((action) => this.selectionRules(action))),
);
get selectedItems() {
@@ -99,7 +101,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
processId$ = this._activatedRoute.parent.data.pipe(map((data) => +data.processId));
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
trackByFn: TrackByFunction<OrderItemListItemDTO> = (index, item) => `${item.orderId}${item.orderItemId}${item.orderItemSubsetId}`;
@@ -108,7 +110,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
filter$ = this._customerOrderSearchStore.filter$.pipe(filter((f) => !!f));
hasFilter$ = combineLatest([this.filter$, this._customerOrderSearchStore.defaultSettings$]).pipe(
map(([filter, defaultFilter]) => !isEqual(filter?.getQueryParams(), Filter.create(defaultFilter).getQueryParams()))
map(([filter, defaultFilter]) => !isEqual(filter?.getQueryParams(), Filter.create(defaultFilter).getQueryParams())),
);
get isTablet$() {
@@ -148,7 +150,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
private _navigationService: CustomerOrdersNavigationService,
private _application: ApplicationService,
private _cache: CacheService,
private _router: Router
private _router: Router,
) {
super({
selectedOrderItemSubsetIds: [],
@@ -166,7 +168,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
const clean = { ...queryParams };
delete clean['updateResults'];
}
})
}),
);
this._searchResultSubscription.add(
@@ -174,8 +176,8 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
.pipe(
debounceTime(150),
switchMap(([processId, params]) =>
this._application.getSelectedBranch$(processId).pipe(map((selectedBranch) => ({ processId, params, selectedBranch })))
)
this._application.getSelectedBranch$(processId).pipe(map((selectedBranch) => ({ processId, params, selectedBranch }))),
),
)
.subscribe(async ({ processId, params, selectedBranch }) => {
const branchChanged = selectedBranch?.id !== this._customerOrderSearchStore?.selectedBranch?.id;
@@ -243,7 +245,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
if (this._activatedRoute?.outlet === 'primary') {
await this.removeDetailsBreadcrumb(processId);
}
})
}),
);
this._searchResultSubscription.add(
@@ -261,12 +263,12 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
await this.navigateToDetails(
processId,
result?.results?.result?.find((_) => true),
queryParams
queryParams,
);
} else if ((!!result?.clear || this._activatedRoute.outlet === 'primary') && this.isDesktopLarge) {
await this._navigationService.getCustomerOrdersResultsPath(processId, { queryParams }).navigate();
}
})
}),
);
this._customerOrderSearchStore.searchResultClearedSubject.pipe(takeUntil(this._onDestroy$)).subscribe((_) => this.clearSelectedItems());
@@ -279,7 +281,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
main_qs: this.sharedFilterInputGroupMain?.uiInput?.value,
};
this._customerOrderSearchStore?.setQueryParams(queryParams);
})
}),
);
this._router.events.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
@@ -302,7 +304,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
if (this._activatedRoute.outlet === 'primary') {
this._cache.set<number>(
{ processId: this._customerOrderSearchStore.processId, token: this.SCROLL_POSITION_TOKEN },
this.scrollContainer?.scrollPos
this.scrollContainer?.scrollPos,
);
}
}

View File

@@ -30,7 +30,7 @@ export class CustomerOrderComponent implements OnInit {
return `${this.breadcrumbRef?.nativeElement?.clientWidth}px`;
}
_onDestroy$ = new Subject<boolean>();
_onDestroy$ = new Subject<void>();
get isTablet$() {
return this._environmentService.matchTablet$;
@@ -43,12 +43,12 @@ export class CustomerOrderComponent implements OnInit {
private _renderer: Renderer2,
private _environmentService: EnvironmentService,
public auth: AuthService,
private _store: CustomerOrderSearchStore
private _store: CustomerOrderSearchStore,
) {}
ngOnInit(): void {
this.selectedBranch$ = this.application.activatedProcessId$.pipe(
switchMap((processId) => this.application.getSelectedBranch$(Number(processId)))
switchMap((processId) => this.application.getSelectedBranch$(Number(processId))),
);
/* Ticket #4544 - Suchrequest abbrechen bei Prozesswechsel

View File

@@ -41,8 +41,10 @@ export interface CustomerTypeSelectorState {
},
],
})
export class CustomerTypeSelectorComponent extends ComponentStore<CustomerTypeSelectorState>
implements OnInit, OnDestroy, ControlValueAccessor {
export class CustomerTypeSelectorComponent
extends ComponentStore<CustomerTypeSelectorState>
implements OnInit, OnDestroy, ControlValueAccessor
{
@ViewChildren(UiCheckboxComponent)
checkboxes: QueryList<UiCheckboxComponent>;
@@ -133,7 +135,7 @@ export class CustomerTypeSelectorComponent extends ComponentStore<CustomerTypeSe
return result;
}),
shareReplay(1)
shareReplay(1),
);
}
@@ -144,7 +146,11 @@ export class CustomerTypeSelectorComponent extends ComponentStore<CustomerTypeSe
onChange = (value: string) => {};
onTouched = () => {};
constructor(private _checkoutService: DomainCheckoutService, private _cache: CacheService, private _cdr: ChangeDetectorRef) {
constructor(
private _checkoutService: DomainCheckoutService,
private _cache: CacheService,
private _cdr: ChangeDetectorRef,
) {
super({
processId: undefined,
customerType: undefined,
@@ -165,10 +171,10 @@ export class CustomerTypeSelectorComponent extends ComponentStore<CustomerTypeSe
this.patchState({ options });
this._cache.set('customerTypeOptions', options);
},
(err) => {}
)
)
)
(err) => {},
),
),
),
);
});
@@ -197,7 +203,7 @@ export class CustomerTypeSelectorComponent extends ComponentStore<CustomerTypeSe
setValue(value: { p4mUser?: boolean; customerType?: string } | string) {
const initial = { p4mUser: this.p4mUser, customerType: this.customerType };
if (isString(value)) {
if (typeof value === 'string') {
this.value = value;
} else {
if (isBoolean(value.p4mUser)) {

View File

@@ -76,7 +76,7 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
protected modal: UiModalService,
protected breadcrumb: BreadcrumbService,
protected cdr: ChangeDetectorRef,
protected customerSearchNavigation: CustomerSearchNavigation
protected customerSearchNavigation: CustomerSearchNavigation,
) {
this._initProcessId$();
}
@@ -88,7 +88,7 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
map((data) => +data.processId),
tap((processId) => (this.latestProcessId = processId)),
distinctUntilChanged(),
shareReplay(1)
shareReplay(1),
);
this.processId$
@@ -118,7 +118,7 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
const formData = await this.activatedRoute.queryParams
.pipe(
map((params) => params['formData']),
first()
first(),
)
.toPromise();
@@ -192,7 +192,7 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
minBirthDateValidator = (): ValidatorFn => {
return (control: AbstractControl): ValidationErrors | null => {
const minAge = 18; // 18 years
const minAge = 16; // 16 years
if (!control.value) {
return null;
@@ -202,8 +202,8 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
const minBirthDate = new Date();
minBirthDate.setFullYear(minBirthDate.getFullYear() - minAge);
// Check if customer is over 18 years old
if (this._checkIfAgeOver18(controlBirthDate, minBirthDate)) {
// Check if customer is over 16 years old
if (this._checkIfAgeOver16(controlBirthDate, minBirthDate)) {
return null;
} else {
return { minBirthDate: `Teilnahme ab ${minAge} Jahren` };
@@ -211,7 +211,7 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
};
};
private _checkIfAgeOver18(inputDate: Date, minBirthDate: Date): boolean {
private _checkIfAgeOver16(inputDate: Date, minBirthDate: Date): boolean {
// Check year
if (inputDate.getFullYear() < minBirthDate.getFullYear()) {
return true;
@@ -251,7 +251,7 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
return of({ invalid: 'E-Mail ist ungültig' });
}
}
})
}),
);
}),
tap((error) => {
@@ -260,7 +260,7 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
}
control.markAsTouched();
this.cdr.markForCheck();
})
}),
);
};
@@ -307,13 +307,13 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
return of({ invalid: 'Kundenkartencode ist ungültig' });
}
}
})
}),
);
}),
tap(() => {
control.markAsTouched();
this.cdr.markForCheck();
})
}),
);
};

View File

@@ -72,7 +72,7 @@ export class CreateP4MCustomerComponent extends AbstractCreateCustomer implement
birthDateValidatorFns = [];
existingCustomer$: Observable<CustomerInfoDTO | null>;
existingCustomer$: Observable<CustomerInfoDTO | CustomerDTO | null>;
ngOnInit(): void {
super.ngOnInit();
@@ -84,7 +84,7 @@ export class CreateP4MCustomerComponent extends AbstractCreateCustomer implement
return this.fetchCustomerInfo();
}
return of(null);
})
}),
);
this.existingCustomer$
@@ -94,12 +94,12 @@ export class CreateP4MCustomerComponent extends AbstractCreateCustomer implement
if (info) {
return this.customerService.getCustomer(info.id, 2).pipe(
map((res) => res.result),
catchError((err) => NEVER)
catchError((err) => NEVER),
);
}
return NEVER;
}),
withLatestFrom(this.processId$)
withLatestFrom(this.processId$),
)
.subscribe(([customer, processId]) => {
if (customer) {
@@ -166,7 +166,7 @@ export class CreateP4MCustomerComponent extends AbstractCreateCustomer implement
data: err,
});
return [null];
})
}),
);
}

View File

@@ -1,6 +1,6 @@
import { Component, ChangeDetectionStrategy, OnInit, OnDestroy } from '@angular/core';
import { Component, ChangeDetectionStrategy, OnInit, OnDestroy, inject, effect, untracked } from '@angular/core';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { BehaviorSubject, Subject, Subscription } from 'rxjs';
import { BehaviorSubject, Subject, Subscription, fromEvent } from 'rxjs';
import { CustomerSearchStore } from './store/customer-search.store';
import { provideComponentStore } from '@ngrx/component-store';
import { Breadcrumb, BreadcrumbService } from '@core/breadcrumb';
@@ -8,6 +8,7 @@ import { delay, filter, first, switchMap, takeUntil } from 'rxjs/operators';
import { CustomerCreateNavigation, CustomerSearchNavigation } from '@shared/services';
import { CustomerSearchMainAutocompleteProvider } from './providers/customer-search-main-autocomplete.provider';
import { FilterAutocompleteProvider } from '@shared/components/filter';
import { toSignal } from '@angular/core/rxjs-interop';
@Component({
selector: 'page-customer-search',
@@ -24,6 +25,10 @@ import { FilterAutocompleteProvider } from '@shared/components/filter';
],
})
export class CustomerSearchComponent implements OnInit, OnDestroy {
private searchStore = inject(CustomerSearchStore);
keyEscPressed = toSignal(fromEvent(document, 'keydown').pipe(filter((e: KeyboardEvent) => e.key === 'Escape')));
get breadcrumb() {
let breadcrumb: string;
@@ -38,7 +43,7 @@ export class CustomerSearchComponent implements OnInit, OnDestroy {
private _breadcrumbs$ = this._store.processId$.pipe(
filter((id) => !!id),
switchMap((id) => this._breadcrumbService.getBreadcrumbsByKeyAndTag$(id, 'customer'))
switchMap((id) => this._breadcrumbService.getBreadcrumbsByKeyAndTag$(id, 'customer')),
);
side$ = new BehaviorSubject<string | undefined>(undefined);
@@ -73,7 +78,7 @@ export class CustomerSearchComponent implements OnInit, OnDestroy {
private _router: Router,
private _breadcrumbService: BreadcrumbService,
private _navigation: CustomerSearchNavigation,
private _createNavigation: CustomerCreateNavigation
private _createNavigation: CustomerCreateNavigation,
) {}
ngOnInit(): void {
@@ -542,4 +547,11 @@ export class CustomerSearchComponent implements OnInit, OnDestroy {
this._breadcrumbService.removeBreadcrumb(orderDetailsHistoryBreadcrumb.id);
}
}
cancelSearchEffect = effect(() => {
const event = this.keyEscPressed();
untracked(() => {
this.searchStore.cancelSearch();
});
});
}

View File

@@ -29,12 +29,12 @@ export interface CustomerDetailsViewMainState {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CustomerDetailsViewMainComponent extends ComponentStore<CustomerDetailsViewMainState> implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
customerService = inject(CrmCustomerService);
fetching$ = combineLatest([this._store.fetchingCustomer$, this._store.fetchingCustomerList$]).pipe(
map(([fetchingCustomer, fetchingList]) => fetchingCustomer || fetchingList)
map(([fetchingCustomer, fetchingList]) => fetchingCustomer || fetchingList),
);
isBusy$ = this.select((s) => s.isBusy);
@@ -46,31 +46,31 @@ export class CustomerDetailsViewMainComponent extends ComponentStore<CustomerDet
customerId$ = this._store.customerId$;
historyRoute$ = combineLatest([this.processId$, this.customerId$]).pipe(
map(([processId, customerId]) => this._navigation.historyRoute({ processId, customerId }))
map(([processId, customerId]) => this._navigation.historyRoute({ processId, customerId })),
);
ordersRoute$ = combineLatest([this.processId$, this.customerId$]).pipe(
map(([processId, customerId]) => this._navigation.ordersRoute({ processId, customerId }))
map(([processId, customerId]) => this._navigation.ordersRoute({ processId, customerId })),
);
isB2b$ = this._store.isBusinessKonto$;
editRoute$ = combineLatest([this.processId$, this.customerId$, this.isB2b$]).pipe(
map(([processId, customerId, isB2b]) => this._navigation.editRoute({ processId, customerId, isB2b }))
map(([processId, customerId, isB2b]) => this._navigation.editRoute({ processId, customerId, isB2b })),
);
showEditButton$ = combineLatest([this._store.isOnlinekonto$, this._store.isBestellungOhneKonto$]).pipe(
map(([isOnlinekonto, isBestellungOhneKonto]) => !isOnlinekonto && !isBestellungOhneKonto)
map(([isOnlinekonto, isBestellungOhneKonto]) => !isOnlinekonto && !isBestellungOhneKonto),
);
hasKundenkarte$ = combineLatest([this._store.isKundenkarte$, this._store.isOnlineKontoMitKundenkarte$]).pipe(
map(([isKundenkarte, isOnlineKontoMitKundenkarte]) => isKundenkarte || isOnlineKontoMitKundenkarte)
map(([isKundenkarte, isOnlineKontoMitKundenkarte]) => isKundenkarte || isOnlineKontoMitKundenkarte),
);
kundenkarteRoute$ = combineLatest([this.hasKundenkarte$, this.processId$, this.customerId$]).pipe(
map(([hasKundenkarte, processId, customerId]) =>
hasKundenkarte ? this._navigation.kundenkarteRoute({ processId, customerId }) : undefined
)
hasKundenkarte ? this._navigation.kundenkarteRoute({ processId, customerId }) : undefined,
),
);
customerType$ = this._store.select((s) => s.customer?.features?.find((f) => f.enabled)?.description);
@@ -194,7 +194,7 @@ export class CustomerDetailsViewMainComponent extends ComponentStore<CustomerDet
private _checkoutNavigation: CheckoutNavigationService,
private _router: Router,
private _activatedRoute: ActivatedRoute,
private _genderSettings: GenderSettingsService
private _genderSettings: GenderSettingsService,
) {
super({ isBusy: false, shoppingCart: undefined, shippingAddress: undefined, payer: undefined });
}
@@ -221,8 +221,8 @@ export class CustomerDetailsViewMainComponent extends ComponentStore<CustomerDet
this._checkoutService.getShoppingCart({
processId: pid,
latest: true,
})
)
}),
),
)
.subscribe((shoppingCart) => {
this.patchState({ shoppingCart });

View File

@@ -4,6 +4,7 @@ import { CustomerSearchStore } from '../store';
import { Filter } from '@shared/components/filter';
import { CustomerSearchNavigation } from '@shared/services';
import { Router } from '@angular/router';
import { injectCancelSearch } from '../inject-cancel-search';
@Component({
selector: 'page-customer-filter-main-view',
@@ -13,6 +14,8 @@ import { Router } from '@angular/router';
host: { class: 'page-customer-filter-main-view' },
})
export class CustomerFilterMainViewComponent {
cancelSearch = injectCancelSearch();
fetchingFilterSettings$ = this._store.fetchingFilter$;
fetching$ = this._store.fetchingCustomerList$;
@@ -38,8 +41,10 @@ export class CustomerFilterMainViewComponent {
private _store: CustomerSearchStore,
private _location: Location,
private _router: Router,
private _customerSearchNavigation: CustomerSearchNavigation
) {}
private _customerSearchNavigation: CustomerSearchNavigation,
) {
this.cancelSearch();
}
search(filter: Filter) {
this._store.setFilter(filter);

View File

@@ -0,0 +1,10 @@
import { inject } from '@angular/core';
import { CustomerSearchStore } from './store';
export function injectCancelSearch() {
const store = inject(CustomerSearchStore);
return () => {
console.log('Cancel search');
store.cancelSearch();
};
}

View File

@@ -5,6 +5,7 @@
*ngIf="filter$ | async; let filter"
[inputGroup]="filter?.input | group: 'main'"
(search)="search(filter)"
(queryChange)="cancelSearch()"
[hint]="message$ | async"
[loading]="fetching$ | async"
[scanner]="true"

View File

@@ -8,6 +8,7 @@ import { isEmpty } from 'lodash';
import { Filter } from '@shared/components/filter';
import { CustomerResultListComponent } from '../../components/customer-result-list/customer-result-list.component';
import { EnvironmentService } from '@core/environment';
import { injectCancelSearch } from '../inject-cancel-search';
@Component({
selector: 'page-customer-results-main-view',
@@ -16,6 +17,8 @@ import { EnvironmentService } from '@core/environment';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CustomerResultsMainViewComponent implements OnInit, OnDestroy, AfterContentInit {
cancelSearch = injectCancelSearch();
processId$ = this._store.processId$;
currentUrl$ = new BehaviorSubject<string>(this._router.url);
@@ -38,7 +41,7 @@ export class CustomerResultsMainViewComponent implements OnInit, OnDestroy, Afte
}
return route;
})
}),
);
routerEventsSubscription: Subscription;
@@ -50,7 +53,7 @@ export class CustomerResultsMainViewComponent implements OnInit, OnDestroy, Afte
if (!filter) return false;
const qt = filter.getQueryToken();
return !isEmpty(qt.filter);
})
}),
);
fetching$ = this._store.fetchingCustomerList$;
@@ -73,7 +76,7 @@ export class CustomerResultsMainViewComponent implements OnInit, OnDestroy, Afte
private _store: CustomerSearchStore,
private _router: Router,
private _navigation: CustomerSearchNavigation,
private _environment: EnvironmentService
private _environment: EnvironmentService,
) {}
ngOnInit(): void {

View File

@@ -5,6 +5,7 @@
*ngIf="filter$ | async; let filter"
[inputGroup]="filter?.input | group: 'main'"
(search)="search(filter)"
(queryChange)="cancelSearch()"
[hint]="message$ | async"
[loading]="fetching$ | async"
[scanner]="true"
@@ -23,7 +24,7 @@
</a>
<button
class="btn btn-light h-14 font-bold"
(click)="closeFilter()"
(click)="closeFilter(); cancelSearch()"
[class.bg-active-branch]="hasFilter$ | async"
[class.text-white]="hasFilter$ | async"
*ngIf="isFilterRouteActive"

View File

@@ -8,6 +8,7 @@ import { CustomerResultListComponent } from '../../components/customer-result-li
import { isEmpty } from 'lodash';
import { CustomerSearchNavigation, NavigationRoute } from '@shared/services';
import { Location } from '@angular/common';
import { injectCancelSearch } from '../inject-cancel-search';
@Component({
selector: 'page-customer-results-side-view',
@@ -16,6 +17,8 @@ import { Location } from '@angular/common';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CustomerResultsSideViewComponent implements OnInit, OnDestroy {
cancelSearch = injectCancelSearch();
processId$ = this._store.processId$;
currentUrl$ = new BehaviorSubject<string>(this._router.url);
@@ -36,7 +39,7 @@ export class CustomerResultsSideViewComponent implements OnInit, OnDestroy {
}
return route;
})
}),
);
get isFilterRouteActive() {
@@ -57,7 +60,7 @@ export class CustomerResultsSideViewComponent implements OnInit, OnDestroy {
if (!filter) return false;
const qt = filter.getQueryToken();
return !isEmpty(qt.filter);
})
}),
);
message$ = this._store.message$;
@@ -76,7 +79,7 @@ export class CustomerResultsSideViewComponent implements OnInit, OnDestroy {
private _store: CustomerSearchStore,
private _router: Router,
private _navigation: CustomerSearchNavigation,
private _location: Location
private _location: Location,
) {}
ngOnInit(): void {

View File

@@ -163,7 +163,11 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
selectedOrderItem$ = this.select(S.selectSelectedOrderItem);
constructor(private _customerService: CrmCustomerService, private _omsService: DomainOmsService, private _modal: UiModalService) {
constructor(
private _customerService: CrmCustomerService,
private _omsService: DomainOmsService,
private _modal: UiModalService,
) {
super({ customerListCount: 0 });
}
@@ -192,9 +196,9 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
switchMap(({ customerId }) =>
this._customerService
.getCustomer(+customerId, 2)
.pipe(tapResponse(this.handleSelectCustomerResponse, this.handleSelectCustomerError, this.handleSelectCustomerComplete))
)
)
.pipe(tapResponse(this.handleSelectCustomerResponse, this.handleSelectCustomerError, this.handleSelectCustomerComplete)),
),
),
);
setFilter = this.updater((state, filter: Filter) => ({ ...state, queryParams: filter?.getQueryParams() ?? {} }));
@@ -221,9 +225,9 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
switchMap((orderId) =>
this._omsService
.getOrder(orderId)
.pipe(tapResponse(this.handleSelectOrderResponse, this.handleSelectOrderError, this.handleSelectOrderComplete))
)
)
.pipe(tapResponse(this.handleSelectOrderResponse, this.handleSelectOrderError, this.handleSelectOrderComplete)),
),
),
);
handleSelectOrderResponse = (order: OrderDTO) => {
@@ -250,10 +254,14 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
this._omsService
.getOrderItemsByCustomerNumber(customer.customerNumber, 0)
.pipe(
tapResponse(this.handleFetchCustomerOrdersResponse, this.handleFetchCustomerOrdersError, this.handleFetchCustomerOrdersComplete)
)
)
)
tapResponse(
this.handleFetchCustomerOrdersResponse,
this.handleFetchCustomerOrdersError,
this.handleFetchCustomerOrdersComplete,
),
),
),
),
);
handleFetchCustomerOrdersResponse = (orders: OrderListItemDTO[]) => {
@@ -275,9 +283,9 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
switchMap(() =>
this._customerService
.filterSettings()
.pipe(tapResponse(this.handleFetchFilterResponse, this.handleFetchFilterError, this.handleFetchFilterComplete))
)
)
.pipe(tapResponse(this.handleFetchFilterResponse, this.handleFetchFilterError, this.handleFetchFilterComplete)),
),
),
);
handleFetchFilterResponse = (result: QuerySettingsDTO) => {
@@ -298,8 +306,8 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
delayWhen(() =>
this.filter$.pipe(
filter((filter) => !!filter),
first()
)
first(),
),
),
withLatestFrom(this.filter$, this.processId$),
map(([a1, a2, a3]) => {
@@ -328,24 +336,23 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
tapResponse(
this.handleSearchResponse(filter, processId, ignoreRestore ? false : restored, !!skipNavigation),
this.handleSearchError,
this.handleSearchComplete
)
)
)
)
this.handleSearchComplete,
),
),
),
),
);
handleSearchResponse = (filter: Filter, processId: number, restored: boolean, skipNavigation: boolean) => (
result: ListResponseArgsOfCustomerInfoDTO
) => {
this.patchState({
customerList: result.result,
customerListCount: result.hits,
message: result?.hits > 0 ? '' : 'Keine Suchergebnisse',
});
this._customerListResponse.next([result, filter, processId, restored, skipNavigation]);
this.cacheSearchResult();
};
handleSearchResponse =
(filter: Filter, processId: number, restored: boolean, skipNavigation: boolean) => (result: ListResponseArgsOfCustomerInfoDTO) => {
this.patchState({
customerList: result.result,
customerListCount: result.hits,
message: result?.hits > 0 ? '' : 'Keine Suchergebnisse',
});
this._customerListResponse.next([result, filter, processId, restored, skipNavigation]);
this.cacheSearchResult();
};
handleSearchError = (err: any) => {
this._modal.error('Fehler beim Laden der Liste', err);
@@ -364,7 +371,7 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
withLatestFrom(this.filter$, this.processId$, this.customerList$, this.fetchingCustomerList$),
filter(
([_, __, ___, customerList, fetchingCustomerList]) =>
!fetchingCustomerList && customerList.length && customerList.length < this.customerListCount
!fetchingCustomerList && customerList.length && customerList.length < this.customerListCount,
),
delayWhen(() => this.fetchingCustomerList$.pipe(filter((fetching) => !fetching))),
tap(() => {
@@ -378,10 +385,10 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
})
.pipe(
takeUntil(this._cancelSearch),
tapResponse(this.handlePaginateResponse, this.handlePaginateError, this.handlePaginateComplete)
)
)
)
tapResponse(this.handlePaginateResponse, this.handlePaginateError, this.handlePaginateComplete),
),
),
),
);
handlePaginateResponse = (result: ListResponseArgsOfCustomerInfoDTO) => {
@@ -429,7 +436,7 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
JSON.stringify({
customerList,
customerListCount,
})
}),
);
}
@@ -458,7 +465,7 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
`CUSTOMER_INFO_CACHE_${customerId}`,
JSON.stringify({
customer,
})
}),
);
}

View File

@@ -30,9 +30,7 @@
<span class="ssc-text" [class.err]="sscInvalid$ | async">{{ sscText$ | async }}</span>
</div>
<div class="err" *ngIf="supplierIdError$ | async">
Kein Lieferant vorhanden
</div>
<div class="err" *ngIf="supplierIdError$ | async">Kein Lieferant vorhanden</div>
</ng-container>
</div>
</div>
@@ -74,7 +72,7 @@
</div>
<div class="price">
<strong>{{ orderItem.price | currency: 'EUR':'code' }}</strong>
<strong>{{ orderItem.price | currency: 'EUR' : 'code' }}</strong>
</div>
<div class="status spec">
<span>Status</span>
@@ -99,8 +97,6 @@
</div>
<div class="footer">
<button class="cta-reorder" (click)="showReorderModal(); $event.stopPropagation()" [disabled]="editSsc$ | async">
Nachbestellen
</button>
<button class="cta-reorder" (click)="showReorderModal(); $event.stopPropagation()" [disabled]="editSsc$ | async">Nachbestellen</button>
</div>
</ng-container>

View File

@@ -111,7 +111,7 @@ export class GoodsInListItemComponent extends ComponentStore<GoodsInListItemComp
catchError(() => {
this.patchState({ supplierIdError: true });
return [undefined];
})
}),
);
readonly instruction$ = this.statusCodes$.pipe(
@@ -120,16 +120,16 @@ export class GoodsInListItemComponent extends ComponentStore<GoodsInListItemComp
const textObj = code?.texts?.find((text) => text?.textType === 'REWORK');
return textObj && textObj.text ? textObj.text : '';
}),
shareReplay()
shareReplay(),
);
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
constructor(
private _omsService: DomainOmsService,
private _command: CommandService,
private _modal: UiModalService,
public environmentService: EnvironmentService
public environmentService: EnvironmentService,
) {
super({
item: undefined,

View File

@@ -50,7 +50,7 @@ export class GoodsInListComponent implements OnInit, AfterViewInit, OnDestroy {
listEmpty$ = combineLatest([this.loading$, this.hits$]).pipe(
map(([loading, hits]) => !loading && hits === 0),
shareReplay()
shareReplay(),
);
editSsc: boolean;
@@ -59,7 +59,7 @@ export class GoodsInListComponent implements OnInit, AfterViewInit, OnDestroy {
showSaveSscSpinner$ = new BehaviorSubject<boolean>(false);
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
private readonly SCROLL_POSITION_TOKEN = 'GOODS_IN_LIST_SCROLL_POSITION';
@@ -70,7 +70,7 @@ export class GoodsInListComponent implements OnInit, AfterViewInit, OnDestroy {
private _router: Router,
private _route: ActivatedRoute,
private readonly _config: Config,
private _cache: CacheService
private _cache: CacheService,
) {}
ngOnInit() {
@@ -155,7 +155,7 @@ export class GoodsInListComponent implements OnInit, AfterViewInit, OnDestroy {
private _addScrollPositionToCache(): void {
this._cache.set<number>(
{ processId: this._config.get('process.ids.goodsIn'), token: this.SCROLL_POSITION_TOKEN },
this.scrollContainer?.scrollPos
this.scrollContainer?.scrollPos,
);
}

View File

@@ -50,7 +50,7 @@ export class GoodsOutDetailsComponent extends ComponentStore<GoodsOutDetailsComp
order$ = this.orderId$.pipe(
filter((orderId) => !!orderId),
switchMap((orderId) => this._omsService.getOrder(orderId)),
shareReplay()
shareReplay(),
);
get processId() {
@@ -59,7 +59,7 @@ export class GoodsOutDetailsComponent extends ComponentStore<GoodsOutDetailsComp
processId$ = this._activatedRoute.parent.data.pipe(map((params) => +params.processId));
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
constructor(
private _activatedRoute: ActivatedRoute,
@@ -67,7 +67,7 @@ export class GoodsOutDetailsComponent extends ComponentStore<GoodsOutDetailsComp
private _omsService: DomainOmsService,
private _breadcrumb: BreadcrumbService,
private _router: Router,
private _uiModal: UiModalService
private _uiModal: UiModalService,
) {
super({
fetching: false,
@@ -166,11 +166,11 @@ export class GoodsOutDetailsComponent extends ComponentStore<GoodsOutDetailsComp
(err) => {},
() => {
this.patchState({ fetching: false });
}
)
},
),
);
})
)
}),
),
);
openModalIfItemsHaveDifferentCustomers(items: OrderItemListItemDTO[]) {

View File

@@ -37,7 +37,7 @@ export class GoodsOutSearchFilterComponent implements OnInit, OnDestroy {
@Input()
processId: number;
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
@ViewChild(UiFilterComponent, { static: false })
uiFilter: UiFilterComponent;
@@ -46,7 +46,7 @@ export class GoodsOutSearchFilterComponent implements OnInit, OnDestroy {
private _goodsOutSearchStore: GoodsOutSearchStore,
private _breadcrumb: BreadcrumbService,
private _cdr: ChangeDetectorRef,
private _router: Router
private _router: Router,
) {}
ngOnInit() {

View File

@@ -30,10 +30,10 @@ import { GoodsOutSearchMainAutocompleteProvider } from './providers/goods-out-se
],
})
export class GoodsOutSearchComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
hasFilter$ = combineLatest([this._goodsOutSearchStore.filter$, this._goodsOutSearchStore.defaultSettings$]).pipe(
map(([filter, defaultFilter]) => !isEqual(filter?.getQueryParams(), UiFilter.create(defaultFilter).getQueryParams()))
map(([filter, defaultFilter]) => !isEqual(filter?.getQueryParams(), UiFilter.create(defaultFilter).getQueryParams())),
);
processId$ = this._activatedRoute.data.pipe(map((data) => +data.processId));
@@ -41,7 +41,7 @@ export class GoodsOutSearchComponent implements OnInit, OnDestroy {
constructor(
private _goodsOutSearchStore: GoodsOutSearchStore,
private _breadcrumb: BreadcrumbService,
private _activatedRoute: ActivatedRoute
private _activatedRoute: ActivatedRoute,
) {}
ngOnInit() {

View File

@@ -36,7 +36,7 @@ export class GoodsOutSearchResultsComponent extends ComponentStore<GoodsOutSearc
listEmpty$ = combineLatest([this.loading$, this.hits$]).pipe(
map(([loading, hits]) => !loading && hits === 0),
shareReplay()
shareReplay(),
);
selectedOrderItemSubsetIds$ = this.select((s) => s.selectedOrderItemSubsetIds);
@@ -47,9 +47,9 @@ export class GoodsOutSearchResultsComponent extends ComponentStore<GoodsOutSearc
actions$ = combineLatest([this.items$, this.selectedOrderItemSubsetIds$]).pipe(
map(([items, selectedOrderItemSubsetIds]) =>
items?.find((item) => selectedOrderItemSubsetIds.find((orderItemSubsetId) => item.orderItemSubsetId === orderItemSubsetId))
items?.find((item) => selectedOrderItemSubsetIds.find((orderItemSubsetId) => item.orderItemSubsetId === orderItemSubsetId)),
),
map((item) => item?.actions?.filter((action) => this.selectionRules(action)))
map((item) => item?.actions?.filter((action) => this.selectionRules(action))),
);
get selectedItems() {
@@ -70,7 +70,7 @@ export class GoodsOutSearchResultsComponent extends ComponentStore<GoodsOutSearc
processId$ = this._activatedRoute.parent.data.pipe(map((data) => +data.processId));
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
trackByFn: TrackByFunction<OrderItemListItemDTO> = (index, item) => `${item.orderId}${item.orderItemId}${item.orderItemSubsetId}`;
@@ -84,7 +84,7 @@ export class GoodsOutSearchResultsComponent extends ComponentStore<GoodsOutSearc
private _activatedRoute: ActivatedRoute,
private _breadcrumb: BreadcrumbService,
private _commandService: CommandService,
private _modal: UiModalService
private _modal: UiModalService,
) {
super({
selectedOrderItemSubsetIds: [],
@@ -233,7 +233,7 @@ export class GoodsOutSearchResultsComponent extends ComponentStore<GoodsOutSearc
this.removeScrollPosition(processId);
}
}
})
}),
);
this._searchResultSubscription.add(
@@ -244,7 +244,7 @@ export class GoodsOutSearchResultsComponent extends ComponentStore<GoodsOutSearc
this.scrollContainer?.scrollTo(scrollPos);
this.removeScrollPosition(processId);
}
})
}),
);
}
@@ -273,7 +273,7 @@ export class GoodsOutSearchResultsComponent extends ComponentStore<GoodsOutSearc
buyerNumber: orderItem.buyerNumber,
archive,
},
}
},
);
} else {
this._router.navigate([`/kunde/${processId}/goods/out/details/order/${encodeURIComponent(orderNumber)}/${processingStatus}`], {

View File

@@ -61,7 +61,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
fetchingCoverItems$ = this.store.fetchingCoverOrderItems$;
viewFetching$ = combineLatest([this.fetchingItems$, this.orderItems$]).pipe(
map(([fetchingItems, orderItems]) => fetchingItems && orderItems.length === 0)
map(([fetchingItems, orderItems]) => fetchingItems && orderItems.length === 0),
);
selectedCompartmentInfo = this.store.selectedCompartmentInfo;
@@ -93,14 +93,17 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
return `${latestCompartmentInfos?.latestCompartmentCode}_${latestCompartmentInfos?.latestCompartmentInfo}`;
}
return latestCompartmentInfos?.latestCompartmentCode;
})
}),
);
addToPreviousCompartmentActionDisabled$ = combineLatest([this.displayedCompartmentInfo$, this.changeActionDisabled$]).pipe(
map(([compartmentInfo, changeActionDisabled]) => !!compartmentInfo || changeActionDisabled)
map(([compartmentInfo, changeActionDisabled]) => !!compartmentInfo || changeActionDisabled),
);
constructor(private _uiModal: UiModalService, private _activatedRoute: ActivatedRoute) {
constructor(
private _uiModal: UiModalService,
private _activatedRoute: ActivatedRoute,
) {
super();
}
@@ -110,7 +113,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
.subscribe(([params, items]) => {
const orderItemSubsetId = +params?.orderItemSubsetId;
const selectedItem: DBHOrderItemListItemDTO = items?.find(
(item: DBHOrderItemListItemDTO) => item?.orderItemSubsetId === orderItemSubsetId
(item: DBHOrderItemListItemDTO) => item?.orderItemSubsetId === orderItemSubsetId,
);
// Trigger functions only if a new item gets selected
@@ -176,7 +179,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
},
side: false,
}).path,
{ queryParamsHandling: 'preserve' }
{ queryParamsHandling: 'preserve' },
);
this.listStore.patchOrderItem({
orderItemSubsetId: item.orderItemSubsetId,
@@ -220,20 +223,21 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
}
updateDate({ date, type }: { date: Date; type?: 'delivery' | 'pickup' | 'preferred' }) {
this.store.updateOrderItemSubsetLoading(true);
switch (type) {
case 'delivery':
this.store.selectedOrderItems.forEach((item) =>
this.store.patchOrderItemSubset({ item, changes: { estimatedShippingDate: date.toISOString() } })
this.store.patchOrderItemSubset({ item, changes: { estimatedShippingDate: date.toISOString() } }),
);
break;
case 'pickup':
this.store.selectedOrderItems.forEach((item) =>
this.store.patchOrderItemSubset({ item, changes: { compartmentStop: date.toISOString() } })
this.store.patchOrderItemSubset({ item, changes: { compartmentStop: date.toISOString() } }),
);
break;
case 'preferred':
this.store.selectedOrderItems.forEach((item) =>
this.store.patchOrderItemSubset({ item, changes: { preferredPickUpDate: date.toISOString() } })
this.store.patchOrderItemSubset({ item, changes: { preferredPickUpDate: date.toISOString() } }),
);
break;
default:
@@ -257,9 +261,9 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
orderItemSubsetId: orderItem.orderItemSubsetId,
compartmentInfo: orderItem.compartmentInfo,
},
{ side: this.side }
{ side: this.side },
).path,
{ queryParams: { buyerNumber: orderItem?.buyerNumber }, queryParamsHandling: 'merge' }
{ queryParams: { buyerNumber: orderItem?.buyerNumber }, queryParamsHandling: 'merge' },
);
}
@@ -274,9 +278,9 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
orderItemSubsetId: orderItem.orderItemSubsetId,
compartmentInfo: orderItem.compartmentInfo,
},
{ side: this.side }
{ side: this.side },
).path,
{ queryParams: { orderItemSubsetId: orderItem.orderItemSubsetId }, queryParamsHandling: 'merge' }
{ queryParams: { orderItemSubsetId: orderItem.orderItemSubsetId }, queryParamsHandling: 'merge' },
);
}
@@ -300,7 +304,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
},
side: this.side,
}).path,
{ queryParamsHandling: 'preserve' }
{ queryParamsHandling: 'preserve' },
);
} else {
if (orderItems.every((item) => item.processingStatus === 128)) {

View File

@@ -65,14 +65,14 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
}
return groups;
})
}),
);
fetchingOrder$ = this.store.fetchingOrder$;
fetchingItems$ = this.store.fetchingOrderItems$;
viewFetching$ = combineLatest([this.orderItems$, this.fetchingItems$]).pipe(
map(([orderItems, fetchingItems]) => orderItems?.length === 0 && fetchingItems)
map(([orderItems, fetchingItems]) => orderItems?.length === 0 && fetchingItems),
);
selectedCompartmentInfo = this.store.selectedCompartmentInfo;
@@ -129,7 +129,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
compartmentInfo: item.compartmentInfo,
},
}).path,
{ queryParamsHandling: 'preserve' }
{ queryParamsHandling: 'preserve' },
);
}
}
@@ -152,20 +152,21 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
}
updateDate({ date, type }: { date: Date; type?: 'delivery' | 'pickup' | 'preferred' }) {
this.store.updateOrderItemSubsetLoading(true);
switch (type) {
case 'delivery': // vsl. Lieferdatum
this.store.orderItems.forEach((item) =>
this.store.patchOrderItemSubset({ item, changes: { estimatedShippingDate: date.toISOString() } })
this.store.patchOrderItemSubset({ item, changes: { estimatedShippingDate: date.toISOString() } }),
);
break;
case 'pickup': // Abholfrist
this.store.orderItems.forEach((item) =>
this.store.patchOrderItemSubset({ item, changes: { compartmentStop: date.toISOString() } })
this.store.patchOrderItemSubset({ item, changes: { compartmentStop: date.toISOString() } }),
);
break;
case 'preferred': // Zurücklegen bis
this.store.orderItems.forEach((item) =>
this.store.patchOrderItemSubset({ item, changes: { preferredPickUpDate: date.toISOString() } })
this.store.patchOrderItemSubset({ item, changes: { preferredPickUpDate: date.toISOString() } }),
);
break;
default:
@@ -190,7 +191,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
compartmentInfo: orderItem.compartmentInfo,
},
}).path,
{ queryParams: { buyerNumber: orderItem?.buyerNumber }, queryParamsHandling: 'merge' }
{ queryParams: { buyerNumber: orderItem?.buyerNumber }, queryParamsHandling: 'merge' },
);
}
@@ -206,7 +207,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
compartmentInfo: orderItem.compartmentInfo,
},
}).path,
{ queryParams: { orderItemSubsetId: orderItem.orderItemSubsetId }, queryParamsHandling: 'merge' }
{ queryParams: { orderItemSubsetId: orderItem.orderItemSubsetId }, queryParamsHandling: 'merge' },
);
}

View File

@@ -127,7 +127,7 @@ export class PickupShelfOutComponent extends PickupShelfBaseComponent {
processingStatus: item.processingStatus,
compartmentInfo: item.compartmentInfo,
},
})
}),
);
}
@@ -142,7 +142,7 @@ export class PickupShelfOutComponent extends PickupShelfBaseComponent {
processingStatus: item.processingStatus,
compartmentInfo: item.compartmentInfo,
},
})
}),
);
}
@@ -179,7 +179,7 @@ export class PickupShelfOutComponent extends PickupShelfBaseComponent {
processingStatus: item.processingStatus,
compartmentInfo: item.compartmentInfo,
},
})
}),
);
}

View File

@@ -162,7 +162,7 @@
<ng-template #abholfrist>
<div class="min-w-[9rem]">Abholfrist</div>
<div *ngIf="!(changeDateLoader$ | async)" class="flex flex-row font-bold">
<div *ngIf="!(orderItemSubsetLoading$ | async); else featureLoading" class="flex flex-row font-bold">
<button
[uiOverlayTrigger]="deadlineDatepicker"
#deadlineDatepickerTrigger="uiOverlayTrigger"
@@ -186,12 +186,11 @@
>
</ui-datepicker>
</div>
<ui-spinner *ngIf="changeDateLoader$ | async; let loader" class="flex flex-row font-bold loader" [show]="loader"></ui-spinner>
</ng-template>
<ng-template #preferredPickUpDate>
<div class="min-w-[9rem]">Zurücklegen bis</div>
<div *ngIf="!(changePreferredDateLoader$ | async)" class="flex flex-row font-bold">
<div *ngIf="!(orderItemSubsetLoading$ | async); else featureLoading" class="flex flex-row font-bold">
<button
[uiOverlayTrigger]="preferredPickUpDatePicker"
#preferredPickUpDatePickerTrigger="uiOverlayTrigger"
@@ -218,12 +217,11 @@
>
</ui-datepicker>
</div>
<ui-spinner *ngIf="changePreferredDateLoader$ | async; let loader" class="flex flex-row font-bold loader" [show]="loader"> </ui-spinner>
</ng-template>
<ng-template #vslLieferdatum>
<div class="min-w-[9rem]">vsl. Lieferdatum</div>
<div *ngIf="!(changeDateLoader$ | async)" class="flex flex-row font-bold">
<div *ngIf="!(orderItemSubsetLoading$ | async); else featureLoading" class="flex flex-row font-bold">
<button
class="cta-datepicker"
[disabled]="changeDateDisabled$ | async"
@@ -247,6 +245,9 @@
>
</ui-datepicker>
</div>
<ui-spinner *ngIf="changeDateLoader$ | async; let loader" class="flex flex-row font-bold loader" [show]="loader"></ui-spinner>
</ng-template>
</ng-container>
<ng-template #featureLoading>
<shared-skeleton-loader class="w-64 h-6"></shared-skeleton-loader>
</ng-template>

View File

@@ -53,6 +53,8 @@ export class PickUpShelfDetailsHeaderComponent {
@Output()
updateDate = new EventEmitter<{ date: Date; type?: 'delivery' | 'pickup' | 'preferred' }>();
orderItemSubsetLoading$ = this._store.orderItemSubsetLoading$;
fetchingOrder$ = this._store.fetchingOrder$;
order$ = this._store.order$;
@@ -73,12 +75,12 @@ export class PickUpShelfDetailsHeaderComponent {
latestDate = new Date(
subsetItems?.reduce((a, b) => {
return new Date(a.data.preferredPickUpDate) > new Date(b.data.preferredPickUpDate) ? a : b;
})?.data?.preferredPickUpDate
})?.data?.preferredPickUpDate,
);
}
return latestDate;
})
}),
);
notificationsChannel$: Observable<NotificationChannel> = this.order$.pipe(map((order) => order?.notificationChannels ?? 0));
@@ -113,7 +115,7 @@ export class PickUpShelfDetailsHeaderComponent {
features$ = this.customer$.pipe(
map((customer) => customer?.features || []),
map((features) => features.filter((f) => f.enabled && !!f.description)),
shareReplay()
shareReplay(),
);
statusActions$ = this.orderItem$.pipe(map((orderItem) => orderItem?.actions?.filter((action) => action.enabled === false)));
@@ -121,14 +123,17 @@ export class PickUpShelfDetailsHeaderComponent {
crudaUpdate$ = this.orderItem$.pipe(map((orederItem) => !!(orederItem?.cruda & 4)));
editButtonDisabled$ = combineLatest([this.changeStatusLoader$, this.crudaUpdate$]).pipe(
map(([changeStatusLoader, crudaUpdate]) => changeStatusLoader || !crudaUpdate)
map(([changeStatusLoader, crudaUpdate]) => changeStatusLoader || !crudaUpdate),
);
canEditStatus$ = combineLatest([this.statusActions$, this.crudaUpdate$]).pipe(
map(([statusActions, crudaUpdate]) => statusActions?.length > 0 && crudaUpdate)
map(([statusActions, crudaUpdate]) => statusActions?.length > 0 && crudaUpdate),
);
constructor(private dateAdapter: DateAdapter, private cdr: ChangeDetectorRef) {}
constructor(
private dateAdapter: DateAdapter,
private cdr: ChangeDetectorRef,
) {}
async handleActionClick(action?: KeyValueDTOOfStringAndString) {
this.changeStatusLoader$.next(true);

View File

@@ -50,9 +50,7 @@
<div>{{ orderItem.product?.name }}</div>
</h3>
<div class="history-wrapper flex flex-col items-end justify-center">
<button class="cta-history text-p1" (click)="historyClick.emit(orderItem)">
Historie
</button>
<button class="cta-history text-p1" (click)="historyClick.emit(orderItem)">Historie</button>
<input
*ngIf="selectable$ | async"

View File

@@ -104,7 +104,7 @@ export class PickUpShelfDetailsItemComponent extends ComponentStore<PickUpShelfD
readonly orderItem$ = this.select((s) => s.orderItem);
emailNotificationDates$ = this.orderItem$.pipe(
switchMap((orderItem) => this._store.getEmailNotificationDate$(orderItem?.orderItemSubsetId))
switchMap((orderItem) => this._store.getEmailNotificationDate$(orderItem?.orderItemSubsetId)),
);
hasEmailNotification$ = this.emailNotificationDates$.pipe(map((dates) => dates?.length > 0));
@@ -114,7 +114,7 @@ export class PickUpShelfDetailsItemComponent extends ComponentStore<PickUpShelfD
hasSmsNotification$ = this.smsNotificationDates$.pipe(map((dates) => dates?.length > 0));
canChangeQuantity$ = combineLatest([this.orderItem$, this._store.fetchPartial$]).pipe(
map(([item, partialPickup]) => ([16, 8192].includes(item?.processingStatus) || partialPickup) && item.quantity > 1)
map(([item, partialPickup]) => ([16, 8192].includes(item?.processingStatus) || partialPickup) && item.quantity > 1),
);
get quantity() {
@@ -141,7 +141,7 @@ export class PickUpShelfDetailsItemComponent extends ComponentStore<PickUpShelfD
}
readonly selected$ = combineLatest([this.orderItem$, this._store.selectedOrderItemIds$]).pipe(
map(([orderItem, selectedItems]) => selectedItems.includes(orderItem?.orderItemSubsetId))
map(([orderItem, selectedItems]) => selectedItems.includes(orderItem?.orderItemSubsetId)),
);
@Output()
@@ -156,7 +156,7 @@ export class PickUpShelfDetailsItemComponent extends ComponentStore<PickUpShelfD
}
readonly selectable$ = combineLatest([this._store.orderItems$, this._store.fetchPartial$]).pipe(
map(([orderItems, fetchPartial]) => orderItems.length > 1 && this.isItemSelectable && fetchPartial)
map(([orderItems, fetchPartial]) => orderItems.length > 1 && this.isItemSelectable && fetchPartial),
);
get receipts() {
@@ -175,7 +175,7 @@ export class PickUpShelfDetailsItemComponent extends ComponentStore<PickUpShelfD
more$ = this.select((s) => s.more);
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
expanded: boolean = false;

View File

@@ -80,13 +80,13 @@ export class PickUpShelfListItemComponent {
}
selected$ = this.store.selectedListItems$.pipe(
map((selectedListItems) => selectedListItems?.find((item) => item?.orderItemSubsetId === this.item?.orderItemSubsetId))
map((selectedListItems) => selectedListItems?.find((item) => item?.orderItemSubsetId === this.item?.orderItemSubsetId)),
);
constructor(
private _elRef: ElementRef,
private _environment: EnvironmentService,
private _processingStatusPipe: PickupShelfProcessingStatusPipe
private _processingStatusPipe: PickupShelfProcessingStatusPipe,
) {}
onDetailsClick() {
@@ -124,7 +124,7 @@ export class PickUpShelfListItemComponent {
store: 'PickupShelfDetailsStore',
},
[this.item],
{ persist: false, ttl: 1000 }
{ persist: false, ttl: 1000 },
);
}

View File

@@ -89,6 +89,8 @@ export const selectSelectedOrderItemIds = (s: PickupShelfDetailsState) => s.sele
export const selectPreviousSelectedOrderItemSubsetId = (s: PickupShelfDetailsState) => s.previousSelectedOrderItemSubsetId;
export const selectOrderItemSubsetLoading = (s: PickupShelfDetailsState) => s.orderItemSubsetLoading;
export const selectDisableHeaderStatusDropdown = (s: PickupShelfDetailsState) => s.disableHeaderStatusDropdown;
export const selectedOrderItems = (s: PickupShelfDetailsState) => {
@@ -160,10 +162,13 @@ export const selectNotifications = (orderItemSubsetId: number) => (s: PickupShel
return tasks
.sort((a, b) => new Date(b.completed).getTime() - new Date(a.completed).getTime())
.reduce((data, result) => {
(data[result.name] = data[result.name] || []).push(new Date(result.completed));
return data;
}, {} as Record<string, Date[]>);
.reduce(
(data, result) => {
(data[result.name] = data[result.name] || []).push(new Date(result.completed));
return data;
},
{} as Record<string, Date[]>,
);
};
export const selectLatestNotificationDatesFor = (orderItemSubsetId: number, keys: string[]) => (s: PickupShelfDetailsState) => {

View File

@@ -34,6 +34,7 @@ export interface PickupShelfDetailsState {
fetchingOrderItemSubsetTasks: { [orderItemSubsetId: number]: boolean };
orderItemSubsetTasks: { [orderItemSubsetId: number]: OrderItemSubsetTaskListItemDTO[] };
orderItemSubsetLoading?: boolean;
coverOrderItems?: DBHOrderItemListItemDTO[];
fetchingCoverOrderItems?: boolean;

View File

@@ -245,6 +245,12 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
return this.get(Selectors.selectCoverOrderItems);
}
orderItemSubsetLoading$ = this.select(Selectors.selectOrderItemSubsetLoading);
get orderItemSubsetLoading() {
return this.get(Selectors.selectOrderItemSubsetLoading);
}
// Wird benöitgt um das Status Dropdown in der Details Header Komponente zu disablen wenn eine Action gehandled wird
disableHeaderStatusDropdown$ = this.select(Selectors.selectDisableHeaderStatusDropdown);
@@ -327,9 +333,9 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
ids: [item.orderItemSubsetId],
eagerLoading: 1,
})
.pipe(tapResponse(this.fetchReceiptsDone, this.fetchReceiptsFailed))
)
)
.pipe(tapResponse(this.fetchReceiptsDone, this.fetchReceiptsFailed)),
),
),
);
private beforeFetchReceipts = () => {
@@ -351,9 +357,9 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
tap(({ orderId }) => this.beforeFetchOrder(orderId)),
// delay(10000),
switchMap(({ orderId }) =>
this._pickupShelfService.getOrderByOrderId(orderId).pipe(tapResponse(this.fetchOrderSuccess, this.fetchOrderFailed))
)
)
this._pickupShelfService.getOrderByOrderId(orderId).pipe(tapResponse(this.fetchOrderSuccess, this.fetchOrderFailed)),
),
),
);
private beforeFetchOrder = (orderId) => {
@@ -394,7 +400,7 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
orderItemSubsetId?: number;
orderDate?: string;
done?: { resolve: (items: DBHOrderItemListItemDTO[]) => void; reject: (err?) => void };
}>
}>,
) =>
trigger$.pipe(
tap((data) => this.beforeFetchOrderItems(data)),
@@ -403,11 +409,11 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
this._pickupShelfIOService.getOrderItemsByOrderNumberOrCompartmentCode({ compartmentCode, orderNumber, filter }).pipe(
tapResponse(
(r) => this.fetchOrderItemsSuccess({ compartmentCode, compartmentInfo, orderItemProcessingStatus }, done?.resolve)(r),
(e) => this.fetchOrderItemsFailed(done?.reject)(e)
)
)
)
)
(e) => this.fetchOrderItemsFailed(done?.reject)(e),
),
),
),
),
);
private beforeFetchOrderItems = ({
@@ -445,41 +451,43 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
});
};
private fetchOrderItemsSuccess = (
{
compartmentCode,
compartmentInfo,
orderItemProcessingStatus,
}: {
compartmentCode?: string;
compartmentInfo?: string;
orderItemProcessingStatus?: OrderItemProcessingStatusValue;
},
resolve?: (items: DBHOrderItemListItemDTO[]) => void
) => (res: ListResponseArgsOfDBHOrderItemListItemDTO) => {
// // Ticket #4348
// check if order items belong to the same customer
// if (buyerNumbers.length > 1) {
// this._modal.error('Fehler beim Laden der Bestellpositionen', new Error('Die Bestellpositionen gehören zu unterschiedlichen Kunden.'));
// return;
// }
this._cacheService.set<DBHOrderItemListItemDTO[]>(
private fetchOrderItemsSuccess =
(
{
name: 'orderItems',
orderId: this.order?.id,
compartmentCode,
compartmentInfo,
orderItemProcessingStatus,
store: 'PickupShelfDetailsStore',
}: {
compartmentCode?: string;
compartmentInfo?: string;
orderItemProcessingStatus?: OrderItemProcessingStatusValue;
},
res.result
);
resolve?: (items: DBHOrderItemListItemDTO[]) => void,
) =>
(res: ListResponseArgsOfDBHOrderItemListItemDTO) => {
// // Ticket #4348
// check if order items belong to the same customer
// if (buyerNumbers.length > 1) {
// this._modal.error('Fehler beim Laden der Bestellpositionen', new Error('Die Bestellpositionen gehören zu unterschiedlichen Kunden.'));
// return;
// }
this.patchState({ fetchingOrderItems: false, orderItems: res.result });
this._runCheckTrigger.next();
resolve?.(res.result);
};
this._cacheService.set<DBHOrderItemListItemDTO[]>(
{
name: 'orderItems',
orderId: this.order?.id,
compartmentCode,
compartmentInfo,
orderItemProcessingStatus,
store: 'PickupShelfDetailsStore',
},
res.result,
);
this.patchState({ fetchingOrderItems: false, orderItems: res.result });
this._runCheckTrigger.next();
resolve?.(res.result);
};
private fetchOrderItemsFailed = (reject?: (err?) => void) => (err: any) => {
this._modal.error('Fehler beim Laden der Bestellpositionen', err);
@@ -492,9 +500,9 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
filter(({ buyerNumber }) => this.customer?.customerNumber !== buyerNumber),
tap(() => this.beforeFetchCustomer()),
switchMap(({ buyerNumber }) =>
this._customerService.getCustomers(buyerNumber).pipe(tapResponse(this.fetchCustomerSuccess, this.fetchCustomerFailed))
)
)
this._customerService.getCustomers(buyerNumber).pipe(tapResponse(this.fetchCustomerSuccess, this.fetchCustomerFailed)),
),
),
);
beforeFetchCustomer = () => {
@@ -540,7 +548,7 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
store: 'PickupShelfDetailsStore',
},
customer,
{ persist: true, ttl: 3600000 }
{ persist: true, ttl: 3600000 },
);
this.patchState({ fetchingCustomer: false, customer });
@@ -558,11 +566,11 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
this._pickupShelfService.patchOrderItemSubset(data.item, data.changes).pipe(
tapResponse(
(res) => this.patchOrderItemSubsetDone(data.item)(res),
(err) => this.patchOrderItemSubsetError(err)
)
)
)
)
(err) => this.patchOrderItemSubsetError(err),
),
),
),
),
);
private patchOrderItemSubsetDone = (item: DBHOrderItemListItemDTO) => (res: ResponseArgsOfOrderItemSubsetDTO) => {
@@ -579,6 +587,8 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
if (res.result.preferredPickUpDate) {
this.patchPreferredPickUpDateOnOrderSubsetItemInState({ item, newPreferredPickUpDate: res.result.preferredPickUpDate });
}
this.updateOrderItemSubsetLoading(false);
};
private patchOrderItemSubsetError = (err: any) => {
@@ -625,7 +635,7 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
return i;
}) ?? [],
};
}
},
);
fetchOrderItemSubsetTasks = this.effect((item$: Observable<DBHOrderItemListItemDTO>) =>
@@ -634,9 +644,9 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
mergeMap((item) =>
this._pickupShelfService
.getOrderItemSubsetTasks(item)
.pipe(tapResponse(this.fetchOrderItemSubsetTasksDone(item), this.fetchOrderItemSubsetTasksFailed(item)))
)
)
.pipe(tapResponse(this.fetchOrderItemSubsetTasksDone(item), this.fetchOrderItemSubsetTasksFailed(item))),
),
),
);
private beforeFetchOrderItemSubsetTasks = (item: DBHOrderItemListItemDTO) => {
@@ -695,8 +705,8 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
delayWhenCustomerNumberNotExists = delayWhen(() =>
this.customerNumber$.pipe(
filter((cn) => !!cn),
take(1)
)
take(1),
),
);
fetchCoverOrderItems = this.effect((trigger$: Observable<void>) =>
@@ -712,17 +722,21 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
.pipe(
tapResponse(
(res) => this.fetchCoverOrderItemsDone(res),
(err) => this.fetchCoverOrderItemsFailed(err)
)
)
)
)
(err) => this.fetchCoverOrderItemsFailed(err),
),
),
),
),
);
private beforeFetchCoverOrderItems = () => {
this.patchState({ fetchingCoverOrderItems: true });
};
updateOrderItemSubsetLoading(orderItemSubsetLoading: boolean) {
this.patchState({ orderItemSubsetLoading });
}
private fetchCoverOrderItemsDone = (res: ListResponseArgsOfDBHOrderItemListItemDTO) => {
this.patchState({ fetchingCoverOrderItems: false, coverOrderItems: res.result });
};

View File

@@ -96,7 +96,7 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
searchboxHint$ = combineLatest([this.fetchingList$, this.fetchListResponse$]).pipe(
debounceTime(100),
map(([fetching, response]) => (response?.response?.hits === 0 && !fetching ? 'Keine Suchergebnisse' : ''))
map(([fetching, response]) => (response?.response?.hits === 0 && !fetching ? 'Keine Suchergebnisse' : '')),
);
readonly selectedListItems$ = this.select(Selectors.selectSelectedListItems);
@@ -174,9 +174,9 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
map(() => this.beforeFetchQuerySettings()),
filter((shouldFetch) => shouldFetch),
switchMap(() =>
this._pickupShelfIOService.getQuerySettings().pipe(tapResponse(this.fetchQuerySettingsDone, this.fetchQuerySettingsError))
)
)
this._pickupShelfIOService.getQuerySettings().pipe(tapResponse(this.fetchQuerySettingsDone, this.fetchQuerySettingsError)),
),
),
);
/**
@@ -212,8 +212,8 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
delayWhenFilterIsNotReady = delayWhen((value: { emitFetchListResponse: boolean } | void) =>
this.filter$.pipe(
filter((filter) => !!filter),
take(1)
)
take(1),
),
);
fetchList = this.effect((trigger$: Observable<{ emitFetchListResponse: boolean } | void>) =>
@@ -221,7 +221,7 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
this.delayWhenFilterIsNotReady,
withLatestFrom(this.filter$, this.processId$),
map(([{ emitFetchListResponse } = { emitFetchListResponse: true }, filter, processId]) =>
this.beforeFetchList(emitFetchListResponse, filter, processId)
this.beforeFetchList(emitFetchListResponse, filter, processId),
),
switchMap(({ emitFetchListResponse, filter, processId, list }) =>
this._pickupShelfIOService
@@ -233,11 +233,11 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
takeUntil(this._cancelListRequests),
tapResponse(
(res) => this.fetchListDone({ processId, queryParams: filter.getQueryParams(), emitFetchListResponse })(res),
(err) => this.fetchListError(err)
)
)
)
)
(err) => this.fetchListError(err),
),
),
),
),
);
private beforeFetchList = (emitFetchListResponse: boolean, filter: Filter, processId: number) => {
@@ -258,22 +258,26 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
return { emitFetchListResponse, filter, processId, list };
};
private fetchListDone = ({
processId,
queryParams,
emitFetchListResponse,
}: {
processId: number;
queryParams: Record<string, string>;
emitFetchListResponse: boolean;
}) => (response: ListResponseArgsOfDBHOrderItemListItemDTO) => {
this.patchState({ fetchingList: false, list: response.result, listHits: response.hits });
if (emitFetchListResponse) {
this._fetchListResponse.next({ processId, response, queryParams });
}
private fetchListDone =
({
processId,
queryParams,
emitFetchListResponse,
}: {
processId: number;
queryParams: Record<string, string>;
emitFetchListResponse: boolean;
}) =>
(response: ListResponseArgsOfDBHOrderItemListItemDTO) => {
this.patchState({ fetchingList: false, list: response.result, listHits: response.hits });
if (emitFetchListResponse) {
this._fetchListResponse.next({ processId, response, queryParams });
}
this._cacheService.set<ListResponseArgsOfDBHOrderItemListItemDTO>({ processId, queryToken: queryParams }, response, { persist: true });
};
this._cacheService.set<ListResponseArgsOfDBHOrderItemListItemDTO>({ processId, queryToken: queryParams }, response, {
persist: true,
});
};
private fetchListError = (err: any) => {
this._modalService.error('Fehler beim Laden der Liste', err);
@@ -295,11 +299,11 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
takeUntil(this._cancelListRequests),
tapResponse(
(r) => this.fetchMoreListDone(r),
(e) => this.fetchMoreListError(e)
)
(e) => this.fetchMoreListError(e),
),
);
})
)
}),
),
);
private beforeFetchMoreList = () => {
@@ -319,6 +323,6 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
patchOrderItem = this.updater(
(state, { orderItemSubsetId, changes }: { orderItemSubsetId: number; changes: Partial<DBHOrderItemListItemDTO> }) => {
return { ...state, list: this.list.map((li) => (li.orderItemSubsetId === orderItemSubsetId ? { ...li, ...changes } : li)) };
}
},
);
}

View File

@@ -47,7 +47,7 @@ export class FinishShippingDocumentComponent implements OnInit, OnDestroy {
private _router: Router,
private _breadcrumb: BreadcrumbService,
private _config: Config,
private _remissionService: DomainRemissionService
private _remissionService: DomainRemissionService,
) {}
ngOnInit() {
@@ -89,15 +89,17 @@ export class FinishShippingDocumentComponent implements OnInit, OnDestroy {
modal.afterClosed$.pipe(takeUntil(this._onDestroy$)).subscribe(async (result) => {
if (result?.data === 'correct') {
await this.createReceiptAndAssignPackageNumber(query);
try {
await this.createReceiptAndAssignPackageNumber(query);
if (coerceBooleanProperty(this._activatedRoute.snapshot.queryParams?.complete)) {
this._router.navigate(['/filiale', 'remission', this.returnId, 'shipping-document'], {
queryParams: { complete: true },
});
} else {
await this.navigateToRemissionList(query);
}
if (coerceBooleanProperty(this._activatedRoute.snapshot.queryParams?.complete)) {
this._router.navigate(['/filiale', 'remission', this.returnId, 'shipping-document'], {
queryParams: { complete: true },
});
} else {
await this.navigateToRemissionList(query);
}
} catch (error) {}
} else if (result?.data === 'rescan') {
this.searchboxComponent.clear();
}
@@ -120,7 +122,11 @@ export class FinishShippingDocumentComponent implements OnInit, OnDestroy {
packageNumber,
});
} catch (error) {
this._modal.error('Fehler beim Speichern der Wannennummer', error);
this._modal.error('Fehler beim Speichern der Wannennummer', error).afterClosed$.subscribe(() => {
this._router.navigate(['/filiale', 'remission', this.returnId, 'finish-shipping-document', this.receiptId]);
});
throw error;
}
}

View File

@@ -16,7 +16,7 @@ import { AddProductModalData } from './add-product-modal.data';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AddProductModalComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
get processId() {
return this._config.get('process.ids.remission');
@@ -45,7 +45,7 @@ export class AddProductModalComponent implements OnInit, OnDestroy {
private _remiService: DomainRemissionService,
private _modal: UiModalService,
private _config: Config,
private _cache: CacheService
private _cache: CacheService,
) {
this.item = this._modalRef.data.item;

View File

@@ -16,7 +16,7 @@ export class RemissionFilterComponent implements OnDestroy {
filter$ = this.store.filter$.pipe(map((filter) => UiFilter.create(filter)));
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
constructor(public store: RemissionListComponentStore) {}
@@ -26,6 +26,8 @@ export class RemissionFilterComponent implements OnDestroy {
}
applyFilter(filter: UiFilter) {
console.log('filter', filter);
this.store.applyFilter(filter);
this.close.emit();
}

View File

@@ -30,15 +30,21 @@
</div>
<div class="grid grid-flow-row gap-1 w-48">
<div class="overflow-hidden overflow-ellipsis whitespace-nowrap" *ngIf="checkFormatAvailable()">
<img *ngIf="iconExists()" class="inline" [src]="formatIconUrl" [alt]="item.formatDetail" />
<span class="ml-1 font-bold format-detail">{{ item.formatDetail }}</span>
<div class="overflow-hidden overflow-ellipsis whitespace-nowrap" *ngIf="formatAvailable">
<img
*ngIf="formatIconAvailable"
class="inline mr-1"
[src]="formatIconUrl"
[alt]="item.formatDetail"
(error)="formatIconAvailable = false"
/>
<span class="font-bold format-detail">{{ item.formatDetail }}</span>
</div>
<div class="font-bold ean">
{{ item.ean }}
</div>
<div class="font-bold price">
{{ item.price.value.value | currency: item.price.value.currency:'code' }}
{{ item.price.value.value | currency: item.price.value.currency : 'code' }}
</div>
<div *ngIf="item.assortment | assortment; let assortment">
<button [uiOverlayTrigger]="assortmentTooltip" data-name="assortment" class="text-active-branch font-bold">

View File

@@ -15,7 +15,6 @@ import { first, takeUntil } from 'rxjs/operators';
import { AddProductToShippingDocumentModalComponent } from '../../modals/add-product-to-shipping-document-modal/add-product-to-shipping-document-modal.component';
import { RemissionListComponentStore } from '../remission-list.component-store';
import { RemissionListComponent } from '../remission-list.component';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'page-remission-list-item',
@@ -24,7 +23,7 @@ import { HttpClient } from '@angular/common/http';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RemissionListItemComponent implements OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
@Input()
item: RemissionListItem;
@@ -60,12 +59,17 @@ export class RemissionListItemComponent implements OnDestroy {
return `/assets/images/Icon_${this.item.dto.product.format}.svg`;
}
get formatAvailable() {
return !!this.item.format && !!this.item.formatDetail && this.item.format !== 'UNKNOWN';
}
formatIconAvailable: boolean = true;
constructor(
private _modal: UiModalService,
private _remissionService: DomainRemissionService,
private _store: RemissionListComponentStore,
private readonly _http: HttpClient,
@Host() private _listComponent: RemissionListComponent
@Host() private _listComponent: RemissionListComponent,
) {}
ngOnDestroy() {
@@ -73,19 +77,6 @@ export class RemissionListItemComponent implements OnDestroy {
this._onDestroy$.complete();
}
checkFormatAvailable() {
return !!this.item.format && !!this.item.formatDetail && this.item.format !== 'UNKNOWN';
}
async iconExists(): Promise<boolean> {
try {
const response = await this._http.head(this.formatIconUrl, { observe: 'response' }).pipe(first()).toPromise();
return response?.status === 200;
} catch {
return false;
}
}
addProductToShippingDocument() {
const modal = this._modal.open({
content: AddProductToShippingDocumentModalComponent,
@@ -187,7 +178,7 @@ export class RemissionListItemComponent implements OnDestroy {
const items = await this._store.items$.pipe(first()).toPromise();
const itemsByEan = items?.filter(
(i) => i.dto.product.ean === this.item.dto.product.ean && i.dto.id !== this.item.dto.id && i.placementType === 'Stapel'
(i) => i.dto.product.ean === this.item.dto.product.ean && i.dto.id !== this.item.dto.id && i.placementType === 'Stapel',
);
if (itemsByEan?.length > 0) {

View File

@@ -7,7 +7,7 @@ import { ComponentStore, tapResponse } from '@ngrx/component-store';
import { ReturnItemDTO, ReturnSuggestionDTO, SupplierDTO } from '@swagger/remi';
import { UiFilter } from '@ui/filter';
import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs';
import { debounceTime, filter, switchMap, takeUntil, tap, withLatestFrom } from 'rxjs/operators';
import { debounceTime, distinctUntilChanged, filter, switchMap, takeUntil, tap, withLatestFrom } from 'rxjs/operators';
export interface RemissionState {
suppliers: SupplierDTO[];
@@ -57,11 +57,11 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
}
get selectedSupplier() {
return this.get((s) => s.suppliers?.find((si) => si.id === s.selectedSupplierId));
return this.get((s) => s.suppliers?.find((si) => si.id === s.selectedSupplierId) ?? s.suppliers[0]);
}
get selectedSupplier$() {
return this.select((s) => s.suppliers?.find((si) => si.id === s.selectedSupplierId));
return this.select((s) => s.suppliers?.find((si) => si.id === s.selectedSupplierId) ?? s.suppliers[0]);
}
get sources() {
@@ -137,7 +137,7 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
private readonly _config: Config,
private readonly _cache: CacheService,
private readonly _activatedRoute: ActivatedRoute,
private readonly _router: Router
private readonly _router: Router,
) {
super({
suppliers: [],
@@ -186,11 +186,11 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
this._domainRemissionService.getSuppliers().pipe(
tapResponse(
(suppliers) => this.setSuppliers(suppliers),
(err) => {}
)
)
)
)
(err) => {},
),
),
),
),
);
loadSources = this.effect(($) =>
@@ -200,11 +200,11 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
this._domainRemissionService.getSources().pipe(
tapResponse(
(sources) => this.setSources(sources),
(err) => {}
)
)
)
)
(err) => {},
),
),
),
),
);
loadRequiredCapacities = this.effect(($) =>
@@ -220,11 +220,11 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
return this._domainRemissionService.getRequiredCapacities({ supplierId: supplier?.id, departments }).pipe(
tapResponse(
(response) => this.setRequiredCapacities(response),
(err) => {}
)
(err) => {},
),
);
})
)
}),
),
);
loadFilter = this.effect((options$: Observable<{ loadDefault?: boolean }>) =>
@@ -259,11 +259,11 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
this._filterChange$.next(true);
}
},
(err) => {}
)
)
)
)
(err) => {},
),
),
),
),
);
search = this.effect((options$: Observable<{ newSearch?: boolean }>) =>
@@ -332,11 +332,11 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
this.setFetching(false);
this._searchCompleted.next(this.get());
},
(err) => {}
)
)
)
)
(err) => {},
),
),
),
),
);
setFetching = this.updater<boolean>((state, fetching) => ({
@@ -435,7 +435,7 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
{
items: this.items,
hits: this.hits,
}
},
);
}

View File

@@ -37,7 +37,7 @@ export class RemissionListComponent implements OnInit, OnDestroy {
@ViewChild('scrollContainer', { static: true })
scrollContainer: CdkVirtualScrollViewport;
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
get processId() {
return this._config.get('process.ids.remission');
@@ -98,12 +98,12 @@ export class RemissionListComponent implements OnInit, OnDestroy {
}
return true;
})
}),
);
listEmpty$ = combineLatest([this.fetching$, this.hits$]).pipe(
map(([loading, hits]) => !loading && hits === 0),
shareReplay()
shareReplay(),
);
get queryParams$() {
@@ -115,7 +115,7 @@ export class RemissionListComponent implements OnInit, OnDestroy {
queryParams = { ...filter.getQueryParams(), ...params, supplier, source };
}
return queryParams;
})
}),
);
}
@@ -131,7 +131,7 @@ export class RemissionListComponent implements OnInit, OnDestroy {
return suppliers;
}
return suppliers.filter((supplier) => supplier?.id === selectedSupplier?.id);
})
}),
);
trackByItemId: TrackByFunction<RemissionListItem> = (_, item) => item.dto.id;
@@ -147,7 +147,7 @@ export class RemissionListComponent implements OnInit, OnDestroy {
private readonly _activatedRoute: ActivatedRoute,
private readonly _breadcrumb: BreadcrumbService,
private readonly _applicationService: ApplicationService,
private readonly _config: Config
private readonly _config: Config,
) {}
ngOnInit() {

View File

@@ -16,7 +16,7 @@ import { ToasterService } from '@shared/shell';
providers: [RemissionListComponentStore],
})
export class RemissionComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
get processId() {
return this._config.get('process.ids.remission');
@@ -29,7 +29,7 @@ export class RemissionComponent implements OnInit, OnDestroy {
private _applicationService: ApplicationService,
private _router: Router,
private _cache: CacheService,
private _toastService: ToasterService
private _toastService: ToasterService,
) {}
ngOnInit(): void {
@@ -38,7 +38,7 @@ export class RemissionComponent implements OnInit, OnDestroy {
this._router.events
?.pipe(
filter((event) => event instanceof NavigationEnd),
takeUntil(this._onDestroy$)
takeUntil(this._onDestroy$),
)
.subscribe(() => {
this.updateProcess();

View File

@@ -96,13 +96,13 @@ export class TaskInfoComponent implements OnChanges {
teaser$ = this.info$.pipe(
filter((info) => !isNullOrUndefined(info)),
switchMap((info) => this.domainTaskCalendarService.getTeaserFile({ infoId: info.id }).pipe(catchError((error) => [undefined])))
switchMap((info) => this.domainTaskCalendarService.getTeaserFile({ infoId: info.id }).pipe(catchError((error) => [undefined]))),
);
attachments$ = this.info$.pipe(
filter((info) => info.attachments > 0),
switchMap((info) => this.domainTaskCalendarService.getFiles({ infoId: info.id })),
map((response) => response.result)
map((response) => response.result),
);
type$ = this.info$.pipe(map((info) => this.domainTaskCalendarService.getInfoType(info)));
@@ -111,7 +111,7 @@ export class TaskInfoComponent implements OnChanges {
indicatorColor$ = this.info$.pipe(map((info) => this.domainTaskCalendarService.getProcessingStatusColorCode(info)));
private noteAdded$ = new Subject();
private noteAdded$ = new Subject<void>();
notes$ = combineLatest([this.info$, this.noteAdded$.pipe(startWith([undefined]))]).pipe(
switchMap(([info]) => this.domainTaskCalendarService.getComments({ infoId: info.id })),
@@ -119,19 +119,19 @@ export class TaskInfoComponent implements OnChanges {
res.result.map((comment) => ({
date: new Date(comment.created),
note: comment.text,
}))
)
})),
),
);
processingStatus$ = this.info$.pipe(
map((info) => this.domainTaskCalendarService.getProcessingStatusList(info)),
shareReplay()
shareReplay(),
);
showUpdateComment$ = combineLatest([this.info$, this.processingStatus$]).pipe(
map(
([info, processingStatus]) => !!info.updateComment && ((info.successor && processingStatus.includes('Removed')) || info.predecessor)
)
([info, processingStatus]) => !!info.updateComment && ((info.successor && processingStatus.includes('Removed')) || info.predecessor),
),
);
@HostBinding('class')
@@ -146,7 +146,7 @@ export class TaskInfoComponent implements OnChanges {
private uiModal: UiModalService,
private clipboard: Clipboard,
@Optional() private modalRef: UiModalRef,
private router: Router
private router: Router,
) {}
ngOnChanges({ info }: SimpleChanges): void {

View File

@@ -17,7 +17,7 @@ import { TaskCalendarStore } from '../../task-calendar.store';
exportAs: 'taskSearchbar',
})
export class TaskSearchbarComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
control = new UntypedFormControl('', [Validators.minLength(3)]);
@@ -30,7 +30,7 @@ export class TaskSearchbarComponent implements OnInit, OnDestroy {
private _activatedRoute: ActivatedRoute,
private _cdr: ChangeDetectorRef,
private _breadcrumb: BreadcrumbService,
private _config: Config
private _config: Config,
) {}
getControlValueFromQuery() {

View File

@@ -15,7 +15,7 @@ import { TaskCalendarStore } from '../../task-calendar.store';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TaskCalendarFilterComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
@Output() exitFilter = new EventEmitter<void>();
filter$ = new BehaviorSubject<UiFilter>(undefined);
@@ -29,7 +29,7 @@ export class TaskCalendarFilterComponent implements OnInit, OnDestroy {
private _router: Router,
private _activatedRoute: ActivatedRoute,
private _breadcrumb: BreadcrumbService,
private _config: Config
private _config: Config,
) {}
private _initFilter(filter: UiFilter) {

View File

@@ -16,7 +16,7 @@ import { ApplicationService } from '@core/application';
providers: [TaskCalendarStore],
})
export class PageTaskCalendarComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
@ViewChild('searchInput', { static: true })
searchInput: ElementRef;
@@ -32,13 +32,17 @@ export class PageTaskCalendarComponent implements OnInit, OnDestroy {
map(([_, filter, initialFilter]) => {
return !isEqual(filter?.getQueryParams(), initialFilter?.getQueryParams());
}),
shareReplay()
shareReplay(),
);
@ViewChild(TaskSearchbarComponent)
searchbar: TaskSearchbarComponent;
constructor(private taskCalendarStore: TaskCalendarStore, private _activatedRoute: ActivatedRoute, private readonly _config: Config) {
constructor(
private taskCalendarStore: TaskCalendarStore,
private _activatedRoute: ActivatedRoute,
private readonly _config: Config,
) {
this.taskCalendarStore.loadFilter();
}

View File

@@ -18,7 +18,7 @@ import { TaskCalendarStore } from '../../task-calendar.store';
providers: [DatePipe],
})
export class TaskSearchComponent implements OnInit, OnDestroy, AfterViewInit {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
private _taskCalendarKey = this._config.get('process.ids.taskCalendar');
today = this.dateAdapter.today();
@@ -40,14 +40,14 @@ export class TaskSearchComponent implements OnInit, OnDestroy, AfterViewInit {
grouped.map((g) => ({
...g,
items: this.domainTaskCalendarService.sort(g.items, ['Overdue', 'InProcess', 'Approved', 'Completed', 'Removed']),
}))
})),
),
// Entfernte ans ende der Gruppe setzen
map((grouped) => grouped.map((g) => ({ ...g, items: g.items.sort((a, b) => this.domainTaskCalendarService.moveRemovedToEnd(a, b)) })))
map((grouped) => grouped.map((g) => ({ ...g, items: g.items.sort((a, b) => this.domainTaskCalendarService.moveRemovedToEnd(a, b)) }))),
);
showEmptyMessage$ = combineLatest([this.fetching$, this.searchResultsLength$, this.taskCalendarStore.hits$]).pipe(
map(([fetching, length, hits]) => !fetching && length <= 0 && hits === 0)
map(([fetching, length, hits]) => !fetching && length <= 0 && hits === 0),
);
previousBreadcrumb$: Observable<Breadcrumb> = this._breadcrumb.getBreadcrumbsByKeyAndTags$(this._taskCalendarKey, ['task-calendar']).pipe(
@@ -57,7 +57,7 @@ export class TaskSearchComponent implements OnInit, OnDestroy, AfterViewInit {
}
// Fallback wenn kein vorheriger Breadcrumb existiert
return { path: '/filiale/task-calendar/tasks', name: 'Aufgaben', section: 'branch', key: 'task-calendar' };
})
}),
);
constructor(
@@ -66,7 +66,7 @@ export class TaskSearchComponent implements OnInit, OnDestroy, AfterViewInit {
private domainTaskCalendarService: DomainTaskCalendarService,
private _activatedRoute: ActivatedRoute,
private _config: Config,
private _breadcrumb: BreadcrumbService
private _breadcrumb: BreadcrumbService,
) {}
ngOnInit() {

View File

@@ -95,7 +95,7 @@ export class BranchSelectorComponent implements OnInit, OnDestroy, AfterViewInit
}
private _value: BranchDTO;
private _onDestroy$ = new Subject<boolean>();
private _onDestroy$ = new Subject<void>();
@Output() valueChange = new EventEmitter<BranchDTO>();
@@ -118,7 +118,11 @@ export class BranchSelectorComponent implements OnInit, OnDestroy, AfterViewInit
@HostBinding('class.focused')
focused = false;
constructor(public store: BranchSelectorStore, private _auth: AuthService, private _elementRef: ElementRef) {}
constructor(
public store: BranchSelectorStore,
private _auth: AuthService,
private _elementRef: ElementRef,
) {}
writeValue(obj: any): void {
if (obj?.id) {
@@ -157,7 +161,7 @@ export class BranchSelectorComponent implements OnInit, OnDestroy, AfterViewInit
this.complete
.pipe(takeUntil(this._onDestroy$), withLatestFrom(this.store.branches$))
.subscribe(([query, branches]) =>
query?.length > 1 ? this.filterBranchesFn({ query, branches }) : this.store.setFilteredBranches(branches)
query?.length > 1 ? this.filterBranchesFn({ query, branches }) : this.store.setFilteredBranches(branches),
);
}

View File

@@ -79,7 +79,7 @@ export class FilterInputGroupMainComponent implements OnInit, OnDestroy, AfterVi
constructor(
@Inject(FilterAutocompleteProvider) @Optional() private autocompleteProviders: FilterAutocompleteProvider[],
private cdr: ChangeDetectorRef
private cdr: ChangeDetectorRef,
) {}
// cancle autocomplete
@@ -130,7 +130,7 @@ export class FilterInputGroupMainComponent implements OnInit, OnDestroy, AfterVi
} else {
this.autocompleteComponent?.close();
}
})
}),
);
}

View File

@@ -37,8 +37,10 @@ export interface SharedGoodsInOutOrderDetailsItemComponentState {
styleUrls: ['goods-in-out-order-details-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<SharedGoodsInOutOrderDetailsItemComponentState>
implements OnInit, OnDestroy {
export class SharedGoodsInOutOrderDetailsItemComponent
extends ComponentStore<SharedGoodsInOutOrderDetailsItemComponentState>
implements OnInit, OnDestroy
{
@ViewChild('autosize') autosize: CdkTextareaAutosize;
@Input()
@@ -78,12 +80,12 @@ export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<Sh
switchMap((oi) =>
this._omsService
.getCompletedTasks({ orderId: oi.orderId, orderItemId: oi.orderItemId, orderItemSubsetId: oi.orderItemSubsetId, take: 4, skip: 0 })
.pipe(catchError(() => NEVER))
)
.pipe(catchError(() => NEVER)),
),
);
canChangeQuantity$ = combineLatest([this.orderItem$, this._host.fetchPartial$]).pipe(
map(([item, partialPickup]) => ([16, 8192].includes(item?.processingStatus) || partialPickup) && item.quantity > 1)
map(([item, partialPickup]) => ([16, 8192].includes(item?.processingStatus) || partialPickup) && item.quantity > 1),
);
get quantity() {
@@ -109,7 +111,7 @@ export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<Sh
}
readonly selected$ = combineLatest([this.orderItem$, this._host.selectedeOrderItemSubsetIds$]).pipe(
map(([orderItem, selectedItems]) => selectedItems.includes(orderItem?.orderItemSubsetId))
map(([orderItem, selectedItems]) => selectedItems.includes(orderItem?.orderItemSubsetId)),
);
@Output()
@@ -120,7 +122,7 @@ export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<Sh
}
readonly selectable$ = combineLatest([this._host.orderItems$, this._host.itemsSelectable$, this._host.fetchPartial$]).pipe(
map(([orderItems, selectable, fetchPartial]) => orderItems.length > 1 && selectable && fetchPartial)
map(([orderItems, selectable, fetchPartial]) => orderItems.length > 1 && selectable && fetchPartial),
);
get receipts() {
@@ -144,7 +146,7 @@ export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<Sh
showMore$ = this.more$.pipe(map((more) => more || this._auth.hasRole('CallCenter')));
fetchHistory$ = new BehaviorSubject<boolean>(false);
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
constructor(
private _host: SharedGoodsInOutOrderDetailsStore,
@@ -152,7 +154,7 @@ export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<Sh
private _omsService: DomainOmsService,
private _modal: UiModalService,
private _cdr: ChangeDetectorRef,
private _auth: AuthService
private _auth: AuthService,
) {
super({
more: false,
@@ -193,11 +195,11 @@ export class SharedGoodsInOutOrderDetailsItemComponent extends ComponentStore<Sh
done?.([]);
}
},
() => {}
)
)
)
)
() => {},
),
),
),
),
);
async saveSpecialComment() {

View File

@@ -92,7 +92,7 @@
</ng-template>
</div>
<div class="item-price">
{{ item.price | currency: 'EUR':'code' }}
{{ item.price | currency: 'EUR' : 'code' }}
</div>
<div class="label-value" *ngIf="showSupplier; else showBranch">

View File

@@ -87,7 +87,7 @@ export function getCanAddResults(state: PurchaseOptionsState): CanAdd[] {
export function getCanAddForItemWithPurchaseOption(
itemId: number,
purchaseOption: PurchaseOption
purchaseOption: PurchaseOption,
): (state: PurchaseOptionsState) => CanAdd {
return (state: PurchaseOptionsState) => {
const canAddResults = getCanAddResults(state);
@@ -157,7 +157,7 @@ export function getItemsThatHaveAnAvailabilityAndCanAddForPurchaseOption(purchas
const canAddResults = getCanAddResults(state);
return items.filter((item) =>
canAddResults.some((canAdd) => canAdd.itemId === item.id && canAdd.purchaseOption === purchaseOption && canAdd.canAdd)
canAddResults.some((canAdd) => canAdd.itemId === item.id && canAdd.purchaseOption === purchaseOption && canAdd.canAdd),
);
};
}
@@ -189,7 +189,7 @@ export function getItemsForList(state: PurchaseOptionsState): Item[] {
export function getAvailabilitiesForItem(
itemId: number,
allDeliveryAvailabilities?: boolean
allDeliveryAvailabilities?: boolean,
): (state: PurchaseOptionsState) => Availability[] {
return (state) => {
let availabilities = getAvailabilities(state);
@@ -198,7 +198,7 @@ export function getAvailabilitiesForItem(
// if 'delivery', 'dig-delivery' and 'b2b-delivery' are present remove 'dig-delivery' and 'b2b-delivery'
if (!allDeliveryAvailabilities && availabilities.some((availability) => availability.purchaseOption === 'delivery')) {
availabilities = availabilities.filter(
(availability) => availability.purchaseOption !== 'dig-delivery' && availability.purchaseOption !== 'b2b-delivery'
(availability) => availability.purchaseOption !== 'dig-delivery' && availability.purchaseOption !== 'b2b-delivery',
);
}
const optionsOrder = PURCHASE_OPTIONS;
@@ -247,7 +247,7 @@ export function getIsGiftCard(itemId: number): (state: PurchaseOptionsState) =>
export function getAvailabilityPriceForPurchaseOption(
itemId: number,
purchaseOption: PurchaseOption
purchaseOption: PurchaseOption,
): (state: PurchaseOptionsState) => (PriceDTO & { fromCatalogue?: boolean }) | undefined {
return (state) => {
const item = getItems(state).find((item) => item.id === itemId);
@@ -316,6 +316,20 @@ export function getAvailabilityPriceForPurchaseOption(
return pickupAvailability?.data?.price;
}
}
// #4760 Fehler bei Abholpreisberechnung in Filiale Darmstadt Ernst-Ludwig-Straße (negativ Preis im Warenkorb)
// Überprüfen ob der Preis ungültig ist und der Versandpreis vorhanden ist
// Wenn ja, dann den Versandpreis nehmen
if (!(availability?.data?.price?.value?.value > 0)) {
if (deliveryAvailability?.data?.price?.value?.value > 0) {
const deliveryPrice = deliveryAvailability?.data?.price;
availability.data.price = deliveryPrice;
} else {
// Wenn der Versandpreis auch ungültig ist, dann den Katalogpreis nehmen
const catalogAvailability = availabilities.find((availability) => availability.purchaseOption === 'catalog');
return catalogAvailability?.data?.price ?? DEFAULT_PRICE_DTO;
}
}
}
if (availability && availability.data.price?.value?.value && availability.data.price) {
@@ -376,7 +390,7 @@ export function getCanAddResultForItemAndCurrentPurchaseOption(itemId: number):
export function getAvailabilityWithPurchaseOption(
itemId: number,
purchaseOption: PurchaseOption
purchaseOption: PurchaseOption,
): (state: PurchaseOptionsState) => Availability {
return (state) => {
let availabilities = getAvailabilitiesForItem(itemId, true)(state);

View File

@@ -40,7 +40,7 @@ export class CustomerSearchNavigation {
];
const queryParams: Record<string, string> = {};
console.log(params.customer);
if (params.customer) {
queryParams.main_qs = params.customer?.customerNumber;
queryParams.filter_customertype = '';

View File

@@ -11,7 +11,7 @@ import { SEARCH_STATE_SEARCH_SERVICE, SEARCH_STATE_SETTINGS_LOADER } from './tok
@Injectable()
export class SearchComponentStoreService<T = any> extends ComponentStore<SearchState<T>> implements OnDestroy {
private _onDestroy$ = new Subject();
private _onDestroy$ = new Subject<void>();
get state() {
return this.get();
@@ -67,7 +67,7 @@ export class SearchComponentStoreService<T = any> extends ComponentStore<SearchS
@Inject(SEARCH_STATE_SETTINGS_LOADER) private readonly _settingsLoader: SearchStateSettingsLoader,
@Inject(SEARCH_STATE_SEARCH_SERVICE) private readonly _searchService: SearchStateSearchService<T>,
private readonly _cache: CacheService,
private readonly _uiModal: UiModalService
private readonly _uiModal: UiModalService,
) {
super({
items: [],
@@ -77,7 +77,7 @@ export class SearchComponentStoreService<T = any> extends ComponentStore<SearchS
this.filter$
.pipe(
takeUntil(this._onDestroy$),
filter((filter) => !!filter)
filter((filter) => !!filter),
)
.subscribe((filter) => {
const cachedResult = this._cache.get(filter?.getQueryParams());
@@ -190,14 +190,14 @@ export class SearchComponentStoreService<T = any> extends ComponentStore<SearchS
this.cacheResults(filter, { items: [...items, ...res.items], hits: res.hits });
this.patchState({ latestResponse: res.response });
},
(err) => this.handleSearchError(err)
(err) => this.handleSearchError(err),
),
finalize(() => {
this.searchCompleted.next(this.state);
})
}),
);
})
)
}),
),
);
searchRequest(filter: UiFilter, items: T[]): Observable<SearchStateSearchResult<T>> {

View File

@@ -1,23 +1,12 @@
/* tslint:disable */
/**
* Gr<47><72>e / Volumen
*/
export interface SizeOfString {
/**
* H<>he
*/
height: number;
/**
* L<>nge / Tiefe
*/
length: number;
/**
* Ma<4D>einheit
*/
unit?: string;
/**

View File

@@ -28,7 +28,7 @@ export class UiNotesComponent implements OnChanges, OnInit, OnDestroy {
control = new UntypedFormControl('', [Validators.required]);
private onDestroy$ = new Subject();
private onDestroy$ = new Subject<void>();
constructor(private cdr: ChangeDetectorRef) {}

View File

@@ -12,7 +12,7 @@ variables:
value: '3'
# Minor Version einstellen
- name: 'Minor'
value: '0'
value: '1'
- name: 'Patch'
value: "$[counter(format('{0}.{1}', variables['Major'], variables['Minor']),0)]"
- name: 'BuildUniqueID'

16495
package-lock.json generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -53,94 +53,73 @@
"gen:swagger:eis": "ng-swagger-gen --config ng-swagger-gen/eis.json",
"gen:swagger:remi": "ng-swagger-gen --config ng-swagger-gen/remi.json",
"gen:swagger:wws": "ng-swagger-gen --config ng-swagger-gen/wws.json",
"prettier": "prettier --write ."
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
"prettier": "prettier --write .",
"pretty-quick": "pretty-quick --staged",
"prepare": "husky"
},
"private": true,
"dependencies": {
"@angular/animations": "^16.1.7",
"@angular/cdk": "^16.1.6",
"@angular/common": "^16.1.7",
"@angular/compiler": "^16.1.7",
"@angular/core": "^16.1.7",
"@angular/forms": "^16.1.7",
"@angular/localize": "^16.1.7",
"@angular/platform-browser": "^16.1.7",
"@angular/platform-browser-dynamic": "^16.1.7",
"@angular/router": "^16.1.7",
"@angular/service-worker": "^16.1.7",
"@angular/animations": "^17.3.10",
"@angular/cdk": "^17.3.10",
"@angular/common": "^17.3.10",
"@angular/compiler": "^17.3.10",
"@angular/core": "^17.3.10",
"@angular/forms": "^17.3.10",
"@angular/localize": "^17.3.10",
"@angular/platform-browser": "^17.3.10",
"@angular/platform-browser-dynamic": "^17.3.10",
"@angular/router": "^17.3.10",
"@angular/service-worker": "^17.3.10",
"@microsoft/signalr": "^7.0.0",
"@ngrx/component-store": "^16.1.0",
"@ngrx/effects": "^16.1.0",
"@ngrx/entity": "^16.1.0",
"@ngrx/store": "^16.1.0",
"@ngrx/store-devtools": "^16.1.0",
"angular-oauth2-oidc": "^15.0.1",
"angular-oauth2-oidc-jwks": "^15.0.1",
"core-js": "^2.6.5",
"hammerjs": "^2.0.8",
"@ngrx/component-store": "^17.2.0",
"@ngrx/effects": "^17.2.0",
"@ngrx/entity": "^17.2.0",
"@ngrx/store": "^17.2.0",
"@ngrx/store-devtools": "^17.2.0",
"angular-oauth2-oidc": "^17.0.2",
"angular-oauth2-oidc-jwks": "^17.0.2",
"lodash": "^4.17.21",
"moment": "^2.29.4",
"ng2-pdf-viewer": "^9.1.5",
"moment": "^2.30.1",
"ng2-pdf-viewer": "^10.2.2",
"parse-duration": "^1.1.0",
"rxjs": "^6.6.7",
"scandit-sdk": "^5.13.2",
"rxjs": "~7.8.0",
"scandit-sdk": "^5.15.0",
"socket.io": "^4.5.4",
"tslib": "^2.0.0",
"uglify-js": "^3.4.9",
"tslib": "^2.3.0",
"uuid": "^8.3.2",
"web-animations-js": "^2.3.2",
"zone.js": "~0.13.1"
"zone.js": "~0.14.6"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.1.6",
"@angular/cli": "^16.1.6",
"@angular/compiler-cli": "^16.1.7",
"@angular/language-service": "^16.1.7",
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.10",
"@angular/language-service": "^17.3.10",
"@ngneat/spectator": "^15.0.1",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/lodash": "^4.14.168",
"@types/moment": "^2.13.0",
"@types/node": "^18.6.1",
"@types/uuid": "^8.3.0",
"autoprefixer": "^10.4.12",
"codelyzer": "^6.0.2",
"husky": "^4.2.3",
"jasmine-core": "~3.8.0",
"jasmine-marbles": "^0.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.9",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "^2.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"karma-junit-reporter": "^2.0.1",
"ng-mocks": "^14.11.0",
"ng-packagr": "^16.1.0",
"autoprefixer": "^10.4.19",
"husky": "^9.0.11",
"jasmine-core": "~5.1.2",
"jasmine-marbles": "^0.9.2",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.3",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "^2.2.1",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"karma-junit-reporter": "~2.0.1",
"ng-swagger-gen": "^2.3.1",
"ngrx-store-freeze": "^0.2.4",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.18",
"postcss-loader": "^4.1.0",
"postcss-scss": "^3.0.4",
"prettier": "2.0.1",
"pretty-quick": "^2.0.1",
"sass": "^1.37.5",
"stylelint": "^13.7.2",
"stylelint-config-standard": "^20.0.0",
"tailwindcss": "^3.1.8",
"ts-node": "~7.0.0",
"tslint": "~6.1.0",
"typescript": "~5.1.6"
"postcss": "^8.4.38",
"prettier": "~3.3.1",
"pretty-quick": "~4.0.0",
"tailwindcss": "^3.4.3",
"typescript": "~5.4.5"
},
"engines": {
"node": "18.x",
"npm": "8.x"
"node": ">=18.13.0",
"npm": ">=10.5.2"
}
}
}

View File

@@ -1,13 +0,0 @@
module.exports = {
//extends: ['stylelint-config-standard'],
rules: {
'at-rule-no-unknown': [
true,
{
ignoreAtRules: ['tailwind', 'apply', 'variants', 'responsive', 'screen'],
},
],
'declaration-block-trailing-semicolon': null,
'no-descending-specificity': null,
},
};