#4239 Bereich Kundenkarte hat kein Schließ-Button

This commit is contained in:
Lorenz Hilpert
2023-07-28 17:33:07 +02:00
parent bb834f6274
commit 14199391e0
3 changed files with 28 additions and 5 deletions

View File

@@ -1,3 +1,3 @@
:host {
@apply grid grid-flow-row justify-center items-center gap-4 bg-surface text-surface-content rounded px-4 py-6;
@apply grid grid-flow-row items-center gap-4 bg-surface text-surface-content rounded px-4 py-6;
}

View File

@@ -1,9 +1,20 @@
<div class="flex flex-row justify-end -mt-4 -mr-2">
<a
*ngIf="detailsRoute$ | async; let detailsRoute"
[routerLink]="detailsRoute.path"
[queryParams]="detailsRoute.urlTree.queryParams"
[queryParamsHandling]="'merge'"
>
<shared-icon icon="close" [size]="32"></shared-icon>
</a>
</div>
<h1 class="text-center text-2xl font-bold">Kundenkarte</h1>
<p class="text-center text-xl">
Alle Infos zu Ihrer Kundenkarte <br />
und allen Partnerkarten.
</p>
<page-customer-kundenkarte
class="justify-self-center"
*ngFor="let karte of primaryKundenkarte$ | async"
[cardDetails]="karte"
[isCustomerCard]="true"
@@ -12,6 +23,7 @@
<p class="text-center text-xl font-bold" *ngIf="(partnerKundenkarte$ | async)?.length">Partnerkarten</p>
<page-customer-kundenkarte
class="justify-self-center"
*ngFor="let karte of partnerKundenkarte$ | async"
[cardDetails]="karte"
[isCustomerCard]="false"

View File

@@ -1,11 +1,13 @@
import { Component, ChangeDetectionStrategy, OnInit, OnDestroy } from '@angular/core';
import { CustomerSearchStore } from '../store';
import { ActivatedRoute } from '@angular/router';
import { Subject } from 'rxjs';
import { ActivatedRoute, RouterLink } from '@angular/router';
import { Subject, combineLatest } from 'rxjs';
import { map, share, switchMap } from 'rxjs/operators';
import { CrmCustomerService } from '@domain/crm';
import { KundenkarteComponent } from '../../components/kundenkarte';
import { AsyncPipe, NgFor, NgIf } from '@angular/common';
import { IconComponent } from '@shared/components/icon';
import { CustomerSearchNavigation } from '../../navigations';
@Component({
selector: 'page-customer-kundenkarte-main-view',
@@ -14,7 +16,7 @@ import { AsyncPipe, NgFor, NgIf } from '@angular/common';
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'page-customer-kundenkarte-main-view' },
standalone: true,
imports: [KundenkarteComponent, NgFor, AsyncPipe, NgIf],
imports: [KundenkarteComponent, NgFor, AsyncPipe, NgIf, IconComponent, RouterLink],
})
export class KundenkarteMainViewComponent implements OnInit, OnDestroy {
private _onDestroy$ = new Subject<void>();
@@ -32,7 +34,16 @@ export class KundenkarteMainViewComponent implements OnInit, OnDestroy {
partnerKundenkarte$ = this.kundenkarte$.pipe(map((kundenkarte) => kundenkarte?.filter((k) => !k.isPrimary)));
constructor(private _store: CustomerSearchStore, private _activatedRoute: ActivatedRoute, private _customerService: CrmCustomerService) {}
detailsRoute$ = combineLatest([this._store.processId$, this._store.customerId$]).pipe(
map(([processId, customerId]) => this._navigation.detailsRoute({ processId, customerId }))
);
constructor(
private _store: CustomerSearchStore,
private _activatedRoute: ActivatedRoute,
private _customerService: CrmCustomerService,
private _navigation: CustomerSearchNavigation
) {}
ngOnInit() {
this.customerId$.subscribe((customerId) => {