This commit is contained in:
Andreas Schickinger
2021-01-28 13:42:38 +01:00
parent 7ae16e19bb
commit 28cdc33f7c
4 changed files with 15 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
<a [routerLink]="['/customer', customer?.id]" class="card-customer-details">
<span class="title">Kundendetails</span>
</a>
<a class="card-customer-orders">
<a class="card-customer-orders" [routerLink]="['/customer', customer?.id, 'orders']">
<span class="title">Bestellungen</span>
</a>
<div class="card-customer-card">

View File

@@ -1,19 +1,18 @@
<ng-container *ngIf="customer$ | async; let customer">
<a [routerLink]="['/customer', customer?.id, 'card']" class="card-customer-card">
<span class="title">Kundenkarte</span>
</a>
<a [routerLink]="['/customer', customer?.id]" class="card-customer-details">
<span class="title">Kundendetails</span>
</a>
<a *ngIf="hasCustomerCard$ | async" [routerLink]="['/customer', customer?.id, 'card']" class="card-customer-card">
<span class="title">Kundenkarte</span>
</a>
<ng-container *ngIf="orders$ | async; let orders">
<div class="card">
<div class="card card-customer-orders">
<div class="header">
<h1>Bestellungen</h1>
<p class="desc" *ngIf="orders.length > 0">Übersicht aller offenen und<br />früheren Bestellungen</p>
<p class="desc-empty" *ngIf="orders.length === 0">Es sind keine Bestellungen vorhanden</p>
</div>
<div class="orders" uiScrollContainer (reachEnd)="reachEnd()">
<div></div>
<div *ngFor="let order of orders" class="order-row">

View File

@@ -8,8 +8,11 @@
.card-customer-card,
.card-customer-details {
@apply bg-white rounded-t-card p-4 text-center;
@apply bg-white p-4 text-center;
box-shadow: 0 -2px 24px 0 #dce2e9;
}
.card-customer-orders {
box-shadow: 0 -2px 24px 0 #dce2e9;
}
@@ -20,6 +23,7 @@
.header {
@apply bg-white rounded-card p-card;
box-shadow: 0px 19px 25px -10px white;
}
a {
@@ -42,7 +46,7 @@ h1 {
.orders {
@apply flex flex-col gap-px-2;
max-height: 680px;
max-height: 740px;
}
.order-row {

View File

@@ -24,6 +24,7 @@ export class CustomerOrdersComponent implements OnInit, OnDestroy {
orders$ = new BehaviorSubject<OrderListItemDTO[]>([]);
isLoading: boolean;
hasCustomerCard$: Observable<boolean>;
constructor(private activatedRoute: ActivatedRoute, private customerDetailsService: CrmCustomerService, private omsService: OmsService) {}
@@ -34,6 +35,9 @@ export class CustomerOrdersComponent implements OnInit, OnDestroy {
map(({ result }) => result)
);
let customerFeatures$ = this.customer$.pipe(map((customer: CustomerDTO) => Object.values(customer.features).filter((f) => f.enabled)));
this.hasCustomerCard$ = customerFeatures$.pipe(map((features) => !!features.find((feature) => feature.description === 'Kundenkarte')));
this.subs.add(
combineLatest([this.customer$, this.skip$])
.pipe(