mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Compare commits
73 Commits
project-de
...
performanc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc949e27b9 | ||
|
|
ed110b443c | ||
|
|
f188ece61e | ||
|
|
14cc3f4895 | ||
|
|
8097c6ad9e | ||
|
|
b0d76b01d7 | ||
|
|
626fd0081f | ||
|
|
362fca74bc | ||
|
|
b8f0a29f79 | ||
|
|
f54400f00d | ||
|
|
54094695b1 | ||
|
|
1e3e9588da | ||
|
|
f04705b659 | ||
|
|
c22672fad0 | ||
|
|
59673a47db | ||
|
|
e56ea0bd4e | ||
|
|
f8c4d4a842 | ||
|
|
c4dd9214a3 | ||
|
|
4d74b3a89e | ||
|
|
b0b3fd40ce | ||
|
|
3404c930c5 | ||
|
|
abcd940ed3 | ||
|
|
c1756942b2 | ||
|
|
ea4d036066 | ||
|
|
101a34bd3f | ||
|
|
99bad149cb | ||
|
|
a0bff7164c | ||
|
|
0c4a4130b9 | ||
|
|
8dd1211729 | ||
|
|
a2f1b8b624 | ||
|
|
98a331ffe5 | ||
|
|
c0f97c9bae | ||
|
|
960ffa165f | ||
|
|
6bdfbe2eff | ||
|
|
80342e61ac | ||
|
|
6bf3894e4d | ||
|
|
aab29838bf | ||
|
|
856ca5651e | ||
|
|
a7d4b8d7fb | ||
|
|
62d260473c | ||
|
|
bde52a2526 | ||
|
|
6243b03cfc | ||
|
|
d24841800e | ||
|
|
f60628c769 | ||
|
|
034f697da5 | ||
|
|
ec9f80767b | ||
|
|
a5e569cf05 | ||
|
|
b62259f9b4 | ||
|
|
95baeaa8a8 | ||
|
|
a5b9115a91 | ||
|
|
1885c58d86 | ||
|
|
add55a47d6 | ||
|
|
129f49a9ee | ||
|
|
9560eb7ad6 | ||
|
|
772ba29a8e | ||
|
|
8ac8f6cc1f | ||
|
|
a0f496475c | ||
|
|
8979a388ee | ||
|
|
8b9a209c49 | ||
|
|
f4c3e3ceee | ||
|
|
5ca8a83f25 | ||
|
|
006011885f | ||
|
|
9c9e061f6d | ||
|
|
c9782a7d29 | ||
|
|
fba465d573 | ||
|
|
5ab4456040 | ||
|
|
fc45efb4af | ||
|
|
bb81b8f826 | ||
|
|
486e2e5a28 | ||
|
|
86d3b4e3f5 | ||
|
|
b440ddbe82 | ||
|
|
d6e0d92132 | ||
|
|
b16ffa4352 |
@@ -8,6 +8,10 @@ import { Filter } from '@shared/components/filter';
|
||||
export class PickupShelfInService extends PickupShelfIOService {
|
||||
private _abholfachService = inject(AbholfachService);
|
||||
|
||||
name() {
|
||||
return 'PickupShelfInService';
|
||||
}
|
||||
|
||||
getQuerySettings() {
|
||||
return this._abholfachService.AbholfachWareneingangQuerySettings();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
export abstract class PickupShelfIOService {
|
||||
abstract name(): string;
|
||||
|
||||
abstract getQuerySettings(): Observable<ResponseArgsOfQuerySettingsDTO>;
|
||||
|
||||
abstract search(queryToken: QueryTokenDTO): Observable<ListResponseArgsOfDBHOrderItemListItemDTO>;
|
||||
|
||||
@@ -8,6 +8,10 @@ import { Filter } from '@shared/components/filter';
|
||||
export class PickupShelfOutService extends PickupShelfIOService {
|
||||
private _abholfachService = inject(AbholfachService);
|
||||
|
||||
name() {
|
||||
return 'PickupShelfOutService';
|
||||
}
|
||||
|
||||
getQuerySettings() {
|
||||
return this._abholfachService.AbholfachWarenausgabeQuerySettings();
|
||||
}
|
||||
|
||||
@@ -15,11 +15,12 @@ export class CanActivateCustomerOrdersWithProcessIdGuard {
|
||||
.toPromise();
|
||||
|
||||
if (!process) {
|
||||
const processes = await this._applicationService.getProcesses$('customer').pipe(first()).toPromise();
|
||||
await this._applicationService.createProcess({
|
||||
id: +route.params.processId,
|
||||
type: 'customer-order',
|
||||
type: 'cart',
|
||||
section: 'customer',
|
||||
name: `Kundenbestellungen`,
|
||||
name: `Vorgang ${this.processNumber(processes.filter((process) => process.type === 'cart'))}`,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -46,6 +47,18 @@ export class CanActivateCustomerOrdersWithProcessIdGuard {
|
||||
|
||||
processNumber(processes: ApplicationProcess[]) {
|
||||
const processNumbers = processes?.map((process) => Number(process?.name?.replace(/\D/g, '')));
|
||||
return !!processNumbers && processNumbers?.length > 0 ? Math.max(...processNumbers) + 1 : 1;
|
||||
return !!processNumbers && processNumbers.length > 0 ? this.findMissingNumber(processNumbers) : 1;
|
||||
}
|
||||
|
||||
findMissingNumber(processNumbers: number[]) {
|
||||
// Ticket #3272 Bei Klick auf "+" bzw. neuen Prozess hinzufügen soll der neue Tab immer die höchste Nummer haben (wie aktuell im Produktiv)
|
||||
// ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// for (let missingNumber = 1; missingNumber < Math.max(...processNumbers); missingNumber++) {
|
||||
// if (!processNumbers.find((number) => number === missingNumber)) {
|
||||
// return missingNumber;
|
||||
// }
|
||||
// }
|
||||
return Math.max(...processNumbers) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,6 +415,10 @@
|
||||
{
|
||||
"name": "isa-box-out",
|
||||
"alias": "Versandbestellung (oder gemischt)"
|
||||
},
|
||||
{
|
||||
"name": "package-variant-closed",
|
||||
"alias": "Bestellung ohne Konto"
|
||||
},{
|
||||
"name": "person",
|
||||
"alias": "Onlinekonto"
|
||||
|
||||
@@ -16,7 +16,6 @@ export interface ArticleSearchState {
|
||||
hits: number;
|
||||
selectedBranch: BranchDTO;
|
||||
selectedItemIds: number[];
|
||||
scrollPosition: number;
|
||||
defaultSettings?: UISettingsDTO;
|
||||
}
|
||||
|
||||
@@ -44,12 +43,6 @@ export class ArticleSearchService extends ComponentStore<ArticleSearchState> {
|
||||
return this.get((s) => s.items);
|
||||
}
|
||||
|
||||
scrollPosition$ = this.select((s) => s.scrollPosition);
|
||||
|
||||
get scrollPosition() {
|
||||
return this.get((s) => s.scrollPosition);
|
||||
}
|
||||
|
||||
selectedBranch$ = this.select((s) => s.selectedBranch);
|
||||
|
||||
get selectedBranch() {
|
||||
@@ -92,7 +85,6 @@ export class ArticleSearchService extends ComponentStore<ArticleSearchState> {
|
||||
searchState: '',
|
||||
selectedItemIds: [],
|
||||
selectedBranch: undefined,
|
||||
scrollPosition: 0,
|
||||
});
|
||||
this.setDefaultFilter();
|
||||
}
|
||||
@@ -113,10 +105,6 @@ export class ArticleSearchService extends ComponentStore<ArticleSearchState> {
|
||||
this.patchState({ selectedBranch });
|
||||
}
|
||||
|
||||
setScrollPosition(scrollPosition: number) {
|
||||
this.patchState({ scrollPosition });
|
||||
}
|
||||
|
||||
async setDefaultFilter(defaultQueryParams?: Record<string, string>) {
|
||||
const defaultSettings = await this.catalog.getSettings().toPromise();
|
||||
|
||||
@@ -160,7 +148,7 @@ export class ArticleSearchService extends ComponentStore<ArticleSearchState> {
|
||||
}
|
||||
}
|
||||
|
||||
search = this.effect((options$: Observable<{ clear?: boolean; orderBy?: boolean }>) =>
|
||||
search = this.effect((options$: Observable<{ clear?: boolean; orderBy?: boolean; doNotTrack?: boolean }>) =>
|
||||
options$.pipe(
|
||||
tap((options) => {
|
||||
this.searchStarted.next({ clear: options?.clear });
|
||||
@@ -178,6 +166,7 @@ export class ArticleSearchService extends ComponentStore<ArticleSearchState> {
|
||||
take: 25,
|
||||
friendlyName: this.friendlyName,
|
||||
stockId: selectedBranch?.id,
|
||||
doNotTrack: options?.doNotTrack,
|
||||
}).pipe(
|
||||
tapResponse(
|
||||
(res) => {
|
||||
|
||||
@@ -88,6 +88,26 @@ export class ArticleSearchFilterComponent implements OnInit, OnDestroy {
|
||||
|
||||
await this.articleSearch.setDefaultFilter(queryParams);
|
||||
});
|
||||
|
||||
this.articleSearch.searchCompleted
|
||||
.pipe(takeUntil(this._onDestroy$), withLatestFrom(this._processId$))
|
||||
.subscribe(async ([searchCompleted, processId]) => {
|
||||
if (searchCompleted.state.searchState === '') {
|
||||
const params = searchCompleted.state.filter.getQueryParams();
|
||||
if (searchCompleted.state.hits === 1) {
|
||||
const item = searchCompleted.state.items.find((f) => f);
|
||||
await this._navigationService
|
||||
.getArticleDetailsPath({
|
||||
processId,
|
||||
itemId: item.id,
|
||||
extras: { queryParams: params },
|
||||
})
|
||||
.navigate();
|
||||
} else {
|
||||
await this._navigationService.getArticleSearchResultsPath(processId, { queryParams: params }).navigate();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { BreadcrumbService } from '@core/breadcrumb';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { DomainCatalogService } from '@domain/catalog';
|
||||
import { combineLatest, NEVER, Subscription } from 'rxjs';
|
||||
import { catchError, debounceTime, first, switchMap, map } from 'rxjs/operators';
|
||||
import { catchError, debounceTime, first, switchMap, map, tap } from 'rxjs/operators';
|
||||
import { ArticleSearchService } from '../article-search.store';
|
||||
import { isEqual } from 'lodash';
|
||||
import { EnvironmentService } from '@core/environment';
|
||||
@@ -17,7 +17,10 @@ import { Filter, FilterInputGroupMainComponent } from 'apps/shared/components/fi
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ArticleSearchMainComponent implements OnInit, OnDestroy {
|
||||
readonly history$ = this.catalog.getSearchHistory({ take: 7 }).pipe(catchError(() => NEVER));
|
||||
readonly history$ = this.catalog.getSearchHistory({ take: 7 }).pipe(
|
||||
map((history) => history.filter((h) => !!h.friendlyName)),
|
||||
catchError(() => NEVER)
|
||||
);
|
||||
|
||||
fetching$ = this.searchService.fetching$;
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
<a
|
||||
<div
|
||||
class="page-search-result-item__item-card hover p-5 desktop-small:px-4 desktop-small:py-[0.625rem] h-[13.25rem] desktop-small:h-[11.3125rem] bg-white border border-solid border-transparent rounded"
|
||||
[class.page-search-result-item__item-card-primary]="primaryOutletActive"
|
||||
[routerLink]="detailsPath"
|
||||
[routerLinkActive]="!isTablet && !primaryOutletActive ? 'active' : ''"
|
||||
queryParamsHandling="preserve"
|
||||
(click)="isDesktopLarge ? scrollIntoView() : ''"
|
||||
[class.active]="isActive"
|
||||
>
|
||||
<div class="page-search-result-item__item-thumbnail text-center mr-4 w-[3.125rem] h-[4.9375rem]">
|
||||
<img
|
||||
@@ -122,4 +119,4 @@
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, ChangeDetectionStrategy, Input, EventEmitter, Output, HostBinding, ElementRef } from '@angular/core';
|
||||
import { Component, ChangeDetectionStrategy, Input, EventEmitter, Output, HostBinding } from '@angular/core';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { EnvironmentService } from '@core/environment';
|
||||
import { DomainAvailabilityService, DomainInStockService } from '@domain/availability';
|
||||
@@ -54,6 +54,8 @@ export class SearchResultItemComponent extends ComponentStore<SearchResultItemCo
|
||||
@Input()
|
||||
primaryOutletActive?: boolean = false;
|
||||
|
||||
@Input() isActive: boolean;
|
||||
|
||||
@Output()
|
||||
selectedChange = new EventEmitter<ItemDTO>();
|
||||
|
||||
@@ -82,11 +84,6 @@ export class SearchResultItemComponent extends ComponentStore<SearchResultItemCo
|
||||
return this._environment.matchDesktopLarge();
|
||||
}
|
||||
|
||||
get detailsPath() {
|
||||
return this._navigationService.getArticleDetailsPath({ processId: this.applicationService.activatedProcessId, itemId: this.item?.id })
|
||||
.path;
|
||||
}
|
||||
|
||||
get resultsPath() {
|
||||
return this._navigationService.getArticleSearchResultsPath(this.applicationService.activatedProcessId).path;
|
||||
}
|
||||
@@ -141,7 +138,6 @@ export class SearchResultItemComponent extends ComponentStore<SearchResultItemCo
|
||||
private _availability: DomainAvailabilityService,
|
||||
private _environment: EnvironmentService,
|
||||
private _navigationService: ProductCatalogNavigationService,
|
||||
private _elRef: ElementRef<HTMLElement>,
|
||||
private _store: Store
|
||||
) {
|
||||
super({
|
||||
@@ -150,10 +146,6 @@ export class SearchResultItemComponent extends ComponentStore<SearchResultItemCo
|
||||
});
|
||||
}
|
||||
|
||||
scrollIntoView() {
|
||||
this._elRef.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
|
||||
setSelected() {
|
||||
const isSelected = this._articleSearchService.selectedItemIds.includes(this.item?.id);
|
||||
this._articleSearchService.setSelected({ selected: !isSelected, itemId: this.item?.id });
|
||||
|
||||
@@ -46,38 +46,74 @@
|
||||
</shared-order-by-filter>
|
||||
</div>
|
||||
|
||||
<div class="h-full relative">
|
||||
<cdk-virtual-scroll-viewport
|
||||
#scrollContainer
|
||||
class="product-list h-full"
|
||||
[itemSize]="(primaryOutletActive$ | async) ? 98 : 181"
|
||||
minBufferPx="1200"
|
||||
[maxBufferPx]="maxBufferCdkScrollContainer$ | async"
|
||||
(scrolledIndexChange)="scrolledIndexChange($event)"
|
||||
>
|
||||
<search-result-item
|
||||
class="page-search-results__result-item"
|
||||
[class.page-search-results__result-item-primary]="primaryOutletActive$ | async"
|
||||
*cdkVirtualFor="let item of results$ | async; trackBy: trackByItemId"
|
||||
(selectedChange)="addToCart($event)"
|
||||
[selected]="isSelected(item)"
|
||||
[selectable]="isSelectable(item)"
|
||||
[item]="item"
|
||||
[primaryOutletActive]="primaryOutletActive$ | async"
|
||||
></search-result-item>
|
||||
<page-search-result-item-loading
|
||||
[primaryOutletActive]="primaryOutletActive$ | async"
|
||||
*ngIf="fetching$ | async"
|
||||
></page-search-result-item-loading>
|
||||
</cdk-virtual-scroll-viewport>
|
||||
<div class="actions z-sticky h-0">
|
||||
<button
|
||||
[disabled]="loading$ | async"
|
||||
*ngIf="(selectedItemIds$ | async)?.length > 0"
|
||||
class="cta-cart cta-action-primary"
|
||||
(click)="addToCart()"
|
||||
>
|
||||
<ui-spinner [show]="loading$ | async">In den Warenkorb legen</ui-spinner>
|
||||
</button>
|
||||
<ng-container *ngIf="primaryOutletActive$ | async; else sideOutlet">
|
||||
<div class="h-full relative">
|
||||
<cdk-virtual-scroll-viewport class="product-list h-full" itemSize="98" (scrolledIndexChange)="scrolledIndexChange($event)">
|
||||
<a
|
||||
*cdkVirtualFor="let item of results$ | async; let i = index; trackBy: trackByItemId"
|
||||
[routerLink]="getDetailsPath(item.id)"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
queryParamsHandling="preserve"
|
||||
(click)="scrollToItem(i)"
|
||||
>
|
||||
<search-result-item
|
||||
class="page-search-results__result-item page-search-results__result-item-primary"
|
||||
(selectedChange)="addToCart($event)"
|
||||
[selected]="isSelected(item)"
|
||||
[selectable]="isSelectable(item)"
|
||||
[item]="item"
|
||||
[primaryOutletActive]="true"
|
||||
[isActive]="rla.isActive"
|
||||
></search-result-item>
|
||||
</a>
|
||||
<page-search-result-item-loading [primaryOutletActive]="true" *ngIf="fetching$ | async"></page-search-result-item-loading>
|
||||
</cdk-virtual-scroll-viewport>
|
||||
<div class="actions z-sticky h-0">
|
||||
<button
|
||||
[disabled]="loading$ | async"
|
||||
*ngIf="(selectedItemIds$ | async)?.length > 0"
|
||||
class="cta-cart cta-action-primary"
|
||||
(click)="addToCart()"
|
||||
>
|
||||
<ui-spinner [show]="loading$ | async">In den Warenkorb legen</ui-spinner>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #sideOutlet>
|
||||
<div class="h-full relative">
|
||||
<cdk-virtual-scroll-viewport class="product-list h-full" itemSize="181" (scrolledIndexChange)="scrolledIndexChange($event)">
|
||||
<a
|
||||
*cdkVirtualFor="let item of results$ | async; let i = index; trackBy: trackByItemId"
|
||||
[routerLink]="getDetailsPath(item.id)"
|
||||
routerLinkActive
|
||||
#rla="routerLinkActive"
|
||||
queryParamsHandling="preserve"
|
||||
(click)="scrollToItem(i)"
|
||||
>
|
||||
<search-result-item
|
||||
class="page-search-results__result-item"
|
||||
(selectedChange)="addToCart($event)"
|
||||
[selected]="isSelected(item)"
|
||||
[selectable]="isSelectable(item)"
|
||||
[item]="item"
|
||||
[primaryOutletActive]="false"
|
||||
[isActive]="rla.isActive"
|
||||
></search-result-item>
|
||||
</a>
|
||||
<page-search-result-item-loading [primaryOutletActive]="false" *ngIf="fetching$ | async"></page-search-result-item-loading>
|
||||
</cdk-virtual-scroll-viewport>
|
||||
<div class="actions z-sticky h-0">
|
||||
<button
|
||||
[disabled]="loading$ | async"
|
||||
*ngIf="(selectedItemIds$ | async)?.length > 0"
|
||||
class="cta-cart cta-action-primary"
|
||||
(click)="addToCart()"
|
||||
>
|
||||
<ui-spinner [show]="loading$ | async">In den Warenkorb legen</ui-spinner>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
@@ -28,6 +28,7 @@ import { SearchResultItemComponent } from './search-result-item.component';
|
||||
import { ProductCatalogNavigationService } from '@shared/services';
|
||||
import { Filter, FilterInputGroupMainComponent } from 'apps/shared/components/filter/src/lib';
|
||||
import { DomainAvailabilityService, ItemData } from '@domain/availability';
|
||||
import { asapScheduler } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'page-search-results',
|
||||
@@ -37,7 +38,7 @@ import { DomainAvailabilityService, ItemData } from '@domain/availability';
|
||||
})
|
||||
export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
@ViewChildren(SearchResultItemComponent) listItems: QueryList<SearchResultItemComponent>;
|
||||
@ViewChild('scrollContainer', { static: true })
|
||||
@ViewChild(CdkVirtualScrollViewport, { static: false })
|
||||
scrollContainer: CdkVirtualScrollViewport;
|
||||
|
||||
@ViewChild(FilterInputGroupMainComponent, { static: false })
|
||||
@@ -59,6 +60,10 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
})
|
||||
);
|
||||
|
||||
getProcessId(): number {
|
||||
return this.application.activatedProcessId;
|
||||
}
|
||||
|
||||
loading$ = new BehaviorSubject<boolean>(false);
|
||||
|
||||
private subscriptions = new Subscription();
|
||||
@@ -92,20 +97,7 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
return this._environment.matchDesktop$.pipe(map((matches) => matches && this.route.outlet === 'primary'));
|
||||
}
|
||||
|
||||
// Ticket #4169 Splitscreen
|
||||
// Render genug Artikel um bei Navigation auf Trefferliste | PDP zum angewählten Artikel zu Scrollen
|
||||
maxBufferCdkScrollContainer$ = this.results$.pipe(
|
||||
withLatestFrom(this.primaryOutletActive$),
|
||||
map(([results, primaryOutlet]) => {
|
||||
if (!primaryOutlet && results?.length > 0) {
|
||||
// Splitscreen mode: Items Length * Item Pixel Height
|
||||
const maxBufferSize = results.length * 181;
|
||||
return maxBufferSize >= 1200 ? maxBufferSize : 1200;
|
||||
} else {
|
||||
return 1200;
|
||||
}
|
||||
})
|
||||
);
|
||||
private readonly SCROLL_INDEX_TOKEN = 'CATALOG_RESULTS_LIST_SCROLL_INDEX';
|
||||
|
||||
constructor(
|
||||
public searchService: ArticleSearchService,
|
||||
@@ -156,9 +148,8 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
|
||||
const cleanQueryParams = this.cleanupQueryParams(queryParams);
|
||||
|
||||
// Scroll to scroll_position in great result list
|
||||
if (!!queryParams?.scroll_position && this.route.outlet === 'primary') {
|
||||
this.scrollTop(Number(queryParams.scroll_position ?? 0));
|
||||
if (this.route.outlet === 'primary' && processChanged) {
|
||||
this.scrollToItem(this._getScrollIndexFromCache());
|
||||
}
|
||||
|
||||
if (!isEqual(cleanQueryParams, this.cleanupQueryParams(this.searchService.filter.getQueryParams()))) {
|
||||
@@ -174,11 +165,6 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
) {
|
||||
this.search({ clear: true });
|
||||
} else {
|
||||
if (!this.isDesktopLarge || this.route.outlet === 'primary') {
|
||||
this.scrollTop(Number(queryParams.scroll_position ?? 0));
|
||||
} else {
|
||||
this.scrollItemIntoView();
|
||||
}
|
||||
const selectedItemIds: Array<string> = queryParams?.selected_item_ids?.split(',') ?? [];
|
||||
for (const id of selectedItemIds) {
|
||||
if (id) {
|
||||
@@ -237,7 +223,19 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
.navigate();
|
||||
}
|
||||
} else if (searchCompleted?.clear || this.route.outlet === 'primary') {
|
||||
await this._navigationService.getArticleSearchResultsPath(processId, { queryParams: params }).navigate();
|
||||
const ean = this.route?.snapshot?.params?.ean;
|
||||
|
||||
if (ean) {
|
||||
await this._navigationService
|
||||
.getArticleDetailsPathByEan({
|
||||
processId,
|
||||
ean,
|
||||
extras: { queryParams: params },
|
||||
})
|
||||
.navigate();
|
||||
} else {
|
||||
await this._navigationService.getArticleSearchResultsPath(processId, { queryParams: params }).navigate();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -259,7 +257,39 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.scrollItemIntoView();
|
||||
this.scrollToItem(this._getScrollIndexFromCache());
|
||||
}
|
||||
|
||||
private _addScrollIndexToCache(index: number): void {
|
||||
this.cache.set<number>({ processId: this.getProcessId(), token: this.SCROLL_INDEX_TOKEN }, index);
|
||||
}
|
||||
|
||||
private _getScrollIndexFromCache(): number {
|
||||
return this.cache.get<number>({ processId: this.getProcessId(), token: this.SCROLL_INDEX_TOKEN });
|
||||
}
|
||||
|
||||
scrollToItem(i?: number) {
|
||||
let index = i;
|
||||
|
||||
if (!index) {
|
||||
index = this._getScrollIndexFromCache();
|
||||
} else {
|
||||
this._addScrollIndexToCache(index);
|
||||
}
|
||||
|
||||
asapScheduler.schedule(() => {
|
||||
this.scrollContainer.scrollToIndex(index, 'smooth');
|
||||
}, 150);
|
||||
}
|
||||
|
||||
scrolledIndexChange(index: number) {
|
||||
if (index && this.searchService.items.length <= this.scrollContainer?.getRenderedRange()?.end) {
|
||||
this.search({ clear: false });
|
||||
}
|
||||
|
||||
if (this.getProcessId() === this.searchService.processId) {
|
||||
this._addScrollIndexToCache(index);
|
||||
}
|
||||
}
|
||||
|
||||
async ngOnDestroy() {
|
||||
@@ -290,42 +320,17 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
this.sharedFilterInputGroupMain.cancelAutocomplete();
|
||||
}
|
||||
|
||||
this.searchService.search({ clear, orderBy });
|
||||
this.searchService.search({ clear, orderBy, doNotTrack: true });
|
||||
}
|
||||
|
||||
scrollTop(scrollPos: number) {
|
||||
setTimeout(() => this.scrollContainer.scrollTo({ top: scrollPos }), 0);
|
||||
}
|
||||
|
||||
scrollItemIntoView() {
|
||||
setTimeout(() => {
|
||||
const item = this.listItems?.find((item) => item.item.id === Number(this.route?.snapshot?.params?.id));
|
||||
item?.scrollIntoView();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
async scrolledIndexChange(index: number) {
|
||||
const results = await this.results$.pipe(first()).toPromise();
|
||||
const hits = await this.hits$.pipe(first()).toPromise();
|
||||
|
||||
if (results.length >= hits) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.route.outlet === 'primary') {
|
||||
this.searchService.setScrollPosition(this.scrollContainer.measureScrollOffset('top'));
|
||||
}
|
||||
|
||||
if (index >= results.length - 20 && results.length - 20 > 0) {
|
||||
this.search({ clear: false });
|
||||
}
|
||||
getDetailsPath(itemId: number) {
|
||||
return this._navigationService.getArticleDetailsPath({ processId: this.application.activatedProcessId, itemId }).path;
|
||||
}
|
||||
|
||||
async updateBreadcrumbs(
|
||||
processId: number = this.searchService.processId,
|
||||
queryParams: Record<string, string> = this.searchService.filter?.getQueryParams()
|
||||
) {
|
||||
const scroll_position = this.searchService.scrollPosition;
|
||||
const selected_item_ids = this.searchService?.selectedItemIds?.toString();
|
||||
|
||||
if (queryParams) {
|
||||
@@ -335,7 +340,7 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
.toPromise();
|
||||
|
||||
const name = queryParams.main_qs ? queryParams.main_qs : 'Alle Artikel';
|
||||
const params = { ...queryParams, scroll_position, selected_item_ids };
|
||||
const params = { ...queryParams, selected_item_ids };
|
||||
|
||||
for (const crumb of crumbs) {
|
||||
this.breadcrumb.patchBreadcrumb(crumb.id, {
|
||||
@@ -388,7 +393,6 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
|
||||
|
||||
cleanupQueryParams(params: Record<string, string> = {}) {
|
||||
const clean = { ...params };
|
||||
delete clean['scroll_position'];
|
||||
delete clean['selected_item_ids'];
|
||||
|
||||
for (const key in clean) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { NotificationChannel } from '@swagger/checkout';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CheckoutReviewDetailsComponent implements OnInit {
|
||||
control = this._store.notificationsControl;
|
||||
control: UntypedFormGroup;
|
||||
|
||||
customerFeatures$ = this._store.customerFeatures$;
|
||||
|
||||
@@ -96,15 +96,18 @@ export class CheckoutReviewDetailsComponent implements OnInit {
|
||||
selectedNotificationChannel = 1;
|
||||
}
|
||||
|
||||
this.control = fb.group({
|
||||
notificationChannel: new UntypedFormGroup({
|
||||
selected: new UntypedFormControl(selectedNotificationChannel),
|
||||
email: new UntypedFormControl(communicationDetails ? communicationDetails.email : '', emailNotificationValidator),
|
||||
mobile: new UntypedFormControl(communicationDetails ? communicationDetails.mobile : '', mobileNotificationValidator),
|
||||
}),
|
||||
});
|
||||
|
||||
this._store.notificationsControl = this.control;
|
||||
if (!this._store.notificationsControl) {
|
||||
this.control = fb.group({
|
||||
notificationChannel: new UntypedFormGroup({
|
||||
selected: new UntypedFormControl(selectedNotificationChannel),
|
||||
email: new UntypedFormControl(communicationDetails ? communicationDetails.email : '', emailNotificationValidator),
|
||||
mobile: new UntypedFormControl(communicationDetails ? communicationDetails.mobile : '', mobileNotificationValidator),
|
||||
}),
|
||||
});
|
||||
this._store.notificationsControl = this.control;
|
||||
} else {
|
||||
this.control = this._store.notificationsControl;
|
||||
}
|
||||
}
|
||||
|
||||
setAgentComment(agentComment: string) {
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<div class="label">ISBN/EAN</div>
|
||||
<div class="value">{{ orderItem.product?.ean }}</div>
|
||||
</div>
|
||||
<div class="detail" *ngIf="!!orderItem.price">
|
||||
<div class="detail" *ngIf="orderItem.price !== undefined">
|
||||
<div class="label">Preis</div>
|
||||
<div class="value">{{ orderItem.price | currency: 'EUR' }}</div>
|
||||
</div>
|
||||
|
||||
@@ -103,6 +103,33 @@ export class CustomerOrderSearchFilterComponent implements OnInit, OnDestroy {
|
||||
this._customerOrdersSearchStore.setQueryParams(queryParams);
|
||||
});
|
||||
|
||||
this._customerOrdersSearchStore.searchResultSubject.pipe(takeUntil(this._onDestroy$)).subscribe(async (result) => {
|
||||
if (result.results.error) {
|
||||
} else {
|
||||
if (result.results.hits > 0) {
|
||||
const queryParams = this._customerOrdersSearchStore.filter.getQueryParams();
|
||||
if (result.results.hits === 1) {
|
||||
const orderItem = result.results.result[0];
|
||||
await this._navigationService
|
||||
.getCustomerOrdersDetailsPath({
|
||||
processId: this.processId,
|
||||
processingStatus: orderItem?.processingStatus,
|
||||
compartmentCode: orderItem?.compartmentCode ? encodeURIComponent(orderItem.compartmentCode) : undefined,
|
||||
orderId: orderItem?.orderId ? orderItem.orderId : undefined,
|
||||
extras: { queryParams },
|
||||
})
|
||||
.navigate();
|
||||
} else {
|
||||
await this._navigationService.getCustomerOrdersResultsPath(this.processId, { queryParams }).navigate();
|
||||
}
|
||||
} else {
|
||||
this._customerOrdersSearchStore.setMessage('keine Suchergebnisse');
|
||||
}
|
||||
|
||||
this._cdr.markForCheck();
|
||||
}
|
||||
});
|
||||
|
||||
this._initSettings();
|
||||
this._initLoading$();
|
||||
}
|
||||
@@ -133,34 +160,6 @@ export class CustomerOrderSearchFilterComponent implements OnInit, OnDestroy {
|
||||
const queryParams = filter.getQueryParams();
|
||||
this._customerOrdersSearchStore.setQueryParams(queryParams);
|
||||
await this.updateQueryParams(queryParams);
|
||||
|
||||
this._customerOrdersSearchStore.searchResultSubject.pipe(takeUntil(this._onDestroy$)).subscribe(async (result) => {
|
||||
if (result.results.error) {
|
||||
} else {
|
||||
if (result.results.hits > 0) {
|
||||
const queryParams = this._customerOrdersSearchStore.filter.getQueryParams();
|
||||
if (result.results.hits === 1) {
|
||||
const orderItem = result.results.result[0];
|
||||
await this._navigationService
|
||||
.getCustomerOrdersDetailsPath({
|
||||
processId: this.processId,
|
||||
processingStatus: orderItem?.processingStatus,
|
||||
compartmentCode: orderItem?.compartmentCode ? encodeURIComponent(orderItem.compartmentCode) : undefined,
|
||||
orderId: orderItem?.orderId ? orderItem.orderId : undefined,
|
||||
extras: { queryParams },
|
||||
})
|
||||
.navigate();
|
||||
} else {
|
||||
await this._navigationService.getCustomerOrdersResultsPath(this.processId, { queryParams }).navigate();
|
||||
}
|
||||
} else {
|
||||
this._customerOrdersSearchStore.setMessage('keine Suchergebnisse');
|
||||
}
|
||||
|
||||
this._cdr.markForCheck();
|
||||
}
|
||||
});
|
||||
|
||||
this._customerOrdersSearchStore.search({ clear: true });
|
||||
}
|
||||
|
||||
|
||||
@@ -62,9 +62,6 @@ export class CustomerOrderSearchMainComponent implements OnInit, OnDestroy {
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
// Clear scroll position
|
||||
localStorage.removeItem(`SCROLL_POSITION_${this.processId}`);
|
||||
|
||||
this._subscriptions.add(
|
||||
combineLatest([this.processId$, this._activatedRoute.queryParams])
|
||||
.pipe(debounceTime(50))
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export const CustomerLabelColor = {
|
||||
Abholfachbestellung: '#EDEFF0',
|
||||
'Versandbestellung (oder gemischt)': '#EDEFF0',
|
||||
'Bestellung ohne Konto': '#EDEFF0',
|
||||
Onlinekonto: '#804279',
|
||||
'Onlinekonto mit Kundenkarte': '#804279',
|
||||
'Business Konto (auf Rechnung)': '#804279',
|
||||
@@ -10,6 +11,7 @@ export const CustomerLabelColor = {
|
||||
|
||||
export const CustomerLabelTextColor = {
|
||||
Abholfachbestellung: '#000000',
|
||||
'Bestellung ohne Konto': '#000000',
|
||||
'Versandbestellung (oder gemischt)': '#000000',
|
||||
Onlinekonto: '#FFFFFF',
|
||||
'Onlinekonto mit Kundenkarte': '#FFFFFF',
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AbstractControl, AsyncValidatorFn, UntypedFormControl, UntypedFormGroup
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { BreadcrumbService } from '@core/breadcrumb';
|
||||
import { CrmCustomerService } from '@domain/crm';
|
||||
import { AddressDTO, CustomerDTO, PayerDTO, ShippingAddressDTO } from '@swagger/crm';
|
||||
import { AddressDTO, CustomerDTO, CustomerInfoDTO, PayerDTO, ShippingAddressDTO } from '@swagger/crm';
|
||||
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
import { UiValidators } from '@ui/validators';
|
||||
import { isNull } from 'lodash';
|
||||
@@ -24,7 +24,12 @@ import {
|
||||
} from 'rxjs/operators';
|
||||
import { AddressFormBlockComponent, DeviatingAddressFormBlockComponent, DeviatingAddressFormBlockData } from '../components/form-blocks';
|
||||
import { FormBlock } from '../components/form-blocks/form-block';
|
||||
import { CustomerCreateFormData, decodeFormData, encodeFormData } from './customer-create-form-data';
|
||||
import {
|
||||
CustomerCreateFormData,
|
||||
decodeFormData,
|
||||
encodeFormData,
|
||||
mapCustomerInfoDtoToCustomerCreateFormData,
|
||||
} from './customer-create-form-data';
|
||||
import { AddressSelectionModalService } from '../modals';
|
||||
import { CustomerCreateNavigation, CustomerSearchNavigation } from '@shared/services';
|
||||
|
||||
@@ -237,13 +242,31 @@ export abstract class AbstractCreateCustomer implements OnInit, OnDestroy {
|
||||
})
|
||||
);
|
||||
}),
|
||||
tap(() => {
|
||||
tap(async (result) => {
|
||||
control.markAsTouched();
|
||||
this.cdr.markForCheck();
|
||||
|
||||
if (result === null) {
|
||||
const customerInfoDto = await this.getAnonymousCustomerForCode(control.value);
|
||||
if (customerInfoDto) {
|
||||
const data = mapCustomerInfoDtoToCustomerCreateFormData(customerInfoDto);
|
||||
this._formData.next(data);
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
async getAnonymousCustomerForCode(code: string): Promise<CustomerInfoDTO | undefined> {
|
||||
try {
|
||||
const res = await this.customerService.getCustomers(code).toPromise();
|
||||
|
||||
if (res.result.length > 0 && res.result[0].id < 0) {
|
||||
return res.result[0];
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
async navigateToCustomerDetails(customer: CustomerDTO) {
|
||||
const processId = await this.processId$.pipe(first()).toPromise();
|
||||
const route = this.customerSearchNavigation.detailsRoute({ processId, customerId: customer.id, customer });
|
||||
|
||||
@@ -56,7 +56,7 @@ export class CreateWebshopCustomerComponent extends AbstractCreateCustomer {
|
||||
async saveCustomer(customer: CustomerDTO): Promise<CustomerDTO> {
|
||||
const { customerDto, customerInfoDto } = this.formData?._meta ?? {};
|
||||
|
||||
const isUpgrade = !!(customerDto || customerInfoDto);
|
||||
const isUpgrade = !!(customerDto || customerInfoDto)?.id;
|
||||
|
||||
if (isUpgrade) {
|
||||
if (customerDto) {
|
||||
|
||||
@@ -411,7 +411,9 @@ export class CustomerDetailsViewMainComponent extends ComponentStore<CustomerDet
|
||||
_patchProcessName() {
|
||||
let name = `${this.customer.firstName} ${this.customer.lastName}`;
|
||||
|
||||
if (this._store.isBusinessKonto) {
|
||||
// Ticket #4458 Es kann vorkommen, dass B2B Konten keinen Firmennamen hinterlegt haben
|
||||
// zusätzlich kanne es bei Mitarbeiter Konten vorkommen, dass die Namen in der Organisation statt im Kundennamen hinterlegt sind
|
||||
if ((this._store.isBusinessKonto && this.customer.organisation?.name) || (!this.customer.firstName && !this.customer.lastName)) {
|
||||
name = `${this.customer.organisation?.name}`;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,4 +10,10 @@
|
||||
[loading]="fetching$ | async"
|
||||
[hint]="message$ | async"
|
||||
></shared-filter-input-group-main>
|
||||
<p class="mt-6">
|
||||
Kunde nicht gefunden?
|
||||
<a class="text-brand" *ngIf="createRoute$ | async; let route" [routerLink]="route.path" [queryParams]="route.queryParams">
|
||||
Neue Kundendaten erfassen
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,10 @@ import { Component, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { Filter, FilterModule } from '@shared/components/filter';
|
||||
import { CustomerSearchStore } from '../store';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { CustomerCreateNavigation } from '@shared/services';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { CustomerInfoDTO } from '@swagger/crm';
|
||||
|
||||
@Component({
|
||||
selector: 'page-customer-main-side-view',
|
||||
@@ -19,7 +23,29 @@ export class MainSideViewComponent {
|
||||
|
||||
fetching$ = this._store.fetchingCustomerList$;
|
||||
|
||||
constructor(private _store: CustomerSearchStore) {}
|
||||
createRoute$ = combineLatest(this.filter$, this._store.processId$).pipe(
|
||||
map(([filter, processId]) => {
|
||||
const queryParams = filter?.getQueryParams();
|
||||
|
||||
let customerInfo: CustomerInfoDTO;
|
||||
|
||||
if (queryParams?.main_qs) {
|
||||
const isMail = queryParams.main_qs.includes('@');
|
||||
customerInfo = {
|
||||
lastName: !isMail ? queryParams.main_qs : undefined,
|
||||
communicationDetails: isMail
|
||||
? {
|
||||
email: queryParams.main_qs,
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
return this._customerCreateNavigation.createCustomerRoute({ processId, customerInfo });
|
||||
})
|
||||
);
|
||||
|
||||
constructor(private _store: CustomerSearchStore, private _customerCreateNavigation: CustomerCreateNavigation) {}
|
||||
|
||||
search(filter: Filter) {
|
||||
this._store.setFilter(filter);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
:host {
|
||||
@apply bg-surface text-surface-content rounded grid grid-flow-row h-full;
|
||||
@apply bg-surface text-surface-content rounded grid grid-flow-row h-full side-view-shadow;
|
||||
}
|
||||
|
||||
.side-view-shadow {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="desktop-large:hidden">
|
||||
<div class="text-center pt-10 px-8 rounded-card side-view-shadow grow">
|
||||
<div class="text-center pt-10 px-8 rounded-card grow">
|
||||
<h1 class="text-[1.625rem] font-bold">Kundensuche</h1>
|
||||
<p class="text-lg mt-2 mb-6">
|
||||
Haben Sie ein Konto bei uns?
|
||||
@@ -28,6 +28,12 @@
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<p class="mt-6">
|
||||
Kunde nicht gefunden?
|
||||
<a class="text-brand" *ngIf="createRoute$ | async; let route" [routerLink]="route.path" [queryParams]="route.queryParams">
|
||||
Neue Kundendaten erfassen
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden desktop-large:block">
|
||||
|
||||
@@ -6,9 +6,10 @@ import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { IconComponent } from '@shared/components/icon';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { CustomerSearchNavigation } from '@shared/services';
|
||||
import { CustomerSearchNavigation, CustomerCreateNavigation } from '@shared/services';
|
||||
import { CustomerFilterMainViewModule } from '../filter-main-view/filter-main-view.module';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { CustomerInfoDTO } from '@swagger/crm';
|
||||
|
||||
@Component({
|
||||
selector: 'page-customer-main-view',
|
||||
@@ -29,6 +30,28 @@ export class CustomerMainViewComponent {
|
||||
})
|
||||
);
|
||||
|
||||
createRoute$ = combineLatest(this._store.filter$, this._store.processId$).pipe(
|
||||
map(([filter, processId]) => {
|
||||
const queryParams = filter?.getQueryParams();
|
||||
|
||||
let customerInfo: CustomerInfoDTO;
|
||||
|
||||
if (queryParams?.main_qs) {
|
||||
const isMail = queryParams.main_qs.includes('@');
|
||||
customerInfo = {
|
||||
lastName: !isMail ? queryParams.main_qs : undefined,
|
||||
communicationDetails: isMail
|
||||
? {
|
||||
email: queryParams.main_qs,
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
return this._customerCreateNavigation.createCustomerRoute({ processId, customerInfo });
|
||||
})
|
||||
);
|
||||
|
||||
filter$ = this._store.filter$;
|
||||
|
||||
hasFilter$ = this.filter$.pipe(
|
||||
@@ -43,7 +66,12 @@ export class CustomerMainViewComponent {
|
||||
|
||||
message$ = this._store.message$;
|
||||
|
||||
constructor(private _searchNavigation: CustomerSearchNavigation, private _store: CustomerSearchStore, private _router: Router) {}
|
||||
constructor(
|
||||
private _searchNavigation: CustomerSearchNavigation,
|
||||
private _customerCreateNavigation: CustomerCreateNavigation,
|
||||
private _store: CustomerSearchStore,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
search(filter: Filter) {
|
||||
this._store.setFilter(filter);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { ProductsFeed } from '@domain/isa';
|
||||
import { ProductCatalogNavigationService } from '@shared/services';
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'page-products-card',
|
||||
@@ -12,9 +14,19 @@ export class ProductsCardComponent {
|
||||
@Input()
|
||||
feed: ProductsFeed;
|
||||
|
||||
constructor(private _router: Router) {}
|
||||
constructor(private _navigation: ProductCatalogNavigationService, private _app: ApplicationService) {}
|
||||
|
||||
navigatetToProduct(ean: string) {
|
||||
this._router.navigate(['/kunde/product/details/ean', ean]);
|
||||
async navigatetToProduct(ean: string) {
|
||||
let processes = await this._app.getProcesses$('customer').pipe(first()).toPromise();
|
||||
|
||||
processes = processes.sort((a, b) => b.activated - a.activated);
|
||||
|
||||
this._navigation
|
||||
.getArticleDetailsPathByEan({
|
||||
processId: processes[0]?.id ?? Date.now(),
|
||||
ean,
|
||||
extras: { queryParams: { main_qs: this.feed.items.map((i) => i.product.ean).join(';') } },
|
||||
})
|
||||
.navigate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ export class GoodsInCleanupListComponent implements OnInit, OnDestroy {
|
||||
key: this._config.get('process.ids.goodsIn'),
|
||||
name: 'Abholfachbereinigungsliste',
|
||||
path: '/filiale/goods/in/cleanup',
|
||||
params: { view: 'cleanup' },
|
||||
section: 'branch',
|
||||
tags: ['goods-in', 'cleanup'],
|
||||
});
|
||||
|
||||
@@ -107,8 +107,8 @@ export class GoodsInListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
await this.updateBreadcrumb({ queryParams: params });
|
||||
await this.createBreadcrumb({ queryParams: params });
|
||||
await this.updateBreadcrumb(params);
|
||||
await this.createBreadcrumb(params);
|
||||
await this.removeBreadcrumbs();
|
||||
});
|
||||
}
|
||||
@@ -124,6 +124,7 @@ export class GoodsInListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
const clean = { ...params };
|
||||
delete clean['scroll_position'];
|
||||
delete clean['take'];
|
||||
delete clean['view'];
|
||||
|
||||
for (const key in clean) {
|
||||
if (Object.prototype.hasOwnProperty.call(clean, key)) {
|
||||
@@ -207,7 +208,7 @@ export class GoodsInListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
name: 'Wareneingangsliste',
|
||||
path: '/filiale/goods/in/list',
|
||||
section: 'branch',
|
||||
params: queryParams,
|
||||
params: { ...queryParams, view: 'wareneingangsliste' },
|
||||
tags: ['goods-in', 'list'],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -88,7 +88,11 @@ export class GoodsInListStore extends ComponentStore<GoodsInListState> {
|
||||
const path = '/filiale/goods/in/list/';
|
||||
if (!this._router.isActive(path, false)) {
|
||||
this._router.navigate([path], {
|
||||
queryParams: { ...this.filter.getQueryParams(), take: res.result.length + _results?.length },
|
||||
queryParams: {
|
||||
...this.filter.getQueryParams(),
|
||||
take: res.result.length + _results?.length,
|
||||
view: 'wareneingangsliste',
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ export class GoodsInRemissionPreviewComponent implements OnInit, OnDestroy {
|
||||
name: 'Abholfachremissionsvorschau',
|
||||
path: '/filiale/goods/in/preview',
|
||||
section: 'branch',
|
||||
params: { view: 'remission' },
|
||||
tags: ['goods-in', 'preview'],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ export class GoodsInReservationComponent implements OnInit, OnDestroy {
|
||||
name: 'Reservierungen',
|
||||
path: '/filiale/goods/in/reservation',
|
||||
section: 'branch',
|
||||
params: { view: 'reservation' },
|
||||
tags: ['goods-in', 'reservation'],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ export abstract class PickupShelfBaseComponent implements OnInit {
|
||||
const name = 'Reservierungen';
|
||||
const path: NavigationRoute = {
|
||||
path: ['/filiale', 'goods', 'in', 'reservation'],
|
||||
queryParams: { view: undefined },
|
||||
queryParams: { view: 'reservation' },
|
||||
urlTree: this.router.createUrlTree(['/filiale', 'goods', 'in', 'reservation'], {}),
|
||||
};
|
||||
|
||||
@@ -251,7 +251,7 @@ export abstract class PickupShelfBaseComponent implements OnInit {
|
||||
const name = 'Abholfachbereinigungsliste';
|
||||
const path: NavigationRoute = {
|
||||
path: ['/filiale', 'goods', 'in', 'cleanup'],
|
||||
queryParams: { view: undefined },
|
||||
queryParams: { view: 'cleanup' },
|
||||
urlTree: this.router.createUrlTree(['/filiale', 'goods', 'in', 'cleanup'], {}),
|
||||
};
|
||||
|
||||
@@ -284,7 +284,7 @@ export abstract class PickupShelfBaseComponent implements OnInit {
|
||||
const name = 'Wareneingangsliste';
|
||||
const path: NavigationRoute = {
|
||||
path: ['/filiale', 'goods', 'in', 'list'],
|
||||
queryParams: { view: undefined },
|
||||
queryParams: { view: 'wareneingangsliste' },
|
||||
urlTree: this.router.createUrlTree(['/filiale', 'goods', 'in', 'list'], {}),
|
||||
};
|
||||
|
||||
@@ -317,7 +317,7 @@ export abstract class PickupShelfBaseComponent implements OnInit {
|
||||
const name = 'Abholfachremissionsvorschau';
|
||||
const path: NavigationRoute = {
|
||||
path: ['/filiale', 'goods', 'in', 'preview'],
|
||||
queryParams: { view: undefined },
|
||||
queryParams: { view: 'remission' },
|
||||
urlTree: this.router.createUrlTree(['/filiale', 'goods', 'in', 'preview'], {}),
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import { PickupShelfDetailsStore, PickupShelfStore } from './store';
|
||||
import { ActionHandlerService } from './services/action-handler.service';
|
||||
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
|
||||
import { OrderItemsContext } from '@domain/oms';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
||||
|
||||
export abstract class PickupShelfDetailsBaseComponent {
|
||||
protected destroyRef = inject(DestroyRef);
|
||||
@@ -18,6 +20,22 @@ export abstract class PickupShelfDetailsBaseComponent {
|
||||
store = inject(PickupShelfDetailsStore);
|
||||
listStore = inject(PickupShelfStore);
|
||||
|
||||
get side() {
|
||||
if (this.activatedRoute.snapshot.queryParams.side !== undefined) {
|
||||
return coerceBooleanProperty(this.activatedRoute.snapshot.queryParams.side);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
side$ = this.activatedRoute.queryParams.pipe(
|
||||
map((params) => {
|
||||
if (params.side !== undefined) {
|
||||
return coerceBooleanProperty(params.side);
|
||||
}
|
||||
return true;
|
||||
})
|
||||
);
|
||||
|
||||
constructor() {
|
||||
this.activatedRoute.params.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((params) => {
|
||||
this.store.fetchOrder({ orderId: Number(params.orderId) });
|
||||
@@ -58,12 +76,26 @@ export abstract class PickupShelfDetailsBaseComponent {
|
||||
itemQuantity: this.store.selectedOrderItemQuantity,
|
||||
});
|
||||
|
||||
const ctxItem = ctx?.items[0];
|
||||
|
||||
// Ticket #4466 - Nach der nachbestellung wurde der Artikel in den Details nicht mehr angezeigt - änderung #4459 rückgängig gemacht
|
||||
// Ticket #4459 - Usecase Abholfach Nachbestellen - Wenn das selektierte Item nicht verändert wurde z.B. beim schließen des nachbestellen Modals
|
||||
// soll hier returned werden, da der unveränderte Stand angezeigt werden soll
|
||||
// if (
|
||||
// !ctxItem ||
|
||||
// (action.command.includes('REORDER') &&
|
||||
// ctxItem.orderItemSubsetId === this.store.selectedOrderItems.find((_) => true).orderItemSubsetId)
|
||||
// ) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
this.store.setFetchPartial(false);
|
||||
this.store.resetSelectedOrderItems();
|
||||
this.listStore.resetSelectedListItems();
|
||||
this.store.resetSelectedOrderItemQuantity();
|
||||
this.store.setSelectedCompartmentInfo(undefined);
|
||||
|
||||
const ctxItem = ctx?.items.find((_) => true);
|
||||
if (!ctxItem) return;
|
||||
|
||||
const updatedDetailsItems = await new Promise<DBHOrderItemListItemDTO[]>((resolve, reject) => {
|
||||
this.store.fetchOrderItems({
|
||||
|
||||
@@ -28,6 +28,17 @@
|
||||
</div>
|
||||
|
||||
<div class="page-pickup-shelf-in-details__action-wrapper">
|
||||
<button
|
||||
[disabled]="actionsDisabled$ | async"
|
||||
class="cta-action shadow-action"
|
||||
[class.cta-action-primary]="action.selected"
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
*ngFor="let action of mainActions$ | async"
|
||||
(click)="handleAction({action})"
|
||||
>
|
||||
<ui-spinner [show]="(changeActionLoader$ | async) === action.command">{{ action.label }}</ui-spinner>
|
||||
</button>
|
||||
|
||||
<ng-container *ngIf="latestCompartmentInfos$ | async; let latestCompartmentInfos">
|
||||
<button
|
||||
[disabled]="addToPreviousCompartmentActionDisabled$ | async"
|
||||
@@ -42,15 +53,4 @@
|
||||
>
|
||||
</button>
|
||||
</ng-container>
|
||||
|
||||
<button
|
||||
[disabled]="actionsDisabled$ | async"
|
||||
class="cta-action shadow-action"
|
||||
[class.cta-action-primary]="action.selected"
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
*ngFor="let action of mainActions$ | async"
|
||||
(click)="handleAction({action})"
|
||||
>
|
||||
<ui-spinner [show]="(changeActionLoader$ | async) === action.command">{{ action.label }}</ui-spinner>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -9,12 +9,13 @@ import { PickupShelfAddToPreviousCompartmentCodeLabelPipe } from '../../shared/p
|
||||
import { UiSpinnerModule } from '@ui/spinner';
|
||||
import { OnInitDirective } from '@shared/directives/element-lifecycle';
|
||||
import { PickupShelfInNavigationService } from '@shared/services';
|
||||
import { BehaviorSubject, combineLatest } from 'rxjs';
|
||||
import { BehaviorSubject, asapScheduler, combineLatest } from 'rxjs';
|
||||
import { map, shareReplay } from 'rxjs/operators';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
|
||||
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RunCheckTrigger } from '../../trigger';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-in-details',
|
||||
@@ -37,6 +38,8 @@ import { ActivatedRoute } from '@angular/router';
|
||||
],
|
||||
})
|
||||
export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseComponent implements OnInit, AfterViewInit {
|
||||
runCheckTrigger = inject(RunCheckTrigger);
|
||||
|
||||
@ViewChild(PickUpShelfDetailsTagsComponent, { static: false })
|
||||
pickUpShelfDetailsTags: PickUpShelfDetailsTagsComponent;
|
||||
|
||||
@@ -128,29 +131,36 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
try {
|
||||
this.changeActionLoader$.next(action.command);
|
||||
this.store.setDisableHeaderStatusDropdown(true);
|
||||
|
||||
const context = await this.execAction({ action, latestCompartmentCode, latestCompartmentInfo });
|
||||
|
||||
if (!!context) {
|
||||
if (action.command.includes('ARRIVED') || action.command.includes('PRINT_PRICEDIFFQRCODELABEL')) {
|
||||
await this.router.navigate(this._pickupShelfInNavigationService.defaultRoute().path);
|
||||
asapScheduler.schedule(async () => {
|
||||
await this.navigateBasedOnCurrentView();
|
||||
}, 100);
|
||||
} else {
|
||||
const item = context?.items.find((_) => true);
|
||||
await this.router.navigate(
|
||||
this._pickupShelfInNavigationService.detailRoute({
|
||||
item: {
|
||||
compartmentCode: item.compartmentCode,
|
||||
orderId: item.orderId,
|
||||
orderNumber: item.orderNumber,
|
||||
processingStatus: item.processingStatus,
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
compartmentInfo: item.compartmentInfo,
|
||||
},
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
this.listStore.patchOrderItem({
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
changes: { processingStatus: item.processingStatus },
|
||||
});
|
||||
if (!!item) {
|
||||
await this.router.navigate(
|
||||
this._pickupShelfInNavigationService.detailRoute({
|
||||
item: {
|
||||
compartmentCode: item.compartmentCode,
|
||||
orderId: item.orderId,
|
||||
orderNumber: item.orderNumber,
|
||||
processingStatus: item.processingStatus,
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
compartmentInfo: item.compartmentInfo,
|
||||
},
|
||||
side: false,
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
this.listStore.patchOrderItem({
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
changes: { processingStatus: item.processingStatus },
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -161,12 +171,32 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
});
|
||||
}
|
||||
|
||||
asapScheduler.schedule(() => {
|
||||
this.runCheckTrigger.next();
|
||||
}, 100);
|
||||
|
||||
setTimeout(() => {
|
||||
this.store.setDisableHeaderStatusDropdown(false);
|
||||
this.changeActionLoader$.next(undefined);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
async navigateBasedOnCurrentView() {
|
||||
const currentView = await this._activatedRoute?.snapshot?.queryParams?.view;
|
||||
switch (currentView) {
|
||||
case 'reservation':
|
||||
return this.router.navigate(['/filiale', 'goods', 'in', 'reservation'], { queryParamsHandling: 'preserve' });
|
||||
case 'cleanup':
|
||||
return this.router.navigate(['/filiale', 'goods', 'in', 'cleanup'], { queryParamsHandling: 'preserve' });
|
||||
case 'remission':
|
||||
return this.router.navigate(['/filiale', 'goods', 'in', 'preview'], { queryParamsHandling: 'preserve' });
|
||||
case 'wareneingangsliste':
|
||||
return this.router.navigate(['/filiale', 'goods', 'in', 'list'], { queryParamsHandling: 'preserve' });
|
||||
default:
|
||||
return this.router.navigate(this._pickupShelfInNavigationService.defaultRoute().path);
|
||||
}
|
||||
}
|
||||
|
||||
updateDate({ date, type }: { date: Date; type?: 'delivery' | 'pickup' | 'preferred' }) {
|
||||
switch (type) {
|
||||
case 'delivery':
|
||||
@@ -196,28 +226,34 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
|
||||
async navigateToEditPage(orderItem: DBHOrderItemListItemDTO) {
|
||||
await this.router.navigate(
|
||||
this._pickupShelfInNavigationService.editRoute({
|
||||
compartmentCode: orderItem.compartmentCode,
|
||||
orderId: orderItem.orderId,
|
||||
orderNumber: orderItem.orderNumber,
|
||||
processingStatus: orderItem.processingStatus,
|
||||
orderItemSubsetId: orderItem.orderItemSubsetId,
|
||||
compartmentInfo: orderItem.compartmentInfo,
|
||||
}).path,
|
||||
this._pickupShelfInNavigationService.editRoute(
|
||||
{
|
||||
compartmentCode: orderItem.compartmentCode,
|
||||
orderId: orderItem.orderId,
|
||||
orderNumber: orderItem.orderNumber,
|
||||
processingStatus: orderItem.processingStatus,
|
||||
orderItemSubsetId: orderItem.orderItemSubsetId,
|
||||
compartmentInfo: orderItem.compartmentInfo,
|
||||
},
|
||||
{ side: this.side }
|
||||
).path,
|
||||
{ queryParams: { buyerNumber: orderItem?.buyerNumber }, queryParamsHandling: 'merge' }
|
||||
);
|
||||
}
|
||||
|
||||
async navigateToHistoryPage(orderItem: DBHOrderItemListItemDTO) {
|
||||
await this.router.navigate(
|
||||
this._pickupShelfInNavigationService.historyRoute({
|
||||
compartmentCode: orderItem.compartmentCode,
|
||||
orderId: orderItem.orderId,
|
||||
orderNumber: orderItem.orderNumber,
|
||||
processingStatus: orderItem.processingStatus,
|
||||
orderItemSubsetId: orderItem.orderItemSubsetId,
|
||||
compartmentInfo: orderItem.compartmentInfo,
|
||||
}).path,
|
||||
this._pickupShelfInNavigationService.historyRoute(
|
||||
{
|
||||
compartmentCode: orderItem.compartmentCode,
|
||||
orderId: orderItem.orderId,
|
||||
orderNumber: orderItem.orderNumber,
|
||||
processingStatus: orderItem.processingStatus,
|
||||
orderItemSubsetId: orderItem.orderItemSubsetId,
|
||||
compartmentInfo: orderItem.compartmentInfo,
|
||||
},
|
||||
{ side: this.side }
|
||||
).path,
|
||||
{ queryParams: { orderItemSubsetId: orderItem.orderItemSubsetId }, queryParamsHandling: 'merge' }
|
||||
);
|
||||
}
|
||||
@@ -229,6 +265,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
async coverClick(orderItems: DBHOrderItemListItemDTO[]) {
|
||||
if (orderItems.length === 1) {
|
||||
const item = orderItems.find((_) => true);
|
||||
|
||||
await this.router.navigate(
|
||||
this._pickupShelfInNavigationService.detailRoute({
|
||||
item: {
|
||||
@@ -239,6 +276,7 @@ export class PickupShelfInDetailsComponent extends PickupShelfDetailsBaseCompone
|
||||
processingStatus: item.processingStatus,
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
},
|
||||
side: this.side,
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
|
||||
@@ -40,6 +40,7 @@ export class PickupShelfInEditComponent extends PickupShelfDetailsBaseComponent
|
||||
compartmentInfo,
|
||||
orderItemSubsetId: this.store?.selectPreviousSelectedOrderItemSubsetId,
|
||||
},
|
||||
side: this.side,
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
|
||||
@@ -40,17 +40,49 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="h-full relative overflow-hidden overflow-y-scroll">
|
||||
<ui-scroll-container
|
||||
*ngIf="!(listEmpty$ | async); else emptyMessage"
|
||||
class="page-pickup-shelf-in-list__scroll-container m-0 p-0"
|
||||
(reachEnd)="loadMore()"
|
||||
[deltaEnd]="150"
|
||||
[showScrollbar]="false"
|
||||
[containerHeight]="25"
|
||||
[showScrollArrow]="false"
|
||||
[showSpacer]="(primaryOutletActive$ | async) || (isTablet$ | async) || (isDesktopSmall$ | async)"
|
||||
<div sharedScrollContainer class="overflow-scroll" (scrolledToBottom)="loadMore()">
|
||||
<div class="empty-message" *ngIf="listEmpty$ | async">
|
||||
Es sind im Moment keine Bestellposten vorhanden,<br />
|
||||
die bearbeitet werden können.
|
||||
</div>
|
||||
<div
|
||||
class="page-pickup-shelf-in-list__items-list"
|
||||
*ngFor="let bueryNumberGroup of list$ | async | groupBy: byBuyerNumberFn; trackBy: trackByGroupFn"
|
||||
>
|
||||
<ng-container *ngIf="bueryNumberGroup.items[0]; let firstItem">
|
||||
<div
|
||||
class="page-pickup-shelf-in-list__item-header-group w-full grid grid-flow-col gap-x-4 items-center justify-between bg-white text-xl rounded-t p-4 font-bold mb-px-2"
|
||||
>
|
||||
<h3>
|
||||
{{ firstItem?.organisation }}
|
||||
<ng-container *ngIf="!!firstItem?.organisation && (!!firstItem?.firstName || !!firstItem?.lastName)"> - </ng-container>
|
||||
{{ firstItem?.lastName }}
|
||||
{{ firstItem?.firstName }}
|
||||
</h3>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngFor="let orderNumberGroup of bueryNumberGroup.items | groupBy: byOrderNumberFn; trackBy: trackByGroupFn">
|
||||
<ng-container *ngFor="let processingStatusGroup of orderNumberGroup.items | groupBy: byProcessingStatusFn; trackBy: trackByGroupFn">
|
||||
<ng-container
|
||||
*ngFor="let compartmentCodeGroup of processingStatusGroup.items | groupBy: byCompartmentCodeFn; trackBy: trackByGroupFn"
|
||||
>
|
||||
<page-pickup-shelf-list-item
|
||||
*ngFor="let item of compartmentCodeGroup.items; let firstItem = first; trackBy: trackByFn"
|
||||
class="page-pickup-shelf-in-list__result-item mb-[0.125rem]"
|
||||
[item]="item"
|
||||
[primaryOutletActive]="primaryOutletActive$ | async"
|
||||
[itemDetailsLink]="getItemDetailsLink(item)"
|
||||
></page-pickup-shelf-list-item>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
<page-pickup-shelf-list-item-loader *ngIf="fetching$ | async"></page-pickup-shelf-list-item-loader>
|
||||
</div>
|
||||
|
||||
<!-- <div class="h-full relative overflow-hidden overflow-y-scroll" sharedScrollContainer>
|
||||
<div *ngIf="!(listEmpty$ | async); else emptyMessage" class="page-pickup-shelf-in-list__scroll-container m-0 p-0" (reachEnd)="loadMore()">
|
||||
<div
|
||||
class="page-pickup-shelf-in-list__items-list w-full"
|
||||
*ngFor="let bueryNumberGroup of list$ | async | groupBy: byBuyerNumberFn; trackBy: trackByGroupFn"
|
||||
@@ -85,12 +117,5 @@
|
||||
</ng-container>
|
||||
</div>
|
||||
<page-pickup-shelf-list-item-loader *ngIf="fetching$ | async"></page-pickup-shelf-list-item-loader>
|
||||
</ui-scroll-container>
|
||||
</div>
|
||||
|
||||
<ng-template #emptyMessage>
|
||||
<div class="empty-message">
|
||||
Es sind im Moment keine Bestellposten vorhanden,<br />
|
||||
die bearbeitet werden können.
|
||||
</div>
|
||||
</ng-template>
|
||||
</div> -->
|
||||
|
||||
@@ -15,7 +15,6 @@ import { ActivatedRoute, NavigationStart, Router, RouterLink } from '@angular/ro
|
||||
import { Filter, FilterModule } from '@shared/components/filter';
|
||||
import { IconModule } from '@shared/components/icon';
|
||||
import { PickUpShelfListItemComponent } from '../../shared/pickup-shelf-list-item/pickup-shelf-list-item.component';
|
||||
import { UiScrollContainerComponent, UiScrollContainerModule } from '@ui/scroll-container';
|
||||
import { Group, GroupByPipe } from '@ui/common';
|
||||
import { UiSpinnerModule } from '@ui/spinner';
|
||||
import { PickupShelfInNavigationService } from '@shared/services';
|
||||
@@ -28,6 +27,7 @@ import { EnvironmentService } from '@core/environment';
|
||||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-in-list',
|
||||
@@ -44,7 +44,7 @@ import { PickupShelfListItemLoaderComponent } from '../../shared/pickup-shelf-li
|
||||
IconModule,
|
||||
FilterModule,
|
||||
PickUpShelfListItemComponent,
|
||||
UiScrollContainerModule,
|
||||
ScrollContainerDirective,
|
||||
GroupByPipe,
|
||||
UiSpinnerModule,
|
||||
PickupShelfListItemLoaderComponent,
|
||||
@@ -52,7 +52,7 @@ import { PickupShelfListItemLoaderComponent } from '../../shared/pickup-shelf-li
|
||||
})
|
||||
export class PickUpShelfInListComponent implements OnInit, AfterViewInit {
|
||||
@ViewChildren(PickUpShelfListItemComponent) listItems: QueryList<PickUpShelfListItemComponent>;
|
||||
@ViewChild(UiScrollContainerComponent) scrollContainer: UiScrollContainerComponent;
|
||||
@ViewChild(ScrollContainerDirective) scrollContainer: ScrollContainerDirective;
|
||||
|
||||
private _pickupShelfInNavigationService = inject(PickupShelfInNavigationService);
|
||||
|
||||
@@ -152,7 +152,7 @@ export class PickUpShelfInListComponent implements OnInit, AfterViewInit {
|
||||
|
||||
private _addScrollPositionToCache(): void {
|
||||
if (this._activatedRoute.outlet === 'primary') {
|
||||
this._cache.set<number>({ processId: this.store.processId, token: this.SCROLL_POSITION_TOKEN }, this.scrollContainer?.scrollPos);
|
||||
this._cache.set<number>({ processId: this.store.processId, token: this.SCROLL_POSITION_TOKEN }, this.scrollContainer?.scrollPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,7 @@ export class PickupShelfInComponent extends PickupShelfBaseComponent {
|
||||
orderItemSubsetId,
|
||||
compartmentInfo,
|
||||
},
|
||||
side: data?.queryParams?.side === 'false' ? false : true, // Fix Ticket #4493 - Wenn man von einer anderen Liste aus kommt z.B. Reservieren Liste, dann soll side in der Breadcrumb false sein
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ import { PickUpShelfDetailsHeaderComponent } from '../../shared/pickup-shelf-det
|
||||
import { PickUpShelfDetailsItemComponent } from '../../shared/pickup-shelf-details-item/pickup-shelf-details-item.component';
|
||||
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString, OrderItemProcessingStatusValue } from '@swagger/oms';
|
||||
import { PickUpShelfOutNavigationService } from '@shared/services';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { BehaviorSubject, asapScheduler } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { PickUpShelfDetailsTagsComponent } from '../../shared/pickup-shelf-details-tags/pickup-shelf-details-tags.component';
|
||||
import { UiSpinnerModule } from '@ui/spinner';
|
||||
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
import { OnInitDirective } from '@shared/directives/element-lifecycle';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { RunCheckTrigger } from '../../trigger';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-out-details',
|
||||
@@ -34,6 +35,8 @@ import { FormsModule } from '@angular/forms';
|
||||
providers: [],
|
||||
})
|
||||
export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseComponent {
|
||||
runCheckTrigger = inject(RunCheckTrigger);
|
||||
|
||||
@ViewChild(PickUpShelfDetailsTagsComponent, { static: false })
|
||||
pickUpShelfDetailsTags: PickUpShelfDetailsTagsComponent;
|
||||
|
||||
@@ -105,6 +108,10 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
|
||||
});
|
||||
}
|
||||
|
||||
asapScheduler.schedule(() => {
|
||||
this.runCheckTrigger.next();
|
||||
}, 100);
|
||||
|
||||
setTimeout(() => {
|
||||
this.store.setDisableHeaderStatusDropdown(false);
|
||||
this.changeActionLoader$.next(undefined);
|
||||
|
||||
@@ -40,7 +40,62 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="h-full relative overflow-hidden overflow-y-scroll">
|
||||
<div sharedScrollContainer class="overflow-scroll" (scrolledToBottom)="loadMore()">
|
||||
<div class="empty-message" *ngIf="listEmpty$ | async">
|
||||
Es sind im Moment keine Bestellposten vorhanden,<br />
|
||||
die bearbeitet werden können.
|
||||
</div>
|
||||
<div
|
||||
class="page-pickup-shelf-out-list__items-list w-full"
|
||||
*ngFor="let bueryNumberGroup of list$ | async | groupBy: byBuyerNumberFn; trackBy: trackByGroupFn"
|
||||
>
|
||||
<ng-container *ngIf="bueryNumberGroup.items[0]; let firstItem">
|
||||
<div
|
||||
class="page-pickup-shelf-out-list__item-header-group w-full grid grid-flow-col gap-x-4 items-center justify-between bg-white text-xl rounded-t p-4 font-bold mb-px-2"
|
||||
>
|
||||
<h3>
|
||||
{{ firstItem?.organisation }}
|
||||
<ng-container *ngIf="!!firstItem?.organisation && (!!firstItem?.firstName || !!firstItem?.lastName)"> - </ng-container>
|
||||
{{ firstItem?.lastName }}
|
||||
{{ firstItem?.firstName }}
|
||||
</h3>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngFor="let orderNumberGroup of bueryNumberGroup.items | groupBy: byOrderNumberFn; trackBy: trackByGroupFn">
|
||||
<ng-container *ngFor="let processingStatusGroup of orderNumberGroup.items | groupBy: byProcessingStatusFn; trackBy: trackByGroupFn">
|
||||
<ng-container
|
||||
*ngFor="let compartmentCodeGroup of processingStatusGroup.items | groupBy: byCompartmentCodeFn; trackBy: trackByGroupFn"
|
||||
>
|
||||
<page-pickup-shelf-list-item
|
||||
*ngFor="let item of compartmentCodeGroup.items; let firstItem = first; trackBy: trackByFn"
|
||||
class="page-pickup-shelf-out-list__result-item mb-[0.125rem]"
|
||||
[item]="item"
|
||||
[primaryOutletActive]="primaryOutletActive$ | async"
|
||||
[itemDetailsLink]="getItemDetailsLink(item)"
|
||||
[selectedItem]="getSelectedItem$(item) | async"
|
||||
[isItemSelectable]="getIsItemSelectable$(item) | async"
|
||||
></page-pickup-shelf-list-item>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
<page-pickup-shelf-list-item-loader *ngIf="fetching$ | async"></page-pickup-shelf-list-item-loader>
|
||||
<div class="actions z-sticky h-0 gap-4" *ngIf="actions$ | async; let actions">
|
||||
<button
|
||||
[disabled]="(loadingFetchedActionButton$ | async) || (fetching$ | async)"
|
||||
class="cta-action"
|
||||
*ngFor="let action of actions"
|
||||
[class.cta-action-primary]="action.selected"
|
||||
[class.cta-action-secondary]="!action.selected"
|
||||
(click)="handleAction(action)"
|
||||
>
|
||||
<ui-spinner [show]="(loadingFetchedActionButton$ | async) || (fetching$ | async)">{{ action.label }}</ui-spinner>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="h-full relative overflow-hidden overflow-y-scroll">
|
||||
<ui-scroll-container
|
||||
*ngIf="!(listEmpty$ | async); else emptyMessage"
|
||||
class="page-pickup-shelf-out-list__scroll-container m-0 p-0"
|
||||
@@ -111,4 +166,4 @@
|
||||
Es sind im Moment keine Bestellposten vorhanden,<br />
|
||||
die bearbeitet werden können.
|
||||
</div>
|
||||
</ng-template>
|
||||
</ng-template> -->
|
||||
|
||||
@@ -21,7 +21,6 @@ import { Filter, FilterModule } from '@shared/components/filter';
|
||||
import { BehaviorSubject, Observable, combineLatest } from 'rxjs';
|
||||
import { isEqual } from 'lodash';
|
||||
import { PickUpShelfListItemComponent } from '../../shared/pickup-shelf-list-item/pickup-shelf-list-item.component';
|
||||
import { UiScrollContainerComponent, UiScrollContainerModule } from '@ui/scroll-container';
|
||||
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString, OrderItemProcessingStatusValue } from '@swagger/oms';
|
||||
import { Group, GroupByPipe } from '@shared/pipes/group-by';
|
||||
import { UiSpinnerModule } from '@ui/spinner';
|
||||
@@ -30,6 +29,7 @@ import { PickupShelfListItemLoaderComponent } from '../../shared/pickup-shelf-li
|
||||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pcikup-shelf-out-list',
|
||||
@@ -39,6 +39,7 @@ import { CacheService } from '@core/cache';
|
||||
host: { class: 'page-pcikup-shelf-out-list' },
|
||||
standalone: true,
|
||||
imports: [
|
||||
ScrollContainerDirective,
|
||||
AsyncPipe,
|
||||
NgFor,
|
||||
RouterLink,
|
||||
@@ -46,7 +47,6 @@ import { CacheService } from '@core/cache';
|
||||
IconModule,
|
||||
FilterModule,
|
||||
PickUpShelfListItemComponent,
|
||||
UiScrollContainerModule,
|
||||
GroupByPipe,
|
||||
UiSpinnerModule,
|
||||
PickupShelfListItemLoaderComponent,
|
||||
@@ -54,7 +54,7 @@ import { CacheService } from '@core/cache';
|
||||
})
|
||||
export class PickupShelfOutListComponent implements OnInit, AfterViewInit {
|
||||
@ViewChildren(PickUpShelfListItemComponent) listItems: QueryList<PickUpShelfListItemComponent>;
|
||||
@ViewChild(UiScrollContainerComponent) scrollContainer: UiScrollContainerComponent;
|
||||
@ViewChild(ScrollContainerDirective) scrollContainer: ScrollContainerDirective;
|
||||
|
||||
private _pickupShelfOutNavigationService = inject(PickUpShelfOutNavigationService);
|
||||
|
||||
@@ -171,7 +171,7 @@ export class PickupShelfOutListComponent implements OnInit, AfterViewInit {
|
||||
|
||||
private _addScrollPositionToCache(): void {
|
||||
if (this._activatedRoute.outlet === 'primary') {
|
||||
this._cache.set<number>({ processId: this.store.processId, token: this.SCROLL_POSITION_TOKEN }, this.scrollContainer?.scrollPos);
|
||||
this._cache.set<number>({ processId: this.store.processId, token: this.SCROLL_POSITION_TOKEN }, this.scrollContainer?.scrollPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<div class="label">ISBN/EAN</div>
|
||||
<div class="value">{{ orderItem.product?.ean }}</div>
|
||||
</div>
|
||||
<div class="detail" *ngIf="!!orderItem.price">
|
||||
<div class="detail" *ngIf="orderItem.price !== undefined">
|
||||
<div class="label">Preis</div>
|
||||
<div class="value">{{ orderItem.price | currency: 'EUR' }}</div>
|
||||
</div>
|
||||
|
||||
@@ -117,6 +117,7 @@ export class PickUpShelfDetailsItemComponent extends ComponentStore<PickUpShelfD
|
||||
set quantity(quantity: number) {
|
||||
if (this.quantity !== quantity) {
|
||||
this.patchState({ quantity });
|
||||
this._store.setSelectedOrderItemQuantity({ orderItemSubsetId: this.orderItem.orderItemSubsetId, quantity });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@ export class PickupShelfFilterComponent {
|
||||
return this._environment.matchDesktopLarge$.pipe(map((matches) => !(matches && this.sideOutlet === 'search')));
|
||||
}
|
||||
|
||||
get isDesktopLarge() {
|
||||
return this._environment.matchDesktopLarge();
|
||||
}
|
||||
|
||||
get hasProcessId$() {
|
||||
return this._activatedRoute?.parent?.params?.pipe(map((params) => !!params?.processId));
|
||||
}
|
||||
@@ -53,7 +57,9 @@ export class PickupShelfFilterComponent {
|
||||
return this._activatedRoute?.parent?.params?.pipe(
|
||||
map((params) => {
|
||||
const hasProcessId = !!params?.processId;
|
||||
if (!!this.order) {
|
||||
|
||||
// Ticket #4457 only route to details view if in split-screen
|
||||
if (!!this.order && this.isDesktopLarge) {
|
||||
return this._routeToShelfDetails(hasProcessId);
|
||||
}
|
||||
|
||||
@@ -134,7 +140,8 @@ export class PickupShelfFilterComponent {
|
||||
}
|
||||
|
||||
clearFilter(filter: Filter) {
|
||||
this.store.setQueryParams({});
|
||||
const { main_qs } = filter.getQueryParams();
|
||||
this.store.setQueryParams({ main_qs });
|
||||
}
|
||||
|
||||
hasSelectedOptions(filter: Filter) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import { DBHOrderItemListItemDTO } from '@swagger/oms';
|
||||
import { Observable, combineLatest } from 'rxjs';
|
||||
import { map, shareReplay, switchMap, take } from 'rxjs/operators';
|
||||
import { PickupShelfStore } from '../../store';
|
||||
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
||||
|
||||
@Component({
|
||||
selector: 'page-pickup-shelf-history',
|
||||
@@ -90,6 +91,7 @@ export class PickUpShelfHistoryComponent {
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
compartmentInfo: item.compartmentInfo,
|
||||
},
|
||||
side: coerceBooleanProperty(this._activatedRoute?.snapshot?.queryParams?.side),
|
||||
}).path,
|
||||
{ queryParamsHandling: 'preserve' }
|
||||
);
|
||||
|
||||
@@ -39,23 +39,23 @@
|
||||
</div>
|
||||
|
||||
<div class="page-pickup-shelf-list-item__item-ean-quantity-changed flex flex-col">
|
||||
<div class="page-pickup-shelf-list-item__item-ean text-p2 flex flex-row mb-[0.375rem]">
|
||||
<div class="page-pickup-shelf-list-item__item-ean text-p2 flex flex-row mb-[0.375rem]" [attr.data-ean]="item?.product?.ean">
|
||||
<div class="min-w-[7.5rem]">EAN</div>
|
||||
<div class="font-bold">{{ item?.product?.ean }}</div>
|
||||
</div>
|
||||
|
||||
<div class="page-pickup-shelf-list-item__item-quantity flex flex-row text-p2 mb-[0.375rem]">
|
||||
<div class="page-pickup-shelf-list-item__item-quantity flex flex-row text-p2 mb-[0.375rem]" [attr.data-menge]="item.quantity">
|
||||
<div class="min-w-[7.5rem]">Menge</div>
|
||||
<div class="font-bold">{{ item.quantity }} x</div>
|
||||
</div>
|
||||
|
||||
<div class="page-pickup-shelf-list-item__item-changed text-p2">
|
||||
<div class="page-pickup-shelf-list-item__item-changed text-p2" [attr.data-geaendert]="item?.processingStatusDate">
|
||||
<div *ngIf="showChangeDate; else showOrderDate" class="flex flex-row">
|
||||
<div class="min-w-[7.5rem]">Geändert</div>
|
||||
<div class="font-bold">{{ item?.processingStatusDate | date: 'dd.MM.yy | HH:mm' }} Uhr</div>
|
||||
</div>
|
||||
<ng-template #showOrderDate>
|
||||
<div class="flex flex-row">
|
||||
<div class="flex flex-row" [attr.data-bestelldatum]="item?.orderDate">
|
||||
<div class="min-w-[7.5rem]">Bestelldatum</div>
|
||||
<div class="font-bold">{{ item?.orderDate | date: 'dd.MM.yy | HH:mm' }} Uhr</div>
|
||||
</div>
|
||||
@@ -67,6 +67,8 @@
|
||||
<div
|
||||
*ngIf="showCompartmentCode"
|
||||
class="page-pickup-shelf-list-item__item-order-number text-h3 mb-[0.375rem] self-end font-bold break-all text-right"
|
||||
[attr.data-compartment-code]="item?.compartmentCode"
|
||||
[attr.data-compartment-info]="item?.compartmentInfo"
|
||||
>
|
||||
{{ item?.compartmentCode }}{{ item?.compartmentInfo && '_' + item?.compartmentInfo }}
|
||||
</div>
|
||||
@@ -75,6 +77,7 @@
|
||||
<div
|
||||
class="page-pickup-shelf-list-item__item-processing-status flex flex-row mb-[0.375rem] rounded p-3 py-[0.125rem] text-white"
|
||||
[style]="processingStatusColor"
|
||||
[attr.data-processing-status]="item.processingStatus"
|
||||
>
|
||||
{{ item.processingStatus | processingStatus }}
|
||||
</div>
|
||||
@@ -83,6 +86,7 @@
|
||||
<div
|
||||
class="font-bold flex flex-row items-center justify-center text-p2 text-[#26830C]"
|
||||
*ngIf="item.features?.paid && (isTablet || isDesktopSmall || primaryOutletActive)"
|
||||
[attr.data-paid]="item.features?.paid"
|
||||
>
|
||||
<shared-icon class="flex items-center justify-center mr-[0.375rem]" [size]="24" icon="credit-card"></shared-icon>
|
||||
{{ item.features?.paid }}
|
||||
@@ -105,7 +109,10 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="page-pickup-shelf-list-item__item-special-comment break-words font-bold text-p2 mt-[0.375rem] text-[#996900]">
|
||||
<div
|
||||
[attr.data-special-comment]="item?.specialComment"
|
||||
class="page-pickup-shelf-list-item__item-special-comment break-words font-bold text-p2 mt-[0.375rem] text-[#996900]"
|
||||
>
|
||||
{{ item?.specialComment }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -231,8 +231,7 @@ export const selectMainActions = (s: PickupShelfDetailsState) => {
|
||||
|
||||
return firstItem?.actions
|
||||
?.filter((action) => typeof action?.enabled !== 'boolean')
|
||||
?.filter((action) => (fetchPartial ? !action.command.includes('FETCHED_PARTIAL') : true))
|
||||
?.sort((a, b) => (a.selected === b.selected ? 0 : a.selected ? -1 : 1));
|
||||
?.filter((action) => (fetchPartial ? !action.command.includes('FETCHED_PARTIAL') : true));
|
||||
};
|
||||
|
||||
export const selectCustomerNumber = (s: PickupShelfDetailsState) => {
|
||||
|
||||
@@ -259,6 +259,10 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
this.patchState({ selectedOrderItemQuantity: {} });
|
||||
}
|
||||
|
||||
setSelectedOrderItemQuantity = this.updater((state, { orderItemSubsetId, quantity }: { orderItemSubsetId: number; quantity: number }) => {
|
||||
return { ...state, selectedOrderItemQuantity: { ...state.selectedOrderItemQuantity, [orderItemSubsetId]: quantity } };
|
||||
});
|
||||
|
||||
setPreviousSelectedOrderItemSubsetId(previousSelectedOrderItemSubsetId: number) {
|
||||
this.patchState({ previousSelectedOrderItemSubsetId });
|
||||
}
|
||||
@@ -541,10 +545,10 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
this.patchOrderItemSubsetInState({
|
||||
orderItemSubsetId: item.orderItemSubsetId,
|
||||
changes: {
|
||||
specialComment: res.result.specialComment,
|
||||
estimatedShippingDate: res.result.estimatedShippingDate,
|
||||
estimatedDelivery: res.result.estimatedDelivery,
|
||||
pickUpDeadline: res.result.compartmentStop,
|
||||
specialComment: res?.result?.specialComment ?? item.specialComment,
|
||||
estimatedShippingDate: res.result?.estimatedShippingDate ?? item.estimatedShippingDate,
|
||||
estimatedDelivery: res.result?.estimatedDelivery ?? item.estimatedDelivery,
|
||||
pickUpDeadline: res.result?.compartmentStop ?? item.pickUpDeadline,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -554,7 +558,8 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
};
|
||||
|
||||
private patchOrderItemSubsetError = (err: any) => {
|
||||
this._modal.error('Fehler beim Speichern des Kommentars', err);
|
||||
this._modal.error('Fehler beim Speichern der Position', err);
|
||||
console.error(err);
|
||||
};
|
||||
|
||||
patchPreferredPickUpDateOnOrderSubsetItemInState({
|
||||
@@ -566,11 +571,11 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
|
||||
}) {
|
||||
// Filter selected order subset items from order
|
||||
const items = this.order.items;
|
||||
const subsetItems: EntityDTOContainerOfOrderItemSubsetDTO[] = items
|
||||
.reduce((acc, item) => {
|
||||
return [...acc, ...item.data.subsetItems];
|
||||
}, [])
|
||||
.filter((item) => this.selectedOrderItemIds.find((id) => id === item.data.id));
|
||||
const subsetItems: EntityDTOContainerOfOrderItemSubsetDTO[] = items.reduce((acc, item) => {
|
||||
return [...acc, ...item.data.subsetItems];
|
||||
}, []);
|
||||
// #4487 - RD // Abholfach - ändern des vsl. Lieferdatums und "zurückgelegt bis"-Datum wirft Fehler
|
||||
// .filter((item) => this.selectedOrderItemIds.find((id) => id === item.data.id));
|
||||
|
||||
// Update preferredPickUpDate on subsetItem from order and patch the state
|
||||
const subsetItem = subsetItems.find((subsetItem) => subsetItem.data.id === item.orderItemSubsetId);
|
||||
|
||||
@@ -41,10 +41,7 @@ export function selectFilter(state: PickupShelfState) {
|
||||
}
|
||||
|
||||
// Wenn queryParams ein leeres Objekt ist, dann wird der Filter gesetzt, aber ohne Werte (leerer Filter)
|
||||
if (isEmpty(queryParams)) {
|
||||
filter.unselectAllFilterOptions();
|
||||
return filter;
|
||||
}
|
||||
filter.unselectAllFilterOptions();
|
||||
|
||||
// Wenn queryParams ein Objekt mit Werten ist, dann wird der Filter gesetzt
|
||||
filter.fromQueryParams(queryParams);
|
||||
|
||||
@@ -164,7 +164,7 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
|
||||
private beforeFetchQuerySettings = () => {
|
||||
const cachedQuerySettings = this._cacheService.get<QuerySettingsDTO>({
|
||||
name: 'pickup-shelf',
|
||||
providerName: this._pickupShelfIOService.constructor.name,
|
||||
providerName: this._pickupShelfIOService.name(),
|
||||
});
|
||||
|
||||
if (!!cachedQuerySettings) {
|
||||
@@ -179,10 +179,7 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
|
||||
private fetchQuerySettingsDone = (resp: ResponseArgsOfQuerySettingsDTO) => {
|
||||
this.patchState({ fetchingQuerySettings: false, querySettings: resp.result });
|
||||
|
||||
this._cacheService.set<QuerySettingsDTO>(
|
||||
{ name: 'pickup-shelf', providerName: this._pickupShelfIOService.constructor.name },
|
||||
resp.result
|
||||
);
|
||||
this._cacheService.set<QuerySettingsDTO>({ name: 'pickup-shelf', providerName: this._pickupShelfIOService.name() }, resp.result);
|
||||
};
|
||||
|
||||
private fetchQuerySettingsError = (err: any) => {
|
||||
|
||||
@@ -31,9 +31,10 @@
|
||||
|
||||
<div class="inline-flex flex-row bg-white rounded-md mt-4">
|
||||
<button
|
||||
class="w-48 py-2 bg-white rounded-md font-bold"
|
||||
class="w-48 py-2 rounded-md font-bold"
|
||||
type="button"
|
||||
*ngFor="let source of sources$ | async"
|
||||
[class.bg-white]="(selectedSource$ | async) !== source"
|
||||
[class.bg-active-branch]="(selectedSource$ | async) === source"
|
||||
[class.text-white]="(selectedSource$ | async) === source"
|
||||
(click)="setSource(source)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Clipboard } from '@angular/cdk/clipboard';
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { DomainPrinterService } from '@domain/printer';
|
||||
@@ -8,7 +8,7 @@ import { PrintModalComponent, PrintModalData } from '@modal/printer';
|
||||
import { ArticleDTO, DisplayInfoDTO } from '@swagger/eis';
|
||||
import { UiModalRef, UiModalService } from '@ui/modal';
|
||||
import { first, map } from 'rxjs/operators';
|
||||
|
||||
import { ProductCatalogNavigationService } from '@shared/services';
|
||||
@Component({
|
||||
selector: 'page-article-list-modal',
|
||||
templateUrl: 'article-list-modal.component.html',
|
||||
@@ -16,6 +16,8 @@ import { first, map } from 'rxjs/operators';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ArticleListModalComponent {
|
||||
productCatalogNavigationService = inject(ProductCatalogNavigationService);
|
||||
|
||||
articles$ = this.domainTaskCalendarService.getArticles({ infoId: this.modalRef.data.id }).pipe(map((response) => response.result));
|
||||
expandedArticle: ArticleDTO;
|
||||
|
||||
@@ -64,15 +66,10 @@ export class ArticleListModalComponent {
|
||||
|
||||
this.modalRef.close('closeAll');
|
||||
|
||||
if (!lastActivatedProcessId) {
|
||||
const processId = Date.now();
|
||||
this.router.navigate(['/kunde', processId, 'product', 'search', 'results'], {
|
||||
this.productCatalogNavigationService
|
||||
.getArticleSearchResultsPath(lastActivatedProcessId, {
|
||||
queryParams: { main_qs: taskCalendarSearch },
|
||||
});
|
||||
} else {
|
||||
this.router.navigate(['/kunde', String(lastActivatedProcessId), 'product', 'search', 'results'], {
|
||||
queryParams: { main_qs: taskCalendarSearch },
|
||||
});
|
||||
}
|
||||
})
|
||||
.navigate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="shared-breadcrumb__crumbs">
|
||||
<ng-container *ngFor="let crumb of breadcrumbs$ | async; let last = last">
|
||||
<a class="shared-breadcrumb__crumb" [routerLink]="crumb.path" [queryParams]="crumb.params">
|
||||
<ng-container *ngFor="let crumb of breadcrumbs$ | async; let idx = index; let last = last">
|
||||
<a class="shared-breadcrumb__crumb" [attr.data-index]="idx" [routerLink]="crumb.path" [queryParams]="crumb.params">
|
||||
<span [class.font-bold]="last">
|
||||
{{ crumb.name }}
|
||||
</span>
|
||||
|
||||
@@ -24,12 +24,17 @@
|
||||
<span class="error" *ngIf="errors.pattern">Keine gültige E-Mail Adresse</span>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="pl-4" *ngIf="channelActionName && notificationChannels.length !== 2">
|
||||
<button type="reset" class="text-black pl-4" *ngIf="!emailDisabled && !!emailControl.value" (click)="clear(emailControl)">
|
||||
<shared-icon icon="close" [size]="24"></shared-icon>
|
||||
</button>
|
||||
<div class="pl-4" *ngIf="showChannelActionNameForEmailControl()">
|
||||
<button
|
||||
data-cta-type="save"
|
||||
data-cta-form="email"
|
||||
class="text-p1 font-bold text-brand outline-none border-none bg-transparent right-0"
|
||||
[disabled]="channelActionLoading || emailControl?.errors?.required || emailControl?.errors?.pattern"
|
||||
[disabled]="emailDisabled"
|
||||
type="button"
|
||||
(click)="channelActionEvent.emit(notificationChannels)"
|
||||
(click)="save()"
|
||||
>
|
||||
{{ channelActionName }}
|
||||
</button>
|
||||
@@ -44,18 +49,17 @@
|
||||
<span class="error" *ngIf="errors.pattern">Keine gültige Mobilnummer</span>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="pl-4" *ngIf="channelActionName">
|
||||
<button type="reset" class="text-black pl-4" *ngIf="!mobileDisabled && !!mobileControl.value" (click)="clear(mobileControl)">
|
||||
<shared-icon icon="close" [size]="24"></shared-icon>
|
||||
</button>
|
||||
<div class="pl-4" *ngIf="showChannelActionNameForMobileControl()">
|
||||
<button
|
||||
data-cta-type="save"
|
||||
data-cta-form="mobile"
|
||||
class="text-p1 font-bold text-brand outline-none border-none bg-transparent right-0"
|
||||
[disabled]="
|
||||
channelActionLoading ||
|
||||
mobileControl?.errors?.required ||
|
||||
mobileControl?.errors?.pattern ||
|
||||
emailControl?.errors?.required ||
|
||||
emailControl?.errors?.pattern
|
||||
"
|
||||
[disabled]="mobileDisabled"
|
||||
type="button"
|
||||
(click)="channelActionEvent.emit(notificationChannels)"
|
||||
(click)="save()"
|
||||
>
|
||||
{{ channelActionName }}
|
||||
</button>
|
||||
|
||||
@@ -43,6 +43,10 @@ export class SharedNotificationChannelControlComponent extends ComponentStore<Sh
|
||||
return !!(this.notificationChannelControl.value & 1) && this.emailControl;
|
||||
}
|
||||
|
||||
get emailDisabled() {
|
||||
return this.channelActionLoading || this.emailControl?.errors?.required || this.emailControl?.errors?.pattern;
|
||||
}
|
||||
|
||||
get mobileControl() {
|
||||
return this.notificationGroup.get('mobile') as FormControl;
|
||||
}
|
||||
@@ -51,6 +55,10 @@ export class SharedNotificationChannelControlComponent extends ComponentStore<Sh
|
||||
return !!(this.notificationChannelControl.value & 2) && this.mobileControl;
|
||||
}
|
||||
|
||||
get mobileDisabled() {
|
||||
return this.channelActionLoading || this.mobileControl?.errors?.required || this.mobileControl?.errors?.pattern;
|
||||
}
|
||||
|
||||
get displayToggle() {
|
||||
return this.displayEmail || this.displayMobile;
|
||||
}
|
||||
@@ -91,6 +99,20 @@ export class SharedNotificationChannelControlComponent extends ComponentStore<Sh
|
||||
this.initNotificationChannels$();
|
||||
}
|
||||
|
||||
showChannelActionNameForEmailControl() {
|
||||
return !!this.channelActionName && this.emailControl?.dirty;
|
||||
}
|
||||
|
||||
showChannelActionNameForMobileControl() {
|
||||
return !!this.channelActionName && this.mobileControl?.dirty;
|
||||
}
|
||||
|
||||
clear(control: FormControl) {
|
||||
control.setValue('');
|
||||
control.markAsDirty();
|
||||
this._cdr.markForCheck();
|
||||
}
|
||||
|
||||
initNotificationChannels$() {
|
||||
if (this.notificationGroup) {
|
||||
this.notificationChannels$ = this.notificationChannelControl.valueChanges.pipe(startWith(this.notificationChannelControl.value)).pipe(
|
||||
@@ -136,4 +158,11 @@ export class SharedNotificationChannelControlComponent extends ComponentStore<Sh
|
||||
this.emailControl?.updateValueAndValidity();
|
||||
this.mobileControl?.updateValueAndValidity();
|
||||
}
|
||||
|
||||
save() {
|
||||
this.channelActionEvent.emit(this.notificationChannels);
|
||||
this.emailControl?.markAsPristine();
|
||||
this.mobileControl?.markAsPristine();
|
||||
this._cdr.markForCheck();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<div class="hidden desktop-large:block side-content" [class.hide-side]="sideOutletNotActivated">
|
||||
<router-outlet #sideOutlet="outlet" name="side"></router-outlet>
|
||||
<div class="shared-splitscreen__side" *ngIf="desktopLarge()" [class.shared-splitscreen__hidden]="!sideActivated()">
|
||||
<router-outlet
|
||||
*ngIf="desktopLarge()"
|
||||
#sideOutlet="outlet"
|
||||
(activate)="onActivate()"
|
||||
(deactivate)="onDeactivate()"
|
||||
name="side"
|
||||
></router-outlet>
|
||||
</div>
|
||||
<div class="col-span-2 desktop-large:col-span-1 main-content" [class.expand-primary]="sideOutletNotActivated">
|
||||
<div class="shared-splitscreen__gap" *ngIf="desktopLarge()" [class.shared-splitscreen__hidden]="!sideActivated()"></div>
|
||||
<div class="shared-splitscreen__primary">
|
||||
<router-outlet #primaryOutlet="outlet"></router-outlet>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
:host {
|
||||
@apply grid grid-cols-split-screen gap-split-screen h-split-screen-tablet max-h-split-screen-tablet desktop-small:h-split-screen-desktop desktop-small:max-h-split-screen-desktop overflow-scroll;
|
||||
@apply flex flex-row h-split-screen-tablet max-h-split-screen-tablet desktop-small:h-split-screen-desktop desktop-small:max-h-split-screen-desktop overflow-scroll;
|
||||
}
|
||||
|
||||
.hide-side {
|
||||
@apply hidden;
|
||||
.shared-splitscreen__side {
|
||||
@apply w-[31rem] min-w-[31rem] flex-grow-0 flex-shrink;
|
||||
}
|
||||
|
||||
.expand-primary {
|
||||
@apply col-span-2;
|
||||
.shared-splitscreen__gap {
|
||||
@apply w-[1.5rem] min-w-[1.5rem] flex-grow-0 flex-shrink;
|
||||
}
|
||||
|
||||
.shared-splitscreen__primary {
|
||||
@apply flex-grow;
|
||||
}
|
||||
|
||||
.shared-splitscreen__hidden {
|
||||
@apply min-w-0 w-0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
import { ChangeDetectionStrategy, Component, ViewChild } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import {
|
||||
AfterContentInit,
|
||||
AfterViewInit,
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
DestroyRef,
|
||||
OnInit,
|
||||
QueryList,
|
||||
ViewChild,
|
||||
ViewChildren,
|
||||
computed,
|
||||
inject,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { ActivatedRoute, RouterOutlet } from '@angular/router';
|
||||
import { EnvironmentService } from '@core/environment';
|
||||
import { OnInitDirective } from '@shared/directives/element-lifecycle';
|
||||
import { NEVER } from 'rxjs';
|
||||
import { switchMap } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'shared-splitscreen',
|
||||
@@ -8,18 +27,34 @@ import { RouterOutlet } from '@angular/router';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
host: { class: 'shared-splitscreen' },
|
||||
imports: [RouterOutlet],
|
||||
imports: [RouterOutlet, AsyncPipe, NgIf],
|
||||
})
|
||||
export class SharedSplitscreenComponent {
|
||||
@ViewChild('sideOutlet', { static: true, read: RouterOutlet })
|
||||
sideOutlet: RouterOutlet;
|
||||
export class SharedSplitscreenComponent implements AfterViewInit {
|
||||
destroyRef = inject(DestroyRef);
|
||||
|
||||
@ViewChild('primaryOutlet', { static: true, read: RouterOutlet })
|
||||
primaryOutlet: RouterOutlet;
|
||||
environment = inject(EnvironmentService);
|
||||
|
||||
get sideOutletNotActivated() {
|
||||
return !(this.sideOutlet && this.sideOutlet.isActivated);
|
||||
@ViewChildren('sideOutlet', { read: RouterOutlet })
|
||||
side: QueryList<RouterOutlet>;
|
||||
|
||||
desktopLarge = signal(false);
|
||||
|
||||
sideActivated = signal(false);
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.environment.matchDesktopLarge$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((desktopLarge) => {
|
||||
this.desktopLarge.set(desktopLarge);
|
||||
if (!desktopLarge) {
|
||||
this.sideActivated.set(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
constructor() {}
|
||||
onActivate() {
|
||||
this.sideActivated.set(true);
|
||||
}
|
||||
|
||||
onDeactivate() {
|
||||
this.sideActivated.set(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"lib": {
|
||||
"entryFile": "src/public-api.ts"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import { coerceStringArray } from '@angular/cdk/coercion';
|
||||
import { DestroyRef, Directive, ElementRef, EventEmitter, Input, OnInit, Output, Renderer2, inject } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { ComponentStore } from '@ngrx/component-store';
|
||||
import { filter, switchMap } from 'rxjs/operators';
|
||||
|
||||
export interface SharedRouterLinkActiveDirectiveState {
|
||||
classList: string[];
|
||||
test: RegExp | undefined;
|
||||
}
|
||||
|
||||
@Directive({ selector: '[sharedRegexRouterLinkActive]', standalone: true })
|
||||
export class RegexRouterLinkActiveDirective extends ComponentStore<SharedRouterLinkActiveDirectiveState> implements OnInit {
|
||||
destroyRef = inject(DestroyRef);
|
||||
|
||||
router = inject(Router);
|
||||
|
||||
elementRef = inject(ElementRef);
|
||||
|
||||
renderer = inject(Renderer2);
|
||||
|
||||
@Input('sharedRegexRouterLinkActive')
|
||||
set classList(value: string[] | string) {
|
||||
this.patchState({ classList: coerceStringArray(value) });
|
||||
}
|
||||
get classList() {
|
||||
return this.get((s) => s.classList);
|
||||
}
|
||||
|
||||
@Input('sharedRegexRouterLinkActiveTest')
|
||||
set test(value: RegExp | string) {
|
||||
const test = typeof value === 'string' ? new RegExp(value) : value;
|
||||
|
||||
this.patchState({ test });
|
||||
}
|
||||
get test() {
|
||||
return this.get((s) => s.test);
|
||||
}
|
||||
|
||||
@Output()
|
||||
isActiveChange = new EventEmitter<boolean>();
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
classList: [],
|
||||
test: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.router.events
|
||||
.pipe(
|
||||
takeUntilDestroyed(this.destroyRef),
|
||||
filter((event) => event instanceof NavigationEnd),
|
||||
switchMap(() => this.select((s) => s))
|
||||
)
|
||||
.subscribe(() => this.checkActiveLink());
|
||||
|
||||
this.checkActiveLink();
|
||||
}
|
||||
|
||||
checkActiveLink() {
|
||||
const { classList, test } = this.get((s) => s);
|
||||
|
||||
let isActive = test?.test(this.router.url) ?? false;
|
||||
|
||||
this.isActiveChange.emit(isActive);
|
||||
|
||||
classList.forEach((className) => {
|
||||
if (isActive) {
|
||||
this.renderer.addClass(this.elementRef.nativeElement, className);
|
||||
} else {
|
||||
this.renderer.removeClass(this.elementRef.nativeElement, className);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './lib/regex-router-link-active.directive';
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Directive, EventEmitter, Output } from '@angular/core';
|
||||
import { NumberInput, coerceElement, coerceNumberProperty } from '@angular/cdk/coercion';
|
||||
import { Directive, ElementRef, EventEmitter, HostListener, Input, Output, inject } from '@angular/core';
|
||||
|
||||
@Directive({ selector: '[sharedScrollContainer]', standalone: true })
|
||||
@Directive({ selector: '[sharedScrollContainer]', standalone: true, host: { class: 'shared-scroll-container' } })
|
||||
export class ScrollContainerDirective {
|
||||
@Output()
|
||||
scrollIndexChange = new EventEmitter<{ start: number; end: number }>();
|
||||
elementRef = inject(ElementRef);
|
||||
|
||||
@Output()
|
||||
scrolledToTop = new EventEmitter<void>();
|
||||
@@ -11,17 +11,50 @@ export class ScrollContainerDirective {
|
||||
@Output()
|
||||
scrolledToBottom = new EventEmitter<void>();
|
||||
|
||||
constructor() {}
|
||||
private _delta: number = 0;
|
||||
|
||||
@Input()
|
||||
set delta(value: NumberInput) {
|
||||
this._delta = coerceNumberProperty(value);
|
||||
}
|
||||
|
||||
get scrollPosition() {
|
||||
const element: HTMLElement = coerceElement(this.elementRef);
|
||||
return element.scrollTop;
|
||||
}
|
||||
|
||||
@HostListener('scroll', ['$event'])
|
||||
onScroll(_: Event) {
|
||||
const element: HTMLElement = coerceElement(this.elementRef);
|
||||
const { scrollTop, scrollHeight, clientHeight } = element;
|
||||
|
||||
if (scrollTop === 0) {
|
||||
this.scrolledToTop.emit();
|
||||
} else if (scrollTop + clientHeight + this._delta >= scrollHeight) {
|
||||
this.scrolledToBottom.emit();
|
||||
}
|
||||
}
|
||||
|
||||
scrollToIndex(index: number) {
|
||||
throw new Error('not implemented');
|
||||
const element: HTMLElement = coerceElement(this.elementRef);
|
||||
const { scrollHeight, clientHeight } = element;
|
||||
const itemHeight = scrollHeight / clientHeight;
|
||||
const scrollPosition = index * itemHeight;
|
||||
element.scrollTo({ top: scrollPosition });
|
||||
}
|
||||
|
||||
scrollTo(position: number) {
|
||||
const element: HTMLElement = coerceElement(this.elementRef);
|
||||
element.scrollTo({ top: position });
|
||||
}
|
||||
|
||||
scrollToTop() {
|
||||
throw new Error('not implemented');
|
||||
const element: HTMLElement = coerceElement(this.elementRef);
|
||||
element.scrollTo({ top: 0 });
|
||||
}
|
||||
|
||||
scrollToBottom() {
|
||||
throw new Error('not implemented');
|
||||
const element: HTMLElement = coerceElement(this.elementRef);
|
||||
element.scrollTo({ top: element.scrollHeight });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NumberInput, coerceNumberProperty } from '@angular/cdk/coercion';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { CustomerInfoDTO } from '@swagger/crm';
|
||||
import { CustomerDTO, CustomerInfoDTO } from '@swagger/crm';
|
||||
import { encodeFormData, mapCustomerInfoDtoToCustomerCreateFormData } from 'apps/page/customer/src/lib/create-customer';
|
||||
import { NavigationRoute } from './navigation-route';
|
||||
|
||||
@@ -36,7 +36,7 @@ export class CustomerCreateNavigation {
|
||||
return this._router.navigate(route.path, { queryParams: route.queryParams });
|
||||
}
|
||||
|
||||
createCustomerRoute(params: { processId: NumberInput; customerType?: string }): NavigationRoute {
|
||||
createCustomerRoute(params: { processId: NumberInput; customerType?: string; customerInfo?: CustomerInfoDTO }): NavigationRoute {
|
||||
const path = [
|
||||
'/kunde',
|
||||
coerceNumberProperty(params.processId),
|
||||
@@ -49,12 +49,20 @@ export class CustomerCreateNavigation {
|
||||
},
|
||||
];
|
||||
|
||||
const urlTree = this._router.createUrlTree(path, { queryParams: {} });
|
||||
let formData = params?.customerInfo ? encodeFormData(mapCustomerInfoDtoToCustomerCreateFormData(params.customerInfo)) : undefined;
|
||||
|
||||
const urlTree = this._router.createUrlTree(path, {
|
||||
queryParams: {
|
||||
formData,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
path,
|
||||
urlTree,
|
||||
queryParams: {},
|
||||
queryParams: {
|
||||
formData,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ export class PickupShelfInNavigationService {
|
||||
].filter((v) => !!v);
|
||||
}
|
||||
|
||||
const queryParams = {};
|
||||
const queryParams = {
|
||||
side: String(side),
|
||||
};
|
||||
|
||||
const urlTree = this._router.createUrlTree(path, { queryParams });
|
||||
|
||||
@@ -115,14 +117,17 @@ export class PickupShelfInNavigationService {
|
||||
};
|
||||
}
|
||||
|
||||
editRoute(item: {
|
||||
orderId: number;
|
||||
orderNumber: string;
|
||||
compartmentCode: string;
|
||||
processingStatus: OrderItemProcessingStatusValue;
|
||||
orderItemSubsetId: number;
|
||||
compartmentInfo: string;
|
||||
}): NavigationRoute {
|
||||
editRoute(
|
||||
item: {
|
||||
orderId: number;
|
||||
orderNumber: string;
|
||||
compartmentCode: string;
|
||||
processingStatus: OrderItemProcessingStatusValue;
|
||||
orderItemSubsetId: number;
|
||||
compartmentInfo: string;
|
||||
},
|
||||
{ side }: { side?: boolean } = { side: true }
|
||||
): NavigationRoute {
|
||||
let path: any[];
|
||||
|
||||
if (!item.orderItemSubsetId) {
|
||||
@@ -145,7 +150,7 @@ export class PickupShelfInNavigationService {
|
||||
item.orderItemSubsetId,
|
||||
'edit',
|
||||
].filter((v) => !!v),
|
||||
side: ['list'],
|
||||
side: side ? ['list'] : null,
|
||||
},
|
||||
},
|
||||
].filter((v) => !!v);
|
||||
@@ -165,7 +170,7 @@ export class PickupShelfInNavigationService {
|
||||
item.orderItemSubsetId,
|
||||
'edit',
|
||||
].filter((v) => !!v),
|
||||
side: ['list'],
|
||||
side: side ? ['list'] : null,
|
||||
},
|
||||
},
|
||||
].filter((v) => !!v);
|
||||
@@ -182,14 +187,17 @@ export class PickupShelfInNavigationService {
|
||||
};
|
||||
}
|
||||
|
||||
historyRoute(item: {
|
||||
orderId: number;
|
||||
orderNumber: string;
|
||||
compartmentCode: string;
|
||||
processingStatus: OrderItemProcessingStatusValue;
|
||||
orderItemSubsetId: number;
|
||||
compartmentInfo: string;
|
||||
}): NavigationRoute {
|
||||
historyRoute(
|
||||
item: {
|
||||
orderId: number;
|
||||
orderNumber: string;
|
||||
compartmentCode: string;
|
||||
processingStatus: OrderItemProcessingStatusValue;
|
||||
orderItemSubsetId: number;
|
||||
compartmentInfo: string;
|
||||
},
|
||||
{ side }: { side?: boolean } = { side: true }
|
||||
): NavigationRoute {
|
||||
let path: any[];
|
||||
|
||||
if (!item.orderItemSubsetId) {
|
||||
@@ -212,7 +220,7 @@ export class PickupShelfInNavigationService {
|
||||
item.orderItemSubsetId,
|
||||
'history',
|
||||
].filter((v) => !!v),
|
||||
side: ['list'],
|
||||
side: side ? ['list'] : null,
|
||||
},
|
||||
},
|
||||
].filter((v) => !!v);
|
||||
@@ -232,7 +240,7 @@ export class PickupShelfInNavigationService {
|
||||
item.orderItemSubsetId,
|
||||
'history',
|
||||
].filter((v) => !!v),
|
||||
side: ['list'],
|
||||
side: side ? ['list'] : null,
|
||||
},
|
||||
},
|
||||
].filter((v) => !!v);
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
@apply px-[0.438rem] py-3;
|
||||
}
|
||||
|
||||
.side-menu-group-item.active,
|
||||
.side-menu-group-item.active:not(.has-child-view),
|
||||
.side-menu-group-item.active-child,
|
||||
.side-menu-group-item:hover,
|
||||
.side-menu-group-item:focus {
|
||||
@apply bg-[#596470] text-white;
|
||||
@@ -52,7 +53,8 @@
|
||||
@apply rotate-180;
|
||||
}
|
||||
|
||||
.side-menu-group-sub-items .side-menu-group-item.active,
|
||||
.side-menu-group-sub-items .side-menu-group-item.active:not(.has-child-view),
|
||||
.side-menu-group-sub-items .side-menu-group-item.active-child,
|
||||
.side-menu-group-sub-items .side-menu-group-item:hover,
|
||||
.side-menu-group-sub-items .side-menu-group-item:focus {
|
||||
@apply bg-[#89949E] text-white;
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
class="side-menu-group-item"
|
||||
(click)="closeSideMenu(); resetBranch(); focusSearchBox()"
|
||||
[routerLink]="productRoutePath$ | async"
|
||||
routerLinkActive="active"
|
||||
sharedRegexRouterLinkActive="active"
|
||||
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/product"
|
||||
(isActiveChange)="focusSearchBox()"
|
||||
>
|
||||
<div class="side-menu-group-item-icon">
|
||||
<shared-icon icon="import-contacts"></shared-icon>
|
||||
@@ -22,8 +24,9 @@
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
[routerLink]="customerSearchRoute.path"
|
||||
[queryParams]="customerSearchRoute.queryParams"
|
||||
routerLinkActive="active"
|
||||
(isActiveChange)="customerActive($event)"
|
||||
sharedRegexRouterLinkActive="active"
|
||||
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/customer"
|
||||
(isActiveChange)="customerActive($event); focusSearchBox()"
|
||||
>
|
||||
<span class="side-menu-group-item-icon">
|
||||
<shared-icon icon="person"></shared-icon>
|
||||
@@ -47,7 +50,9 @@
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
[routerLink]="customerSearchRoute.path"
|
||||
[queryParams]="customerSearchRoute.queryParams"
|
||||
routerLinkActive="active"
|
||||
sharedRegexRouterLinkActive="active"
|
||||
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/customer\/(\(search|search)"
|
||||
(isActiveChange)="focusSearchBox()"
|
||||
>
|
||||
<span class="side-menu-group-item-icon"></span>
|
||||
<span class="side-menu-group-item-label">
|
||||
@@ -57,10 +62,11 @@
|
||||
<a
|
||||
*ngIf="customerCreateRoute$ | async; let customerCreateRoute"
|
||||
class="side-menu-group-item"
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
(click)="closeSideMenu()"
|
||||
[routerLink]="customerCreateRoute.path"
|
||||
[queryParams]="customerCreateRoute.queryParams"
|
||||
routerLinkActive="active"
|
||||
sharedRegexRouterLinkActive="active"
|
||||
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/customer\/(\(create|create)"
|
||||
>
|
||||
<span class="side-menu-group-item-icon"></span>
|
||||
<span class="side-menu-group-item-label">
|
||||
@@ -75,7 +81,9 @@
|
||||
class="side-menu-group-item"
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
[routerLink]="pickUpShelfOutRoutePath$ | async"
|
||||
routerLinkActive="active"
|
||||
sharedRegexRouterLinkActive="active"
|
||||
sharedRegexRouterLinkActiveTest="^\/kunde\/\d*\/pickup-shelf"
|
||||
(isActiveChange)="focusSearchBox()"
|
||||
>
|
||||
<span class="side-menu-group-item-icon">
|
||||
<shared-icon icon="unarchive"></shared-icon>
|
||||
@@ -91,6 +99,7 @@
|
||||
(click)="closeSideMenu(); resetBranch(); focusSearchBox()"
|
||||
[routerLink]="customerOrdersRoutePath$ | async"
|
||||
routerLinkActive="active"
|
||||
(isActiveChange)="focusSearchBox()"
|
||||
>
|
||||
<span class="side-menu-group-item-icon">
|
||||
<shared-icon icon="deployed-code"></shared-icon>
|
||||
@@ -114,6 +123,7 @@
|
||||
[routerLink]="taskCalenderNavigation.path"
|
||||
[queryParams]="taskCalenderNavigation.queryParams"
|
||||
routerLinkActive="active"
|
||||
(isActiveChange)="focusSearchBox()"
|
||||
>
|
||||
<span class="side-menu-group-item-icon">
|
||||
<shared-icon icon="event-available"></shared-icon>
|
||||
@@ -145,8 +155,9 @@
|
||||
*ngIf="pickUpShelfInRoutePath$ | async; let pickUpShelfInNavigation"
|
||||
[routerLink]="pickUpShelfInNavigation.path"
|
||||
[queryParams]="pickUpShelfInNavigation.queryParams"
|
||||
routerLinkActive="active"
|
||||
(isActiveChange)="shelfActive($event)"
|
||||
sharedRegexRouterLinkActive="active"
|
||||
sharedRegexRouterLinkActiveTest="^\/filiale\/(pickup-shelf|goods\/in)"
|
||||
(isActiveChange)="shelfActive($event); focusSearchBox()"
|
||||
>
|
||||
<span class="side-menu-group-item-icon">
|
||||
<shared-icon icon="isa-abholfach"></shared-icon>
|
||||
@@ -166,11 +177,14 @@
|
||||
<div class="side-menu-group-sub-items" [class.hidden]="!shelfExpanded">
|
||||
<a
|
||||
class="side-menu-group-item"
|
||||
*ngIf="pickUpShelfInListRoutePath$ | async; let pickUpShelfInListNavigation"
|
||||
*ngIf="pickUpShelfInRoutePath$ | async; let pickUpShelfInListNavigation"
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
[routerLink]="pickUpShelfInListNavigation.path"
|
||||
[queryParams]="pickUpShelfInListNavigation.queryParams"
|
||||
routerLinkActive="active"
|
||||
[class.has-child-view]="currentShelfView$ | async"
|
||||
sharedRegexRouterLinkActive="active"
|
||||
[sharedRegexRouterLinkActiveTest]="'^\/filiale\/pickup-shelf'"
|
||||
(isActiveChange)="shelfActive($event); focusSearchBox()"
|
||||
>
|
||||
<span class="side-menu-group-item-icon"></span>
|
||||
<span class="side-menu-group-item-label">
|
||||
@@ -179,9 +193,12 @@
|
||||
</a>
|
||||
<a
|
||||
class="side-menu-group-item"
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
(click)="closeSideMenu()"
|
||||
[routerLink]="['/filiale', 'goods', 'in', 'reservation']"
|
||||
[queryParams]="{ view: 'reservation' }"
|
||||
[class.active-child]="(currentShelfView$ | async) === 'reservation'"
|
||||
routerLinkActive="active"
|
||||
(isActiveChange)="shelfActive($event)"
|
||||
>
|
||||
<span class="side-menu-group-item-icon"></span>
|
||||
<span class="side-menu-group-item-label">
|
||||
@@ -190,9 +207,12 @@
|
||||
</a>
|
||||
<a
|
||||
class="side-menu-group-item"
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
(click)="closeSideMenu()"
|
||||
[routerLink]="['/filiale', 'goods', 'in', 'cleanup']"
|
||||
[queryParams]="{ view: 'cleanup' }"
|
||||
[class.active-child]="(currentShelfView$ | async) === 'cleanup'"
|
||||
routerLinkActive="active"
|
||||
(isActiveChange)="shelfActive($event)"
|
||||
>
|
||||
<span class="side-menu-group-item-icon"></span>
|
||||
<span class="side-menu-group-item-label">
|
||||
@@ -201,9 +221,12 @@
|
||||
</a>
|
||||
<a
|
||||
class="side-menu-group-item"
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
(click)="closeSideMenu()"
|
||||
[routerLink]="['/filiale', 'goods', 'in', 'preview']"
|
||||
[queryParams]="{ view: 'remission' }"
|
||||
[class.active-child]="(currentShelfView$ | async) === 'remission'"
|
||||
routerLinkActive="active"
|
||||
(isActiveChange)="shelfActive($event)"
|
||||
>
|
||||
<span class="side-menu-group-item-icon"></span>
|
||||
<span class="side-menu-group-item-label">
|
||||
@@ -212,9 +235,12 @@
|
||||
</a>
|
||||
<a
|
||||
class="side-menu-group-item"
|
||||
(click)="closeSideMenu(); focusSearchBox()"
|
||||
(click)="closeSideMenu()"
|
||||
[routerLink]="['/filiale', 'goods', 'in', 'list']"
|
||||
[queryParams]="{ view: 'wareneingangsliste' }"
|
||||
[class.active-child]="(currentShelfView$ | async) === 'wareneingangsliste'"
|
||||
routerLinkActive="active"
|
||||
(isActiveChange)="shelfActive($event)"
|
||||
>
|
||||
<span class="side-menu-group-item-icon"></span>
|
||||
<span class="side-menu-group-item-label">
|
||||
|
||||
@@ -19,6 +19,7 @@ import { CommonModule, DOCUMENT } from '@angular/common';
|
||||
import { Config } from '@core/config';
|
||||
import { BreadcrumbService } from '@core/breadcrumb';
|
||||
import { IconComponent } from '@shared/components/icon';
|
||||
import { RegexRouterLinkActiveDirective } from '@shared/directives/router-link-active';
|
||||
|
||||
@Component({
|
||||
selector: 'shell-side-menu',
|
||||
@@ -26,7 +27,7 @@ import { IconComponent } from '@shared/components/icon';
|
||||
styleUrls: ['side-menu.component.css'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [CommonModule, IconComponent, RouterModule, AuthModule],
|
||||
imports: [CommonModule, IconComponent, RouterModule, AuthModule, RegexRouterLinkActiveDirective],
|
||||
})
|
||||
export class ShellSideMenuComponent {
|
||||
branchKey$ = this._stockService.StockCurrentBranch().pipe(
|
||||
@@ -121,10 +122,11 @@ export class ShellSideMenuComponent {
|
||||
this._pickUpShelfInNavigation.defaultRoute()
|
||||
);
|
||||
|
||||
pickUpShelfInListRoutePath$ = this.getLastNavigationByProcessId(
|
||||
this._config.get('process.ids.pickupShelf'),
|
||||
this._pickUpShelfInNavigation.listRoute()
|
||||
);
|
||||
// #4478 - RD // Abholfach - Routing löst Suche aus
|
||||
// pickUpShelfInListRoutePath$ = this.getLastNavigationByProcessId(
|
||||
// this._config.get('process.ids.pickupShelf'),
|
||||
// this._pickUpShelfInNavigation.listRoute()
|
||||
// );
|
||||
|
||||
remissionNavigation$ = this.getLastNavigationByProcessId(this._config.get('process.ids.remission'), {
|
||||
path: ['/filiale', 'remission'],
|
||||
@@ -136,6 +138,10 @@ export class ShellSideMenuComponent {
|
||||
queryParams: {},
|
||||
});
|
||||
|
||||
get currentShelfView$() {
|
||||
return this._route.queryParams.pipe(map((params) => params.view));
|
||||
}
|
||||
|
||||
shelfExpanded: boolean = false;
|
||||
customerExpanded: boolean = false;
|
||||
|
||||
@@ -158,11 +164,7 @@ export class ShellSideMenuComponent {
|
||||
private _pickUpShelfInNavigation: PickupShelfInNavigationService,
|
||||
private _cdr: ChangeDetectorRef,
|
||||
@Inject(DOCUMENT) private readonly _document: Document
|
||||
) {
|
||||
this._router.events.subscribe((event) => {
|
||||
// console.log(event);
|
||||
});
|
||||
}
|
||||
) {}
|
||||
|
||||
customerActive(isActive: boolean) {
|
||||
if (isActive) {
|
||||
@@ -191,6 +193,10 @@ export class ShellSideMenuComponent {
|
||||
map((breadcrumbs) => {
|
||||
const lastCrumb = breadcrumbs
|
||||
.filter((breadcrumb) => !breadcrumb?.params?.hasOwnProperty('view'))
|
||||
.filter((breadcrumb) => !breadcrumb?.tags?.includes('reservation'))
|
||||
.filter((breadcrumb) => !breadcrumb?.tags?.includes('cleanup'))
|
||||
.filter((breadcrumb) => !breadcrumb?.tags?.includes('wareneingangsliste'))
|
||||
.filter((breadcrumb) => !breadcrumb?.tags?.includes('preview'))
|
||||
.reduce((last, current) => {
|
||||
if (!last) return current;
|
||||
|
||||
@@ -246,7 +252,7 @@ export class ShellSideMenuComponent {
|
||||
}
|
||||
|
||||
focusSearchBox() {
|
||||
this._document.getElementById('searchbox')?.focus();
|
||||
setTimeout(() => this._document.getElementById('searchbox')?.focus(), 0);
|
||||
}
|
||||
|
||||
async createProcess() {
|
||||
|
||||
@@ -1,15 +1,4 @@
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
ElementRef,
|
||||
EventEmitter,
|
||||
Input,
|
||||
OnChanges,
|
||||
OnInit,
|
||||
Output,
|
||||
SimpleChanges,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ui-scroll-container',
|
||||
@@ -18,7 +7,7 @@ import {
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class UiScrollContainerComponent implements OnInit {
|
||||
@ViewChild('scrollContainer', { read: ElementRef, static: false })
|
||||
@ViewChild('scrollContainer', { read: ElementRef, static: true })
|
||||
scrollContainer: ElementRef;
|
||||
|
||||
@Output() reachEnd = new EventEmitter<void>();
|
||||
|
||||
13797
package-lock.json
generated
13797
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -35,7 +35,7 @@
|
||||
"test:shared": "ng test shared",
|
||||
"*test:shell-breadcrumb": "ng test @shell/breadcrumb",
|
||||
"test:store-search-component-store": "ng test @store/search-component-store",
|
||||
"test:ui": "ng test ui",
|
||||
"*test:ui": "ng test ui",
|
||||
"*test:utils": "ng test utils",
|
||||
"*test:native-container": "ng test native-container",
|
||||
"lint": "ng lint",
|
||||
|
||||
Reference in New Issue
Block a user