Skip to content

WidgetTeamsBonusComponent

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-teams-bonus/widget-teams-bonus.component.ts (line 22)

Part of: Pams

WidgetTeamsBonusComponent is an Angular dashboard widget that retrieves and presents team bonus dashboard data, including formatted price output. It responds to value and resize changes, coordinates chart initialization, maintains its Chaching state, and performs cleanup during destruction.

Implements: OnInit

Methods

MethodSignatureReturns
getDashboardDatagetDashboardData()void
onResizeonResize()void
setChachingsetChaching()void
getChachinggetChaching()void
onValueChangedonValueChanged(e: undefined)void
ngOnInitngOnInit()void
getpriceFormattedgetpriceFormatted(x: undefined)string
ngDoCheckngDoCheck()void
onChartInitonChartInit(e: any, index: number)void
ngOnDestroyngOnDestroy()void
switchChartTypeHandlerswitchChartTypeHandler()void
switchBasedOnTendencyHandlerswitchBasedOnTendencyHandler()void
setValuesetValue(value: number)void

Properties

PropertyType
triangleNeedleDxCircularGaugeComponent
originalWidgetWidget
_widgetWidget
numYearsnumber
numYearsDatasourceany[]
todayWidgetsEnumany
cachingWidgetDataCachingWidgetData
teamsTeamsTendancy[]
withNominalboolean
basedOnTendencyboolean
subscriptionSubscription
initOptsany
seriesany[]
headerDataany
echartsIntanceany
optionsany
TargetBooking`string
AchievedBooking`string

Where it refuses work

  • WidgetTeamsBonusComponent stops the work with an early return when isNumber(value).

Diagram

mermaid
graph LR
  Dashboard[Dashboard] --> WidgetTeamsBonusComponent
  WidgetTeamsBonusComponent --> Init[ngOnInit]
  Init --> Data[getDashboardData]
  WidgetTeamsBonusComponent --> ValueChange[onValueChanged]
  ValueChange --> Data
  WidgetTeamsBonusComponent --> Resize[onResize]
  Resize --> Chart[onChartInit]
  WidgetTeamsBonusComponent --> Cache[setChaching / getChaching]
  WidgetTeamsBonusComponent --> Format[getpriceFormatted]
  WidgetTeamsBonusComponent --> Destroy[ngOnDestroy]

Usage

ts
import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { WidgetTeamsBonusComponent } from './widget-teams-bonus.component';

@Component({
  selector: 'app-dashboard-host',
  template: `
    <app-widget-teams-bonus></app-widget-teams-bonus>
  `,
})
export class DashboardHostComponent implements AfterViewInit {
  @ViewChild(WidgetTeamsBonusComponent)
  teamsBonusWidget?: WidgetTeamsBonusComponent;

  ngAfterViewInit(): void {
    this.teamsBonusWidget?.getDashboardData();
    this.teamsBonusWidget?.onResize();

    const formattedPrice = this.teamsBonusWidget?.getpriceFormatted();
    console.log(formattedPrice);
  }
}

AI Coding Instructions

  • Keep data refresh behavior in getDashboardData() and trigger it through existing lifecycle or value-change flows.
  • Preserve the existing setChaching() and getChaching() method names unless all callers are updated together.
  • Call onChartInit() only when the chart host and dashboard data are ready.
  • Route resize-related chart updates through onResize() rather than duplicating resize handling in consumers.
  • Keep cleanup logic in ngOnDestroy() aligned with any subscriptions, chart instances, or listeners added by the component.

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
WidgetTeamsBonusComponent — PAMS Documentation Test