Merge branch 'develop' into release/3.0

This commit is contained in:
Lorenz Hilpert
2023-10-24 14:21:59 +02:00
13 changed files with 110 additions and 77 deletions

View File

@@ -2,6 +2,7 @@ import { Injectable, inject } from '@angular/core';
import { AbholfachService, AutocompleteTokenDTO, ListResponseArgsOfDBHOrderItemListItemDTO, QueryTokenDTO } from '@swagger/oms';
import { PickupShelfIOService } from './pickup-shelf-io.service';
import { Observable, throwError } from 'rxjs';
import { Filter } from '@shared/components/filter';
@Injectable({ providedIn: 'root' })
export class PickupShelfInService extends PickupShelfIOService {
@@ -22,6 +23,7 @@ export class PickupShelfInService extends PickupShelfIOService {
getOrderItemsByOrderNumberOrCompartmentCode(args: {
orderNumber?: string;
compartmentCode?: string;
filter?: Filter;
}): Observable<ListResponseArgsOfDBHOrderItemListItemDTO> {
if (!args.orderNumber && !args.compartmentCode) {
return throwError(
@@ -33,9 +35,7 @@ export class PickupShelfInService extends PickupShelfIOService {
input: {
qs: args.compartmentCode ?? args.orderNumber,
},
filter: {
archive: String(false),
},
filter: args?.filter?.getQueryToken()?.filter,
});
}

View File

@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { Filter } from '@shared/components/filter';
import {
AutocompleteTokenDTO,
ListResponseArgsOfDBHOrderItemListItemDTO,
@@ -19,6 +20,7 @@ export abstract class PickupShelfIOService {
abstract getOrderItemsByOrderNumberOrCompartmentCode(args: {
orderNumber?: string;
compartmentCode?: string;
filter?: Filter;
}): Observable<ListResponseArgsOfDBHOrderItemListItemDTO>;
abstract getOrderItemsByCustomerNumber(args: { customerNumber: string }): Observable<ListResponseArgsOfDBHOrderItemListItemDTO>;

View File

@@ -2,6 +2,7 @@ import { Injectable, inject } from '@angular/core';
import { AbholfachService, AutocompleteTokenDTO, ListResponseArgsOfDBHOrderItemListItemDTO, QueryTokenDTO } from '@swagger/oms';
import { PickupShelfIOService } from './pickup-shelf-io.service';
import { Observable, throwError } from 'rxjs';
import { Filter } from '@shared/components/filter';
@Injectable({ providedIn: 'root' })
export class PickupShelfOutService extends PickupShelfIOService {
@@ -22,6 +23,7 @@ export class PickupShelfOutService extends PickupShelfIOService {
getOrderItemsByOrderNumberOrCompartmentCode(args: {
orderNumber?: string;
compartmentCode?: string;
filter?: Filter;
}): Observable<ListResponseArgsOfDBHOrderItemListItemDTO> {
if (!args.orderNumber && !args.compartmentCode) {
return throwError(
@@ -33,9 +35,7 @@ export class PickupShelfOutService extends PickupShelfIOService {
input: {
qs: args.compartmentCode ?? args.orderNumber,
},
filter: {
archive: String(false),
},
filter: args?.filter?.getQueryToken()?.filter,
});
}

View File

@@ -6,7 +6,7 @@ import { map, takeUntil, withLatestFrom } from 'rxjs/operators';
import { ArticleSearchService } from '../article-search.store';
import { ActivatedRoute } from '@angular/router';
import { ProductCatalogNavigationService } from '@shared/services';
import { Filter, FilterComponent, FilterInput } from 'apps/shared/components/filter/src/lib';
import { Filter, FilterComponent } from 'apps/shared/components/filter/src/lib';
@Component({
selector: 'page-article-search-filter',
@@ -28,10 +28,6 @@ export class ArticleSearchFilterComponent implements OnInit, OnDestroy {
showFilter: boolean = false;
get isDesktop() {
return this._environment.matchDesktop();
}
get isTablet() {
return this._environment.matchTablet();
}
@@ -106,8 +102,7 @@ export class ArticleSearchFilterComponent implements OnInit, OnDestroy {
.pipe(takeUntil(this._onDestroy$), withLatestFrom(this._processId$))
.subscribe(async ([searchCompleted, processId]) => {
if (searchCompleted.state.searchState === '') {
// Check if desktop is necessary, otherwise it would trigger navigation twice (Inside Article-Search.component and here)
if (searchCompleted.state.hits === 1 && !this.isDesktop) {
if (searchCompleted.state.hits === 1) {
const item = searchCompleted.state.items.find((f) => f);
await this._navigationService
.getArticleDetailsPath({
@@ -115,7 +110,7 @@ export class ArticleSearchFilterComponent implements OnInit, OnDestroy {
itemId: item.id,
})
.navigate();
} else if (!this.isDesktop) {
} else {
const params = searchCompleted.state.filter.getQueryParams();
await this._navigationService.getArticleSearchResultsPath(processId, { queryParams: params }).navigate();
}

View File

@@ -236,7 +236,7 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
})
.navigate();
}
} else if ((searchCompleted?.clear || this.route.outlet === 'primary') && this.isDesktopLarge) {
} else if (searchCompleted?.clear || this.route.outlet === 'primary') {
await this._navigationService.getArticleSearchResultsPath(processId, { queryParams: params }).navigate();
}
}

View File

@@ -70,7 +70,7 @@ export class CustomerOrderSearchMainComponent implements OnInit, OnDestroy {
.pipe(debounceTime(50))
.subscribe(([processId, queryParams]) => {
this.removeBreadcrumbs(processId);
this.updateBreadcrumb(processId, queryParams);
this.updateBreadcrumb(queryParams);
})
);
@@ -88,17 +88,19 @@ export class CustomerOrderSearchMainComponent implements OnInit, OnDestroy {
})
);
// #4143 To make Splitscreen Search and Filter work combined
this._subscriptions.add(
this._customerOrderSearchStore.searchStarted.subscribe(async (_) => {
const queryParams = {
...this.cleanupQueryParams(this._customerOrderSearchStore.filter.getQueryParams()),
main_qs: this.filterInputGroup?.uiInput?.value,
};
// Im Zuge des Tickets #4256 auskommentiert, da es zu Problemen geführt hat
// In der Filter Komponente wird dies schon gemacht
this._customerOrderSearchStore.setQueryParams(queryParams);
})
);
// // #4143 To make Splitscreen Search and Filter work combined
// this._subscriptions.add(
// this._customerOrderSearchStore.searchStarted.subscribe(async (_) => {
// const queryParams = {
// ...this.cleanupQueryParams(this._customerOrderSearchStore.filter.getQueryParams()),
// main_qs: this.filterInputGroup?.uiInput?.value,
// };
// this._customerOrderSearchStore.setQueryParams(queryParams);
// })
// );
}
ngOnDestroy() {
@@ -147,15 +149,19 @@ export class CustomerOrderSearchMainComponent implements OnInit, OnDestroy {
async search(filter: Filter) {
this._customerOrderSearchStore.setMessage('');
this.filterInputGroup?.cancelAutocomplete();
const queryParams = filter.getQueryParams();
this._customerOrderSearchStore.setQueryParams(queryParams);
await this.updateQueryParams(queryParams);
this._customerOrderSearchStore.search({ clear: true });
await this.updateQueryParams(this.processId);
}
async updateBreadcrumb(processId: number, params: Record<string, string>) {
async updateBreadcrumb(params: Record<string, string>) {
await this._breadcrumb.addOrUpdateBreadcrumbIfNotExists({
key: processId,
key: this.processId,
name: 'Kundenbestellung',
path: this._navigationService.getCustomerOrdersBasePath(processId).path,
path: this._navigationService.getCustomerOrdersBasePath(this.processId).path,
tags: ['customer-order', 'main', 'filter'],
section: 'customer',
params,
@@ -164,12 +170,12 @@ export class CustomerOrderSearchMainComponent implements OnInit, OnDestroy {
setQueryHistory(filter: Filter, query: string) {
filter.fromQueryParams({ main_qs: query });
const queryParams = filter.getQueryParams();
this._customerOrderSearchStore.setQueryParams(queryParams);
}
async updateQueryParams(processId: number) {
const queryParams = { ...this._customerOrderSearchStore.filter?.getQueryParams() };
queryParams.main_qs = queryParams.main_qs ?? '';
async updateQueryParams(queryParams: Record<string, string>) {
await this._router.navigate([], { queryParams });
this.updateBreadcrumb(processId, queryParams);
await this.updateBreadcrumb(queryParams);
}
}

View File

@@ -26,6 +26,7 @@ export abstract class PickupShelfDetailsBaseComponent {
compartmentCode: params.compartmentCode ? decodeURIComponent(params.compartmentCode) : undefined,
compartmentInfo: params.compartmentInfo ? decodeURIComponent(params.compartmentInfo) : undefined,
orderItemProcessingStatus: (params.orderItemProcessingStatus ? +params.orderItemProcessingStatus : undefined) as any,
filter: this.listStore?.filter,
});
});
}
@@ -70,6 +71,7 @@ export abstract class PickupShelfDetailsBaseComponent {
compartmentCode: ctxItem.processingStatus === 128 ? ctxItem.compartmentCode : undefined,
compartmentInfo: ctxItem.processingStatus === 128 ? ctxItem.compartmentInfo : undefined,
orderItemProcessingStatus: ctxItem.processingStatus,
filter: this.listStore?.filter,
done: { resolve, reject },
});
});

View File

@@ -127,10 +127,8 @@ export class PickUpShelfInListComponent implements OnInit, AfterViewInit {
}
const scrollPos = this._getScrollPositionFromCache();
if (!!scrollPos) {
if (!!scrollPos && this._activatedRoute.outlet === 'primary') {
setTimeout(() => {
if (this._activatedRoute.outlet === 'primary') {
}
this.scrollContainer?.scrollTo(scrollPos);
this._removeScrollPositionFromCache();
}, 150);

View File

@@ -38,7 +38,11 @@ export class PickUpShelfHistoryComponent {
historyItem$ = combineLatest([this.orderNumber$, this.compartmentCode$]).pipe(
switchMap(([orderNumber, compartmentCode]) =>
this._pickupShelfIOService
.getOrderItemsByOrderNumberOrCompartmentCode({ compartmentCode, orderNumber })
.getOrderItemsByOrderNumberOrCompartmentCode({
compartmentCode,
orderNumber,
filter: this.store?.filter,
})
.pipe(map((response) => response?.result?.find((listItem) => listItem?.orderItemSubsetId === this.orderItemSubsetId)))
),
shareReplay()

View File

@@ -20,7 +20,10 @@
/>
</div>
<div class="page-pickup-shelf-list-item__item-title-contributors flex flex-col">
<div
class="page-pickup-shelf-list-item__item-title-contributors flex flex-col"
[class.mr-32]="showCompartmentCode && item.features?.paid && (isTablet || isDesktopSmall || primaryOutletActive)"
>
<div
class="page-pickup-shelf-list-item__item-contributors text-p2 font-normal text-ellipsis overflow-hidden max-w-[24rem] whitespace-nowrap mb-[0.375rem]"
>

View File

@@ -26,6 +26,7 @@ import { CustomerInfoDTO, ListResponseArgsOfCustomerInfoDTO } from '@swagger/crm
import { CacheService } from '@core/cache';
import { RunCheckTrigger } from '../trigger';
import { DomainReceiptService } from '@domain/oms';
import { Filter } from '@shared/components/filter';
@Injectable()
export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsState> {
@@ -352,13 +353,14 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
compartmentCode?: string;
compartmentInfo?: string;
orderItemProcessingStatus?: OrderItemProcessingStatusValue;
filter?: Filter;
done?: { resolve: (items: DBHOrderItemListItemDTO[]) => void; reject: (err?) => void };
}>
) =>
trigger$.pipe(
tap((data) => this.beforeFetchOrderItems(data)),
switchMap(({ compartmentCode, orderNumber, compartmentInfo, orderItemProcessingStatus, done }) =>
this._pickupShelfIOService.getOrderItemsByOrderNumberOrCompartmentCode({ compartmentCode, orderNumber }).pipe(
switchMap(({ compartmentCode, orderNumber, compartmentInfo, orderItemProcessingStatus, filter, done }) =>
this._pickupShelfIOService.getOrderItemsByOrderNumberOrCompartmentCode({ compartmentCode, orderNumber, filter }).pipe(
tapResponse(
(r) => this.fetchOrderItemsSuccess({ compartmentCode, compartmentInfo, orderItemProcessingStatus }, done?.resolve)(r),
(e) => this.fetchOrderItemsFailed(done?.reject)(e)

View File

@@ -1,13 +1,14 @@
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { first, map, retry } from 'rxjs/operators';
import { ShellService } from '../shell.service';
import { BehaviorSubject } from 'rxjs';
import { BehaviorSubject, Observable, combineLatest } from 'rxjs';
import { MessageBoardItemDTO, NotificationsHub } from '@hub/notifications';
import { UiModalService } from '@ui/modal';
import { ModalNotificationsComponent } from '@modal/notifications';
import { ApplicationService } from '@core/application';
import { StockService } from '@swagger/wws';
import { AuthService } from '@core/auth';
import { EnvironmentService } from '@core/environment';
@Component({
selector: 'shell-top-bar',
@@ -33,17 +34,24 @@ export class ShellTopBarComponent implements OnInit {
map((x) => x.result.key)
);
canNotIncreaseFontSize$ = this._shellService.fontSize$.pipe(map((size) => size === 'large'));
canNotIncreaseFontSize$ = combineLatest([this._shellService.fontSize$, this.isTablet$]).pipe(
map(([size, isTablet]) => (isTablet ? size === 'normal' : size === 'large'))
);
canNotDecreaseFontSize$ = this._shellService.fontSize$.pipe(map((size) => size === 'small'));
get isTablet$(): Observable<boolean> {
return this._environment.matchTablet$;
}
constructor(
private _shellService: ShellService,
private _stockService: StockService,
private _authService: AuthService,
private readonly _notificationsHub: NotificationsHub,
private _modal: UiModalService,
private _app: ApplicationService
private _app: ApplicationService,
private _environment: EnvironmentService
) {}
ngOnInit() {

79
package-lock.json generated
View File

@@ -1059,20 +1059,33 @@
}
},
"node_modules/@babel/helper-environment-visitor": {
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz",
"integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==",
"version": "7.22.20",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
"integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-function-name": {
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz",
"integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
"integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dependencies": {
"@babel/template": "^7.22.5",
"@babel/types": "^7.22.5"
"@babel/template": "^7.22.15",
"@babel/types": "^7.23.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-function-name/node_modules/@babel/template": {
"version": "7.22.15",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
"integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
"dependencies": {
"@babel/code-frame": "^7.22.13",
"@babel/parser": "^7.22.15",
"@babel/types": "^7.22.15"
},
"engines": {
"node": ">=6.9.0"
@@ -1228,9 +1241,9 @@
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.22.15",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz",
"integrity": "sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==",
"version": "7.22.20",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
"integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
"engines": {
"node": ">=6.9.0"
}
@@ -1311,9 +1324,9 @@
}
},
"node_modules/@babel/parser": {
"version": "7.22.16",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz",
"integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
"integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"bin": {
"parser": "bin/babel-parser.js"
},
@@ -2605,18 +2618,18 @@
}
},
"node_modules/@babel/traverse": {
"version": "7.22.17",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.17.tgz",
"integrity": "sha512-xK4Uwm0JnAMvxYZxOVecss85WxTEIbTa7bnGyf/+EgCL5Zt3U7htUpEOWv9detPlamGKuRzCqw74xVglDWpPdg==",
"version": "7.23.2",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
"integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
"dependencies": {
"@babel/code-frame": "^7.22.13",
"@babel/generator": "^7.22.15",
"@babel/helper-environment-visitor": "^7.22.5",
"@babel/helper-function-name": "^7.22.5",
"@babel/generator": "^7.23.0",
"@babel/helper-environment-visitor": "^7.22.20",
"@babel/helper-function-name": "^7.23.0",
"@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6",
"@babel/parser": "^7.22.16",
"@babel/types": "^7.22.17",
"@babel/parser": "^7.23.0",
"@babel/types": "^7.23.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
@@ -2625,11 +2638,11 @@
}
},
"node_modules/@babel/traverse/node_modules/@babel/generator": {
"version": "7.22.15",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz",
"integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
"integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
"dependencies": {
"@babel/types": "^7.22.15",
"@babel/types": "^7.23.0",
"@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1"
@@ -2639,12 +2652,12 @@
}
},
"node_modules/@babel/types": {
"version": "7.22.17",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.17.tgz",
"integrity": "sha512-YSQPHLFtQNE5xN9tHuZnzu8vPr61wVTBZdfv1meex1NBosa4iT05k/Jw06ddJugi4bk7The/oSwQGFcksmEJQg==",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
"integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
"dependencies": {
"@babel/helper-string-parser": "^7.22.5",
"@babel/helper-validator-identifier": "^7.22.15",
"@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -12833,9 +12846,9 @@
}
},
"node_modules/postcss": {
"version": "8.4.29",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz",
"integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==",
"version": "8.4.31",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
"dev": true,
"funding": [
{