Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 3x 3x 3x 3x 4x 4x 4x 2x | import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { CheckoutFacade } from 'ish-core/facades/checkout.facade';
import { BasketInfo } from 'ish-core/models/basket-info/basket-info.model';
/**
* Displays basket info messages, e.g. if a basket operation has only partly been executed
*
* @example
* <ish-basket-info></ish-basket-info>
*/
@Component({
selector: 'ish-basket-info',
templateUrl: './basket-info.component.html',
changeDetection: ChangeDetectionStrategy.Default,
})
export class BasketInfoComponent implements OnInit {
infoMessages$: Observable<BasketInfo[]>;
constructor(private checkoutFacade: CheckoutFacade) {}
ngOnInit() {
this.infoMessages$ = this.checkoutFacade.basketInfo$.pipe(
map(results =>
results?.map(info => ({
...info,
causes: info?.causes?.filter(
cause => !cause.parameters || (cause.parameters && !cause.parameters.lineItemId)
),
}))
)
);
}
}
|