libs/pfe-connector/src/lib/pfe-building-block-page.ts

Extends

AbstractBuildingBlockPage<PFEFacade>

Metadata

Relationships

Index

Properties
Methods

Methods

onPageComplete
onPageComplete()
Returns : void
onPageWaiting
onPageWaiting()
Returns : void
handleBuildBlocksChanged
handleBuildBlocksChanged(: [AbstractBuildingBlock[], AbstractBuildingBlock[]], allowedRetries: number)

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 :
Name Type Optional Default value
[AbstractBuildingBlock[], AbstractBuildingBlock[]] No
allowedRetries number No 2
Returns : void
handlePageStatusUpdates
handlePageStatusUpdates(newStatus: ABSTRACT_PAGE_STATUS)
Parameters :
Name Type Optional
newStatus ABSTRACT_PAGE_STATUS No
Returns : void
onPageDestroy
onPageDestroy()
Returns : void
onPageReady
onPageReady()
Returns : void

Properties

connect$
Type : unknown
Default value : new Subject<void>()
disconnect$
Type : unknown
Default value : new Subject<void>()
facadeMap
Type : unknown
Default value : new Map<string, AbstractBuildingBlockFacade>()
Readonly id
Type : string
pageData
Type : PageDataForTemplate
Default value : {}
status
Type : unknown
Default value : ABSTRACT_PAGE_STATUS.WAITING
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);
  }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""