Skip to content

WidgetTopOffersByTeamsLastNyearsComponent

reference
1 min readUpdated

Kind: Class

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

Part of: Pams

WidgetTopOffersByTeamsLastNyearsComponent is an Angular dashboard widget that loads and displays top offers grouped by teams for the selected year range. It manages lifecycle updates, chart initialization and click handling, year-based coloring, and cached widget settings.

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
  A[ngOnInit / ngOnChanges] --> B[getChaching]
  B --> C[getDashboardData]
  C --> D[afterResponse]
  D --> E[onChartInit]
  E --> F[setYearColor]
  G[onValueChanged] --> H[setChaching]
  H --> C
  I[onPlannedVisitsChartClick] --> C

Usage

ts
import { Component, ViewChild } from '@angular/core';
import { WidgetTopOffersByTeamsLastNyearsComponent } from './widget-top-offers-by-teams-last-nyears.component';

@Component({
  selector: 'app-dashboard-host',
  template: `
    <app-widget-top-offers-by-teams-last-nyears></app-widget-top-offers-by-teams-last-nyears>

    <button type="button" (click)="refreshOffers()">
      Refresh offers
    </button>
  `
})
export class DashboardHostComponent {
  @ViewChild(WidgetTopOffersByTeamsLastNyearsComponent)
  offersWidget!: WidgetTopOffersByTeamsLastNyearsComponent;

  refreshOffers(): void {
    this.offersWidget.getDashboardData();
  }

  handleYearChange(): void {
    this.offersWidget.onValueChanged();
  }
}

AI Coding Instructions

  • Keep data loading in getDashboardData() and handle transformed response state in afterResponse().
  • Preserve the Angular lifecycle flow through ngOnInit() and ngOnChanges() when adding input-driven behavior.
  • Initialize or update chart bindings through onChartInit() after dashboard data is available.
  • Keep the existing setChaching() and getChaching() method names when working with cached widget settings.
  • Route chart click behavior through onPlannedVisitsChartClick() rather than adding duplicate chart event handlers.

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