Kind: Class
Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-booking-city/mrm-booking-city.component.ts (line 118)
Part of: Pams
MrmBookingCityComponent is an Angular dashboard widget for loading, initializing, and saving booking-city dashboard data. It manages authorization checks, lifecycle updates, period-based totals by year and month, and month-name translation for display.
Methods
| Method | Signature | Returns |
|---|---|---|
GetAuthorizationAccess | GetAuthorizationAccess(url: string) | void |
ngOnInit | ngOnInit() | void |
ngOnChanges | ngOnChanges() | void |
ngOnDestroy | ngOnDestroy() | void |
getDashboardData | getDashboardData() | void |
initalizingData | initalizingData(value: BranchData[]) | void |
saveDashboardData | saveDashboardData() | void |
calculateSumByYear | calculateSumByYear() | void |
calculateSumByMonth | calculateSumByMonth(monthIndex: number) | void |
translateMonthName | translateMonthName(month: MonthData) | string |
getpriceFormatted | getpriceFormatted(x: undefined) | string |
onResize | onResize() | void |
setChaching | setChaching() | void |
getChaching | getChaching() | void |
switchChartTypeHandler | switchChartTypeHandler() | void |
switchBasedOnTendencyHandler | switchBasedOnTendencyHandler() | void |
comparingWithPrevMonth | comparingWithPrevMonth(month: BranchData, bIndex: number, index: number, propertyName: string) | string |
comparingMonthsWithPrevSumm | comparingMonthsWithPrevSumm(month: TotalBookingMonths, index: number, propertyName: string) | string |
isCurrentMonth | isCurrentMonth(month: MonthData) | boolean |
getpriceForecastAmount | getpriceForecastAmount(month: MonthData) | number |
expectedCurrencyChange | expectedCurrencyChange(e: undefined) | void |
selectText | selectText(e: undefined) | void |
mouseoverRowSpan | mouseoverRowSpan(e: undefined, bIndex: number) | void |
mouseoutRowSpan | mouseoutRowSpan(e: undefined, bIndex: number) | void |
syncScroll | syncScroll(e: undefined) | void |
editSelectedMonthPrepare | editSelectedMonthPrepare(month: MonthData, supplierId: number) | void |
sorting | sorting(propertyName: string, propertyType: string, monthIndex: number) | void |
openPopup | openPopup(n: string, t: string, i: string, btnTxt: string) | void |
savePopup | savePopup() | void |
ClosewithDonotSave | ClosewithDonotSave() | void |
OnOpenedPopup | OnOpenedPopup() | void |
closePopup | closePopup() | void |
Properties
| Property | Type |
|---|---|
sharedPopup | SharedPopupComponent |
scrollOne | ElementRef |
scrollTwo | ElementRef |
scrollThree | ElementRef |
_widget | Widget |
_widgetType | string |
withoutOptionBar | boolean |
editMode | boolean |
bookingOrSales | number |
withNominal | boolean |
selectedTeam | number |
forecastRuleId | number |
data | BranchData[] |
allowedtoEdit | boolean |
allowedtoEnableEdting | boolean |
widgetEditRequest | any |
widgetEditEnd | any |
forecastRules | any[] |
selectedYear | number |
numYearsDatasource | any[] |
todayWidgetsEnum | any |
cachingWidgetData | CachingWidgetData |
originalData | BranchData[] |
selectedData | BranchData[] |
singleMonths | MonthData |
branchCurrency | any |
basedOnTendency | boolean |
subscription | Subscription |
SeriseRange | any[] |
echartsIntance | any |
totalBookingMonths | TotalBookingMonths[] |
tempTotalMonth | TotalBookingMonths |
popup | any |
searchText | string |
sortingDirection | number |
Where it refuses work
MrmBookingCityComponentstops the work with an early return whena[propertyName] < b[propertyName], in 2 places.MrmBookingCityComponentstops the work with an early return whena[propertyName] > b[propertyName], in 2 places.MrmBookingCityComponentstops the work with an early return whenmonth.MonthId == 12.MrmBookingCityComponentstops the work with an early return whenmonth[propertyName] < this.data[bIndex].MrmBooking[index - 1][propertyName].MrmBookingCityComponentstops the work with an early return whenmonth[propertyName] < this.totalBookingMonths[index - 1][propertyName].MrmBookingCityComponentstops the work with an early return whenthis.allowedtoEnableEdting.
Diagram
mermaidgraph LR A[Angular Lifecycle] --> B[ngOnInit] A --> C[ngOnChanges] A --> D[ngOnDestroy] B --> E[GetAuthorizationAccess] E --> F[getDashboardData] F --> G[initalizingData] C --> F G --> H[calculateSumByYear] G --> I[calculateSumByMonth] I --> J[translateMonthName] G --> K[saveDashboardData]
Usage
tsimport { ComponentFixture, TestBed } from '@angular/core/testing';
import { MrmBookingCityComponent } from './mrm-booking-city.component';
describe('MrmBookingCityComponent', () => {
let fixture: ComponentFixture<MrmBookingCityComponent>;
let component: MrmBookingCityComponent;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [MrmBookingCityComponent],
}).compileComponents();
fixture = TestBed.createComponent(MrmBookingCityComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('loads dashboard data during initialization', () => {
component.ngOnInit();
component.getDashboardData();
component.calculateSumByYear();
component.calculateSumByMonth();
});
});
AI Coding Instructions
- Keep data loading inside the existing authorization and lifecycle flow; call
GetAuthorizationAccess()before requesting dashboard data when access must be verified. - Treat
ngOnChanges()as a refresh path when component inputs change, and avoid duplicating initialization logic outsideinitalizingData(). - Keep yearly and monthly aggregation logic in
calculateSumByYear()andcalculateSumByMonth()so displayed totals remain derived from the same data source. - Use
translateMonthName()for month labels instead of hardcoding display text, especially when adding localized dashboard output. - Release subscriptions, timers, or other managed resources in
ngOnDestroy()when extending the component.
Used by
3 references from 3 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (3)
TranslateHandler—Pams/Web/Pams.Web/Client/app/app.module.ts:1DashboardTabComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/dashboard-tab/dashboard-tab.component.ts:1ReportsTabComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/reports-library/reports-tab/reports-tab.component.ts:1
Was this page helpful?