Skip to content

WidgetForecastBacklogPaymentComponent

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-forecast-backlog-payment/widget-forecast-backlog-payment.component.ts (line 26)

Part of: Pams

WidgetForecastBacklogPaymentComponent manages forecast backlog payment data for a dashboard widget. It loads dashboard and My Disk data, processes responses, handles sales pipeline chart interactions, and controls invoice display settings.

Implements: OnInit

Methods

MethodSignatureReturns
getDashboardDatagetDashboardData()void
getMyDiskDatagetMyDiskData()void
afterResponseafterResponse(Data: WidgetBacklogInvoices[])void
borderColorborderColor(stage: string)string
ngOnInitngOnInit()void
onChartInitonChartInit(e: any)void
onSalesPipelineChartClickonSalesPipelineChartClick(e: undefined)void
onSalesPipelineChartInMyDiskTabClickonSalesPipelineChartInMyDiskTabClick(e: undefined)void
switchCommissionInvoicesOffswitchCommissionInvoicesOff()void
switchSalesInvoicesOffswitchSalesInvoicesOff()void
ngOnDestroyngOnDestroy()void

Properties

PropertyType
_widgetWidget
_myDiskFilterObjMyDiskFilterObj
ChartInMyDiskTabClickany
todayWidgetsEnumany
subscriptionSubscription
maxValueForYaxisnumber
initOptsany
seriesany[]
headerDataany[]
dataany[]
datasourceWidgetBacklogInvoices[]
originalDatasourceWidgetBacklogInvoices[]
echartsIntanceany
CommissionInvoicesboolean
SalesInvoicesboolean
isLoadingboolean
optionsany

Where it refuses work

  • WidgetForecastBacklogPaymentComponent stops the work with an early return when stage == "Overdue".

Diagram

mermaid
graph LR
  Init[ngOnInit] --> Dashboard[getDashboardData]
  Init --> MyDisk[getMyDiskData]
  Dashboard --> Response[afterResponse]
  MyDisk --> Response
  Response --> Chart[onChartInit]
  Chart --> PipelineClick[onSalesPipelineChartClick]
  Chart --> MyDiskClick[onSalesPipelineChartInMyDiskTabClick]
  Response --> Border[borderColor]
  InvoiceControls[switchCommissionInvoicesOff / switchSalesInvoicesOff] --> Response

Usage

ts
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { WidgetForecastBacklogPaymentComponent } from './widget-forecast-backlog-payment.component';

describe('WidgetForecastBacklogPaymentComponent', () => {
  let fixture: ComponentFixture<WidgetForecastBacklogPaymentComponent>;
  let component: WidgetForecastBacklogPaymentComponent;

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [WidgetForecastBacklogPaymentComponent],
    }).compileComponents();

    fixture = TestBed.createComponent(WidgetForecastBacklogPaymentComponent);
    component = fixture.componentInstance;

    fixture.detectChanges();
  });

  it('loads widget data and supports invoice controls', () => {
    component.getDashboardData();
    component.getMyDiskData();

    component.switchCommissionInvoicesOff();
    component.switchSalesInvoicesOff();

    expect(component.borderColor()).toBeDefined();
  });
});

AI Coding Instructions

  • Keep data loading in getDashboardData() and getMyDiskData() so dashboard and My Disk flows remain separate.
  • Process API results through afterResponse() before updating chart-related state.
  • Initialize chart behavior from onChartInit() and route chart click events to the matching sales pipeline handler.
  • Preserve the separate handlers for dashboard and My Disk sales pipeline clicks, since they may require different navigation or filtering behavior.
  • Update invoice visibility through switchCommissionInvoicesOff() and switchSalesInvoicesOff() rather than changing related state directly.

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • TranslateHandlerPams/Web/Pams.Web/Client/app/app.module.ts:1

Was this page helpful?

Download as PDF