mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
#1519 Changed Template and Added Check If TotalItemCount is 0
This commit is contained in:
committed by
Lorenz Hilpert
parent
fcc88e2ec5
commit
a622b3dc0c
@@ -142,7 +142,11 @@
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="card footer row">
|
||||
<div class="total-item-reading-points">{{ totalItemCount$ | async }} Artikel | {{ totalReadingPoints$ | async }} Lesepunkte</div>
|
||||
<ng-container *ngIf="totalItemCount$ | async; let totalItemCount">
|
||||
<div *ngIf="totalReadingPoints$ | async; let totalReadingPoints" class="total-item-reading-points">
|
||||
{{ totalItemCount }} Artikel | {{ totalReadingPoints }} Lesepunkte
|
||||
</div>
|
||||
</ng-container>
|
||||
<div class="grow"></div>
|
||||
<div class="total-cta-container">
|
||||
<div class="total-container">
|
||||
|
||||
@@ -11,7 +11,7 @@ import { first, map, shareReplay, switchMap, takeUntil } from 'rxjs/operators';
|
||||
import { SsoService } from 'sso';
|
||||
import { PurchasingOptionsModalComponent, PurchasingOptionsModalData } from '../modals/purchasing-options-modal';
|
||||
import { PurchasingOptions } from '../modals/purchasing-options-modal/purchasing-options-modal.store';
|
||||
import { Subject } from 'rxjs';
|
||||
import { Subject, NEVER } from 'rxjs';
|
||||
import { StringDictionary } from '@cmf/core';
|
||||
import { DomainCatalogService } from '@domain/catalog';
|
||||
import { BreadcrumbService } from '@core/breadcrumb';
|
||||
@@ -79,8 +79,11 @@ export class CheckoutReviewComponent {
|
||||
);
|
||||
|
||||
totalReadingPoints$ = this.items$.pipe(
|
||||
switchMap((displayOrders) =>
|
||||
this.domainCatalogService
|
||||
switchMap((displayOrders) => {
|
||||
if (displayOrders.length === 0) {
|
||||
return NEVER;
|
||||
}
|
||||
return this.domainCatalogService
|
||||
.getPromotionPoints({
|
||||
items: displayOrders.map((i) => ({
|
||||
id: Number(i.product?.catalogProductNumber),
|
||||
@@ -88,8 +91,8 @@ export class CheckoutReviewComponent {
|
||||
price: i.unitPrice?.value?.value,
|
||||
})),
|
||||
})
|
||||
.pipe(map((response) => Object.values(response.result).reduce((sum, points) => sum + points, 0)))
|
||||
)
|
||||
.pipe(map((response) => Object.values(response.result).reduce((sum, points) => sum + points, 0)));
|
||||
})
|
||||
);
|
||||
|
||||
customerFeatures$ = this.applicationService.activatedProcessId$.pipe(
|
||||
|
||||
Reference in New Issue
Block a user