mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
#1320 bugfix remove disabled features from customer details view
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<p class="info">Sind Ihre {{ (customerType$ | async) === 'b2b' ? 'Firmendaten' : 'Kundendaten' }} korrekt?</p>
|
||||
<div class="tags">
|
||||
<div class="tag" *ngFor="let feature of customer.features">
|
||||
<div class="tag" *ngFor="let feature of customerFeatures$ | async">
|
||||
<ui-icon icon="check" size="15px"></ui-icon>
|
||||
{{ feature.description }}
|
||||
</div>
|
||||
|
||||
@@ -5,9 +5,9 @@ import { Breadcrumb, BreadcrumbService } from '@core/breadcrumb';
|
||||
import { CartService } from '@domain/cart';
|
||||
import { CheckoutService } from '@domain/checkout';
|
||||
import { AddressHelper, AssignedPayerHelper, CrmCustomerService } from '@domain/crm';
|
||||
import { CustomerDTO } from '@swagger/crm';
|
||||
import { CustomerDTO, KeyValueDTOOfStringAndString } from '@swagger/crm';
|
||||
import { ShippingAddressHelper } from 'apps/domain/crm/src/lib/helpers/shipping-address.helper';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { first, map, shareReplay, switchMap, tap } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
@@ -20,6 +20,7 @@ export class CustomerDetailsComponent implements OnInit {
|
||||
customerId$: Observable<number>;
|
||||
customer$: Observable<CustomerDTO>;
|
||||
cartExists: boolean;
|
||||
customerFeatures$: Observable<KeyValueDTOOfStringAndString[]>;
|
||||
|
||||
customerType$: Observable<'store' | 'b2b' | 'onlineshop' | 'guestaccount'>;
|
||||
|
||||
@@ -83,8 +84,9 @@ export class CustomerDetailsComponent implements OnInit {
|
||||
);
|
||||
|
||||
this.customerType$ = this.customer$.pipe(
|
||||
map((customer) => {
|
||||
map((customer: CustomerDTO) => {
|
||||
const features = Object.values(customer.features).filter((f) => f.enabled);
|
||||
this.customerFeatures$ = of(features);
|
||||
return features[0].key as 'store' | 'onlineshop' | 'b2b' | 'guestaccount';
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user