Skip to content

MrmBacklogProductTypesComponent

reference
2 min readUpdated

Kind: Class

Source: Frontend/src/app/components/dashboard/dashboard-libary/widgets/mrm-backlog-product-types/mrm-backlog-product-types.component.ts (line 45)

Part of: Frontend

MrmBacklogProductTypesComponent is an Angular dashboard widget for displaying backlog product-type data. It checks feature access, loads and initializes dashboard data, calculates display values, and responds to lifecycle and resize events within the dashboard widget library.

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
switchVendorTypeIdHandlerswitchVendorTypeIdHandler(vendorTypeId: number)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
withNominalboolean
allowedtoEditboolean
allowedtoEnableEdtingboolean
selectedYearnumber
vendorTypeEnumany
vendorTypeIdany
cachingWidgetDataCachingWidgetData
dataBranchData[]
originalDataBranchData[]
singleMonthsMonthData
branchNamestring
branchCurrencyany
SeriseRangeany[]
echartsIntanceany
totalBookingMonthsTotalBookingMonths[]
tempTotalMonthTotalBookingMonths
totalTargetsnumber
yearBookingnumber
totalForecastsnumber
tempTotalTargetTotalTargets
urrenFeaturenumber

Where it refuses work

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

Diagram

mermaid
graph LR
    A[Angular Lifecycle] --> B[MrmBacklogProductTypesComponent]
    B --> C[checkFeatureSubscription]
    B --> D[ngOnInit]
    B --> E[ngOnChanges]
    D --> F[getDashboardData]
    E --> F
    F --> G[initalizingData]
    G --> H[calculatePerformancePer]
    G --> I[translateMonthName]
    G --> J[getpriceFormatted]
    B --> K[onResize]
    K --> L[setChaching]

Usage

ts
import { MrmBacklogProductTypesComponent } from './mrm-backlog-product-types.component';

function refreshBacklogProductTypes(
  component: MrmBacklogProductTypesComponent,
): void {
  if (!component.checkFeatureSubscription()) {
    return;
  }

  component.getDashboardData();

  const performancePercentage = component.calculatePerformancePer();
  const monthName = component.translateMonthName();
  const formattedPrice = component.getpriceFormatted();

  console.log({
    performancePercentage,
    monthName,
    formattedPrice,
  });
}

AI Coding Instructions

  • Call checkFeatureSubscription() before requesting or displaying feature-specific dashboard data.
  • Keep data loading in getDashboardData() and data preparation in initalizingData() rather than duplicating initialization logic.
  • Preserve the existing method name initalizingData() when modifying call sites, including its current spelling.
  • Recalculate display-derived values through calculatePerformancePer(), translateMonthName(), and getpriceFormatted() instead of formatting the same values in templates.
  • Route resize-related updates through onResize() and keep caching behavior within setChaching().

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