Skip to content

PrincipalReportComponent

reference
3 min readUpdated

Kind: Class

Source: Frontend/src/app/components/dashboard/_principalReport/principal-report.component.ts (line 86)

Part of: Frontend

PrincipalReportComponent manages the principal dashboard report view. It handles introduction modal state, date and numeral formatting, report period changes, window resizing, and page-number retrieval for report navigation.

Implements: OnInit

Methods

MethodSignatureReturns
openIntroductionAndOutlinesPopupopenIntroductionAndOutlinesPopup()void
closeIntroductionAndOutlinesModalcloseIntroductionAndOutlinesModal()void
formatDateformatDate(date: undefined)void
NumeralConversionDefaultNumeralConversionDefault(num: number)void
resizeWindowresizeWindow()void
ngOnInitngOnInit()void
BookingHistoryPeriodChangedBookingHistoryPeriodChanged(period: string)void
DeliveriesHistoryPeriodChangedDeliveriesHistoryPeriodChanged(period: string)void
OverallAnalysisPeriodChangedOverallAnalysisPeriodChanged(period: string)void
getPageNumbergetPageNumber(pageId: string)number
getAllLookupsgetAllLookups()void
AddInquiriesColAddInquiriesCol(e: undefined)void
RemoveInquiriesColRemoveInquiriesCol(e: undefined)void
AddOffersColAddOffersCol(e: undefined)void
RemoveOffersColRemoveOffersCol(e: undefined)void
getImagesFroPrintgetImagesFroPrint(accountId: number)void
downloadLogoByLogoIddownloadLogoByLogoId(logoId: string, FileModules: number, accountId: number)void
getBase64ImagegetBase64Image(img: undefined)void
GenerateNewReportGenerateNewReport()void
GenerateReportGenerateReport()void
checkForCachedDatacheckForCachedData()void
prepareGeneratedReportParameterprepareGeneratedReportParameter()void
prepareGeneratedReportDataprepareGeneratedReportData()void
PrintReportPrintReport()void
scrollscroll(id: undefined)void
isScrolledIntoViewisScrolledIntoView(id: undefined)void
checkScrolledIntoViewcheckScrolledIntoView()void
onAccountTypeChangeonAccountTypeChange(e: undefined)void
onPrincipalChangeonPrincipalChange(e: undefined)void
onPrincipalRemoveonPrincipalRemove(e: undefined)void
onClientChangeonClientChange(e: undefined)void
onClientRemoveonClientRemove(e: undefined)void
onGridContentReadyonGridContentReady(e: undefined)void
chooseWidgetchooseWidget(e: undefined)void
onClientFilterChangeonClientFilterChange(e: undefined)void
onProductTypeChangeonProductTypeChange(e: undefined)void
onStatusChangeonStatusChange(e: undefined)void
onSelectAllChartsonSelectAllCharts()void
ClosewithDonotSaveClosewithDonotSave()void
openTimeFrameOptionsopenTimeFrameOptions()void
openSettingsOptionsopenSettingsOptions()void
TimeFrameValueChangedTimeFrameValueChanged()void
OnOpenedPopupOnOpenedPopup()void
openPopupopenPopup(n: string, t: string, i: string, btnTxt: string)void
savePopupsavePopup()void
closePopupclosePopup()void
ngDoCheckngDoCheck()void
validatevalidate(e: undefined)void
selectTextselectText(e: undefined)void
ngOnDestroyngOnDestroy()void

Properties

PropertyType
sharedPopupSharedPopupComponent
GenerateReportValidationDxValidationGroupComponent
TimeFrameValidationDxValidationGroupComponent
RunningJobsElementRef
SalesOverviewElementRef
FirmOffersElementElementRef
OrdersStatusElementElementRef
LostAnalysisElementElementRef
OrdersBookingElementElementRef
DeliveredOrdersElementElementRef
SubmittedOffersElementElementRef
OverallAnalysisElementElementRef
subscriptionSubscription
LodingPanalMessageany
loadingVisibleany
principalsany
clientsany
accountsInfoPrincipalsInfo[]
selectedAccountInfonumber[]
SelectedAccountstring[]
SelectedPrincipalIdnumber
SelectedClientIdnumber
clientsFiltersany
accountTypeany
productTypesany
Statusany
SelectedStatusesany
TempKeystring
Periodsany
DateDisplayFormatany
dateDisplayFormatForTypeScriptany
DateDisplayFormatForMomentany
UseDateboolean
UsePeriodboolean
ClientsPerChartnumber
SelectAllChartsboolean
ThisYearany
TimeValuenumber
TimePeriodnumber
LostTotalAmountnumber
LostTotalCountnumber
SubmittedTotalCountnumber
SubmittedTotalAmountnumber
HitRateCountnumber
HitRateValuenumber
ReportDataany
ReportIsReadyboolean
GeneratedReportboolean
isGeneratingboolean
dataBackdropstring

Where it refuses work

  • PrincipalReportComponent stops the work with an early return when date.
  • PrincipalReportComponent stops the work with an early return when this.isGenerating.
  • PrincipalReportComponent stops the work with an early return when dataField == "OfferTotalPrice" || dataField == "OrderTotalPrice" || dataField == "OrderBa….
  • PrincipalReportComponent stops the work with an early return when id == ReportSettingsEnum.ReportIntroduction.
  • PrincipalReportComponent stops the work with an early return when id == ReportSettingsEnum.ReportSalesAnalysis.
  • PrincipalReportComponent stops the work with an early return when id == ReportSettingsEnum.ReportLostOpportunities.

Diagram

mermaid
graph LR
  Dashboard[Dashboard View] --> Report[PrincipalReportComponent]
  Report --> Init[ngOnInit]
  Report --> Modal[Introduction and Outlines Modal]
  Report --> Formatting[Date and Numeral Formatting]
  Report --> Periods[History and Analysis Period Changes]
  Report --> Resize[resizeWindow]
  Report --> Pagination[getPageNumber]

  Modal --> Open[openIntroductionAndOutlinesPopup]
  Modal --> Close[closeIntroductionAndOutlinesModal]
  Periods --> Booking[BookingHistoryPeriodChanged]
  Periods --> Deliveries[DeliveriesHistoryPeriodChanged]
  Periods --> Analysis[OverallAnalysisPeriodChanged]

Usage

ts
import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { PrincipalReportComponent } from './components/dashboard/_principalReport/principal-report.component';

@Component({
  selector: 'app-dashboard-host',
  template: `
    <app-principal-report></app-principal-report>
    <button (click)="showReportIntroduction()">Show introduction</button>
  `,
})
export class DashboardHostComponent implements AfterViewInit {
  @ViewChild(PrincipalReportComponent)
  reportComponent!: PrincipalReportComponent;

  ngAfterViewInit(): void {
    const pageNumber: number = this.reportComponent.getPageNumber();
    console.log('Current report page:', pageNumber);
  }

  showReportIntroduction(): void {
    this.reportComponent.openIntroductionAndOutlinesPopup();
  }

  closeReportIntroduction(): void {
    this.reportComponent.closeIntroductionAndOutlinesModal();
  }
}

AI Coding Instructions

  • Keep modal interactions paired: open the introduction view with openIntroductionAndOutlinesPopup() and dismiss it with closeIntroductionAndOutlinesModal().
  • Call report setup through Angular lifecycle hooks rather than invoking ngOnInit() from other components.
  • Connect booking, delivery, and overall-analysis controls to their matching period-change methods.
  • Preserve the return type of getPageNumber() as number when passing pagination state to related dashboard views.

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)

  • DashboardWidgetsModuleFrontend/src/app/components/dashboard/dashboard-widgets.module.ts:1
  • PrincipalReportRouteModuleFrontend/src/app/components/dashboard/principal-report-route.module.ts:1

Was this page helpful?

Download as PDF