Skip to content

MrmPmBacklogComponent

reference
2 min readUpdated

Kind: Class

Source: Frontend/src/app/components/dashboard/dashboard-libary/widgets/mrm-pm-backlog/mrm-pm-backlog.component.ts (line 44)

Part of: Frontend

MrmPmBacklogComponent is an Angular dashboard widget that retrieves and prepares MRM PM backlog data for display. It checks feature subscription access, reacts to lifecycle changes and resizing, calculates performance values, formats price and month labels, and stores cached state.

Extends: BaseWidgetComponent

Methods

MethodSignatureReturns
checkFeatureSubscriptioncheckFeatureSubscription()boolean
ngOnInitngOnInit()void
ngOnChangesngOnChanges()void
getDashboardDatagetDashboardData()void
initalizingDatainitalizingData(value: BranchData[])void
calculatePerformancePercalculatePerformancePer(month: MonthData)number
translateMonthNametranslateMonthName(month: MonthData)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
comparingWithPrevMonthcomparingWithPrevMonth(month: MonthData, bIndex: number, index: number)string
comparingBookingWithPrevSummcomparingBookingWithPrevSumm(month: TotalBookingMonths, index: number)string
comparingForecastWithPrevSummcomparingForecastWithPrevSumm(month: TotalBookingMonths, index: number)string
setValuesetValue(value: number)void
setForecastValuesetForecastValue(value: number)void
setMarginAvaragesetMarginAvarage(value: number)void
isForecastisForecast(month: MonthData)boolean
isAchievedOrCurrentisAchievedOrCurrent(month: MonthData)boolean
getpriceForecastAmountgetpriceForecastAmount(month: MonthData)number
expectedCurrencyChangeexpectedCurrencyChange(e: undefined)void

Properties

PropertyType
_widgetWidget
_widgetTypestring
yearIdnumber
periodIdnumber
countOfEditablePrevMonthsnumber
withoutOptionBarboolean
bookingOrSalesnumber
withNominalboolean
selectedTeamnumber
forecastRuleIdnumber
allowedtoEditboolean
allowedtoEnableEdtingboolean
forecastRulesany[]
selectedYearnumber
numYearsDatasourceany[]
todayWidgetsEnumany
cachingWidgetDataCachingWidgetData
dataBranchData[]
originalDataBranchData[]
singleMonthsMonthData
branchCurrencyany
basedOnTendencyboolean
SeriseRangeany[]
echartsIntanceany
totalBookingMonthsTotalBookingMonths[]
tempTotalMonthTotalBookingMonths
totalTargetsnumber
yearBookingnumber
totalForecastsnumber
tempTotalTargetTotalTargets
pastDiffnumber
urrenFeaturenumber

Where it refuses work

  • MrmPmBacklogComponent stops the work with an early return when this.dashboardLibraryService.checkFeatureSubscription(this.widget.chartEnumId).
  • MrmPmBacklogComponent stops the work with an early return when month.MonthId == 12.
  • MrmPmBacklogComponent stops the work with an early return when month.TotalValue < this.data[bIndex].MrmBooking[index - 1].TotalValue.
  • MrmPmBacklogComponent stops the work with an early return when month.TotalBookingMonth < this.totalBookingMonths[index - 1].TotalBookingMonth.
  • MrmPmBacklogComponent stops the work with an early return when month.TotalForecastMonth < this.totalBookingMonths[index - 1].TotalForecastMonth.
  • MrmPmBacklogComponent stops the work with an early return when month.MonthId >= new Date().getMonth() + 1.

Diagram

mermaid
graph LR
  Host[Dashboard Host] --> Component[MrmPmBacklogComponent]
  Component --> Subscription[checkFeatureSubscription]
  Component --> Lifecycle[ngOnInit / ngOnChanges]
  Lifecycle --> Data[getDashboardData]
  Data --> Initialize[initalizingData]
  Initialize --> Performance[calculatePerformancePer]
  Initialize --> Labels[translateMonthName]
  Initialize --> Price[getpriceFormatted]
  Component --> Resize[onResize]
  Data --> Cache[setChaching]

Usage

ts
import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { MrmPmBacklogComponent } from './mrm-pm-backlog.component';

@Component({
  selector: 'app-dashboard-page',
  template: `<app-mrm-pm-backlog></app-mrm-pm-backlog>`,
})
export class DashboardPageComponent implements AfterViewInit {
  @ViewChild(MrmPmBacklogComponent)
  backlogWidget!: MrmPmBacklogComponent;

  ngAfterViewInit(): void {
    if (!this.backlogWidget.checkFeatureSubscription()) {
      return;
    }

    this.backlogWidget.getDashboardData();

    const performance = this.backlogWidget.calculatePerformancePer();
    const formattedPrice = this.backlogWidget.getpriceFormatted();

    console.log({ performance, formattedPrice });
  }
}

AI Coding Instructions

  • Keep subscription checks in place before requesting or displaying backlog data.
  • Let Angular call lifecycle hooks; call data-loading methods directly only for explicit refresh behavior.
  • Keep display transformations in calculatePerformancePer, translateMonthName, and getpriceFormatted rather than duplicating formatting in templates.
  • Update cached state through setChaching when changing the data-loading flow.
  • Preserve resize handling through onResize when modifying chart, layout, or responsive display logic.

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