Skip to content

MrmBookingTeamsComponent

reference
2 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-booking-teams/mrm-booking-teams.component.ts (line 45)

Part of: Pams

MrmBookingTeamsComponent is an Angular dashboard widget for loading and presenting MRM booking team data. It manages lifecycle updates, data initialization, performance calculation, month and price formatting, resize handling, and cached 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
sortingsorting(propertyName: string, propertyType: string, monthIndex: number)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
sortingDirectionnumber

Where it refuses work

  • MrmBookingTeamsComponent stops the work with an early return when a[propertyName] < b[propertyName], in 2 places.
  • MrmBookingTeamsComponent stops the work with an early return when a[propertyName] > b[propertyName], in 2 places.
  • MrmBookingTeamsComponent stops the work with an early return when month.MonthId == 12.
  • MrmBookingTeamsComponent stops the work with an early return when month.TotalValue < this.data[bIndex].MrmBooking[index - 1].TotalValue.
  • MrmBookingTeamsComponent stops the work with an early return when month.TotalBookingMonth < this.totalBookingMonths[index - 1].TotalBookingMonth.
  • MrmBookingTeamsComponent stops the work with an early return when month.TotalForecastMonth < this.totalBookingMonths[index - 1].TotalForecastMonth.

Diagram

mermaid
graph LR
    Angular[Angular lifecycle] --> Init[ngOnInit]
    Angular --> Changes[ngOnChanges]
    Angular --> Destroy[ngOnDestroy]

    Init --> Load[getDashboardData]
    Changes --> Load
    Load --> Initialize[initalizingData]
    Initialize --> Performance[calculatePerformancePer]
    Initialize --> Month[translateMonthName]
    Initialize --> Price[getpriceFormatted]
    Initialize --> Cache[setChaching]

    Resize[onResize] --> Initialize

Usage

ts
import { Component, ViewChild } from '@angular/core';
import { MrmBookingTeamsComponent } from './mrm-booking-teams/mrm-booking-teams.component';

@Component({
  selector: 'app-dashboard-page',
  template: `
    <app-mrm-booking-teams></app-mrm-booking-teams>

    <button type="button" (click)="refreshBookingTeams()">
      Refresh booking teams
    </button>
  `,
})
export class DashboardPageComponent {
  @ViewChild(MrmBookingTeamsComponent)
  bookingTeamsComponent?: MrmBookingTeamsComponent;

  refreshBookingTeams(): void {
    this.bookingTeamsComponent?.getDashboardData();
  }
}

AI Coding Instructions

  • Let Angular call ngOnInit, ngOnChanges, and ngOnDestroy; keep lifecycle-specific setup and cleanup in those methods.
  • Call getDashboardData() when the widget needs refreshed dashboard data, then keep derived display values initialized through initalizingData().
  • Keep formatting logic in translateMonthName() and getpriceFormatted() so templates do not duplicate display transformations.
  • Preserve setChaching() calls when changing the data-loading flow so widget state remains available after dashboard updates.
  • Re-run layout-related initialization from onResize() when adding chart, grid, or responsive display 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