mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Compare commits
1 Commits
tracking
...
fix/4706-A
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2644f2ec6 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,7 +1,5 @@
|
||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
.matomo
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/tmp
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
npm run pretty-quick
|
||||
4
TASKS.md
Normal file
4
TASKS.md
Normal file
@@ -0,0 +1,4 @@
|
||||
- Neue Icon Module (z.B. mit SVG sprites)
|
||||
- Breadcrumb Navigation (Neu)
|
||||
- Remissions Produkt Liste (Refactoring / Neu)
|
||||
- Angular Version (Upgrade)
|
||||
40
angular.json
40
angular.json
@@ -2,7 +2,6 @@
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "apps",
|
||||
|
||||
"projects": {
|
||||
"@swagger/availability": {
|
||||
"root": "apps/swagger/availability",
|
||||
@@ -960,10 +959,10 @@
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"configurations": {
|
||||
"production": {
|
||||
"buildTarget": "isa-app:build:production"
|
||||
"browserTarget": "isa-app:build:production"
|
||||
},
|
||||
"development": {
|
||||
"buildTarget": "isa-app:build:development"
|
||||
"browserTarget": "isa-app:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
@@ -971,7 +970,7 @@
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"buildTarget": "isa-app:build"
|
||||
"browserTarget": "isa-app:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
@@ -1471,6 +1470,39 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import { Directive, HostListener, Input } from '@angular/core';
|
||||
import { ProductCatalogNavigationService } from '@shared/services';
|
||||
|
||||
@Directive({
|
||||
selector: '[productImageNavigation]',
|
||||
standalone: true,
|
||||
})
|
||||
export class NavigateOnClickDirective {
|
||||
@Input('productImageNavigation') ean: string;
|
||||
|
||||
constructor(private readonly _productCatalogNavigation: ProductCatalogNavigationService) {}
|
||||
|
||||
@HostListener('click', ['$event'])
|
||||
async onClick(event: MouseEvent) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
if (this.ean) {
|
||||
await this._navigateToProductSearchDetails();
|
||||
}
|
||||
}
|
||||
|
||||
private async _navigateToProductSearchDetails() {
|
||||
await this._productCatalogNavigation
|
||||
.getArticleDetailsPathByEan({
|
||||
processId: Date.now(),
|
||||
ean: this.ean,
|
||||
extras: { queryParams: { main_qs: this.ean } },
|
||||
})
|
||||
.navigate();
|
||||
}
|
||||
}
|
||||
@@ -5,5 +5,4 @@
|
||||
export * from './lib/product-image.service';
|
||||
export * from './lib/product-image.module';
|
||||
export * from './lib/product-image.pipe';
|
||||
export * from './lib/product-image-navigation.directive';
|
||||
export * from './lib/tokens';
|
||||
|
||||
@@ -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))
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export class ThumbnailUrlPipe implements PipeTransform, OnDestroy {
|
||||
private input$ = new BehaviorSubject<{ width?: number; height?: number; ean?: string }>(undefined);
|
||||
private result: string;
|
||||
|
||||
private onDestroy$ = new Subject<void>();
|
||||
private onDestroy$ = new Subject();
|
||||
|
||||
constructor(private domainCatalogThumbnailService: DomainCatalogThumbnailService, private cdr: ChangeDetectorRef) {}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isDevMode, NgModule } from '@angular/core';
|
||||
import { inject, isDevMode, NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import {
|
||||
CanActivateCartGuard,
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
CanActivateCustomerOrdersWithProcessIdGuard,
|
||||
CanActivateCustomerWithProcessIdGuard,
|
||||
CanActivateGoodsInGuard,
|
||||
CanActivateGoodsOutGuard,
|
||||
CanActivateGoodsOutWithProcessIdGuard,
|
||||
CanActivateProductGuard,
|
||||
CanActivateProductWithProcessIdGuard,
|
||||
CanActivateRemissionGuard,
|
||||
@@ -20,9 +22,9 @@ import { MainComponent } from './main.component';
|
||||
import { PreviewComponent } from './preview';
|
||||
import { BranchSectionResolver, CustomerSectionResolver, ProcessIdResolver } from './resolvers';
|
||||
import { TokenLoginComponent, TokenLoginModule } from './token-login';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { ProcessIdGuard } from './guards/process-id.guard';
|
||||
import { ActivateProcessIdGuard, ActivateProcessIdWithConfigKeyGuard } from './guards/activate-process-id.guard';
|
||||
import { MatomoRouteData } from 'ngx-matomo-client';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
@@ -43,11 +45,6 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'dashboard',
|
||||
loadChildren: () => import('@page/dashboard').then((m) => m.DashboardModule),
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Dashboard',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'product',
|
||||
|
||||
@@ -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', connectInZone: true }),
|
||||
StoreDevtoolsModule.instrument({ name: 'ISA Ngrx Application Store' }),
|
||||
],
|
||||
})
|
||||
export class AppStoreModule {}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
import { Component, HostListener, Inject, OnInit, Renderer2 } from '@angular/core';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { SwUpdate } from '@angular/service-worker';
|
||||
import { SwUpdate, UpdateAvailableEvent } 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, Subscription } from 'rxjs';
|
||||
import { asapScheduler, interval, Observable, 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',
|
||||
@@ -20,6 +21,7 @@ import { UiMessageModalComponent, UiModalService } from '@ui/modal';
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
private _checkForUpdates: number = this._config.get('checkForUpdates');
|
||||
updateAvailableObs: Observable<UpdateAvailableEvent>;
|
||||
|
||||
get checkForUpdates(): number {
|
||||
return this._checkForUpdates;
|
||||
|
||||
@@ -37,8 +37,6 @@ import { NativeContainerService } from 'native-container';
|
||||
import { ShellModule } from '@shared/shell';
|
||||
import { MainComponent } from './main.component';
|
||||
import { IconModule } from '@shared/components/icon';
|
||||
import { provideMatomo } from 'ngx-matomo-client';
|
||||
import { withRouter, withRouteData } from 'ngx-matomo-client';
|
||||
|
||||
registerLocaleData(localeDe, localeDeExtra);
|
||||
registerLocaleData(localeDe, 'de', localeDeExtra);
|
||||
@@ -48,7 +46,7 @@ export function _appInitializerFactory(
|
||||
auth: AuthService,
|
||||
injector: Injector,
|
||||
scanAdapter: ScanAdapterService,
|
||||
nativeContainer: NativeContainerService,
|
||||
nativeContainer: NativeContainerService
|
||||
) {
|
||||
return async () => {
|
||||
const statusElement = document.querySelector('#init-status');
|
||||
@@ -137,7 +135,6 @@ export function _notificationsHubOptionsFactory(config: Config, auth: AuthServic
|
||||
useClass: IsaErrorHandler,
|
||||
},
|
||||
{ provide: LOCALE_ID, useValue: 'de-DE' },
|
||||
provideMatomo({ trackerUrl: 'http://localhost:8080', siteId: '1' }, withRouter(), withRouteData()),
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
|
||||
@@ -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,3 +57,4 @@ import 'zone.js'; // Included with Angular CLI.
|
||||
/***************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
*/
|
||||
import 'hammerjs';
|
||||
|
||||
@@ -47,7 +47,7 @@ export class MockRemissionService extends RemissionService {
|
||||
>();
|
||||
private remissionSubjectIdRef = new Map<number, number>();
|
||||
|
||||
private reloadProductsSubject = new Subject<void>();
|
||||
private reloadProductsSubject = new Subject();
|
||||
private productSubject = new BehaviorSubject<RemissionProduct[]>(
|
||||
remissionProducts
|
||||
);
|
||||
|
||||
@@ -35,11 +35,7 @@
|
||||
</div>
|
||||
|
||||
<div class="branch-actions">
|
||||
<button
|
||||
*ngIf="(branch.id | stockInfo: (inStock$ | async))?.availableQuantity > 0 && branch?.isShippingEnabled"
|
||||
class="cta-reserve"
|
||||
(click)="reserve(branch)"
|
||||
>
|
||||
<button *ngIf="(branch.id | stockInfo: (inStock$ | async))?.availableQuantity > 0" class="cta-reserve" (click)="reserve(branch)">
|
||||
Reservieren
|
||||
</button>
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export class ModalAvailabilitiesComponent {
|
||||
(branch) =>
|
||||
branch &&
|
||||
branch?.isOnline &&
|
||||
// branch?.isShippingEnabled && ------ Rausgenommen aufgrund des Tickets #4712
|
||||
branch?.isShippingEnabled &&
|
||||
branch?.isOrderingEnabled &&
|
||||
branch?.id !== userbranch?.id &&
|
||||
branch?.branchType === 1
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
<ng-container *ngIf="isAvailable$ | async; else notAvailable">
|
||||
Archivtitel. Wird nicht mehr gedruckt. Artikel ist bestellbar, weil lieferbar.
|
||||
</ng-container>
|
||||
<ng-template #notAvailable> Archivtitel. Wird nicht mehr gedruckt. Nicht bestellbar. </ng-template>
|
||||
<ng-template #notAvailable>
|
||||
Archivtitel. Wird nicht mehr gedruckt. Nicht bestellbar.
|
||||
</ng-template>
|
||||
</ui-tooltip>
|
||||
</button>
|
||||
</div>
|
||||
@@ -42,7 +44,7 @@
|
||||
<img
|
||||
class="max-h-[19.6875rem] max-w-[12.1875rem] rounded"
|
||||
(load)="loadImage()"
|
||||
[src]="item.imageId | productImage: 195 : 315 : true"
|
||||
[src]="item.imageId | productImage: 195:315:true"
|
||||
alt="product image"
|
||||
/>
|
||||
<ui-icon
|
||||
@@ -105,7 +107,7 @@
|
||||
|
||||
<div class="page-article-details__product-price-info flex flex-col mb-4 flex-nowrap self-end">
|
||||
<div class="page-article-details__product-price font-bold text-xl self-end" *ngIf="price$ | async; let price">
|
||||
{{ price?.value?.value | currency: price?.value?.currency : 'code' }}
|
||||
{{ price?.value?.value | currency: price?.value?.currency:'code' }}
|
||||
</div>
|
||||
<div *ngIf="price$ | async; let price" class="page-article-details__product-price-bound self-end">
|
||||
{{ price?.vat?.vatType | vat: (priceMaintained$ | async) }}
|
||||
@@ -347,9 +349,6 @@
|
||||
*ngIf="store.item$ | async; let item"
|
||||
class="shadow-[#dce2e9_0px_-2px_18px_0px] mb-5 border-none outline-none flex items-center px-5 h-14 min-h-[3.5rem] bg-white w-full"
|
||||
(click)="showRecommendations = true"
|
||||
matomoClickCategory="prodict-details"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="recommendations"
|
||||
>
|
||||
<span class="uppercase text-[#0556B4] font-bold text-p3">Empfehlungen</span>
|
||||
<img class="absolute right-5 -top-[0.125rem] h-12" src="assets/images/recommendation_tag.png" alt="recommendation icon" />
|
||||
@@ -365,9 +364,6 @@
|
||||
*ngIf="!(store.isDownload$ | async)"
|
||||
class="text-brand border-2 border-brand bg-white font-bold text-lg px-[1.375rem] py-4 rounded-full mr-[1.875rem]"
|
||||
(click)="showAvailabilities()"
|
||||
matomoClickCategory="prodict-details"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="bestaende-in-anderen-filialen"
|
||||
>
|
||||
Bestände in anderen Filialen
|
||||
</button>
|
||||
@@ -375,9 +371,6 @@
|
||||
class="text-white bg-brand border-brand font-bold text-lg px-[1.375rem] py-4 rounded-full border-none no-underline"
|
||||
(click)="showPurchasingModal()"
|
||||
[disabled]="!(isAvailable$ | async) || (fetchingAvailabilities$ | async) || (item?.features && (item?.features)[0]?.key === 'PFO')"
|
||||
matomoClickCategory="prodict-details"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="in-den-Warenkorb"
|
||||
>
|
||||
In den Warenkorb
|
||||
</button>
|
||||
|
||||
@@ -141,7 +141,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
|
||||
this.store.deliveryB2BAvailability$,
|
||||
]).pipe(
|
||||
map((availabilities) => {
|
||||
return availabilities?.some((availability) => (availability as any)?.priceMaintained) ?? false;
|
||||
return availabilities?.some((availability) => availability?.priceMaintained) ?? false;
|
||||
})
|
||||
);
|
||||
|
||||
@@ -439,10 +439,11 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
|
||||
async navigateToResultList() {
|
||||
const processId = this.applicationService.activatedProcessId;
|
||||
let crumbs = await this.breadcrumb
|
||||
.getBreadcrumbsByKeyAndTags$(this.applicationService.activatedProcessId, ['catalog', 'details'])
|
||||
.getBreadcrumbsByKeyAndTags$(this.applicationService.activatedProcessId, ['catalog'])
|
||||
.pipe(first())
|
||||
.toPromise();
|
||||
|
||||
crumbs = crumbs.filter((crumb) => !crumb.tags?.includes('details'));
|
||||
const crumb = crumbs[crumbs.length - 1];
|
||||
if (!!crumb) {
|
||||
await this._navigationService.getArticleSearchResultsPath(processId, { queryParams: crumb.params }).navigate();
|
||||
|
||||
@@ -14,7 +14,6 @@ import { OrderDeadlinePipeModule } from '@shared/pipes/order-deadline';
|
||||
import { IconModule } from '@shared/components/icon';
|
||||
import { ArticleDetailsTextComponent } from './article-details-text/article-details-text.component';
|
||||
import { IconBadgeComponent } from 'apps/shared/components/icon/src/lib/badge/icon-badge.component';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -31,7 +30,6 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
OrderDeadlinePipeModule,
|
||||
ArticleDetailsTextComponent,
|
||||
IconBadgeComponent,
|
||||
MatomoModule,
|
||||
],
|
||||
exports: [ArticleDetailsComponent, ArticleRecommendationsComponent],
|
||||
declarations: [ArticleDetailsComponent, ArticleRecommendationsComponent],
|
||||
|
||||
@@ -24,7 +24,7 @@ import { FilterAutocompleteProvider } from '@shared/components/filter';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ArticleSearchComponent implements OnInit, OnDestroy {
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
private _processId$: Observable<number>;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -58,7 +58,7 @@ export class ArticleSearchFilterComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
constructor(
|
||||
private articleSearch: ArticleSearchService,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<div class="bg-white rounded py-10 px-4 text-center shadow-[0_-2px_24px_0_#dce2e9] h-full">
|
||||
<h1 class="text-h3 text-[1.625rem] font-bold mb-[0.375rem]">Artikelsuche</h1>
|
||||
<p class="text-lg mb-10">Welchen Artikel suchen Sie?</p>
|
||||
<p class="text-lg mb-10">
|
||||
Welchen Artikel suchen Sie?
|
||||
</p>
|
||||
<ng-container *ngIf="filter$ | async; let filter">
|
||||
<shared-filter-filter-group-main
|
||||
class="mb-8 w-full"
|
||||
@@ -36,9 +38,6 @@
|
||||
<button
|
||||
class="flex flex-row items-center outline-none border-none bg-white text-black text-p2 m-0 p-0"
|
||||
(click)="setQueryHistory(filter, recentQuery.friendlyName)"
|
||||
matomoClickCategory="search"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="recent-search"
|
||||
>
|
||||
<shared-icon
|
||||
class="flex w-8 h-8 justify-center items-center mr-3 rounded-full text-black bg-[#edeff0]"
|
||||
|
||||
@@ -4,10 +4,9 @@ import { ArticleSearchMainComponent } from './search-main.component';
|
||||
import { FilterModule } from '@shared/components/filter';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { IconComponent, IconModule } from '@shared/components/icon';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, RouterModule, IconComponent, FilterModule, IconModule, MatomoModule],
|
||||
imports: [CommonModule, RouterModule, IconComponent, FilterModule, IconModule],
|
||||
exports: [ArticleSearchMainComponent],
|
||||
declarations: [ArticleSearchMainComponent],
|
||||
providers: [],
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
class="page-search-result-item__item-price desktop-small:text-p3 font-bold justify-self-end"
|
||||
[class.page-search-result-item__item-price-primary]="primaryOutletActive"
|
||||
>
|
||||
{{ item?.catalogAvailability?.price?.value?.value | currency: 'EUR' : 'code' }}
|
||||
{{ item?.catalogAvailability?.price?.value?.value | currency: 'EUR':'code' }}
|
||||
</div>
|
||||
|
||||
<div class="page-search-result-item__item-select-bullet justify-self-end">
|
||||
@@ -75,14 +75,9 @@
|
||||
*ngIf="selectable"
|
||||
(click)="$event.stopPropagation()"
|
||||
[ngModel]="selected"
|
||||
(ngModelChange)="
|
||||
setSelected();
|
||||
tracker.trackEvent({ category: 'Trefferliste', action: 'select', name: item.product.name, value: selected ? 1 : 0 })
|
||||
"
|
||||
(ngModelChange)="setSelected()"
|
||||
class="isa-select-bullet"
|
||||
type="checkbox"
|
||||
matomoTracker
|
||||
#tracker="matomo"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
[hint]="searchboxHint$ | async"
|
||||
[loading]="fetching$ | async"
|
||||
[inputGroup]="filter?.input | group: 'main'"
|
||||
(search)="search({ filter, clear: true })"
|
||||
(search)="search({filter, clear: true})"
|
||||
[showDescription]="false"
|
||||
[scanner]="true"
|
||||
></shared-filter-input-group-main>
|
||||
@@ -32,7 +32,8 @@
|
||||
class="page-search-results__items-count inline-flex flex-row items-center pr-5 text-p3"
|
||||
[class.mb-4]="primaryOutletActive$ | async"
|
||||
>
|
||||
{{ hits ?? 0 }}
|
||||
{{ hits ??
|
||||
0 }}
|
||||
Titel
|
||||
</div>
|
||||
</div>
|
||||
@@ -74,9 +75,6 @@
|
||||
*ngIf="(selectedItemIds$ | async)?.length > 0"
|
||||
class="cta-cart cta-action-primary"
|
||||
(click)="addToCart()"
|
||||
matomoClickCategory="Trefferliste"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="In den Warenkorb legen"
|
||||
>
|
||||
<ui-spinner [show]="loading$ | async">In den Warenkorb legen</ui-spinner>
|
||||
</button>
|
||||
|
||||
@@ -155,7 +155,7 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
|
||||
const cleanQueryParams = this.cleanupQueryParams(queryParams);
|
||||
|
||||
if (processChanged) {
|
||||
if (this.route.outlet === 'primary' || processChanged) {
|
||||
this.scrollToItem(this._getScrollIndexFromCache());
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
}
|
||||
|
||||
private _getScrollIndexFromCache(): number {
|
||||
return this.cache.get<number>({ processId: this.getProcessId(), token: this.SCROLL_INDEX_TOKEN }) ?? 0;
|
||||
return this.cache.get<number>({ processId: this.getProcessId(), token: this.SCROLL_INDEX_TOKEN });
|
||||
}
|
||||
|
||||
scrollToItem(i?: number) {
|
||||
|
||||
@@ -19,7 +19,6 @@ import { FilterAutocompleteProvider, FilterModule, OrderByFilterModule } from '@
|
||||
import { FocusSearchboxEvent } from '../focus-searchbox.event';
|
||||
import { ArticleSearchMainAutocompleteProvider } from '../providers';
|
||||
import { IconComponent } from '@shared/components/icon';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -36,7 +35,6 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
UiTooltipModule,
|
||||
FilterModule,
|
||||
IconComponent,
|
||||
MatomoModule,
|
||||
],
|
||||
exports: [ArticleSearchResultsComponent, SearchResultItemComponent],
|
||||
declarations: [
|
||||
|
||||
@@ -6,45 +6,24 @@ import { ArticleSearchFilterComponent } from './article-search/search-filter/sea
|
||||
import { ArticleSearchMainComponent } from './article-search/search-main/search-main.component';
|
||||
import { ArticleSearchResultsComponent } from './article-search/search-results/search-results.component';
|
||||
import { PageCatalogComponent } from './page-catalog.component';
|
||||
import { MatomoRouteData } from 'ngx-matomo-client';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PageCatalogComponent,
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'filter',
|
||||
component: ArticleSearchFilterComponent,
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche - Filter',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'filter/:id',
|
||||
component: ArticleSearchFilterComponent,
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche - Filter',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'search',
|
||||
component: ArticleSearchComponent,
|
||||
outlet: 'side',
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
@@ -55,59 +34,29 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'results',
|
||||
component: ArticleSearchResultsComponent,
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche - Trefferliste',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'results',
|
||||
component: ArticleSearchResultsComponent,
|
||||
outlet: 'side',
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche - Trefferliste',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'results/:id',
|
||||
component: ArticleSearchResultsComponent,
|
||||
outlet: 'side',
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche - Artikeldetails',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'results/:ean/ean',
|
||||
component: ArticleSearchResultsComponent,
|
||||
outlet: 'side',
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche - Artikeldetails (EAN)',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'details/:id',
|
||||
component: ArticleDetailsComponent,
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche - Artikeldetails (ID)',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'details/:ean/ean',
|
||||
component: ArticleDetailsComponent,
|
||||
data: {
|
||||
matomo: {
|
||||
title: 'Artikelsuche - Artikeldetails (EAN)',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
|
||||
@@ -33,7 +33,7 @@ export class PageCatalogComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
return `${this.breadcrumbRef?.nativeElement?.clientWidth}px`;
|
||||
}
|
||||
|
||||
_onDestroy$ = new Subject<void>();
|
||||
_onDestroy$ = new Subject<boolean>();
|
||||
|
||||
get isTablet$() {
|
||||
return this._environmentService.matchTablet$;
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
<ng-container *ngIf="payer$ | async; let payer">
|
||||
<div *ngIf="showAddresses$ | async" class="flex flex-row items-start justify-between p-5 pt-0">
|
||||
<div class="flex flex-row flex-wrap pr-4" data-address-type="Rechnungsadresse" data-which="Rechnungsadresse">
|
||||
<div class="mr-3" data-what="title">Rechnungsadresse</div>
|
||||
<div class="font-bold" data-what="address">
|
||||
<div class="flex flex-row flex-wrap pr-4" data-address-type="Rechnungsadresse">
|
||||
<div class="mr-3">Rechnungsadresse</div>
|
||||
<div class="font-bold">
|
||||
{{ payer | payerAddress }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -47,9 +47,9 @@
|
||||
|
||||
<ng-container *ngIf="payer$ | async; let payer">
|
||||
<div *ngIf="showAddresses$ | async" class="flex flex-row items-start justify-between px-5">
|
||||
<div class="flex flex-row flex-wrap pr-4" data-address-type="Lieferadresse" data-which="Lieferadresse">
|
||||
<div class="mr-3" data-what="title">Lieferadresse</div>
|
||||
<div class="font-bold" data-what="address">
|
||||
<div class="flex flex-row flex-wrap pr-4" data-address-type="Lieferadresse">
|
||||
<div class="mr-3">Lieferadresse</div>
|
||||
<div class="font-bold">
|
||||
{{ shippingAddress$ | async | shippingAddress }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,14 +19,17 @@
|
||||
placeholder="Eine Anmerkung hinzufügen"
|
||||
[(ngModel)]="value"
|
||||
[rows]="rows"
|
||||
(ngModelChange)="updateValue()"
|
||||
(blur)="updateValue()"
|
||||
(ngModelChange)="check()"
|
||||
(blur)="save()"
|
||||
></textarea>
|
||||
|
||||
<div class="comment-actions py-4">
|
||||
<button type="reset" class="clear pl-4" *ngIf="!disabled && !!value" (click)="clear(); triggerResize()">
|
||||
<shared-icon icon="close" [size]="24"></shared-icon>
|
||||
</button>
|
||||
<button class="cta-save ml-4" type="submit" *ngIf="!disabled && isDirty" (click)="save()">
|
||||
Speichern
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ export class SpecialCommentComponent implements ControlValueAccessor {
|
||||
|
||||
clear() {
|
||||
this.value = '';
|
||||
this.updateValue();
|
||||
this.save();
|
||||
}
|
||||
|
||||
check() {
|
||||
@@ -80,12 +80,11 @@ export class SpecialCommentComponent implements ControlValueAccessor {
|
||||
this.cdr.markForCheck();
|
||||
}
|
||||
|
||||
updateValue() {
|
||||
save() {
|
||||
this.initialValue = this.value;
|
||||
this.onChange(this.value);
|
||||
this.check();
|
||||
}
|
||||
|
||||
setIsDirty(isDirty: boolean) {
|
||||
this.isDirty = isDirty;
|
||||
this.isDirtyChange.emit(isDirty);
|
||||
|
||||
@@ -33,7 +33,7 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
|
||||
|
||||
private _toaster = inject(ToasterService);
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
processId = Date.now();
|
||||
selectedDate = this.dateAdapter.today();
|
||||
minDateDatepicker = this.dateAdapter.addCalendarDays(this.dateAdapter.today(), -1);
|
||||
|
||||
@@ -141,7 +141,7 @@ export class CustomerOrderDetailsItemComponent extends ComponentStore<CustomerOr
|
||||
|
||||
more$ = this.select((s) => s.more);
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
get isNative() {
|
||||
return this._environment.isNative();
|
||||
|
||||
@@ -22,7 +22,7 @@ export class CustomerOrderSearchFilterComponent implements OnInit, OnDestroy {
|
||||
|
||||
processId = Number(this._activatedRoute?.parent?.snapshot?.data?.processId);
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
@ViewChild(FilterComponent, { static: false })
|
||||
uiFilter: FilterComponent;
|
||||
|
||||
@@ -23,7 +23,7 @@ import { CustomerOrdersNavigationService } from '@shared/services';
|
||||
],
|
||||
})
|
||||
export class CustomerOrderSearchComponent implements OnInit, OnDestroy {
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
private _processId$: Observable<number>;
|
||||
|
||||
get isTablet() {
|
||||
|
||||
@@ -201,8 +201,8 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
|
||||
|
||||
search = this.effect((options$: Observable<{ clear?: boolean; siletReload?: boolean }>) =>
|
||||
options$.pipe(
|
||||
tap((opt) => {
|
||||
this.searchStarted.next(opt);
|
||||
tap((_) => {
|
||||
this.searchStarted.next();
|
||||
this.patchState({ message: undefined });
|
||||
}),
|
||||
withLatestFrom(this.results$, this.filter$, this.selectedBranch$),
|
||||
|
||||
@@ -99,7 +99,7 @@ export class CustomerOrderSearchResultsComponent extends ComponentStore<Customer
|
||||
|
||||
processId$ = this._activatedRoute.parent.data.pipe(map((data) => +data.processId));
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
trackByFn: TrackByFunction<OrderItemListItemDTO> = (index, item) => `${item.orderId}${item.orderItemId}${item.orderItemSubsetId}`;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export class CustomerOrderComponent implements OnInit {
|
||||
return `${this.breadcrumbRef?.nativeElement?.clientWidth}px`;
|
||||
}
|
||||
|
||||
_onDestroy$ = new Subject<void>();
|
||||
_onDestroy$ = new Subject<boolean>();
|
||||
|
||||
get isTablet$() {
|
||||
return this._environmentService.matchTablet$;
|
||||
|
||||
@@ -197,7 +197,7 @@ export class CustomerTypeSelectorComponent extends ComponentStore<CustomerTypeSe
|
||||
setValue(value: { p4mUser?: boolean; customerType?: string } | string) {
|
||||
const initial = { p4mUser: this.p4mUser, customerType: this.customerType };
|
||||
|
||||
if (typeof value === 'string') {
|
||||
if (isString(value)) {
|
||||
this.value = value;
|
||||
} else {
|
||||
if (isBoolean(value.p4mUser)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { ChangeDetectorRef, Directive, OnDestroy, OnInit, ViewChild, inject } from '@angular/core';
|
||||
import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup, ValidationErrors, ValidatorFn } from '@angular/forms';
|
||||
import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { BreadcrumbService } from '@core/breadcrumb';
|
||||
import { CrmCustomerService } from '@domain/crm';
|
||||
@@ -190,47 +190,6 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
|
||||
this.cdr.markForCheck();
|
||||
}
|
||||
|
||||
minBirthDateValidator = (): ValidatorFn => {
|
||||
return (control: AbstractControl): ValidationErrors | null => {
|
||||
const minAge = 18; // 18 years
|
||||
|
||||
if (!control.value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const controlBirthDate = new Date(control.value);
|
||||
const minBirthDate = new Date();
|
||||
minBirthDate.setFullYear(minBirthDate.getFullYear() - minAge);
|
||||
|
||||
// Check if customer is over 18 years old
|
||||
if (this._checkIfAgeOver18(controlBirthDate, minBirthDate)) {
|
||||
return null;
|
||||
} else {
|
||||
return { minBirthDate: `Teilnahme ab ${minAge} Jahren` };
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
private _checkIfAgeOver18(inputDate: Date, minBirthDate: Date): boolean {
|
||||
// Check year
|
||||
if (inputDate.getFullYear() < minBirthDate.getFullYear()) {
|
||||
return true;
|
||||
}
|
||||
// Check Year + Month
|
||||
else if (inputDate.getFullYear() === minBirthDate.getFullYear() && inputDate.getMonth() < minBirthDate.getMonth()) {
|
||||
return true;
|
||||
}
|
||||
// Check Year + Month + Day
|
||||
else if (
|
||||
inputDate.getFullYear() === minBirthDate.getFullYear() &&
|
||||
inputDate.getMonth() === minBirthDate.getMonth() &&
|
||||
inputDate.getDate() <= minBirthDate.getDate()
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
emailExistsValidator: AsyncValidatorFn = (control) => {
|
||||
return of(control.value).pipe(
|
||||
tap((_) => this.customerExists$.next(false)),
|
||||
|
||||
@@ -70,9 +70,9 @@ export class CreateP4MCustomerComponent extends AbstractCreateCustomer implement
|
||||
|
||||
agbValidatorFns = [Validators.requiredTrue];
|
||||
|
||||
birthDateValidatorFns = [];
|
||||
birthDateValidatorFns = [Validators.required];
|
||||
|
||||
existingCustomer$: Observable<CustomerInfoDTO | CustomerDTO | null>;
|
||||
existingCustomer$: Observable<CustomerInfoDTO | null>;
|
||||
|
||||
ngOnInit(): void {
|
||||
super.ngOnInit();
|
||||
@@ -138,7 +138,6 @@ export class CreateP4MCustomerComponent extends AbstractCreateCustomer implement
|
||||
|
||||
initMarksAndValidators() {
|
||||
this.asyncLoyaltyCardValidatorFn = [this.checkLoyalityCardValidator];
|
||||
this.birthDateValidatorFns = [Validators.required, this.minBirthDateValidator()];
|
||||
if (this._customerType === 'webshop') {
|
||||
this.emailRequiredMark = true;
|
||||
this.emailValidatorFn = [Validators.required, Validators.email, validateEmail];
|
||||
|
||||
@@ -22,7 +22,7 @@ export class UpdateP4MWebshopCustomerComponent extends AbstractCreateCustomer im
|
||||
|
||||
agbValidatorFns = [Validators.requiredTrue];
|
||||
|
||||
birthDateValidatorFns = [Validators.required, this.minBirthDateValidator()];
|
||||
birthDateValidatorFns = [Validators.required];
|
||||
|
||||
nameRequiredMarks: (keyof NameFormBlockData)[] = ['gender', 'firstName', 'lastName'];
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface CustomerDetailsViewMainState {
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CustomerDetailsViewMainComponent extends ComponentStore<CustomerDetailsViewMainState> implements OnInit, OnDestroy {
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
customerService = inject(CrmCustomerService);
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<div class="header">
|
||||
<div class="cleanup-headline">
|
||||
<h1 class="cleanup-title">Abholfachbereinigung</h1>
|
||||
<h1 class="cleanup-title">
|
||||
Abholfachbereinigung
|
||||
</h1>
|
||||
<p class="cleanup-paragraph">
|
||||
Bitte nehmen Sie die<br />
|
||||
Artikel auf die Fläche.
|
||||
@@ -28,17 +30,12 @@
|
||||
*ngFor="let item of compartmentCodeGroup.items; let firstItem = first"
|
||||
[item]="item"
|
||||
[showCompartmentCode]="firstItem"
|
||||
(selectedChange)="
|
||||
setSelectedItem(item, $event);
|
||||
tracker.trackEvent({ category: 'goods-in-cleanup', action: 'select', name: 'order-item', value: $event ? 1 : 0 })
|
||||
"
|
||||
[selectable]="item | goodsInCleanupSelectable: selectionRules : selectedItems"
|
||||
(selectedChange)="setSelectedItem(item, $event)"
|
||||
[selectable]="item | goodsInCleanupSelectable: selectionRules:selectedItems"
|
||||
[selected]="item | goodsInCleanupSelected: selectedOrderItemSubsetIds"
|
||||
(click)="navigateToDetails(item)"
|
||||
[showSupplier]="true"
|
||||
[quantityEditable]="item.overallQuantity > 1 && (selectedOrderItemSubsetIds$ | async)?.includes(item.orderItemSubsetId)"
|
||||
matomoTracker
|
||||
#tracker="matomo"
|
||||
>
|
||||
</shared-goods-in-out-order-group-item>
|
||||
<div class="divider" *ngIf="!lastCompartmentCode"></div>
|
||||
@@ -66,9 +63,6 @@
|
||||
[class.cta-action-primary]="action.selected"
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
(click)="handleAction(action)"
|
||||
matomoClickCategory="goods-in-cleanup"
|
||||
matomoClickAction="click"
|
||||
[matomoClickName]="action.label"
|
||||
>
|
||||
<ui-spinner [show]="(changeActionLoader$ | async) || (loading$ | async)">{{ action.label }}</ui-spinner>
|
||||
</button>
|
||||
|
||||
@@ -8,10 +8,9 @@ import { UiSpinnerModule } from 'apps/ui/spinner/src/lib/ui-spinner.module';
|
||||
import { GoodsInCleanupListComponent } from './goods-in-cleanup-list.component';
|
||||
import { GoodsInCleanupSelectablePipe } from './goods-in-cleanup-selectable.pipe';
|
||||
import { GoodsInCleanupSelectedPipe } from './goods-in-cleanup-selected.pipe';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, UiCommonModule, GoodsInOutOrderGroupModule, UiSpinnerModule, UiScrollContainerModule, RouterModule, MatomoModule],
|
||||
imports: [CommonModule, UiCommonModule, GoodsInOutOrderGroupModule, UiSpinnerModule, UiScrollContainerModule, RouterModule],
|
||||
exports: [GoodsInCleanupListComponent],
|
||||
declarations: [GoodsInCleanupListComponent, GoodsInCleanupSelectablePipe, GoodsInCleanupSelectedPipe],
|
||||
providers: [],
|
||||
|
||||
@@ -25,16 +25,14 @@
|
||||
type="text"
|
||||
[ngModel]="ssc"
|
||||
(ngModelChange)="sscChange($event)"
|
||||
[matomoTracker]="['blur']"
|
||||
matomoCategory="goods-in-list-item"
|
||||
matomoAction="input"
|
||||
matomoName="meldenummer"
|
||||
/>
|
||||
|
||||
<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>
|
||||
@@ -44,7 +42,6 @@
|
||||
<img
|
||||
class="thumbnail"
|
||||
loading="lazy"
|
||||
[productImageNavigation]="orderItem?.product?.ean"
|
||||
*ngIf="orderItem?.product?.ean | productImage; let productImage"
|
||||
[src]="productImage"
|
||||
[alt]="orderItem?.product?.name"
|
||||
@@ -76,7 +73,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>
|
||||
@@ -101,14 +98,7 @@
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<button
|
||||
class="cta-reorder"
|
||||
(click)="showReorderModal(); $event.stopPropagation()"
|
||||
[disabled]="editSsc$ | async"
|
||||
matomoClickCategory="goods-in-list-item"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="nachbestellen"
|
||||
>
|
||||
<button class="cta-reorder" (click)="showReorderModal(); $event.stopPropagation()" [disabled]="editSsc$ | async">
|
||||
Nachbestellen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -123,7 +123,7 @@ export class GoodsInListItemComponent extends ComponentStore<GoodsInListItemComp
|
||||
shareReplay()
|
||||
);
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
constructor(
|
||||
private _omsService: DomainOmsService,
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NavigateOnClickDirective, ProductImageModule } from 'apps/cdn/product-image/src/public-api';
|
||||
import { ProductImageModule } from 'apps/cdn/product-image/src/public-api';
|
||||
import { UiIconModule } from '@ui/icon';
|
||||
import { UiInputModule } from '@ui/input';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { GoodsInListItemComponent } from './goods-in-list-item.component';
|
||||
import { PipesModule } from 'apps/shared/components/goods-in-out/src/lib/pipes/pipes.module';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
PipesModule,
|
||||
UiIconModule,
|
||||
ProductImageModule,
|
||||
FormsModule,
|
||||
UiInputModule,
|
||||
NavigateOnClickDirective,
|
||||
MatomoModule,
|
||||
],
|
||||
imports: [CommonModule, PipesModule, UiIconModule, ProductImageModule, FormsModule, UiInputModule],
|
||||
exports: [GoodsInListItemComponent],
|
||||
declarations: [GoodsInListItemComponent],
|
||||
providers: [],
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<div class="goods-in-list-headline">
|
||||
<h1 class="goods-in-list-title">Wareneingangsliste</h1>
|
||||
<h1 class="goods-in-list-title">
|
||||
Wareneingangsliste
|
||||
</h1>
|
||||
<p class="goods-in-list-paragraph">
|
||||
Vergeben Sie Meldenummern oder<br />
|
||||
bestellen Sie Artikel nach
|
||||
@@ -43,36 +45,18 @@
|
||||
</ng-template>
|
||||
|
||||
<div *ngIf="!(listEmpty$ | async)" class="actions">
|
||||
<button
|
||||
*ngIf="!editSsc"
|
||||
class="cta-edit-ssc cta-action-primary"
|
||||
(click)="editSsc = true"
|
||||
matomoClickCategory="goods-in-list"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="meldenummer-vergeben"
|
||||
>
|
||||
<button *ngIf="!editSsc" class="cta-edit-ssc cta-action-primary" (click)="editSsc = true">
|
||||
Meldenummern vergeben
|
||||
</button>
|
||||
|
||||
<ng-container *ngIf="editSsc">
|
||||
<button
|
||||
class="cta-cancel-ssc cta-action-secondary"
|
||||
(click)="cancelSsc()"
|
||||
matomoClickCategory="goods-in-list"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="meldenummer-vergeben-abbrechen"
|
||||
>
|
||||
<button class="cta-cancel-ssc cta-action-secondary" (click)="cancelSsc()">
|
||||
Abbrechen
|
||||
</button>
|
||||
<button
|
||||
class="cta-save-ssc cta-action-primary"
|
||||
(click)="saveSsc()"
|
||||
[disabled]="editSscDisabled$ | async"
|
||||
matomoClickCategory="goods-in-list"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="meldenummer-vergeben-speichern"
|
||||
>
|
||||
<ui-spinner [show]="showSaveSscSpinner$ | async"> Meldenummern speichern </ui-spinner>
|
||||
<button class="cta-save-ssc cta-action-primary" (click)="saveSsc()" [disabled]="editSscDisabled$ | async">
|
||||
<ui-spinner [show]="showSaveSscSpinner$ | async">
|
||||
Meldenummern speichern
|
||||
</ui-spinner>
|
||||
</button>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
||||
@@ -59,7 +59,7 @@ export class GoodsInListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
showSaveSscSpinner$ = new BehaviorSubject<boolean>(false);
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
private readonly SCROLL_POSITION_TOKEN = 'GOODS_IN_LIST_SCROLL_POSITION';
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import { UiSpinnerModule } from 'apps/ui/spinner/src/lib/ui-spinner.module';
|
||||
import { GoodsInListItemModule } from './goods-in-list-item/goods-in-list-item.module';
|
||||
|
||||
import { GoodsInListComponent } from './goods-in-list.component';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -19,7 +18,6 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
UiScrollContainerModule,
|
||||
UiOrderByFilterModule,
|
||||
UiSpinnerModule,
|
||||
MatomoModule,
|
||||
],
|
||||
exports: [],
|
||||
declarations: [GoodsInListComponent],
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<div class="header">
|
||||
<div class="reservations-headline">
|
||||
<h1 class="reservations-title">Reservierungsliste</h1>
|
||||
<h1 class="reservations-title">
|
||||
Reservierungsliste
|
||||
</h1>
|
||||
<p class="reservations-paragraph">
|
||||
Hier sehen Sie alle zu<br />
|
||||
reservierenden Bestellposten.
|
||||
@@ -29,17 +31,12 @@
|
||||
*ngFor="let item of compartmentCodeGroup.items; let firstItem = first"
|
||||
[item]="item"
|
||||
[showCompartmentCode]="firstItem"
|
||||
(selectedChange)="
|
||||
setSelectedItem(item, $event);
|
||||
tracker.trackEvent({ category: 'goods-in-reservation', action: 'select', name: 'order-item', value: $event ? 1 : 0 })
|
||||
"
|
||||
[selectable]="item | goodsInReservationSelectable: selectionRules : selectedItems"
|
||||
(selectedChange)="setSelectedItem(item, $event)"
|
||||
[selectable]="item | goodsInReservationSelectable: selectionRules:selectedItems"
|
||||
[selected]="item | goodsInReservationSelected: selectedOrderItemSubsetIds"
|
||||
[showInStock]="takeAwayAvailabilities$ | async"
|
||||
(click)="navigateToDetails(item)"
|
||||
[quantityEditable]="item.overallQuantity > 1 && (selectedOrderItemSubsetIds$ | async)?.includes(item.orderItemSubsetId)"
|
||||
matomoTracker
|
||||
#tracker="matomo"
|
||||
>
|
||||
</shared-goods-in-out-order-group-item>
|
||||
<div class="divider" *ngIf="!lastCompartmentCode"></div>
|
||||
@@ -52,7 +49,9 @@
|
||||
</ui-scroll-container>
|
||||
|
||||
<ng-template #emptyMessage>
|
||||
<div class="empty-message">Es sind derzeit keine Reservierungen offen.</div>
|
||||
<div class="empty-message">
|
||||
Es sind derzeit keine Reservierungen offen.
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<div class="actions" *ngIf="actions$ | async; let actions">
|
||||
@@ -63,9 +62,6 @@
|
||||
[class.cta-action-primary]="action.selected"
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
(click)="handleAction(action)"
|
||||
matomoClickCategory="goods-in-reservation"
|
||||
matomoClickAction="click"
|
||||
[matomoClickName]="action.label"
|
||||
>
|
||||
<ui-spinner [show]="(changeActionLoader$ | async) || (loading$ | async)">{{ action.label }}</ui-spinner>
|
||||
</button>
|
||||
|
||||
@@ -8,10 +8,9 @@ import { GoodsInReservationSelectablePipe } from './goods-in-reservation-selecta
|
||||
import { GoodsInReservationSelectedPipe } from './goods-in-reservation-selected.pipe';
|
||||
|
||||
import { GoodsInReservationComponent } from './goods-in-reservation.component';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, UiCommonModule, UiScrollContainerModule, GoodsInOutOrderGroupModule, UiSpinnerModule, MatomoModule],
|
||||
imports: [CommonModule, UiCommonModule, UiScrollContainerModule, GoodsInOutOrderGroupModule, UiSpinnerModule],
|
||||
exports: [GoodsInReservationComponent],
|
||||
declarations: [GoodsInReservationComponent, GoodsInReservationSelectablePipe, GoodsInReservationSelectedPipe],
|
||||
})
|
||||
|
||||
@@ -59,7 +59,7 @@ export class GoodsOutDetailsComponent extends ComponentStore<GoodsOutDetailsComp
|
||||
|
||||
processId$ = this._activatedRoute.parent.data.pipe(map((params) => +params.processId));
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
constructor(
|
||||
private _activatedRoute: ActivatedRoute,
|
||||
|
||||
@@ -37,7 +37,7 @@ export class GoodsOutSearchFilterComponent implements OnInit, OnDestroy {
|
||||
@Input()
|
||||
processId: number;
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
@ViewChild(UiFilterComponent, { static: false })
|
||||
uiFilter: UiFilterComponent;
|
||||
|
||||
@@ -30,7 +30,7 @@ import { GoodsOutSearchMainAutocompleteProvider } from './providers/goods-out-se
|
||||
],
|
||||
})
|
||||
export class GoodsOutSearchComponent implements OnInit, OnDestroy {
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
hasFilter$ = combineLatest([this._goodsOutSearchStore.filter$, this._goodsOutSearchStore.defaultSettings$]).pipe(
|
||||
map(([filter, defaultFilter]) => !isEqual(filter?.getQueryParams(), UiFilter.create(defaultFilter).getQueryParams()))
|
||||
|
||||
@@ -70,7 +70,7 @@ export class GoodsOutSearchResultsComponent extends ComponentStore<GoodsOutSearc
|
||||
|
||||
processId$ = this._activatedRoute.parent.data.pipe(map((data) => +data.processId));
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
trackByFn: TrackByFunction<OrderItemListItemDTO> = (index, item) => `${item.orderId}${item.orderItemId}${item.orderItemSubsetId}`;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</span>
|
||||
</ng-template>
|
||||
</div>
|
||||
<div data-which="Statusmeldung" class="text-right" *ngIf="!packageDetails?.package?.features?.['annotation']; else annotationTmpl">
|
||||
<div class="text-right" *ngIf="!packageDetails?.package?.features?.['annotation']; else annotationTmpl">
|
||||
<ng-container *ngIf="(packageDetails.package.arrivalStatus | arrivalStatus) === 'Fehlt'">
|
||||
<button
|
||||
class="isa-icon-button mr-2"
|
||||
@@ -52,13 +52,12 @@
|
||||
<div
|
||||
class="isa-label text-white font-bold page-package-details__arrival-status"
|
||||
[class]="packageDetails.package.arrivalStatus | arrivalStatusColorClass"
|
||||
data-what="arrival-status"
|
||||
>
|
||||
{{ packageDetails.package.arrivalStatus | arrivalStatus }}
|
||||
</div>
|
||||
</div>
|
||||
<ng-template #annotationTmpl>
|
||||
<div class="page-package-details__annotation text-right text-[#5A728A] col-span-2" data-what="annotation">
|
||||
<div class="text-right text-[#5A728A] col-span-2">
|
||||
{{ packageDetails?.package?.features?.['annotation'] }}
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
@@ -36,22 +36,12 @@
|
||||
|
||||
<page-pickup-shelf-details-tags class="mb-px-2" *ngIf="showTagsComponent$ | async"></page-pickup-shelf-details-tags>
|
||||
|
||||
<ng-container *ngIf="fetchingCoverItems$ | async; else coverItemsTmpl">
|
||||
<div class="bg-white grid grid-flow-col gap-5 justify-center items-center h-40">
|
||||
<shared-skeleton-loader class="h-16 w-12"></shared-skeleton-loader>
|
||||
<shared-skeleton-loader class="h-16 w-12"></shared-skeleton-loader>
|
||||
<shared-skeleton-loader class="h-16 w-12"></shared-skeleton-loader>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #coverItemsTmpl>
|
||||
<page-pickup-shelf-details-covers
|
||||
*ngIf="(coverOrderItems$ | async)?.length > 0"
|
||||
[coverItems]="coverOrderItems$ | async"
|
||||
[selectedOrderItem]="selectedItem$ | async"
|
||||
(coverClick)="coverClick($event)"
|
||||
></page-pickup-shelf-details-covers>
|
||||
</ng-template>
|
||||
<page-pickup-shelf-details-covers
|
||||
*ngIf="(coverOrderItems$ | async)?.length > 0"
|
||||
[coverItems]="coverOrderItems$ | async"
|
||||
[selectedOrderItem]="selectedItem$ | async"
|
||||
(coverClick)="coverClick($event)"
|
||||
></page-pickup-shelf-details-covers>
|
||||
</div>
|
||||
|
||||
<div class="page-pickup-shelf-in-details__action-wrapper">
|
||||
@@ -61,10 +51,7 @@
|
||||
[class.cta-action-primary]="action.selected"
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
*ngFor="let action of mainActions$ | async"
|
||||
(click)="handleAction({ action })"
|
||||
matomoClickCategory="pickup-shelf-in-details"
|
||||
matomoClickAction="click"
|
||||
[matomoClickName]="action.label"
|
||||
(click)="handleAction({action})"
|
||||
>
|
||||
<ui-spinner [show]="(changeActionLoader$ | async) === action.command">{{ action.label }}</ui-spinner>
|
||||
</button>
|
||||
@@ -76,13 +63,7 @@
|
||||
class="cta-action shadow-action"
|
||||
[class.cta-action-primary]="action.selected"
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
(click)="
|
||||
handleAction({
|
||||
action,
|
||||
latestCompartmentCode: latestCompartmentInfos?.latestCompartmentCode,
|
||||
latestCompartmentInfo: latestCompartmentInfos?.latestCompartmentInfo,
|
||||
})
|
||||
"
|
||||
(click)="handleAction({action, latestCompartmentCode: latestCompartmentInfos?.latestCompartmentCode, latestCompartmentInfo: latestCompartmentInfos?.latestCompartmentInfo })"
|
||||
>
|
||||
<ui-spinner [show]="(changeActionLoader$ | async) === action.command"
|
||||
>{{ latestDisplayedCompartmentInfos$ | async | addToPreviousCompartmentCodeLabelPipe }} zubuchen</ui-spinner
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, ChangeDetectionStrategy, inject, OnInit, AfterViewInit, ViewChild } from '@angular/core';
|
||||
import { Component, ChangeDetectionStrategy, inject, OnInit, AfterViewInit, ViewChild, OnDestroy } from '@angular/core';
|
||||
import { PickupShelfDetailsBaseComponent } from '../../pickup-shelf-details-base.component';
|
||||
import { AsyncPipe, NgFor, NgIf } from '@angular/common';
|
||||
import { PickUpShelfDetailsHeaderComponent } from '../../shared/pickup-shelf-details-header/pickup-shelf-details-header.component';
|
||||
@@ -18,8 +18,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { RunCheckTrigger } from '../../trigger';
|
||||
import { PickUpShelfDetailsItemsGroupComponent } from '../../shared/pickup-shelf-details-items-group/pickup-shelf-details-items-group.component';
|
||||
import { isEqual } from 'lodash';
|
||||
import { SkeletonLoaderComponent } from '@shared/components/loader';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-in-details',
|
||||
@@ -40,11 +38,9 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
PickupShelfAddToPreviousCompartmentCodeLabelPipe,
|
||||
UiSpinnerModule,
|
||||
OnInitDirective,
|
||||
SkeletonLoaderComponent,
|
||||
MatomoModule,
|
||||
],
|
||||
})
|
||||
export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseComponent implements OnInit, AfterViewInit {
|
||||
export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
runCheckTrigger = inject(RunCheckTrigger);
|
||||
|
||||
@ViewChild(PickUpShelfDetailsTagsComponent, { static: false })
|
||||
@@ -58,12 +54,12 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
|
||||
noOrderItemsFound$ = this.store.noOrderItemsFound$;
|
||||
|
||||
fetchingOrder$ = this.store.fetchingOrder$;
|
||||
fetching$ = this.store.fetchingOrder$;
|
||||
fetchingItems$ = this.store.fetchingOrderItems$;
|
||||
fetchingCoverItems$ = this.store.fetchingCoverOrderItems$;
|
||||
|
||||
viewFetching$ = combineLatest([this.fetchingItems$, this.orderItems$]).pipe(
|
||||
map(([fetchingItems, orderItems]) => fetchingItems && orderItems.length === 0),
|
||||
viewFetching$ = combineLatest([this.fetching$, this.fetchingItems$, this.fetchingCoverItems$]).pipe(
|
||||
map(([fetching, fetchingItems, fetchingCoverItems]) => fetching || fetchingItems || fetchingCoverItems)
|
||||
);
|
||||
|
||||
selectedCompartmentInfo = this.store.selectedCompartmentInfo;
|
||||
@@ -95,17 +91,14 @@ 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();
|
||||
}
|
||||
|
||||
@@ -115,22 +108,22 @@ 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
|
||||
if (!!selectedItem && this.store.selectPreviousSelectedOrderItemSubsetId !== orderItemSubsetId) {
|
||||
this.store.setPreviousSelectedOrderItemSubsetId(orderItemSubsetId); // Wichtig das die ID im Store vorhanden bleibt um z.B. für die Filter eine zurücknavigation zu ermöglichen
|
||||
this.store.selectOrderItem(selectedItem, true); // Wird automatisch unselected wenn die Details Seite verlassen wird
|
||||
this.store.fetchCoverOrderItems();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Fix #4696 - Always Fetch Cover Order Items
|
||||
this._activatedRoute.params.pipe(distinctUntilChanged(isEqual), takeUntilDestroyed(this.destroyRef)).subscribe((_) => {
|
||||
if (!this.store.coverOrderItems || this.store.coverOrderItems.length === 0) {
|
||||
this.store.fetchCoverOrderItems();
|
||||
}
|
||||
});
|
||||
ngOnDestroy(): void {
|
||||
// Fix #4696 - Clear the previous selected orderItemSubsetId from store after leaving Details page
|
||||
// Es gab Fälle, in denen beim erneuten Aufruf der Details Seite, die vorherige ID noch im Store vorhanden war und deshalb der code in ngOnInit nicht ausgeführt wurde
|
||||
this.store.setPreviousSelectedOrderItemSubsetId(undefined);
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
@@ -181,7 +174,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
},
|
||||
side: false,
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' },
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
this.listStore.patchOrderItem({
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
@@ -225,21 +218,20 @@ 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:
|
||||
@@ -263,9 +255,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' }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -280,9 +272,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' }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -306,7 +298,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
},
|
||||
side: this.side,
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' },
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
} else {
|
||||
if (orderItems.every((item) => item.processingStatus === 128)) {
|
||||
|
||||
@@ -50,7 +50,7 @@ export class PickupShelfInEditComponent extends PickupShelfDetailsBaseComponent
|
||||
},
|
||||
side: this.side,
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' },
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import { CacheService } from '@core/cache';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { PickupShelfListItemLoaderComponent } from '../../shared/pickup-shelf-list-item/pickup-shelf-list-item-loader.component';
|
||||
import { ScrollContainerDirective } from '@shared/directives/scroll-container';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-in-list',
|
||||
@@ -77,7 +76,7 @@ export class PickUpShelfInListComponent implements OnInit, AfterViewInit {
|
||||
map(([filter, defaultFilter]) => {
|
||||
const filterQueryParams = filter?.getQueryParams();
|
||||
return !isEqual(filterQueryParams, Filter.create(defaultFilter).getQueryParams());
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
fetching$: Observable<boolean> = this.store.fetchingList$;
|
||||
@@ -118,7 +117,7 @@ export class PickUpShelfInListComponent implements OnInit, AfterViewInit {
|
||||
private _activatedRoute: ActivatedRoute,
|
||||
private _pickUpShelfInNavigation: PickupShelfInNavigationService,
|
||||
private _cache: CacheService,
|
||||
private _router: Router,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
(click)="showFilter.emit()"
|
||||
class="page-pickup-shelf-in-main__filter w-[6.75rem] h-14 rounded font-bold px-5 mb-4 text-lg bg-[#AEB7C1] flex flex-row flex-nowrap items-center justify-center"
|
||||
[class.active]="hasFilter$ | async"
|
||||
matomoClickAction="open"
|
||||
matomoClickCategory="filter"
|
||||
>
|
||||
<shared-icon class="mr-2" icon="filter-variant"></shared-icon>
|
||||
Filter
|
||||
|
||||
@@ -7,7 +7,6 @@ import { isEqual } from 'lodash';
|
||||
import { Observable, combineLatest } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { PickupShelfStore } from '../../store';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-in-main-side-view',
|
||||
@@ -16,7 +15,7 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
standalone: true,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
host: { class: 'page-pickup-shelf-in-main-side-view' },
|
||||
imports: [FilterModule, AsyncPipe, NgIf, IconModule, MatomoModule],
|
||||
imports: [FilterModule, AsyncPipe, NgIf, IconModule],
|
||||
})
|
||||
export class PickUpShelfInMainSideViewComponent implements OnInit {
|
||||
@Output() showFilter = new EventEmitter<void>();
|
||||
@@ -36,7 +35,7 @@ export class PickUpShelfInMainSideViewComponent implements OnInit {
|
||||
map(([filter, defaultFilter]) => {
|
||||
const filterQueryParams = filter?.getQueryParams();
|
||||
return !isEqual(filterQueryParams, Filter.create(defaultFilter).getQueryParams());
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
fetching$: Observable<boolean> = this.store.fetchingList$;
|
||||
|
||||
@@ -97,10 +97,6 @@ export class PickupShelfInComponent extends PickupShelfBaseComponent {
|
||||
|
||||
const order = await this.detailsStore.order$.pipe(take(1)).toPromise();
|
||||
|
||||
if (!order) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (order?.orderNumber) {
|
||||
return order?.orderNumber;
|
||||
}
|
||||
@@ -115,12 +111,6 @@ export class PickupShelfInComponent extends PickupShelfBaseComponent {
|
||||
const orderItemSubsetId = this.detailsStore.orderItemSubsetId;
|
||||
const compartmentInfo = this.detailsStore.compartmentInfo;
|
||||
|
||||
// Ticket #4692 - Wenn keine Order vorhanden ist, dann soll Breadcrumb nicht erstellt werden
|
||||
// Dies kann z.B. passieren bei Datenbankproblemen wenn das Fetchen der Order sehr lange braucht
|
||||
if (!order) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this._pickupShelfInNavigationService.detailRoute({
|
||||
item: {
|
||||
orderId: order?.id,
|
||||
|
||||
@@ -8,7 +8,6 @@ import { PickUpShelfInMainSideViewComponent } from './pickup-shelf-in-main-side-
|
||||
import { PickUpShelfInMainComponent } from './pickup-shelf-in-main/pickup-shelf-in-main.component';
|
||||
import { PickUpShelfInListComponent } from './pickup-shelf-in-list/pickup-shelf-in-list.component';
|
||||
import { PickupShelfInEditComponent } from './pickup-shelf-in-edit/pickup-shelf-in-edit.component';
|
||||
import { MatomoRouteData } from 'ngx-matomo-client';
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
@@ -19,125 +18,53 @@ export const routes: Routes = [
|
||||
},
|
||||
runGuardsAndResolvers: 'always',
|
||||
children: [
|
||||
{
|
||||
path: 'main',
|
||||
component: PickUpShelfInMainComponent,
|
||||
data: {
|
||||
view: 'main',
|
||||
matomo: {
|
||||
title: 'Abholfach',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'list',
|
||||
component: PickUpShelfInListComponent,
|
||||
data: {
|
||||
view: 'list',
|
||||
matomo: {
|
||||
title: 'Abholfach - Trefferliste',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'list/filter',
|
||||
component: PickupShelfFilterComponent,
|
||||
data: {
|
||||
view: 'filter',
|
||||
matomo: {
|
||||
title: 'Abholfach - Filter',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
},
|
||||
{ path: 'main', component: PickUpShelfInMainComponent, data: { view: 'main' } },
|
||||
{ path: 'list', component: PickUpShelfInListComponent, data: { view: 'list' } },
|
||||
{ path: 'list/filter', component: PickupShelfFilterComponent, data: { view: 'filter' } },
|
||||
{
|
||||
path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus/:orderItemSubsetId/edit',
|
||||
component: PickupShelfInEditComponent,
|
||||
data: {
|
||||
view: 'edit',
|
||||
matomo: {
|
||||
title: 'Abholfach - Bearbeiten',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'edit' },
|
||||
},
|
||||
{
|
||||
path: 'order/:orderId/compartment/:compartmentCode/:orderItemSubsetId/edit',
|
||||
component: PickupShelfInEditComponent,
|
||||
data: {
|
||||
view: 'edit',
|
||||
matomo: {
|
||||
title: 'Abholfach - Bearbeiten',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'edit' },
|
||||
},
|
||||
{
|
||||
path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/:orderItemSubsetId/edit',
|
||||
component: PickupShelfInEditComponent,
|
||||
data: {
|
||||
view: 'edit',
|
||||
matomo: {
|
||||
title: 'Abholfach - Bearbeiten',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'edit' },
|
||||
},
|
||||
{
|
||||
path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus/:orderItemSubsetId/history',
|
||||
component: PickUpShelfHistoryComponent,
|
||||
data: {
|
||||
view: 'history',
|
||||
matomo: {
|
||||
title: 'Abholfach - Historie',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'history' },
|
||||
},
|
||||
{
|
||||
path: 'order/:orderId/compartment/:compartmentCode/:orderItemSubsetId/history',
|
||||
component: PickUpShelfHistoryComponent,
|
||||
data: {
|
||||
view: 'history',
|
||||
matomo: {
|
||||
title: 'Abholfach - Historie',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'history' },
|
||||
},
|
||||
{
|
||||
path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/:orderItemSubsetId/history',
|
||||
component: PickUpShelfHistoryComponent,
|
||||
data: {
|
||||
view: 'history',
|
||||
matomo: {
|
||||
title: 'Abholfach - Historie',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'history' },
|
||||
},
|
||||
{
|
||||
path: 'order/:orderId/:orderNumber/item/status/:orderItemProcessingStatus/:orderItemSubsetId',
|
||||
component: PickupShelfInDetailsComponent,
|
||||
data: {
|
||||
view: 'details',
|
||||
matomo: {
|
||||
title: 'Abholfach - Details',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'details' },
|
||||
},
|
||||
{
|
||||
path: 'order/:orderId/compartment/:compartmentCode/:orderItemSubsetId',
|
||||
component: PickupShelfInDetailsComponent,
|
||||
data: {
|
||||
view: 'details',
|
||||
matomo: {
|
||||
title: 'Abholfach - Details',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'details' },
|
||||
},
|
||||
{
|
||||
path: 'order/:orderId/compartment/:compartmentCode/:compartmentInfo/:orderItemSubsetId',
|
||||
component: PickupShelfInDetailsComponent,
|
||||
data: {
|
||||
view: 'details',
|
||||
matomo: {
|
||||
title: 'Abholfach - Details',
|
||||
} as MatomoRouteData,
|
||||
},
|
||||
data: { view: 'details' },
|
||||
},
|
||||
{ path: 'search', component: PickUpShelfInMainSideViewComponent, outlet: 'side' },
|
||||
{ path: 'list', component: PickUpShelfInListComponent, data: { view: 'list' }, outlet: 'side' },
|
||||
|
||||
@@ -47,9 +47,6 @@
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
*ngFor="let action of mainActions$ | async"
|
||||
(click)="handleAction(action)"
|
||||
matomoClickCategory="pickup-shelf-out-details"
|
||||
matomoClickAction="click"
|
||||
[matomoClickName]="action.label"
|
||||
>
|
||||
<ui-spinner [show]="(changeActionLoader$ | async) === action.command">{{ action.label }}</ui-spinner>
|
||||
</button>
|
||||
|
||||
@@ -14,7 +14,6 @@ import { OnInitDirective } from '@shared/directives/element-lifecycle';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { RunCheckTrigger } from '../../trigger';
|
||||
import { PickUpShelfDetailsItemsGroupComponent } from '../../shared/pickup-shelf-details-items-group/pickup-shelf-details-items-group.component';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-out-details',
|
||||
@@ -34,7 +33,6 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
UiSpinnerModule,
|
||||
OnInitDirective,
|
||||
FormsModule,
|
||||
MatomoModule,
|
||||
],
|
||||
providers: [],
|
||||
})
|
||||
@@ -48,9 +46,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
|
||||
|
||||
order$ = this.store.order$;
|
||||
|
||||
orderItems$ = this.store.orderItems$;
|
||||
|
||||
groupedItems$: Observable<Array<{ type: string; items: DBHOrderItemListItemDTO[] }>> = this.orderItems$.pipe(
|
||||
groupedItems$: Observable<Array<{ type: string; items: DBHOrderItemListItemDTO[] }>> = this.store.orderItems$.pipe(
|
||||
map((items) => {
|
||||
const groups: Array<{ type: string; items: DBHOrderItemListItemDTO[] }> = [];
|
||||
|
||||
@@ -67,15 +63,13 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
|
||||
}
|
||||
|
||||
return groups;
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
fetchingOrder$ = this.store.fetchingOrder$;
|
||||
fetching$ = this.store.fetchingOrder$;
|
||||
fetchingItems$ = this.store.fetchingOrderItems$;
|
||||
|
||||
viewFetching$ = combineLatest([this.orderItems$, this.fetchingItems$]).pipe(
|
||||
map(([orderItems, fetchingItems]) => orderItems?.length === 0 && fetchingItems),
|
||||
);
|
||||
viewFetching$ = combineLatest([this.fetching$, this.fetchingItems$]).pipe(map(([fetching, fetchingItems]) => fetching || fetchingItems));
|
||||
|
||||
selectedCompartmentInfo = this.store.selectedCompartmentInfo;
|
||||
|
||||
@@ -131,7 +125,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
|
||||
compartmentInfo: item.compartmentInfo,
|
||||
},
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' },
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -154,21 +148,20 @@ 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:
|
||||
@@ -193,7 +186,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
|
||||
compartmentInfo: orderItem.compartmentInfo,
|
||||
},
|
||||
}).path,
|
||||
{ queryParams: { buyerNumber: orderItem?.buyerNumber }, queryParamsHandling: 'merge' },
|
||||
{ queryParams: { buyerNumber: orderItem?.buyerNumber }, queryParamsHandling: 'merge' }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -209,7 +202,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
|
||||
compartmentInfo: orderItem.compartmentInfo,
|
||||
},
|
||||
}).path,
|
||||
{ queryParams: { orderItemSubsetId: orderItem.orderItemSubsetId }, queryParamsHandling: 'merge' },
|
||||
{ queryParams: { orderItemSubsetId: orderItem.orderItemSubsetId }, queryParamsHandling: 'merge' }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
class="page-pickup-shelf-out-list__items-count inline-flex flex-row items-center pr-5 text-p3"
|
||||
[class.mb-4]="primaryOutletActive$ | async"
|
||||
>
|
||||
{{ hits ?? 0 }}
|
||||
{{ hits ??
|
||||
0 }}
|
||||
Titel
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,9 +89,6 @@
|
||||
[class.cta-action-primary]="action.selected"
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
(click)="handleAction(action)"
|
||||
matomoClickCategory="pickup-shelf-out-list"
|
||||
matomoClickAction="click"
|
||||
[matomoClickName]="action.label"
|
||||
>
|
||||
<ui-spinner [show]="(loadingFetchedActionButton$ | async) || (fetching$ | async)">{{ action.label }}</ui-spinner>
|
||||
</button>
|
||||
|
||||
@@ -30,7 +30,6 @@ import { ActionHandlerService } from '../../services/action-handler.service';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { CacheService } from '@core/cache';
|
||||
import { ScrollContainerDirective } from '@shared/directives/scroll-container';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pcikup-shelf-out-list',
|
||||
@@ -51,7 +50,6 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
GroupByPipe,
|
||||
UiSpinnerModule,
|
||||
PickupShelfListItemLoaderComponent,
|
||||
MatomoModule,
|
||||
],
|
||||
})
|
||||
export class PickupShelfOutListComponent implements OnInit, AfterViewInit {
|
||||
@@ -82,7 +80,7 @@ export class PickupShelfOutListComponent implements OnInit, AfterViewInit {
|
||||
map(([filter, defaultFilter]) => {
|
||||
const filterQueryParams = filter?.getQueryParams();
|
||||
return !isEqual(filterQueryParams, Filter.create(defaultFilter).getQueryParams());
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
fetching$: Observable<boolean> = this.store.fetchingList$;
|
||||
@@ -122,9 +120,9 @@ export class PickupShelfOutListComponent implements OnInit, AfterViewInit {
|
||||
|
||||
actions$ = combineLatest([this.list$, this.selectedIds$]).pipe(
|
||||
map(([items, selectedIds]) =>
|
||||
items?.find((item) => selectedIds.find((orderItemSubsetId) => item.orderItemSubsetId === orderItemSubsetId)),
|
||||
items?.find((item) => selectedIds.find((orderItemSubsetId) => item.orderItemSubsetId === orderItemSubsetId))
|
||||
),
|
||||
map((item) => item?.actions?.filter((action) => this.selectionRules(action))),
|
||||
map((item) => item?.actions?.filter((action) => this.selectionRules(action)))
|
||||
);
|
||||
|
||||
loadingFetchedActionButton$ = new BehaviorSubject<boolean>(false);
|
||||
@@ -137,7 +135,7 @@ export class PickupShelfOutListComponent implements OnInit, AfterViewInit {
|
||||
private _uiModal: UiModalService,
|
||||
private _pickUpShelfOutNavigation: PickUpShelfOutNavigationService,
|
||||
private _cache: CacheService,
|
||||
private _router: Router,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -192,7 +190,7 @@ export class PickupShelfOutListComponent implements OnInit, AfterViewInit {
|
||||
|
||||
getSelectedItem$(item: DBHOrderItemListItemDTO) {
|
||||
return this.store.selectedListItems$.pipe(
|
||||
map((selectedListItems) => selectedListItems?.find((i) => i?.orderItemSubsetId === item?.orderItemSubsetId)),
|
||||
map((selectedListItems) => selectedListItems?.find((i) => i?.orderItemSubsetId === item?.orderItemSubsetId))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -206,7 +204,7 @@ export class PickupShelfOutListComponent implements OnInit, AfterViewInit {
|
||||
} else {
|
||||
return item?.actions?.some((action) => this.selectionRules(action));
|
||||
}
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { PickupShelfIOService, PickupShelfOutService } from '@domain/pickup-shel
|
||||
import { GetNameForBreadcrumbData, GetPathForBreadcrumbData, PickupShelfBaseComponent } from '../pickup-shelf-base.component';
|
||||
import { NavigationRoute, PickUpShelfOutNavigationService } from '@shared/services';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import { DBHOrderItemListItemDTO } from '@swagger/oms';
|
||||
import { DBHOrderItemListItemDTO, ListResponseArgsOfDBHOrderItemListItemDTO } from '@swagger/oms';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { provideActionHandlers } from '@core/command';
|
||||
@@ -212,7 +212,7 @@ export class PickupShelfOutComponent extends PickupShelfBaseComponent {
|
||||
*/
|
||||
const filterQueryParams = this.listStore.filter.getQueryParams();
|
||||
|
||||
if (response.hits === 1) {
|
||||
if (response.hits === 1 || this._hasSameOrderNumber(response)) {
|
||||
const detailsPath = await this.getPathForDetail(response.result[0]).pipe(take(1)).toPromise();
|
||||
await this.router.navigate(detailsPath.path, { queryParams: { ...queryParams, ...filterQueryParams, ...detailsPath.queryParams } });
|
||||
} else if (response.hits > 1) {
|
||||
@@ -224,13 +224,10 @@ export class PickupShelfOutComponent extends PickupShelfBaseComponent {
|
||||
});
|
||||
}
|
||||
|
||||
// Ticket 4720 WA // Trefferliste wird übersprungen - Bei mehreren Bestellposten pro Bestellung soll IMMER auf Trefferliste navigiert werden
|
||||
// Damit werden #4684 und #4688 überflüssig
|
||||
|
||||
// REMOVED: Fix Ticket #4684 Navigate on Details if items contain same OrderNumber
|
||||
// private _hasSameOrderNumber(response: ListResponseArgsOfDBHOrderItemListItemDTO) {
|
||||
// if (response.hits === 0) return false;
|
||||
// const orderNumbers = new Set(response.result.map((item) => item.orderNumber));
|
||||
// return orderNumbers.size === 1;
|
||||
// }
|
||||
// Fix Ticket #4684 Navigate on Details if items contain same OrderNumber
|
||||
private _hasSameOrderNumber(response: ListResponseArgsOfDBHOrderItemListItemDTO) {
|
||||
if (response.hits === 0) return false;
|
||||
const orderNumbers = new Set(response.result.map((item) => item.orderNumber));
|
||||
return orderNumbers.size === 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
[routerLink]="customerDetailsRoute.path"
|
||||
[queryParams]="customerDetailsRoute.queryParams"
|
||||
[queryParamsHandling]="'merge'"
|
||||
matomoClickCategory="pickup-shelf-details-header-nav-menu"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="customer-details"
|
||||
>Kundendetails</a
|
||||
>
|
||||
<a
|
||||
@@ -30,9 +27,6 @@
|
||||
[routerLink]="ordersRoute.path"
|
||||
[queryParams]="ordersRoute.queryParams"
|
||||
[queryParamsHandling]="'merge'"
|
||||
matomoClickCategory="pickup-shelf-details-header-nav-menu"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="customer-orders"
|
||||
>Bestellungen</a
|
||||
>
|
||||
</shared-menu>
|
||||
|
||||
@@ -8,7 +8,6 @@ import { IconComponent } from '@shared/components/icon';
|
||||
import { SharedMenuModule } from '@shared/components/menu';
|
||||
import { CustomerSearchNavigation } from '@shared/services';
|
||||
import { CustomerInfoDTO } from '@swagger/crm';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@@ -24,7 +23,7 @@ export interface PickUpShelfDetailsHeaderNavMenuComponentState {
|
||||
standalone: true,
|
||||
host: { class: 'page-pickup-shelf-details-header-nav-menu' },
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [CdkMenuModule, SharedMenuModule, IconComponent, RouterLink, NgIf, AsyncPipe, MatomoModule],
|
||||
imports: [CdkMenuModule, SharedMenuModule, IconComponent, RouterLink, NgIf, AsyncPipe],
|
||||
})
|
||||
export class PickUpShelfDetailsHeaderNavMenuComponent extends ComponentStore<PickUpShelfDetailsHeaderNavMenuComponentState> {
|
||||
@Input() set customer(value: CustomerInfoDTO) {
|
||||
@@ -40,14 +39,14 @@ export class PickUpShelfDetailsHeaderNavMenuComponent extends ComponentStore<Pic
|
||||
readonly showCustomerDetails$ = this.select((state) => state.showCustomerDetails);
|
||||
|
||||
ordersRoute$ = this.customer$.pipe(
|
||||
map((customer) => !!customer && this._navigation.ordersRoute({ processId: Date.now(), customerId: customer?.id, customer })),
|
||||
map((customer) => !!customer && this._navigation.ordersRoute({ processId: Date.now(), customerId: customer?.id, customer }))
|
||||
);
|
||||
|
||||
customerDetailsRoute$ = combineLatest([this.showCustomerDetails$, this.customer$]).pipe(
|
||||
map(
|
||||
([showCustomerDetails, customer]) =>
|
||||
showCustomerDetails && !!customer && this._navigation.detailsRoute({ processId: Date.now(), customerId: customer?.id, customer }),
|
||||
),
|
||||
showCustomerDetails && !!customer && this._navigation.detailsRoute({ processId: Date.now(), customerId: customer?.id, customer })
|
||||
)
|
||||
);
|
||||
|
||||
constructor(private _navigation: CustomerSearchNavigation) {
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<ng-container *ngIf="orderItem$ | async; let orderItem">
|
||||
<div class="grid grid-flow-row gap-px-2">
|
||||
<div class="bg-[#F5F7FA] flex flex-row justify-between items-center p-4 rounded-t">
|
||||
<div class="grid grid-flow-col gap-[0.4375rem] items-center" *ngIf="fetchingCustomerDone$ | async; else featureLoading">
|
||||
<ng-container *ngIf="features$ | async; let features">
|
||||
<shared-icon *ngIf="features?.length > 0" [size]="24" icon="person"></shared-icon>
|
||||
<div class="grid grid-flow-col gap-2 items-center font-bold text-p2" *ngFor="let feature of features">
|
||||
{{ feature?.description }}
|
||||
</div>
|
||||
</ng-container>
|
||||
<div class="grid grid-flow-col gap-[0.4375rem] items-center" *ngIf="features$ | async; let features; else: featureLoading">
|
||||
<shared-icon *ngIf="features?.length > 0" [size]="24" icon="person"></shared-icon>
|
||||
<div class="grid grid-flow-col gap-2 items-center font-bold text-p2" *ngFor="let feature of features">
|
||||
{{ feature?.description }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
@@ -15,9 +13,6 @@
|
||||
class="page-pickup-shelf-details-header__edit-cta bg-transparent text-brand font-bold border-none text-p1"
|
||||
*ngIf="editClick.observers.length"
|
||||
(click)="editClick.emit(orderItem)"
|
||||
matomoClickCategory="pickup-shelf-details-header"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="edit"
|
||||
>
|
||||
Bearbeiten
|
||||
</button>
|
||||
@@ -79,9 +74,6 @@
|
||||
[uiOverlayTrigger]="statusDropdown"
|
||||
[disabled]="changeStatusDisabled$ | async"
|
||||
#dropdown="uiOverlayTrigger"
|
||||
matomoClickCategory="pickup-shelf-details-header"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="status-dropdown"
|
||||
>
|
||||
<div class="mr-[0.375rem]">
|
||||
{{ orderItem?.processingStatus | processingStatus }}
|
||||
@@ -94,14 +86,7 @@
|
||||
></shared-icon>
|
||||
</button>
|
||||
<ui-dropdown #statusDropdown yPosition="below" xPosition="after" [xOffset]="8">
|
||||
<button
|
||||
uiDropdownItem
|
||||
*ngFor="let action of statusActions$ | async"
|
||||
(click)="handleActionClick(action)"
|
||||
matomoClickCategory="pickup-shelf-details-header"
|
||||
matomoClickAction="select"
|
||||
[matomoClickName]="action.label"
|
||||
>
|
||||
<button uiDropdownItem *ngFor="let action of statusActions$ | async" (click)="handleActionClick(action)">
|
||||
{{ action.label }}
|
||||
</button>
|
||||
</ui-dropdown>
|
||||
@@ -111,12 +96,7 @@
|
||||
</div>
|
||||
<div class="flex flex-row page-pickup-shelf-details-header__order-source" data-detail-id="Bestellkanal">
|
||||
<div class="min-w-[9rem]">Bestellkanal</div>
|
||||
<div class="flex flex-row font-bold">
|
||||
<shared-skeleton-loader class="w-32" *ngIf="fetchingOrder$ | async; else orderSourceTmpl"></shared-skeleton-loader>
|
||||
<ng-template #orderSourceTmpl>
|
||||
{{ order()?.features?.orderSource }}
|
||||
</ng-template>
|
||||
</div>
|
||||
<div class="flex flex-row font-bold">{{ order?.features?.orderSource }}</div>
|
||||
</div>
|
||||
<div
|
||||
class="flex flex-row page-pickup-shelf-details-header__change-date justify-between"
|
||||
@@ -157,29 +137,29 @@
|
||||
data-detail-id="Benachrichtigung"
|
||||
>
|
||||
<div class="min-w-[9rem]">Benachrichtigung</div>
|
||||
<div class="flex flex-row font-bold">
|
||||
<shared-skeleton-loader class="w-32" *ngIf="fetchingOrder$ | async; else notificationsChannelTpl"></shared-skeleton-loader>
|
||||
<ng-template #notificationsChannelTpl>
|
||||
{{ (notificationsChannel$ | async | notificationsChannel) || '-' }}
|
||||
</ng-template>
|
||||
</div>
|
||||
<div class="flex flex-row font-bold">{{ (notificationsChannel$ | async | notificationsChannel) || '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #featureLoading>
|
||||
<div class="fetch-wrapper">
|
||||
<div class="fetching"></div>
|
||||
<div class="fetching"></div>
|
||||
<div class="fetching"></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #abholfrist>
|
||||
<div class="min-w-[9rem]">Abholfrist</div>
|
||||
<div *ngIf="!(orderItemSubsetLoading$ | async); else featureLoading" class="flex flex-row font-bold">
|
||||
<div *ngIf="!(changeDateLoader$ | async)" class="flex flex-row font-bold">
|
||||
<button
|
||||
[uiOverlayTrigger]="deadlineDatepicker"
|
||||
#deadlineDatepickerTrigger="uiOverlayTrigger"
|
||||
[disabled]="!isKulturpass && (!!orderItem?.features?.paid || (changeDateDisabled$ | async))"
|
||||
class="cta-pickup-deadline"
|
||||
matomoClickCategory="pickup-shelf-details-header"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="pickup-deadline"
|
||||
>
|
||||
<strong class="border-r border-[#AEB7C1] pr-4">
|
||||
{{ orderItem?.pickUpDeadline | date: 'dd.MM.yy' }}
|
||||
@@ -198,19 +178,17 @@
|
||||
>
|
||||
</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="!(orderItemSubsetLoading$ | async); else featureLoading" class="flex flex-row font-bold">
|
||||
<div *ngIf="!(changePreferredDateLoader$ | async)" class="flex flex-row font-bold">
|
||||
<button
|
||||
[uiOverlayTrigger]="preferredPickUpDatePicker"
|
||||
#preferredPickUpDatePickerTrigger="uiOverlayTrigger"
|
||||
[disabled]="(!isKulturpass && !!orderItem?.features?.paid) || (changeDateDisabled$ | async)"
|
||||
class="cta-pickup-preferred"
|
||||
matomoClickCategory="pickup-shelf-details-header"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="pickup-preferred"
|
||||
>
|
||||
<strong class="border-r border-[#AEB7C1] pr-4" *ngIf="findLatestPreferredPickUpDate$ | async; let pickUpDate; else: selectTemplate">
|
||||
{{ pickUpDate | date: 'dd.MM.yy' }}
|
||||
@@ -232,19 +210,17 @@
|
||||
>
|
||||
</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="!(orderItemSubsetLoading$ | async); else featureLoading" class="flex flex-row font-bold">
|
||||
<div *ngIf="!(changeDateLoader$ | async)" class="flex flex-row font-bold">
|
||||
<button
|
||||
class="cta-datepicker"
|
||||
[disabled]="changeDateDisabled$ | async"
|
||||
[uiOverlayTrigger]="uiDatepicker"
|
||||
#datepicker="uiOverlayTrigger"
|
||||
matomoClickCategory="pickup-shelf-details-header"
|
||||
matomoClickAction="click"
|
||||
matomoClickName="vsl-lieferdatum"
|
||||
>
|
||||
<span class="border-r border-[#AEB7C1] pr-4">
|
||||
{{ orderItem?.estimatedShippingDate | date: 'dd.MM.yy' }}
|
||||
@@ -263,9 +239,6 @@
|
||||
>
|
||||
</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>
|
||||
|
||||
@@ -12,9 +12,6 @@ import { PickupShelfNotificationsChannelPipe } from '../pipes/notifications-chan
|
||||
import { PickupShelfProcessingStatusPipe } from '../pipes/processing-status.pipe';
|
||||
import { UiDatepickerModule } from '@ui/datepicker';
|
||||
import { PickUpShelfDetailsHeaderNavMenuComponent } from '../pickup-shelf-details-header-nav-menu/pickup-shelf-details-header-nav-menu.component';
|
||||
import { SkeletonLoaderComponent } from '@shared/components/loader';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-details-header',
|
||||
@@ -39,8 +36,6 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
UiCommonModule,
|
||||
UiDatepickerModule,
|
||||
PickUpShelfDetailsHeaderNavMenuComponent,
|
||||
SkeletonLoaderComponent,
|
||||
MatomoModule,
|
||||
],
|
||||
})
|
||||
export class PickUpShelfDetailsHeaderComponent {
|
||||
@@ -55,13 +50,13 @@ export class PickUpShelfDetailsHeaderComponent {
|
||||
@Output()
|
||||
updateDate = new EventEmitter<{ date: Date; type?: 'delivery' | 'pickup' | 'preferred' }>();
|
||||
|
||||
orderItemSubsetLoading$ = this._store.orderItemSubsetLoading$;
|
||||
get order$(): Observable<OrderDTO> {
|
||||
return this._store.order$;
|
||||
}
|
||||
|
||||
fetchingOrder$ = this._store.fetchingOrder$;
|
||||
|
||||
order$ = this._store.order$;
|
||||
|
||||
order = toSignal(this.order$);
|
||||
get order(): OrderDTO {
|
||||
return this._store.order;
|
||||
}
|
||||
|
||||
findLatestPreferredPickUpDate$: Observable<Date> = this.order$.pipe(
|
||||
withLatestFrom(this._store.selectedOrderItemIds$),
|
||||
@@ -77,12 +72,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));
|
||||
@@ -91,7 +86,7 @@ export class PickUpShelfDetailsHeaderComponent {
|
||||
processId?: number;
|
||||
|
||||
get isKulturpass() {
|
||||
return this.order()?.features?.orderSource === 'KulturPass';
|
||||
return this.order?.features?.orderSource === 'KulturPass';
|
||||
}
|
||||
|
||||
minDateDatepicker = this.dateAdapter.addCalendarDays(this.dateAdapter.today(), -1);
|
||||
@@ -110,14 +105,12 @@ export class PickUpShelfDetailsHeaderComponent {
|
||||
|
||||
changeDateDisabled$ = this.changeStatusDisabled$;
|
||||
|
||||
fetchingCustomerDone$ = this._store.fetchingCustomer$.pipe(map((fetchingCustomer) => !fetchingCustomer));
|
||||
|
||||
customer$ = this._store.customer$;
|
||||
|
||||
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)));
|
||||
@@ -125,17 +118,14 @@ 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);
|
||||
|
||||
@@ -32,11 +32,7 @@
|
||||
</div>
|
||||
<div class="page-pickup-shelf-details-item__item-container">
|
||||
<div class="page-pickup-shelf-details-item__thumbnail">
|
||||
<img
|
||||
[productImageNavigation]="orderItem?.product?.ean"
|
||||
[src]="orderItem.product?.ean | productImage"
|
||||
[alt]="orderItem.product?.name"
|
||||
/>
|
||||
<img [src]="orderItem.product?.ean | productImage" [alt]="orderItem.product?.name" />
|
||||
</div>
|
||||
<div class="page-pickup-shelf-details-item__details">
|
||||
<div class="flex flex-row justify-between items-start mb-[1.3125rem]">
|
||||
@@ -50,24 +46,16 @@
|
||||
<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"
|
||||
[ngModel]="selected$ | async"
|
||||
(ngModelChange)="
|
||||
setSelected($event);
|
||||
tracker.trackEvent({
|
||||
category: 'pickup-shelf-list-item',
|
||||
action: 'select',
|
||||
name: orderItem?.product?.name,
|
||||
value: $event ? 1 : 0,
|
||||
})
|
||||
"
|
||||
(ngModelChange)="setSelected($event)"
|
||||
class="isa-select-bullet mt-4"
|
||||
type="checkbox"
|
||||
matomoTracker
|
||||
#tracker="matomo"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,12 +68,7 @@
|
||||
[showTrash]="false"
|
||||
[range]="orderItem?.quantity"
|
||||
[(ngModel)]="quantity"
|
||||
(ngModelChange)="
|
||||
tracker.trackEvent({ category: 'pickup-shelf-list-item', action: 'quantity', name: orderItem?.product?.name, value: $event })
|
||||
"
|
||||
[showSpinner]="false"
|
||||
matomoTracker
|
||||
#tracker="matomo"
|
||||
>
|
||||
</ui-quantity-dropdown>
|
||||
<span class="overall-quantity">(von {{ orderItem?.overallQuantity }})</span>
|
||||
@@ -270,9 +253,6 @@
|
||||
type="submit"
|
||||
*ngIf="specialCommentControl?.enabled && specialCommentControl.dirty"
|
||||
(click)="saveSpecialComment()"
|
||||
matomoClickCategory="pickup-shelf-details-item"
|
||||
matomoClickAction="save"
|
||||
matomoClickName="special-comment"
|
||||
>
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
inject,
|
||||
} from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl } from '@angular/forms';
|
||||
import { NavigateOnClickDirective, ProductImageModule } from '@cdn/product-image';
|
||||
import { ProductImageModule } from '@cdn/product-image';
|
||||
import { DBHOrderItemListItemDTO, OrderDTO, ReceiptDTO } from '@swagger/oms';
|
||||
import { UiCommonModule } from '@ui/common';
|
||||
import { UiTooltipModule } from '@ui/tooltip';
|
||||
@@ -25,7 +25,6 @@ import { Subject, combineLatest } from 'rxjs';
|
||||
import { PickupShelfDetailsStore } from '../../store';
|
||||
import { UiQuantityDropdownModule } from '@ui/quantity-dropdown';
|
||||
import { NotificationTypePipe } from './notification-type.pipe';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
export interface PickUpShelfDetailsItemComponentState {
|
||||
orderItem?: DBHOrderItemListItemDTO;
|
||||
@@ -58,8 +57,6 @@ export interface PickUpShelfDetailsItemComponentState {
|
||||
IconModule,
|
||||
UiQuantityDropdownModule,
|
||||
NotificationTypePipe,
|
||||
NavigateOnClickDirective,
|
||||
MatomoModule,
|
||||
],
|
||||
})
|
||||
export class PickUpShelfDetailsItemComponent extends ComponentStore<PickUpShelfDetailsItemComponentState> implements OnInit {
|
||||
@@ -106,7 +103,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));
|
||||
@@ -116,7 +113,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() {
|
||||
@@ -143,7 +140,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()
|
||||
@@ -158,7 +155,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() {
|
||||
@@ -177,7 +174,7 @@ export class PickUpShelfDetailsItemComponent extends ComponentStore<PickUpShelfD
|
||||
|
||||
more$ = this.select((s) => s.more);
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
expanded: boolean = false;
|
||||
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
[class.selected]="tag === (selected$ | async) && !inputFocus.focused"
|
||||
*ngFor="let tag of defaultTags"
|
||||
(click)="setCompartmentInfo(tag)"
|
||||
matomoClickCategory="pickup-shelf-details-tags"
|
||||
matomoClickAction="click"
|
||||
[matomoClickName]="tag"
|
||||
[matomoClickValue]="(selected$ | async) === tag ? 0 : 1"
|
||||
>
|
||||
{{ tag }}
|
||||
</button>
|
||||
@@ -27,10 +23,6 @@
|
||||
placeholder="..."
|
||||
[size]="controlSize$ | async"
|
||||
maxlength="15"
|
||||
[matomoTracker]="['blur']"
|
||||
matomoCategory="pickup-shelf-details-tags"
|
||||
matomoAction="blur"
|
||||
matomoName="tag-input"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,6 @@ import { AsyncPipe, NgFor } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, forwardRef } from '@angular/core';
|
||||
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
import { UiCommonModule } from '@ui/common';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
||||
import { first, map } from 'rxjs/operators';
|
||||
|
||||
@@ -13,7 +12,7 @@ import { first, map } from 'rxjs/operators';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
host: { class: 'page-pickup-shelf-details-tags' },
|
||||
standalone: true,
|
||||
imports: [NgFor, UiCommonModule, FormsModule, AsyncPipe, MatomoModule],
|
||||
imports: [NgFor, UiCommonModule, FormsModule, AsyncPipe],
|
||||
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => PickUpShelfDetailsTagsComponent), multi: true }],
|
||||
})
|
||||
export class PickUpShelfDetailsTagsComponent implements OnInit, OnDestroy, ControlValueAccessor {
|
||||
@@ -60,7 +59,7 @@ export class PickUpShelfDetailsTagsComponent implements OnInit, OnDestroy, Contr
|
||||
|
||||
ngOnInit() {
|
||||
this.subscription.add(
|
||||
this.selected$.pipe(map((selected) => (this.defaultTags.includes(selected) ? '' : selected))).subscribe(this.inputValueSubject),
|
||||
this.selected$.pipe(map((selected) => (this.defaultTags.includes(selected) ? '' : selected))).subscribe(this.inputValueSubject)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[routerLink]="itemDetailsLink"
|
||||
[routerLinkActive]="!isTablet && !primaryOutletActive ? 'active' : ''"
|
||||
queryParamsHandling="preserve"
|
||||
(click)="onDetailsClick()"
|
||||
(click)="isDesktopLarge ? scrollIntoView() : ''"
|
||||
>
|
||||
<div
|
||||
class="page-pickup-shelf-list-item__item-grid-container"
|
||||
@@ -15,7 +15,6 @@
|
||||
class="page-pickup-shelf-list-item__item-image w-[3.125rem] max-h-[4.9375rem]"
|
||||
loading="lazy"
|
||||
*ngIf="item?.product?.ean | productImage; let productImage"
|
||||
[productImageNavigation]="item?.product?.ean"
|
||||
[src]="productImage"
|
||||
[alt]="item?.product?.name"
|
||||
/>
|
||||
@@ -104,14 +103,9 @@
|
||||
<input
|
||||
(click)="$event.stopPropagation()"
|
||||
[ngModel]="selectedItem"
|
||||
(ngModelChange)="
|
||||
setSelected();
|
||||
tracker.trackEvent({ category: 'pickup-shelf-list-item', action: 'select', name: item?.product?.name, value: $event ? 1 : 0 })
|
||||
"
|
||||
(ngModelChange)="setSelected()"
|
||||
class="isa-select-bullet"
|
||||
type="checkbox"
|
||||
matomoTracker
|
||||
#tracker="matomo"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CurrencyPipe, DatePipe, NgFor, NgIf } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, Input, inject } from '@angular/core';
|
||||
import { RouterLink, RouterLinkActive } from '@angular/router';
|
||||
import { NavigateOnClickDirective, ProductImageModule } from '@cdn/product-image';
|
||||
import { ProductImageModule } from '@cdn/product-image';
|
||||
import { EnvironmentService } from '@core/environment';
|
||||
import { IconModule } from '@shared/components/icon';
|
||||
import { DBHOrderItemListItemDTO } from '@swagger/oms';
|
||||
@@ -10,8 +10,6 @@ import { PickupShelfProcessingStatusPipe } from '../pipes/processing-status.pipe
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { PickupShelfStore } from '../../store';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { CacheService } from '@core/cache';
|
||||
import { MatomoModule } from 'ngx-matomo-client';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-list-item',
|
||||
@@ -32,14 +30,10 @@ import { MatomoModule } from 'ngx-matomo-client';
|
||||
ProductImageModule,
|
||||
UiCommonModule,
|
||||
PickupShelfProcessingStatusPipe,
|
||||
NavigateOnClickDirective,
|
||||
MatomoModule,
|
||||
],
|
||||
providers: [PickupShelfProcessingStatusPipe],
|
||||
})
|
||||
export class PickUpShelfListItemComponent {
|
||||
private cache = inject(CacheService);
|
||||
|
||||
store = inject(PickupShelfStore);
|
||||
|
||||
@Input() item: DBHOrderItemListItemDTO;
|
||||
@@ -82,54 +76,15 @@ 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() {
|
||||
if (this.isDesktopLarge) {
|
||||
this.scrollIntoView();
|
||||
}
|
||||
|
||||
if (!this.hasOrderItemInCache()) {
|
||||
this.addOrderItemIntoCache();
|
||||
}
|
||||
}
|
||||
|
||||
hasOrderItemInCache() {
|
||||
const items =
|
||||
this.cache.get<DBHOrderItemListItemDTO[]>({
|
||||
name: 'orderItems',
|
||||
orderId: this.item.orderId,
|
||||
compartmentCode: this.item.compartmentCode,
|
||||
compartmentInfo: this.item.compartmentInfo,
|
||||
orderItemProcessingStatus: this.item.processingStatus,
|
||||
store: 'PickupShelfDetailsStore',
|
||||
}) ?? [];
|
||||
|
||||
return items.some((i) => i.orderItemSubsetId === this.item.orderItemSubsetId);
|
||||
}
|
||||
|
||||
addOrderItemIntoCache() {
|
||||
this.cache.set(
|
||||
{
|
||||
name: 'orderItems',
|
||||
orderId: this.item.orderId,
|
||||
compartmentCode: this.item.compartmentCode,
|
||||
compartmentInfo: this.item.compartmentInfo,
|
||||
orderItemProcessingStatus: this.item.processingStatus,
|
||||
store: 'PickupShelfDetailsStore',
|
||||
},
|
||||
[this.item],
|
||||
{ persist: false, ttl: 1000 },
|
||||
);
|
||||
}
|
||||
|
||||
scrollIntoView() {
|
||||
this._elRef.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
|
||||
@@ -89,8 +89,6 @@ 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) => {
|
||||
|
||||
@@ -34,7 +34,6 @@ export interface PickupShelfDetailsState {
|
||||
|
||||
fetchingOrderItemSubsetTasks: { [orderItemSubsetId: number]: boolean };
|
||||
orderItemSubsetTasks: { [orderItemSubsetId: number]: OrderItemSubsetTaskListItemDTO[] };
|
||||
orderItemSubsetLoading?: boolean;
|
||||
|
||||
coverOrderItems?: DBHOrderItemListItemDTO[];
|
||||
fetchingCoverOrderItems?: boolean;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ComponentStore, tapResponse } from '@ngrx/component-store';
|
||||
import { PickupShelfDetailsState } from './pickup-shelf-details.state';
|
||||
import { Observable, combineLatest } from 'rxjs';
|
||||
import { Observable } from 'rxjs';
|
||||
import {
|
||||
DBHOrderItemListItemDTO,
|
||||
EntityDTOContainerOfOrderItemSubsetDTO,
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
} from '@swagger/oms';
|
||||
import { PickupShelfIOService, PickupShelfService } from '@domain/pickup-shelf';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { delayWhen, filter, map, mergeMap, switchMap, take, tap, withLatestFrom } from 'rxjs/operators';
|
||||
import { debounceTime, delayWhen, distinctUntilChanged, filter, mergeMap, switchMap, take, tap, withLatestFrom } from 'rxjs/operators';
|
||||
import { UiModalService } from '@ui/modal';
|
||||
import { CrmCustomerService } from '@domain/crm';
|
||||
import * as Selectors from './pickup-shelf-details.selectors';
|
||||
@@ -27,6 +27,7 @@ import { CacheService } from '@core/cache';
|
||||
import { RunCheckTrigger } from '../trigger';
|
||||
import { DomainReceiptService } from '@domain/oms';
|
||||
import { PickupShelfStore } from './pickup-shelf.store';
|
||||
import { isEqual } from 'lodash';
|
||||
|
||||
@Injectable()
|
||||
export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsState> {
|
||||
@@ -56,20 +57,10 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
return this.get(Selectors.selectFetchingOrder);
|
||||
}
|
||||
|
||||
// orderItems$ = this.select(Selectors.selectOrderItems);
|
||||
|
||||
// get orderItems() {
|
||||
// return this.get(Selectors.selectOrderItems);
|
||||
// }
|
||||
|
||||
orderItems$ = combineLatest([
|
||||
this.select(Selectors.selectOrderItems),
|
||||
this.select((s) => s).pipe(switchMap((s) => this._listStore.itemsForPreview$(s))),
|
||||
]).pipe(map(([orderItems, itemsForPreview]) => (orderItems?.length ? orderItems : itemsForPreview)));
|
||||
orderItems$ = this.select(Selectors.selectOrderItems);
|
||||
|
||||
get orderItems() {
|
||||
const orderItems = this.get(Selectors.selectOrderItems);
|
||||
return orderItems?.length ? orderItems : this.get((s) => this._listStore.itemsForPreview(s));
|
||||
return this.get(Selectors.selectOrderItems);
|
||||
}
|
||||
|
||||
fetchingOrderItems$ = this.select(Selectors.selectFetchingOrderItems);
|
||||
@@ -245,12 +236,6 @@ 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);
|
||||
|
||||
@@ -355,7 +340,6 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
fetchOrder = this.effect((trigger$: Observable<{ orderId: number }>) =>
|
||||
trigger$.pipe(
|
||||
tap(({ orderId }) => this.beforeFetchOrder(orderId)),
|
||||
// delay(10000),
|
||||
switchMap(({ orderId }) =>
|
||||
this._pickupShelfService.getOrderByOrderId(orderId).pipe(tapResponse(this.fetchOrderSuccess, this.fetchOrderFailed))
|
||||
)
|
||||
@@ -363,7 +347,7 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
);
|
||||
|
||||
private beforeFetchOrder = (orderId) => {
|
||||
const order = this._cacheService.get<OrderDTO>({ name: 'order', orderId, store: 'PickupShelfDetailsStore' }) ?? { id: orderId };
|
||||
const order = this._cacheService.get<OrderDTO>({ name: 'order', orderId, store: 'PickupShelfDetailsStore' });
|
||||
const customer = this._cacheService.get<CustomerInfoDTO>({
|
||||
name: 'customer',
|
||||
orderId,
|
||||
@@ -496,7 +480,7 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
fetchCustomer = this.effect((trigger$: Observable<{ buyerNumber: string }>) =>
|
||||
trigger$.pipe(
|
||||
filter(({ buyerNumber }) => this.customer?.customerNumber !== buyerNumber),
|
||||
tap(() => this.beforeFetchCustomer()),
|
||||
tap(this.beforeFetchCustomer),
|
||||
switchMap(({ buyerNumber }) =>
|
||||
this._customerService.getCustomers(buyerNumber).pipe(tapResponse(this.fetchCustomerSuccess, this.fetchCustomerFailed))
|
||||
)
|
||||
@@ -509,7 +493,7 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
orderId: this.order.id,
|
||||
store: 'PickupShelfDetailsStore',
|
||||
});
|
||||
this.patchState({ fetchingCustomer: !customer, customer: customer });
|
||||
this.patchState({ fetchingCustomer: true, customer });
|
||||
};
|
||||
|
||||
fetchCustomerSuccess = (res: ListResponseArgsOfCustomerInfoDTO) => {
|
||||
@@ -518,7 +502,6 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
// check if response contains exactly one customer
|
||||
if (customers.length > 1) {
|
||||
this._modal.error('Fehler beim Laden des Kunden', new Error('Es wurde mehr als ein Kunde gefunden.'));
|
||||
this.patchState({ fetchingCustomer: false });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -535,7 +518,6 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
// also check if the order is a KulturPass order, then there may be no customer
|
||||
if (!isKulturpass && customer?.customerNumber !== this.order.buyer.buyerNumber) {
|
||||
this._modal.error('Fehler beim Laden des Kunden', new Error('Der Kunde ist nicht der Bestellung zugeordnet.'));
|
||||
this.patchState({ fetchingCustomer: false });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -585,8 +567,6 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
if (res.result.preferredPickUpDate) {
|
||||
this.patchPreferredPickUpDateOnOrderSubsetItemInState({ item, newPreferredPickUpDate: res.result.preferredPickUpDate });
|
||||
}
|
||||
|
||||
this.updateOrderItemSubsetLoading(false);
|
||||
};
|
||||
|
||||
private patchOrderItemSubsetError = (err: any) => {
|
||||
@@ -731,10 +711,6 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
this.patchState({ fetchingCoverOrderItems: true });
|
||||
};
|
||||
|
||||
updateOrderItemSubsetLoading(orderItemSubsetLoading: boolean) {
|
||||
this.patchState({ orderItemSubsetLoading });
|
||||
}
|
||||
|
||||
private fetchCoverOrderItemsDone = (res: ListResponseArgsOfDBHOrderItemListItemDTO) => {
|
||||
this.patchState({ fetchingCoverOrderItems: false, coverOrderItems: res.result });
|
||||
};
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
import { Filter } from '@shared/components/filter';
|
||||
import { PickupShelfState } from './pickup-shelf.state';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { PickupShelfDetailsState } from './pickup-shelf-details.state';
|
||||
import {
|
||||
selectDisplayedCompartmentCode,
|
||||
selectDisplayedCompartmentInfo,
|
||||
selectDisplayedOrderItemProcessingStatus,
|
||||
selectOrder,
|
||||
} from './pickup-shelf-details.selectors';
|
||||
|
||||
export function selectProcessId(state: PickupShelfState) {
|
||||
return state.processId;
|
||||
@@ -71,27 +64,3 @@ export function selectListHits(state: PickupShelfState) {
|
||||
export function selectSelectedListItems(state: PickupShelfState) {
|
||||
return state.selectedListItems ?? [];
|
||||
}
|
||||
|
||||
export const selectItemsForPreview = (detailsState: PickupShelfDetailsState) => (state: PickupShelfState) => {
|
||||
const orderId = selectOrder(detailsState)?.id;
|
||||
|
||||
let items = state.list.filter((item) => item.orderId === orderId);
|
||||
|
||||
const processingStatus = selectDisplayedOrderItemProcessingStatus(detailsState);
|
||||
if (processingStatus) {
|
||||
items = items?.filter((oi) => oi.processingStatus === processingStatus);
|
||||
}
|
||||
|
||||
const compartmentCode = selectDisplayedCompartmentCode(detailsState);
|
||||
if (compartmentCode) {
|
||||
items = items?.filter((oi) => oi.compartmentCode === compartmentCode);
|
||||
|
||||
const compartmentInfo = selectDisplayedCompartmentInfo(detailsState);
|
||||
|
||||
if (compartmentInfo) {
|
||||
items = items?.filter((oi) => oi.compartmentInfo === compartmentInfo);
|
||||
}
|
||||
}
|
||||
|
||||
return items;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,6 @@ import * as Selectors from './pickup-shelf.selectors';
|
||||
import { Observable, Subject, combineLatest } from 'rxjs';
|
||||
import { CacheService } from '@core/cache';
|
||||
import { Filter } from '@shared/components/filter';
|
||||
import { PickupShelfDetailsState } from './pickup-shelf-details.state';
|
||||
|
||||
@Injectable()
|
||||
export class PickupShelfStore extends ComponentStore<PickupShelfState> implements OnStoreInit {
|
||||
@@ -105,10 +104,6 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
|
||||
return this.get(Selectors.selectSelectedListItems);
|
||||
}
|
||||
|
||||
itemsForPreview$ = (state: PickupShelfDetailsState) => this.select(Selectors.selectItemsForPreview(state));
|
||||
|
||||
itemsForPreview = (state: PickupShelfDetailsState) => this.get(Selectors.selectItemsForPreview(state));
|
||||
|
||||
constructor() {
|
||||
// Nicht entfernen sonst wird der Store nicht initialisiert
|
||||
super({});
|
||||
|
||||
@@ -16,7 +16,7 @@ import { AddProductModalData } from './add-product-modal.data';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AddProductModalComponent implements OnInit, OnDestroy {
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
get processId() {
|
||||
return this._config.get('process.ids.remission');
|
||||
|
||||
@@ -11,7 +11,6 @@ import { UiTooltipModule } from '@ui/tooltip';
|
||||
import { UiCommonModule } from '@ui/common';
|
||||
import { UiDropdownModule } from '@ui/dropdown';
|
||||
import { UiIconModule } from '@ui/icon';
|
||||
import { SharedProductGroupPipe } from '@shared/pipes/product-group';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -26,7 +25,6 @@ import { SharedProductGroupPipe } from '@shared/pipes/product-group';
|
||||
UiTooltipModule,
|
||||
UiDropdownModule,
|
||||
UiIconModule,
|
||||
SharedProductGroupPipe,
|
||||
],
|
||||
exports: [AddProductModalComponent],
|
||||
declarations: [AddProductModalComponent],
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from './product-group.pipe';
|
||||
export * from './remission-pipe.module';
|
||||
|
||||
@@ -6,9 +6,8 @@ import { distinctUntilChanged, map, switchMap } from 'rxjs/operators';
|
||||
@Pipe({
|
||||
name: 'productGroup',
|
||||
pure: false,
|
||||
standalone: true,
|
||||
})
|
||||
export class SharedProductGroupPipe implements PipeTransform, OnDestroy {
|
||||
export class ProductGroupPipe implements PipeTransform, OnDestroy {
|
||||
result: string;
|
||||
|
||||
productGroup$ = new Subject<string>();
|
||||
@@ -1,10 +1,11 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AssortmentPipe } from './assortment.pipe';
|
||||
import { ProductGroupPipe } from './product-group.pipe';
|
||||
import { ShortReceiptNumberPipe } from './short-receipt-number.pipe';
|
||||
import { SupplierPipe } from './supplier.pipe';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AssortmentPipe, ShortReceiptNumberPipe, SupplierPipe],
|
||||
exports: [AssortmentPipe, ShortReceiptNumberPipe, SupplierPipe],
|
||||
declarations: [ProductGroupPipe, AssortmentPipe, ShortReceiptNumberPipe, SupplierPipe],
|
||||
exports: [ProductGroupPipe, AssortmentPipe, ShortReceiptNumberPipe, SupplierPipe],
|
||||
})
|
||||
export class RemissionPipeModule {}
|
||||
|
||||
@@ -16,7 +16,7 @@ export class RemissionFilterComponent implements OnDestroy {
|
||||
|
||||
filter$ = this.store.filter$.pipe(map((filter) => UiFilter.create(filter)));
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
constructor(public store: RemissionListComponentStore) {}
|
||||
|
||||
|
||||
@@ -21,24 +21,16 @@
|
||||
</div>
|
||||
<div class="product-data-grid grid gap-6 items-start">
|
||||
<div>
|
||||
<img
|
||||
[productImageNavigation]="item?.ean"
|
||||
class="max-w-full max-h-full shadow rounded"
|
||||
src="{{ item.ean | productImage }}"
|
||||
alt="item.dto.product.name"
|
||||
/>
|
||||
<img class="max-w-full max-h-full shadow rounded" src="{{ item.ean | productImage }}" alt="item.dto.product.name" />
|
||||
</div>
|
||||
|
||||
<div class="grid grid-flow-row gap-1 w-48">
|
||||
<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
|
||||
class="overflow-hidden overflow-ellipsis whitespace-nowrap"
|
||||
*ngIf="!!item.format && !!item.formatDetail && item.format !== 'UNKNOWN'"
|
||||
>
|
||||
<img class="inline" src="/assets/images/Icon_{{ item.dto.product.format }}.svg" [alt]="item.formatDetail" />
|
||||
<span class="ml-1 font-bold format-detail">{{ item.formatDetail }}</span>
|
||||
</div>
|
||||
<div class="font-bold ean">
|
||||
{{ item.ean }}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from '@swagger/remi';
|
||||
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
import { mapFromReturnItemDTO, mapFromReturnSuggestionDTO } from 'apps/domain/remission/src/lib/mappings';
|
||||
import { Subject } from 'rxjs';
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
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';
|
||||
@@ -23,7 +23,7 @@ import { RemissionListComponent } from '../remission-list.component';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class RemissionListItemComponent implements OnDestroy {
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
@Input()
|
||||
item: RemissionListItem;
|
||||
@@ -55,16 +55,6 @@ export class RemissionListItemComponent implements OnDestroy {
|
||||
|
||||
loading$ = this._listComponent.remittingItem$.asObservable();
|
||||
|
||||
get formatIconUrl() {
|
||||
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,
|
||||
|
||||
@@ -2,13 +2,12 @@ import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { RemissionListItemComponent } from './remission-list-item.component';
|
||||
import { NavigateOnClickDirective, ProductImageModule } from '@cdn/product-image';
|
||||
import { ProductImageModule } from '@cdn/product-image';
|
||||
import { RemissionPipeModule } from '../../pipes';
|
||||
import { UiTooltipModule } from '@ui/tooltip';
|
||||
import { UiCommonModule } from '@ui/common';
|
||||
import { AddProductToShippingDocumentModalModule } from '../../modals/add-product-to-shipping-document-modal/add-product-to-shipping-document-modal.module';
|
||||
import { UiSpinnerModule } from '@ui/spinner';
|
||||
import { SharedProductGroupPipe } from '@shared/pipes/product-group';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -19,8 +18,6 @@ import { SharedProductGroupPipe } from '@shared/pipes/product-group';
|
||||
RemissionPipeModule,
|
||||
UiTooltipModule,
|
||||
AddProductToShippingDocumentModalModule,
|
||||
SharedProductGroupPipe,
|
||||
NavigateOnClickDirective,
|
||||
],
|
||||
exports: [RemissionListItemComponent],
|
||||
declarations: [RemissionListItemComponent],
|
||||
|
||||
@@ -37,7 +37,7 @@ export class RemissionListComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('scrollContainer', { static: true })
|
||||
scrollContainer: CdkVirtualScrollViewport;
|
||||
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
get processId() {
|
||||
return this._config.get('process.ids.remission');
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ToasterService } from '@shared/shell';
|
||||
providers: [RemissionListComponentStore],
|
||||
})
|
||||
export class RemissionComponent implements OnInit, OnDestroy {
|
||||
private _onDestroy$ = new Subject<void>();
|
||||
private _onDestroy$ = new Subject();
|
||||
|
||||
get processId() {
|
||||
return this._config.get('process.ids.remission');
|
||||
|
||||
@@ -5,10 +5,9 @@ import { UiSpinnerModule } from '@ui/spinner';
|
||||
import { RemissionPipeModule } from '../../pipes';
|
||||
import { SharedShippingDocumentDetailsItemComponent } from './shipping-document-details-item/shipping-document-details-item.component';
|
||||
import { SharedShippingDocumentDetailsComponent } from './shipping-document-details.component';
|
||||
import { SharedProductGroupPipe } from '@shared/pipes/product-group';
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, RemissionPipeModule, ProductImageModule, UiSpinnerModule, SharedProductGroupPipe],
|
||||
imports: [CommonModule, RemissionPipeModule, ProductImageModule, UiSpinnerModule],
|
||||
exports: [SharedShippingDocumentDetailsComponent, SharedShippingDocumentDetailsItemComponent],
|
||||
declarations: [SharedShippingDocumentDetailsComponent, SharedShippingDocumentDetailsItemComponent],
|
||||
providers: [],
|
||||
|
||||
@@ -111,7 +111,7 @@ export class TaskInfoComponent implements OnChanges {
|
||||
|
||||
indicatorColor$ = this.info$.pipe(map((info) => this.domainTaskCalendarService.getProcessingStatusColorCode(info)));
|
||||
|
||||
private noteAdded$ = new Subject<void>();
|
||||
private noteAdded$ = new Subject();
|
||||
|
||||
notes$ = combineLatest([this.info$, this.noteAdded$.pipe(startWith([undefined]))]).pipe(
|
||||
switchMap(([info]) => this.domainTaskCalendarService.getComments({ infoId: info.id })),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user