Skip to content

WidgetTeamsBonusComponent

reference
1 min readUpdated

Kind: Class

Source: Frontend/src/app/components/dashboard/dashboard-libary/widgets/widget-teams-bonus/widget-teams-bonus.component.ts (line 19)

Part of: Frontend

WidgetTeamsBonusComponent is an Angular dashboard widget that loads and displays team bonus data. It checks feature subscription access, manages cached widget state, responds to value and resize changes, and coordinates chart initialization and price formatting.

Extends: BaseWidgetComponent

Implements: OnInit

Methods

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

Properties

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

Where it refuses work

  • WidgetTeamsBonusComponent stops the work with an early return when this.dashboardLibraryService.checkFeatureSubscription(this.widget.chartEnumId).
  • WidgetTeamsBonusComponent stops the work with an early return when !Number.isNaN(value).

Diagram

mermaid
graph LR
  Init[ngOnInit] --> Subscription[checkFeatureSubscription]
  Subscription --> Data[getDashboardData]
  Init --> CacheRead[getChaching]
  Data --> CacheWrite[setChaching]
  Data --> Chart[onChartInit]
  ValueChange[onValueChanged] --> Data
  Resize[onResize] --> Chart
  ChangeDetection[ngDoCheck] --> Data
  Data --> Price[getpriceFormatted]

Usage

ts
import { TestBed } from '@angular/core/testing';
import { WidgetTeamsBonusComponent } from './widget-teams-bonus.component';

const fixture = TestBed.createComponent(WidgetTeamsBonusComponent);
const component = fixture.componentInstance;

fixture.detectChanges();

if (component.checkFeatureSubscription()) {
  component.getDashboardData();
  component.onChartInit();

  const formattedPrice = component.getpriceFormatted();
  console.log(formattedPrice);
}

// Call when the widget container size changes.
component.onResize();

AI Coding Instructions

  • Let Angular create the component through its template or test fixture rather than instantiating it directly.
  • Check checkFeatureSubscription() before requesting or rendering team bonus data.
  • Keep cache reads and writes aligned with getChaching() and setChaching() so widget state remains consistent.
  • Reinitialize or resize chart state through onResize() and onChartInit() rather than directly changing chart internals.
  • Preserve the existing getChaching and setChaching method names when integrating with current callers.

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)

  • DashboardWidgetsModuleFrontend/src/app/components/dashboard/dashboard-widgets.module.ts:1

Was this page helpful?

Download as PDF