Skip to content

WidgetTopOffersByPrincipalsLastNyearsComponent

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-top-offers-by-principals-last-nyears/widget-top-offers-by-principals-last-nyears.component.ts (line 23)

Part of: Pams

WidgetTopOffersByPrincipalsLastNyearsComponent manages dashboard data for the top offers by principals view across recent years. It coordinates data retrieval, response handling, chart setup and interactions, year color selection, caching, and value-change updates.

Implements: OnInit

Methods

MethodSignatureReturns
getDashboardDatagetDashboardData()void
afterResponseafterResponse(Data: any[])void
ngOnChangesngOnChanges()void
ngOnInitngOnInit()void
setYearColorsetYearColor(year: number)string
onChartInitonChartInit(e: any)void
onPlannedVisitsChartClickonPlannedVisitsChartClick(e: undefined)void
setChachingsetChaching()void
getChachinggetChaching()void
onValueChangedonValueChanged(e: undefined)void
switchChartTypeHandlerswitchChartTypeHandler()void
switchChartRefernceCommissionHandlerswitchChartRefernceCommissionHandler()void
toggoleOnlyCurrentOfferstoggoleOnlyCurrentOffers()void
toggoleBudgetOfferstoggoleBudgetOffers()void
toggoleFirmOfferstoggoleFirmOffers()void
switchFirmOffersswitchFirmOffers()void
switchBudgetOffersswitchBudgetOffers()void
nextPagenextPage()void
prevPageprevPage()void
ngOnDestroyngOnDestroy()void

Properties

PropertyType
_widgetWidget
meAsVendorboolean
isRefernceCommissionboolean
withoutOptionBarboolean
onlyCurrentOffersboolean
numYearsnumber
_FirmOffersboolean
_BudgetOffersboolean
numYearsDatasourceany[]
todayWidgetsEnumany
subscriptionSubscription
branchNamestring
maxValueForYaxisnumber
initOptsany
seriesany[]
headerDataany[]
echartsIntanceany
cachingWidgetDataCachingWidgetData
originalDatasourceWidgetTopOffers[]
datasourceWidgetTopOffers[]
originalHeaderany[]
optionsany
skipnumber

Diagram

mermaid
graph LR
  AngularLifecycle[Angular lifecycle] --> ngOnInit
  AngularLifecycle --> ngOnChanges
  ngOnInit --> getDashboardData
  ngOnChanges --> getDashboardData
  getDashboardData --> afterResponse
  afterResponse --> setYearColor
  afterResponse --> onChartInit
  onChartInit --> Chart[Offers chart]
  Chart --> onPlannedVisitsChartClick
  ValueChange[Value change] --> onValueChanged
  onValueChanged --> setChaching
  getChaching --> getDashboardData

Usage

ts
import { WidgetTopOffersByPrincipalsLastNyearsComponent } from './widget-top-offers-by-principals-last-nyears.component';

export function refreshTopOffers(
  widget: WidgetTopOffersByPrincipalsLastNyearsComponent
): void {
  widget.getChaching();
  widget.getDashboardData();
}

export function persistSelectedValue(
  widget: WidgetTopOffersByPrincipalsLastNyearsComponent
): void {
  widget.onValueChanged();
  widget.setChaching();
}

AI Coding Instructions

  • Use getDashboardData() as the entry point when the widget needs refreshed dashboard content.
  • Keep response-specific chart preparation in afterResponse() and initialize chart bindings through onChartInit().
  • Let Angular invoke ngOnInit() and ngOnChanges() rather than calling lifecycle hooks from application code.
  • Preserve the existing setChaching() and getChaching() method names when changing cache behavior.
  • Keep chart click behavior inside onPlannedVisitsChartClick() so chart event handling remains localized.

Used by

2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (2)

  • TranslateHandlerPams/Web/Pams.Web/Client/app/app.module.ts:1
  • WidgetTopOffersByVariantsComponentPams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-top-offers-by-variants/widget-top-offers-by-variants.component.ts:1

Was this page helpful?

Download as PDF