Skip to content

WidgetBacklogOverTheMonthsComponent

reference
2 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/widget-backlog-over-the-months/widget-backlog-over-the-months.component.ts (line 45)

Part of: Pams

WidgetBacklogOverTheMonthsComponent is an Angular dashboard widget that prepares and displays backlog data across monthly ranges. It loads dashboard and team lookup data, manages lifecycle updates, calculates performance percentages, and translates month labels for presentation.

Implements: OnInit

Methods

MethodSignatureReturns
ngOnInitngOnInit()void
ngDoCheckngDoCheck()void
ngOnChangesngOnChanges()void
ngOnDestroyngOnDestroy()void
getDashboardDatagetDashboardData()void
initalizingDatainitalizingData(value: BranchData[])void
getTeamLookupgetTeamLookup()void
setSeriseRangesetSeriseRange()any[]
calculatePerformancePercalculatePerformancePer(month: BacklogData)number
translateMonthNametranslateMonthName(month: BacklogData)string
getpriceFormattedgetpriceFormatted(x: undefined)string
onResizeonResize()void
setChachingsetChaching()void
getChachinggetChaching()void
onValueChangedonValueChanged(e: undefined)void
onChartInitonChartInit(e: any, index: number)void
switchChartTypeHandlerswitchChartTypeHandler()void
switchBasedOnTendencyHandlerswitchBasedOnTendencyHandler()void
setValuesetValue(value: number)void
setForecastValuesetForecastValue(value: number)void
setMarginAvaragesetMarginAvarage(value: number)void
setMarginAvarageColorsetMarginAvarageColor(value: number)void
isForecastisForecast(month: BacklogData)boolean
isAchievedOrCurrentisAchievedOrCurrent(month: BacklogData)boolean
getpriceForecastAmountgetpriceForecastAmount(month: BacklogData)number
expectedCurrencyChangeexpectedCurrencyChange(e: undefined)void

Properties

PropertyType
triangleNeedleDxCircularGaugeComponent
originalWidgetWidget
_widgetWidget
_widgetTypestring
withoutOptionBarboolean
bookingOrSalesnumber
withNominalboolean
selectedTeamnumber
forecastRuleIdnumber
forecastRulesany[]
selectedYearnumber
numYearsDatasourceany[]
todayWidgetsEnumany
cachingWidgetDataCachingWidgetData
dataBranchData[]
originalDataBranchData[]
singlePrincipalBacklogData
singleBacklogMonthMonthData
singleBranchBranchData
branchCurrencyany
basedOnTendencyboolean
subscriptionSubscription
SeriseRangeany[]
initOptsany
headerDataany
echartsIntanceany
TargetBooking`string
AchievedBooking`string
teamsLookupany[]
valueBranchData[]

Where it refuses work

  • WidgetBacklogOverTheMonthsComponent stops the work with an early return when month.MonthId == 12.
  • WidgetBacklogOverTheMonthsComponent stops the work with an early return when month.MonthId >= new Date().getMonth() + 1.
  • WidgetBacklogOverTheMonthsComponent stops the work with an early return when month.MonthId <= new Date().getMonth() + 1.

Diagram

mermaid
graph LR
  A[Angular lifecycle] --> B[WidgetBacklogOverTheMonthsComponent]
  B --> C[getDashboardData]
  B --> D[getTeamLookup]
  C --> E[initalizingData]
  E --> F[setSeriseRange]
  E --> G[calculatePerformancePer]
  F --> H[translateMonthName]
  G --> I[Dashboard chart data]
  H --> I

Usage

ts
import { WidgetBacklogOverTheMonthsComponent } from './widget-backlog-over-the-months.component';

function refreshBacklogWidget(
  widget: WidgetBacklogOverTheMonthsComponent,
): void {
  widget.getDashboardData();

  const seriesRange = widget.setSeriseRange();
  const performancePercentage = widget.calculatePerformancePer();
  const monthLabel = widget.translateMonthName();

  console.log({ seriesRange, performancePercentage, monthLabel });
}

// Angular calls ngOnInit, ngOnChanges, ngDoCheck, and ngOnDestroy
// as part of the component lifecycle.

AI Coding Instructions

  • Keep data initialization inside initalizingData() so dashboard values are prepared consistently after data retrieval.
  • Call getDashboardData() when widget inputs or dashboard context changes rather than duplicating data-loading logic.
  • Preserve the existing setSeriseRange() return shape because chart bindings may depend on its series structure.
  • Use translateMonthName() for displayed month labels instead of formatting month values directly in templates.
  • Release subscriptions, timers, or other resources in ngOnDestroy() when adding asynchronous behavior.

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