libs/pfe-connector/src/lib/pfe-building-block-page.ts
AbstractBuildingBlockPage<PFEFacade>
| changeDetection | ChangeDetectionStrategy.Eager |
Properties |
Methods |
| onPageComplete |
onPageComplete()
|
|
Inherited from
AbstractBuildingBlockPage
|
|
Returns :
void
|
| onPageWaiting |
onPageWaiting()
|
|
Inherited from
AbstractBuildingBlockPage
|
|
Returns :
void
|
| handleBuildBlocksChanged | |||||||||||
handleBuildBlocksChanged(: [AbstractBuildingBlock[], AbstractBuildingBlock[]], allowedRetries: number)
|
|||||||||||
|
Inherited from
AbstractBuildingBlockPage
|
|||||||||||
|
Whenever the set of Building Blocks has changed ensure that the matching facades are created & connected or respectively disconnected and deleted from our internal facade map. We chose this approach instead of reusing facades as the underlying component is in fact deleted and recreated by the Angular renderer so we would have to introduce extra logic to re-initialize that component. It's easier to pretend that we encounter a Building Block the first time.
Parameters :
Returns :
void
|
| handlePageStatusUpdates | ||||||
handlePageStatusUpdates(newStatus: ABSTRACT_PAGE_STATUS)
|
||||||
|
Inherited from
AbstractBuildingBlockPage
|
||||||
|
Parameters :
Returns :
void
|
| onPageDestroy |
onPageDestroy()
|
|
Inherited from
AbstractBuildingBlockPage
|
|
Returns :
void
|
| onPageReady |
onPageReady()
|
|
Inherited from
AbstractBuildingBlockPage
|
|
Returns :
void
|
| connect$ |
Type : unknown
|
Default value : new Subject<void>()
|
|
Inherited from
AbstractBuildingBlockPage
|
| disconnect$ |
Type : unknown
|
Default value : new Subject<void>()
|
|
Inherited from
AbstractBuildingBlockPage
|
| facadeMap |
Type : unknown
|
Default value : new Map<string, AbstractBuildingBlockFacade>()
|
|
Inherited from
AbstractBuildingBlockPage
|
| Readonly id |
Type : string
|
|
Inherited from
AbstractBuildingBlockPage
|
| pageData |
Type : PageDataForTemplate
|
Default value : {}
|
|
Inherited from
AbstractBuildingBlockPage
|
| status |
Type : unknown
|
Default value : ABSTRACT_PAGE_STATUS.WAITING
|
|
Inherited from
AbstractBuildingBlockPage
|
import { PfeBusinessService } from '@allianz/ngx-pfe';
import {
AbstractBuildingBlock,
AbstractBuildingBlockPage
} from '@allianz/taly-core/building-blocks';
import { ChangeDetectionStrategy, Component, inject, Injector } from '@angular/core';
import { PFEFacade } from './pfe-facade';
import { PFE_FACADE_FACTORY } from './tokens';
@Component({
template: '',
standalone: false,
// This page base class imperatively calls setState/setResources on child building blocks.
// It must use Eager change detection so that those updates are reflected in the view.
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
changeDetection: ChangeDetectionStrategy.Eager
})
export class PFEBuildingBlockPage extends AbstractBuildingBlockPage<PFEFacade> {
protected pfeBusinessService = inject(PfeBusinessService);
private injector = inject(Injector);
private buildingBlockFacadeFactory = inject(PFE_FACADE_FACTORY);
override onPageComplete() {
this.pfeBusinessService.setPageStatus(true);
}
override onPageWaiting() {
this.pfeBusinessService.setPageStatus(false);
}
protected override createFacade(block: AbstractBuildingBlock): PFEFacade {
return this.buildingBlockFacadeFactory(block, this.injector);
}
}