mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Merge branch 'develop' into release/3.0
This commit is contained in:
@@ -137,21 +137,23 @@
|
|||||||
|
|
||||||
<div class="page-article-details__product-stock flex justify-end items-center">
|
<div class="page-article-details__product-stock flex justify-end items-center">
|
||||||
<div class="h-5 w-16 bg-[#e6eff9] animate-[load_0.75s_linear_infinite]" *ngIf="store.fetchingTakeAwayAvailability$ | async"></div>
|
<div class="h-5 w-16 bg-[#e6eff9] animate-[load_0.75s_linear_infinite]" *ngIf="store.fetchingTakeAwayAvailability$ | async"></div>
|
||||||
<div
|
<button
|
||||||
class="flex flex-row py-4 pl-4"
|
class="flex flex-row py-4 pl-4"
|
||||||
|
type="button"
|
||||||
[uiOverlayTrigger]="tooltip"
|
[uiOverlayTrigger]="tooltip"
|
||||||
[overlayTriggerDisabled]="!(stockTooltipText$ | async)"
|
[overlayTriggerDisabled]="!(stockTooltipText$ | async)"
|
||||||
|
(click)="showTooltip()"
|
||||||
*ngIf="!(store.fetchingTakeAwayAvailability$ | async)"
|
*ngIf="!(store.fetchingTakeAwayAvailability$ | async)"
|
||||||
>
|
>
|
||||||
<ng-container *ngIf="store.takeAwayAvailability$ | async; let takeAwayAvailability">
|
<ng-container *ngIf="store.takeAwayAvailability$ | async; let takeAwayAvailability">
|
||||||
<ui-icon class="mr-2 mb-1" icon="home" size="15px"></ui-icon>
|
<ui-icon class="mr-2 mb-1" icon="home" size="15px"></ui-icon>
|
||||||
<span class="font-bold text-p3">{{ takeAwayAvailability.inStock || 0 }}x</span>
|
<span class="font-bold text-p3">{{ takeAwayAvailability.inStock || 0 }}x</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</button>
|
||||||
|
<ui-tooltip #tooltip yPosition="above" xPosition="after" [yOffset]="-12" [closeable]="true">
|
||||||
|
{{ stockTooltipText$ | async }}
|
||||||
|
</ui-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<ui-tooltip #tooltip yPosition="above" xPosition="after" [yOffset]="-8" [closeable]="true">
|
|
||||||
{{ stockTooltipText$ | async }}
|
|
||||||
</ui-tooltip>
|
|
||||||
|
|
||||||
<div class="page-article-details__product-ean-specs flex flex-col">
|
<div class="page-article-details__product-ean-specs flex flex-col">
|
||||||
<div class="page-article-details__product-ean" data-name="product-ean">{{ item.product?.ean }}</div>
|
<div class="page-article-details__product-ean" data-name="product-ean">{{ item.product?.ean }}</div>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import { PurchaseOptionsModalService } from '@shared/modals/purchase-options-mod
|
|||||||
import { EnvironmentService } from '@core/environment';
|
import { EnvironmentService } from '@core/environment';
|
||||||
import { CheckoutNavigationService, ProductCatalogNavigationService } from '@shared/services';
|
import { CheckoutNavigationService, ProductCatalogNavigationService } from '@shared/services';
|
||||||
import { DomainCheckoutService } from '@domain/checkout';
|
import { DomainCheckoutService } from '@domain/checkout';
|
||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-article-details',
|
selector: 'page-article-details',
|
||||||
@@ -100,23 +101,6 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
|
|||||||
switchMap((processId) => this.applicationService.getSelectedBranch$(processId))
|
switchMap((processId) => this.applicationService.getSelectedBranch$(processId))
|
||||||
);
|
);
|
||||||
|
|
||||||
stockTooltipText$ = combineLatest([this.store.branch$, this.selectedBranchId$]).pipe(
|
|
||||||
map(([defaultBranch, selectedBranch]) => {
|
|
||||||
if (defaultBranch?.branchType === 4) {
|
|
||||||
if (!selectedBranch) {
|
|
||||||
return 'Wählen Sie eine Filiale aus, um den Bestand zu sehen.';
|
|
||||||
}
|
|
||||||
return 'Sie sehen den Bestand einer anderen Filiale.';
|
|
||||||
} else {
|
|
||||||
if (selectedBranch && defaultBranch.id !== selectedBranch?.id) {
|
|
||||||
return 'Sie sehen den Bestand einer anderen Filiale.';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}),
|
|
||||||
shareReplay(1)
|
|
||||||
);
|
|
||||||
|
|
||||||
get isTablet$() {
|
get isTablet$() {
|
||||||
return this._environment.matchTablet$;
|
return this._environment.matchTablet$;
|
||||||
}
|
}
|
||||||
@@ -134,6 +118,15 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
|
|||||||
return this.detailsContainer?.nativeElement;
|
return this.detailsContainer?.nativeElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stockTooltipText$ = combineLatest([this.store.defaultBranch$, this.selectedBranchId$]).pipe(
|
||||||
|
map(([defaultBranch, selectedBranch]) => {
|
||||||
|
if (defaultBranch?.branchType !== 4 && selectedBranch && defaultBranch.id !== selectedBranch?.id) {
|
||||||
|
return 'Sie sehen den Bestand einer anderen Filiale.';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public readonly applicationService: ApplicationService,
|
public readonly applicationService: ApplicationService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
@@ -149,7 +142,8 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
|
|||||||
private _checkoutNavigationService: CheckoutNavigationService,
|
private _checkoutNavigationService: CheckoutNavigationService,
|
||||||
private _environment: EnvironmentService,
|
private _environment: EnvironmentService,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private _domainCheckoutService: DomainCheckoutService
|
private _domainCheckoutService: DomainCheckoutService,
|
||||||
|
private _store: Store
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -231,6 +225,14 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async showTooltip() {
|
||||||
|
const text = await this.stockTooltipText$.pipe(first()).toPromise();
|
||||||
|
if (!text) {
|
||||||
|
// Show Tooltip attached to branch selector dropdown
|
||||||
|
this._store.dispatch({ type: 'OPEN_TOOLTIP_NO_BRANCH_SELECTED' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async updateBreadcrumbDesktop(item: ItemDTO) {
|
async updateBreadcrumbDesktop(item: ItemDTO) {
|
||||||
const crumbs = await this.breadcrumb
|
const crumbs = await this.breadcrumb
|
||||||
.getBreadcrumbsByKeyAndTags$(this.applicationService.activatedProcessId, ['catalog', 'details'])
|
.getBreadcrumbsByKeyAndTags$(this.applicationService.activatedProcessId, ['catalog', 'details'])
|
||||||
|
|||||||
@@ -61,8 +61,12 @@ export class ArticleDetailsStore extends ComponentStore<ArticleDetailsState> {
|
|||||||
return this.get((s) => s.branch);
|
return this.get((s) => s.branch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get defaultBranch$() {
|
||||||
|
return this.domainAvailabilityService.getDefaultBranch();
|
||||||
|
}
|
||||||
|
|
||||||
readonly branch$ = this.select((s) => s.branch).pipe(
|
readonly branch$ = this.select((s) => s.branch).pipe(
|
||||||
withLatestFrom(this.domainAvailabilityService.getDefaultBranch()),
|
withLatestFrom(this.defaultBranch$),
|
||||||
map(([selectedBranch, defaultBranch]) => selectedBranch ?? defaultBranch)
|
map(([selectedBranch, defaultBranch]) => selectedBranch ?? defaultBranch)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -81,33 +81,29 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<button
|
||||||
class="page-search-result-item__item-stock desktop-small:text-p3 font-bold z-dropdown justify-self-start"
|
class="page-search-result-item__item-stock desktop-small:text-p3 font-bold z-dropdown justify-self-start flex flex-row items-center justify-center"
|
||||||
[class.justify-self-end]="!mainOutletActive"
|
[class.justify-self-end]="!mainOutletActive"
|
||||||
[uiOverlayTrigger]="tooltip"
|
[uiOverlayTrigger]="tooltip"
|
||||||
[overlayTriggerDisabled]="!(stockTooltipText$ | async)"
|
[overlayTriggerDisabled]="!(stockTooltipText$ | async)"
|
||||||
|
type="button"
|
||||||
|
(click)="$event.stopPropagation(); $event.preventDefault(); showTooltip()"
|
||||||
>
|
>
|
||||||
|
<ui-icon class="mr-[0.125rem] -mt-[0.275rem]" icon="home" size="1rem"></ui-icon>
|
||||||
<ng-container *ngIf="isOrderBranch$ | async">
|
<ng-container *ngIf="isOrderBranch$ | async">
|
||||||
<div class="flex flex-row items-center justify-between">
|
<span
|
||||||
<ui-icon class="-mt-[0.1875rem]" icon="home" size="1em"></ui-icon>
|
*ngIf="inStock$ | async; let stock"
|
||||||
<span
|
[class.skeleton]="stock.inStock === undefined"
|
||||||
*ngIf="inStock$ | async; let stock"
|
class="min-w-[0.75rem] text-right inline-block"
|
||||||
[class.skeleton]="stock.inStock === undefined"
|
>{{ stock?.inStock }}</span
|
||||||
class="min-w-[1rem] text-right inline-block"
|
>
|
||||||
>{{ stock?.inStock }}</span
|
|
||||||
>
|
|
||||||
<span>x</span>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="!(isOrderBranch$ | async)">
|
<ng-container *ngIf="!(isOrderBranch$ | async)">
|
||||||
<div class="flex flex-row items-center justify-between z-dropdown">
|
<span class="min-w-[1rem] text-center inline-block">-</span>
|
||||||
<ui-icon class="block" icon="home" size="1em"></ui-icon>
|
|
||||||
<span class="min-w-[1rem] text-center inline-block">-</span>
|
|
||||||
<span>x</span>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
<span>x</span>
|
||||||
<ui-tooltip #tooltip yPosition="above" xPosition="after" [yOffset]="-8" [closeable]="true">
|
</button>
|
||||||
|
<ui-tooltip #tooltip yPosition="above" xPosition="after" [yOffset]="-12" [closeable]="true">
|
||||||
{{ stockTooltipText$ | async }}
|
{{ stockTooltipText$ | async }}
|
||||||
</ui-tooltip>
|
</ui-tooltip>
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import { ItemDTO } from '@swagger/cat';
|
|||||||
import { DateAdapter } from '@ui/common';
|
import { DateAdapter } from '@ui/common';
|
||||||
import { isEqual } from 'lodash';
|
import { isEqual } from 'lodash';
|
||||||
import { combineLatest } from 'rxjs';
|
import { combineLatest } from 'rxjs';
|
||||||
import { debounceTime, switchMap, map, filter } from 'rxjs/operators';
|
import { debounceTime, switchMap, map, filter, first } from 'rxjs/operators';
|
||||||
import { ArticleSearchService } from '../article-search.store';
|
import { ArticleSearchService } from '../article-search.store';
|
||||||
import { ProductCatalogNavigationService } from '@shared/services';
|
import { ProductCatalogNavigationService } from '@shared/services';
|
||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
|
||||||
export interface SearchResultItemComponentState {
|
export interface SearchResultItemComponentState {
|
||||||
item?: ItemDTO;
|
item?: ItemDTO;
|
||||||
@@ -104,15 +105,8 @@ export class SearchResultItemComponent extends ComponentStore<SearchResultItemCo
|
|||||||
|
|
||||||
stockTooltipText$ = combineLatest([this.defaultBranch$, this.selectedBranchId$]).pipe(
|
stockTooltipText$ = combineLatest([this.defaultBranch$, this.selectedBranchId$]).pipe(
|
||||||
map(([defaultBranch, selectedBranch]) => {
|
map(([defaultBranch, selectedBranch]) => {
|
||||||
if (defaultBranch?.branchType === 4) {
|
if (defaultBranch?.branchType !== 4 && selectedBranch && defaultBranch.id !== selectedBranch?.id) {
|
||||||
if (!selectedBranch) {
|
|
||||||
return 'Wählen Sie eine Filiale aus, um den Bestand zu sehen.';
|
|
||||||
}
|
|
||||||
return 'Sie sehen den Bestand einer anderen Filiale.';
|
return 'Sie sehen den Bestand einer anderen Filiale.';
|
||||||
} else {
|
|
||||||
if (selectedBranch && defaultBranch.id !== selectedBranch?.id) {
|
|
||||||
return 'Sie sehen den Bestand einer anderen Filiale.';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
})
|
})
|
||||||
@@ -146,7 +140,8 @@ export class SearchResultItemComponent extends ComponentStore<SearchResultItemCo
|
|||||||
private _availability: DomainAvailabilityService,
|
private _availability: DomainAvailabilityService,
|
||||||
private _environment: EnvironmentService,
|
private _environment: EnvironmentService,
|
||||||
private _navigationService: ProductCatalogNavigationService,
|
private _navigationService: ProductCatalogNavigationService,
|
||||||
private _elRef: ElementRef<HTMLElement>
|
private _elRef: ElementRef<HTMLElement>,
|
||||||
|
private _store: Store
|
||||||
) {
|
) {
|
||||||
super({
|
super({
|
||||||
selected: false,
|
selected: false,
|
||||||
@@ -168,6 +163,14 @@ export class SearchResultItemComponent extends ComponentStore<SearchResultItemCo
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async showTooltip() {
|
||||||
|
const text = await this.stockTooltipText$.pipe(first()).toPromise();
|
||||||
|
if (!text) {
|
||||||
|
// Show Tooltip attached to branch selector dropdown
|
||||||
|
this._store.dispatch({ type: 'OPEN_TOOLTIP_NO_BRANCH_SELECTED' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@HostBinding('style') get class() {
|
@HostBinding('style') get class() {
|
||||||
return this.mainOutletActive ? { height: '6.125rem' } : '';
|
return this.mainOutletActive ? { height: '6.125rem' } : '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<shared-breadcrumb class="mb-5 desktop-small:mb-9" [key]="activatedProcessId$ | async" [tags]="['catalog']">
|
<shared-breadcrumb class="mb-5 desktop-small:mb-9" [key]="activatedProcessId$ | async" [tags]="['catalog']">
|
||||||
<shared-branch-selector
|
<shared-branch-selector
|
||||||
|
[uiOverlayTrigger]="tooltip"
|
||||||
|
[overlayTriggerDisabled]="stockTooltipDisabled"
|
||||||
[filterCurrentBranch]="!!auth.hasRole('Store')"
|
[filterCurrentBranch]="!!auth.hasRole('Store')"
|
||||||
[orderBy]="auth.hasRole('Store') ? 'distance' : 'name'"
|
[orderBy]="auth.hasRole('Store') ? 'distance' : 'name'"
|
||||||
[branchType]="1"
|
[branchType]="1"
|
||||||
@@ -7,6 +9,9 @@
|
|||||||
(valueChange)="patchProcessData($event)"
|
(valueChange)="patchProcessData($event)"
|
||||||
>
|
>
|
||||||
</shared-branch-selector>
|
</shared-branch-selector>
|
||||||
|
<ui-tooltip #tooltip yPosition="below" xPosition="after" [xOffset]="-263" [yOffset]="4" [closeable]="true">
|
||||||
|
{{ stockTooltipText$ | async }}
|
||||||
|
</ui-tooltip>
|
||||||
</shared-breadcrumb>
|
</shared-breadcrumb>
|
||||||
|
|
||||||
<ng-container *ngIf="routerEvents$ | async">
|
<ng-container *ngIf="routerEvents$ | async">
|
||||||
|
|||||||
@@ -6,9 +6,12 @@ import { EnvironmentService } from '@core/environment';
|
|||||||
import { BranchSelectorComponent } from '@shared/components/branch-selector';
|
import { BranchSelectorComponent } from '@shared/components/branch-selector';
|
||||||
import { BreadcrumbComponent } from '@shared/components/breadcrumb';
|
import { BreadcrumbComponent } from '@shared/components/breadcrumb';
|
||||||
import { BranchDTO } from '@swagger/checkout';
|
import { BranchDTO } from '@swagger/checkout';
|
||||||
|
import { UiOverlayTriggerDirective } from '@ui/common';
|
||||||
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
import { UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||||
import { fromEvent, Observable, Subject } from 'rxjs';
|
import { combineLatest, fromEvent, Observable, Subject } from 'rxjs';
|
||||||
import { first, map, shareReplay, switchMap, takeUntil, withLatestFrom } from 'rxjs/operators';
|
import { first, map, shareReplay, switchMap, takeUntil, withLatestFrom } from 'rxjs/operators';
|
||||||
|
import { ActionsSubject } from '@ngrx/store';
|
||||||
|
import { DomainAvailabilityService } from '@domain/availability';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-catalog',
|
selector: 'page-catalog',
|
||||||
@@ -23,6 +26,8 @@ export class PageCatalogComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
activatedProcessId$: Observable<string>;
|
activatedProcessId$: Observable<string>;
|
||||||
selectedBranch$: Observable<BranchDTO>;
|
selectedBranch$: Observable<BranchDTO>;
|
||||||
|
|
||||||
|
@ViewChild(UiOverlayTriggerDirective) branchInputNoBranchSelectedTrigger: UiOverlayTriggerDirective;
|
||||||
|
|
||||||
get branchSelectorWidth() {
|
get branchSelectorWidth() {
|
||||||
return `${this.breadcrumbRef?.nativeElement?.clientWidth}px`;
|
return `${this.breadcrumbRef?.nativeElement?.clientWidth}px`;
|
||||||
}
|
}
|
||||||
@@ -45,23 +50,52 @@ export class PageCatalogComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
showRightOutlet$ = this.routerEvents$.pipe(map((_) => !!this._activatedRoute?.children?.find((child) => child?.outlet === 'right')));
|
showRightOutlet$ = this.routerEvents$.pipe(map((_) => !!this._activatedRoute?.children?.find((child) => child?.outlet === 'right')));
|
||||||
|
|
||||||
|
defaultBranch$ = this._availability.getDefaultBranch();
|
||||||
|
|
||||||
|
stockTooltipText$: Observable<string>;
|
||||||
|
|
||||||
|
stockTooltipDisabled$: Observable<boolean>;
|
||||||
|
|
||||||
|
get stockTooltipDisabled() {
|
||||||
|
return this.branchInputNoBranchSelectedTrigger?.opened ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public application: ApplicationService,
|
public application: ApplicationService,
|
||||||
|
private _availability: DomainAvailabilityService,
|
||||||
private _uiModal: UiModalService,
|
private _uiModal: UiModalService,
|
||||||
public auth: AuthService,
|
public auth: AuthService,
|
||||||
private _environmentService: EnvironmentService,
|
private _environmentService: EnvironmentService,
|
||||||
private _renderer: Renderer2,
|
private _renderer: Renderer2,
|
||||||
private _activatedRoute: ActivatedRoute,
|
private _activatedRoute: ActivatedRoute,
|
||||||
private _router: Router
|
private _router: Router,
|
||||||
|
private _actions: ActionsSubject
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.activatedProcessId$ = this.application.activatedProcessId$.pipe(map((processId) => String(processId)));
|
this.activatedProcessId$ = this.application.activatedProcessId$.pipe(map((processId) => String(processId)));
|
||||||
|
|
||||||
this.selectedBranch$ = this.activatedProcessId$.pipe(switchMap((processId) => this.application.getSelectedBranch$(Number(processId))));
|
this.selectedBranch$ = this.activatedProcessId$.pipe(switchMap((processId) => this.application.getSelectedBranch$(Number(processId))));
|
||||||
|
|
||||||
|
this.stockTooltipText$ = combineLatest([this.defaultBranch$, this.selectedBranch$]).pipe(
|
||||||
|
map(([defaultBranch, selectedBranch]) => {
|
||||||
|
if (defaultBranch?.branchType === 4 && !selectedBranch) {
|
||||||
|
return 'Bitte wählen Sie eine Filiale aus, um den Bestand zu sehen.';
|
||||||
|
} else if (defaultBranch?.branchType !== 4 && !selectedBranch) {
|
||||||
|
return 'Bitte wählen Sie eine Filiale aus, um den Bestand einer anderen Filiale zu sehen';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
|
this._actions.pipe(takeUntil(this._onDestroy$), withLatestFrom(this.stockTooltipText$)).subscribe(([action, text]) => {
|
||||||
|
if (action.type === 'OPEN_TOOLTIP_NO_BRANCH_SELECTED' && !!text) {
|
||||||
|
this.branchInputNoBranchSelectedTrigger.open();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
fromEvent(this.branchSelectorRef.nativeElement, 'focusin')
|
fromEvent(this.branchSelectorRef.nativeElement, 'focusin')
|
||||||
.pipe(takeUntil(this._onDestroy$), withLatestFrom(this.isTablet$))
|
.pipe(takeUntil(this._onDestroy$), withLatestFrom(this.isTablet$))
|
||||||
.subscribe(([_, isTablet]) => {
|
.subscribe(([_, isTablet]) => {
|
||||||
|
|||||||
@@ -6,9 +6,20 @@ import { ArticleDetailsModule } from './article-details/article-details.module';
|
|||||||
import { ArticleSearchModule } from './article-search/article-search.module';
|
import { ArticleSearchModule } from './article-search/article-search.module';
|
||||||
import { PageCatalogRoutingModule } from './page-catalog-routing.module';
|
import { PageCatalogRoutingModule } from './page-catalog-routing.module';
|
||||||
import { PageCatalogComponent } from './page-catalog.component';
|
import { PageCatalogComponent } from './page-catalog.component';
|
||||||
|
import { UiCommonModule } from '@ui/common';
|
||||||
|
import { UiTooltipModule } from '@ui/tooltip';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CommonModule, PageCatalogRoutingModule, ArticleSearchModule, ArticleDetailsModule, BreadcrumbModule, BranchSelectorComponent],
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
PageCatalogRoutingModule,
|
||||||
|
ArticleSearchModule,
|
||||||
|
ArticleDetailsModule,
|
||||||
|
BreadcrumbModule,
|
||||||
|
BranchSelectorComponent,
|
||||||
|
UiCommonModule,
|
||||||
|
UiTooltipModule,
|
||||||
|
],
|
||||||
exports: [],
|
exports: [],
|
||||||
declarations: [PageCatalogComponent],
|
declarations: [PageCatalogComponent],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -165,7 +165,7 @@
|
|||||||
[disabled]="showLoader$ | async"
|
[disabled]="showLoader$ | async"
|
||||||
>
|
>
|
||||||
<shared-loader [loading]="showLoader$ | async" spinnerSize="32">
|
<shared-loader [loading]="showLoader$ | async" spinnerSize="32">
|
||||||
Weiter zur Artielsuche
|
Weiter zur Artikelsuche
|
||||||
</shared-loader>
|
</shared-loader>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ export class FilterInputOptionDateRangeComponent {
|
|||||||
subscribeChanges() {
|
subscribeChanges() {
|
||||||
this.unsubscribeChanges();
|
this.unsubscribeChanges();
|
||||||
if (this.uiStartOption) {
|
if (this.uiStartOption) {
|
||||||
|
this.formGroup.patchValue({ start: (this.uiStartOption.value as any) as Date });
|
||||||
|
|
||||||
this.optionChangeSubscription.add(
|
this.optionChangeSubscription.add(
|
||||||
this.uiStartOption.changes.subscribe(() => {
|
this.uiStartOption.changes.subscribe(() => {
|
||||||
if (new Date(this.uiStartOption.value) !== new Date(this.formGroup.get('start').value)) {
|
if (new Date(this.uiStartOption.value) !== new Date(this.formGroup.get('start').value)) {
|
||||||
@@ -71,6 +73,8 @@ export class FilterInputOptionDateRangeComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (this.uiStopOption) {
|
if (this.uiStopOption) {
|
||||||
|
this.formGroup.patchValue({ stop: (this.uiStopOption.value as any) as Date });
|
||||||
|
|
||||||
this.optionChangeSubscription.add(
|
this.optionChangeSubscription.add(
|
||||||
this.uiStopOption.changes.subscribe(() => {
|
this.uiStopOption.changes.subscribe(() => {
|
||||||
if (new Date(this.uiStopOption.value) !== new Date(this.formGroup.get('stop').value)) {
|
if (new Date(this.uiStopOption.value) !== new Date(this.formGroup.get('stop').value)) {
|
||||||
|
|||||||
@@ -68,15 +68,19 @@ export class ShellProcessBarComponent implements OnInit {
|
|||||||
setTimeout(() => this.scrollToEnd(), 25);
|
setTimeout(() => this.scrollToEnd(), 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static REGEX_PROCESS_NAME = /^Vorgang \d+$/;
|
||||||
|
|
||||||
async createCartProcess() {
|
async createCartProcess() {
|
||||||
const processes = await this._app.getProcesses$('customer').pipe(first()).toPromise();
|
const processes = await this._app.getProcesses$('customer').pipe(first()).toPromise();
|
||||||
|
|
||||||
const count = processes.filter((x) => x.type === 'cart' && x.name.startsWith('Vorgang ')).length;
|
const processIds = processes.filter((x) => ShellProcessBarComponent.REGEX_PROCESS_NAME.test(x.name)).map((x) => +x.name.split(' ')[1]);
|
||||||
|
|
||||||
|
const maxId = processIds.length > 0 ? Math.max(...processIds) : 0;
|
||||||
|
|
||||||
const process: ApplicationProcess = {
|
const process: ApplicationProcess = {
|
||||||
id: Date.now(),
|
id: Date.now(),
|
||||||
type: 'cart',
|
type: 'cart',
|
||||||
name: `Vorgang ${count + 1}`,
|
name: `Vorgang ${maxId + 1}`,
|
||||||
section: 'customer',
|
section: 'customer',
|
||||||
closeable: true,
|
closeable: true,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import {
|
|||||||
Directive,
|
Directive,
|
||||||
ElementRef,
|
ElementRef,
|
||||||
EmbeddedViewRef,
|
EmbeddedViewRef,
|
||||||
HostBinding,
|
|
||||||
HostListener,
|
HostListener,
|
||||||
Input,
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
@@ -13,10 +12,12 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
|
Inject,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { asapScheduler, Subject } from 'rxjs';
|
import { asapScheduler, Subject, fromEvent, Subscription } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { take, takeUntil } from 'rxjs/operators';
|
||||||
import { UiOverlayTrigger } from './overlay-trigger';
|
import { UiOverlayTrigger } from './overlay-trigger';
|
||||||
|
import { DOCUMENT } from '@angular/common';
|
||||||
|
|
||||||
@Directive({ selector: '[uiOverlayTrigger]', exportAs: 'uiOverlayTrigger' })
|
@Directive({ selector: '[uiOverlayTrigger]', exportAs: 'uiOverlayTrigger' })
|
||||||
export class UiOverlayTriggerDirective implements OnInit, OnDestroy, OnChanges {
|
export class UiOverlayTriggerDirective implements OnInit, OnDestroy, OnChanges {
|
||||||
@@ -32,6 +33,7 @@ export class UiOverlayTriggerDirective implements OnInit, OnDestroy, OnChanges {
|
|||||||
private overlayRef: OverlayRef;
|
private overlayRef: OverlayRef;
|
||||||
private viewRef: EmbeddedViewRef<any>;
|
private viewRef: EmbeddedViewRef<any>;
|
||||||
private _onDestroy$ = new Subject<void>();
|
private _onDestroy$ = new Subject<void>();
|
||||||
|
private _clickListenerSub: Subscription;
|
||||||
|
|
||||||
get opened() {
|
get opened() {
|
||||||
return !!this.viewRef;
|
return !!this.viewRef;
|
||||||
@@ -42,7 +44,8 @@ export class UiOverlayTriggerDirective implements OnInit, OnDestroy, OnChanges {
|
|||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private elementRef: ElementRef,
|
private elementRef: ElementRef,
|
||||||
private overlay: Overlay,
|
private overlay: Overlay,
|
||||||
private cdr: ChangeDetectorRef
|
private cdr: ChangeDetectorRef,
|
||||||
|
@Inject(DOCUMENT) private _document: Document
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnChanges({ position }: SimpleChanges): void {
|
ngOnChanges({ position }: SimpleChanges): void {
|
||||||
@@ -107,6 +110,9 @@ export class UiOverlayTriggerDirective implements OnInit, OnDestroy, OnChanges {
|
|||||||
this.updatePositionStrategy();
|
this.updatePositionStrategy();
|
||||||
|
|
||||||
this.viewRef = this.overlayRef.attach(dropdownPortal);
|
this.viewRef = this.overlayRef.attach(dropdownPortal);
|
||||||
|
|
||||||
|
this.registerCloseOnClickListener();
|
||||||
|
|
||||||
this.component.close = () => this.close();
|
this.component.close = () => this.close();
|
||||||
|
|
||||||
this.cdr.markForCheck();
|
this.cdr.markForCheck();
|
||||||
@@ -116,6 +122,7 @@ export class UiOverlayTriggerDirective implements OnInit, OnDestroy, OnChanges {
|
|||||||
this.viewRef?.destroy();
|
this.viewRef?.destroy();
|
||||||
this.overlayRef.detach();
|
this.overlayRef.detach();
|
||||||
delete this.viewRef;
|
delete this.viewRef;
|
||||||
|
this._clickListenerSub.unsubscribe();
|
||||||
this.cdr.markForCheck();
|
this.cdr.markForCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,6 +137,18 @@ export class UiOverlayTriggerDirective implements OnInit, OnDestroy, OnChanges {
|
|||||||
.subscribe(() => this.close());
|
.subscribe(() => this.close());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registerCloseOnClickListener() {
|
||||||
|
asapScheduler.schedule(() => {
|
||||||
|
this._clickListenerSub = fromEvent(this._document.body, 'click')
|
||||||
|
.pipe(take(1))
|
||||||
|
.subscribe((event) => {
|
||||||
|
if (this.viewRef && !this.overlayRef?.hostElement?.contains(event.target as HTMLElement)) {
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 1);
|
||||||
|
}
|
||||||
|
|
||||||
updatePositionStrategy() {
|
updatePositionStrategy() {
|
||||||
this.overlayRef.updatePositionStrategy(this.getPositionStrategy());
|
this.overlayRef.updatePositionStrategy(this.getPositionStrategy());
|
||||||
}
|
}
|
||||||
@@ -169,11 +188,4 @@ export class UiOverlayTriggerDirective implements OnInit, OnDestroy, OnChanges {
|
|||||||
updatePosition() {
|
updatePosition() {
|
||||||
this.overlayRef?.updatePositionStrategy(this.getPositionStrategy());
|
this.overlayRef?.updatePositionStrategy(this.getPositionStrategy());
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('document:click', ['$event'])
|
|
||||||
documentClick(event: MouseEvent) {
|
|
||||||
if (this.viewRef && !this.overlayRef?.hostElement?.contains(event.target as HTMLElement)) {
|
|
||||||
this.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
28
package-lock.json
generated
28
package-lock.json
generated
@@ -35,7 +35,7 @@
|
|||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"ng2-pdf-viewer": "^9.1.3",
|
"ng2-pdf-viewer": "^9.1.3",
|
||||||
"rxjs": "^6.6.7",
|
"rxjs": "^6.6.7",
|
||||||
"scandit-sdk": "^5.12.1",
|
"scandit-sdk": "^5.13.2",
|
||||||
"socket.io": "^4.5.4",
|
"socket.io": "^4.5.4",
|
||||||
"tslib": "^2.0.0",
|
"tslib": "^2.0.0",
|
||||||
"uglify-js": "^3.4.9",
|
"uglify-js": "^3.4.9",
|
||||||
@@ -2186,8 +2186,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/runtime-corejs2": {
|
"node_modules/@babel/runtime-corejs2": {
|
||||||
"version": "7.20.7",
|
"version": "7.22.6",
|
||||||
"license": "MIT",
|
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.22.6.tgz",
|
||||||
|
"integrity": "sha512-GTJVRjzQIHUBwRzuWxPII87XoWxXzILBJrQh5gqIV6q6m231Y0BBA9NKta5FV5Lbl8z5gS3+m6YSoKJp0KQJ4g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^2.6.12",
|
"core-js": "^2.6.12",
|
||||||
"regenerator-runtime": "^0.13.11"
|
"regenerator-runtime": "^0.13.11"
|
||||||
@@ -13452,10 +13453,11 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/scandit-sdk": {
|
"node_modules/scandit-sdk": {
|
||||||
"version": "5.12.2",
|
"version": "5.13.2",
|
||||||
"license": "SEE LICENSE IN LICENSE",
|
"resolved": "https://registry.npmjs.org/scandit-sdk/-/scandit-sdk-5.13.2.tgz",
|
||||||
|
"integrity": "sha512-ZrUciqc8X+wb9+JJD5gkn/JRLWBZYBpZO17RlqL/uS4TuMaVKLcj3EXH77nGacSwQowM03NdBGc5GPqykZq2Ow==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime-corejs2": "^7.20.7",
|
"@babel/runtime-corejs2": "^7.20.13",
|
||||||
"@juggle/resize-observer": "^3.4.0",
|
"@juggle/resize-observer": "^3.4.0",
|
||||||
"csstype": "^3.1.1",
|
"csstype": "^3.1.1",
|
||||||
"eventemitter3": "^5.0.0",
|
"eventemitter3": "^5.0.0",
|
||||||
@@ -13463,7 +13465,7 @@
|
|||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"objectFitPolyfill": "^2.3.5",
|
"objectFitPolyfill": "^2.3.5",
|
||||||
"tslib": "^2.4.1",
|
"tslib": "^2.4.1",
|
||||||
"ua-parser-js": "^1.0.32"
|
"ua-parser-js": "^1.0.33"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.18"
|
"node": ">=10.18"
|
||||||
@@ -17702,7 +17704,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/runtime-corejs2": {
|
"@babel/runtime-corejs2": {
|
||||||
"version": "7.20.7",
|
"version": "7.22.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.22.6.tgz",
|
||||||
|
"integrity": "sha512-GTJVRjzQIHUBwRzuWxPII87XoWxXzILBJrQh5gqIV6q6m231Y0BBA9NKta5FV5Lbl8z5gS3+m6YSoKJp0KQJ4g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"core-js": "^2.6.12",
|
"core-js": "^2.6.12",
|
||||||
"regenerator-runtime": "^0.13.11"
|
"regenerator-runtime": "^0.13.11"
|
||||||
@@ -24968,9 +24972,11 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"scandit-sdk": {
|
"scandit-sdk": {
|
||||||
"version": "5.12.2",
|
"version": "5.13.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/scandit-sdk/-/scandit-sdk-5.13.2.tgz",
|
||||||
|
"integrity": "sha512-ZrUciqc8X+wb9+JJD5gkn/JRLWBZYBpZO17RlqL/uS4TuMaVKLcj3EXH77nGacSwQowM03NdBGc5GPqykZq2Ow==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/runtime-corejs2": "^7.20.7",
|
"@babel/runtime-corejs2": "^7.20.13",
|
||||||
"@juggle/resize-observer": "^3.4.0",
|
"@juggle/resize-observer": "^3.4.0",
|
||||||
"csstype": "^3.1.1",
|
"csstype": "^3.1.1",
|
||||||
"eventemitter3": "^5.0.0",
|
"eventemitter3": "^5.0.0",
|
||||||
@@ -24978,7 +24984,7 @@
|
|||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"objectFitPolyfill": "^2.3.5",
|
"objectFitPolyfill": "^2.3.5",
|
||||||
"tslib": "^2.4.1",
|
"tslib": "^2.4.1",
|
||||||
"ua-parser-js": "^1.0.32"
|
"ua-parser-js": "^1.0.33"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"eventemitter3": {
|
"eventemitter3": {
|
||||||
|
|||||||
Reference in New Issue
Block a user