Skip to content

WidgetBacklogOverTheMonthsComponent

reference
2 min readUpdated

Kind: Class

Source: Frontend/src/app/components/dashboard/dashboard-libary/widgets/widget-backlog-over-the-months/widget-backlog-over-the-months.component.ts (line 44)

Part of: Frontend

WidgetBacklogOverTheMonthsComponent is an Angular dashboard widget that loads and prepares backlog data for display across months. It checks feature subscription access, retrieves dashboard and team lookup data, builds chart series ranges, and formats month labels and performance values.

Extends: BaseWidgetComponent

Implements: OnInit

Methods

MethodSignatureReturns
checkFeatureSubscriptioncheckFeatureSubscription()boolean
ngOnInitngOnInit()void
ngDoCheckngDoCheck()void
ngOnChangesngOnChanges()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
SeriseRangeany[]
initOptsany
headerDataany
echartsIntanceany
TargetBooking`string
AchievedBooking`string
teamsLookupany[]
currenFeaturenumber
valueBranchData[]

Where it refuses work

  • WidgetBacklogOverTheMonthsComponent stops the work with an early return when this.dashboardLibraryService.checkFeatureSubscription(this.widget.chartEnumId).
  • 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[checkFeatureSubscription]
  C --> D[getDashboardData]
  D --> E[initalizingData]
  E --> F[getTeamLookup]
  E --> G[setSeriseRange]
  G --> H[calculatePerformancePer]
  G --> I[translateMonthName]
  H --> J[Dashboard chart output]
  I --> J

Usage

ts
import { Component, ViewChild } from '@angular/core';
import { WidgetBacklogOverTheMonthsComponent } from './widget-backlog-over-the-months.component';

@Component({
  selector: 'app-dashboard-host',
  template: `
    <app-widget-backlog-over-the-months
      #backlogWidget>
    </app-widget-backlog-over-the-months>
  `
})
export class DashboardHostComponent {
  @ViewChild('backlogWidget')
  backlogWidget!: WidgetBacklogOverTheMonthsComponent;

  refreshBacklogData(): void {
    if (this.backlogWidget.checkFeatureSubscription()) {
      this.backlogWidget.getDashboardData();
    }
  }
}

AI Coding Instructions

  • Keep data loading behind checkFeatureSubscription() so unavailable features do not request dashboard data.
  • Preserve Angular lifecycle behavior in ngOnInit, ngDoCheck, and ngOnChanges; avoid moving lifecycle work into unrelated event handlers.
  • Call initalizingData() after data retrieval when updating the widget data state; retain the existing method spelling for compatibility.
  • Keep chart series construction in setSeriseRange() and use translateMonthName() for month labels rather than formatting month values in multiple locations.
  • Treat getTeamLookup() as the integration point for team-related filtering or lookup data used by the dashboard widget.

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