Skip to content

MrmPmBacklogComponent

reference
2 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-pm-backlog/mrm-pm-backlog.component.ts (line 44)

Part of: Pams

MrmPmBacklogComponent is an Angular dashboard widget that loads and prepares PM backlog data for display. It responds to lifecycle changes and window resizing, calculates performance values, formats price and month labels, and manages cached widget state.

Methods

MethodSignatureReturns
ngOnInitngOnInit()void
ngOnChangesngOnChanges()void
ngOnDestroyngOnDestroy()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
withoutOptionBarboolean
bookingOrSalesnumber
withNominalboolean
selectedTeamnumber
forecastRuleIdnumber
allowedtoEditboolean
allowedtoEnableEdtingboolean
forecastRulesany[]
selectedYearnumber
numYearsDatasourceany[]
todayWidgetsEnumany
cachingWidgetDataCachingWidgetData
dataBranchData[]
originalDataBranchData[]
singleMonthsMonthData
branchCurrencyany
basedOnTendencyboolean
subscriptionSubscription
SeriseRangeany[]
echartsIntanceany
totalBookingMonthsTotalBookingMonths[]
tempTotalMonthTotalBookingMonths
totalTargetsnumber
yearBookingnumber
totalForecastsnumber
tempTotalTargetTotalTargets

Where it refuses work

  • 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.
  • MrmPmBacklogComponent stops the work with an early return when month.MonthId <= new Date().getMonth() + 1.

Diagram

mermaid
graph LR
    Angular[Angular lifecycle] --> Init[ngOnInit]
    Angular --> Changes[ngOnChanges]
    Init --> Data[getDashboardData]
    Changes --> Data
    Data --> Initialize[initalizingData]
    Initialize --> Performance[calculatePerformancePer]
    Initialize --> Month[translateMonthName]
    Initialize --> Price[getpriceFormatted]
    Initialize --> Cache[setChaching]
    Resize[onResize] --> Initialize
    Destroy[ngOnDestroy] --> Cleanup[Release component resources]

Usage

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

@Component({
  selector: 'app-dashboard-host',
  template: `
    <!-- Render MrmPmBacklogComponent in this dashboard view. -->
    <button type="button" (click)="refreshBacklog()">Refresh backlog</button>
  `
})
export class DashboardHostComponent {
  @ViewChild(MrmPmBacklogComponent)
  backlogComponent?: MrmPmBacklogComponent;

  refreshBacklog(): void {
    this.backlogComponent?.getDashboardData();
  }

  handleResize(): void {
    this.backlogComponent?.onResize();
  }
}

AI Coding Instructions

  • Keep data loading within getDashboardData() and pass returned data through initalizingData() before updating display state.
  • Preserve Angular lifecycle behavior: initialize data in ngOnInit(), react to input updates in ngOnChanges(), and release subscriptions or listeners in ngOnDestroy().
  • Keep the existing method names, including initalizingData() and setChaching(), unless all callers are updated together.
  • Recalculate displayed values through calculatePerformancePer(), translateMonthName(), and getpriceFormatted() rather than duplicating formatting logic in the template.
  • Route resize-driven layout or data updates through onResize() and retain cache updates through setChaching().

Used by

2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (2)

  • TranslateHandlerPams/Web/Pams.Web/Client/app/app.module.ts:1
  • DashboardTabComponentPams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/dashboard-tab/dashboard-tab.component.ts:1

Was this page helpful?

Download as PDF