import { Request, Response } from 'express'; import { DashboardParentChildData } from 'src/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types'; import { components } from '../../types/api'; import { DashboardDataResponse } from '../../types/Metrics'; import { Services } from '../../types/Services'; import { LoadType, ReportType, RequestedReport } from '../../types/UserReports'; import { PartialDate } from '../_filters/types'; import { DashboardSection, MoJTableHead } from './dashboard-visualisation/types'; import DataPresentation from './DataPresentation'; import { GroupedAuditSuggestions } from 'src/dpr/services/dashboardAuditService/types'; export default class Dashboard extends DataPresentation { sections: DashboardSection[]; dashboardData: DashboardDataResponse[]; parentDataNotFound: boolean; parentChildData: DashboardParentChildData[]; partialDate: PartialDate | undefined; dashboardFeatureFlags: Record; audit: GroupedAuditSuggestions; constructor(services: Services, res: Response, req: Request, definition: components['schemas']['DashboardDefinition'], summary: components['schemas']['VariantDefinitionSummary'] | undefined, loadType: LoadType, requestData?: RequestedReport | undefined); build: () => Promise<{ expired: true; dashboardConfig?: never; } | { dashboardConfig: { audit: GroupedAuditSuggestions; dataset: { rows: import("./dashboard-visualisation/types").MoJTableRow[][]; head: MoJTableHead[]; }; executionId?: string | undefined; requestedTimestamp?: string | undefined; querySummary?: import("../_async/request-details/types").QuerySummaryItem[]; queryData?: NodeJS.Dict | undefined; requestUrl?: import("../../types/UserReports").AsyncReportUrlItemData | undefined; defaultQuery?: string | undefined; actions: import("../_reports/report-heading/report-actions/types").ReportAction[]; downloadConfig: import("../_reports/report-heading/report-actions/types").DownloadActionParams | undefined; bookmarkConfig: { bookmarkActionEndpoint: string; showBookmark: boolean; linkText: string; linkType: string; }; subscriptionConfig: import("../../types/AsyncReportUtils").SubscriptionActionConfig | undefined; feedbackFormHref: string | undefined; hasDefaults: boolean | undefined; saveDefaultsEnabled: boolean; sections: DashboardSection[]; filters: import("../_filters/types").FilterValue[]; appliedFilters: import("../_filters/filters-applied/utils").AppliedFilterChip[]; reportName: string; name: string; description: string | undefined; printable: boolean; fields: components["schemas"]["FieldDefinition"][]; schedule?: string | undefined | null; classification?: string | undefined; template?: string; specification?: components["schemas"]["Specification"]; loadType: LoadType; csrfToken: string; type: ReportType; tableId?: string; id: string; reportId: string; }; expired?: never; }>; /** * Gets all the report data * */ getData: () => Promise; /** * Gets the dashboard data */ getDashboardData: () => Promise; private getAsyncData; private getSyncData; getParentChildData: () => Promise; /** * Gets the parent and child data for a parent child dashboard, returns in a single array with the parent data first, followed by the child data * NOTE: Only available for Async * */ getChildData: (childVariants: components["schemas"]["DashboardDefinition"][], services: Services, token: string, req: Request, requestData?: RequestedReport) => Promise; /** * Gets the relevant report details from the report definition * */ buildDashboardDetails: () => Promise; buildSections: () => void; buildPartialDate: () => void; /** * Builds the report query */ buildReportQuery: () => void; auditDashboard: () => undefined; getDatasetAsTable: () => { rows: import("./dashboard-visualisation/types").MoJTableRow[][]; head: MoJTableHead[]; }; }