File

datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.ts

Index

Methods

Constructor

constructor(alertService: AlertService, measurementService: MeasurementService, sanitizer: DomSanitizer, translateService: TranslateService, utilsService: UtilsService)
Parameters :
Name Type Optional
alertService AlertService No
measurementService MeasurementService No
sanitizer DomSanitizer No
translateService TranslateService No
utilsService UtilsService No

Methods

Async fetchAndPrepareDataToExport
fetchAndPrepareDataToExport(exportConfig: ExportConfig, isMeasurement: boolean)
Parameters :
Name Type Optional
exportConfig ExportConfig No
isMeasurement boolean No
Returns : Promise<DataToExport[]>
Async fetchAndProcessMeasurementFile
fetchAndProcessMeasurementFile(details: DatapointDetails, measurementFileConfig: MeasurementFileConfig)
Parameters :
Name Type Optional
details DatapointDetails No
measurementFileConfig MeasurementFileConfig No
Returns : Promise<DataToExportWithBackendCreatedFile | undefined>
Async fetchMeasurementDataFilesAndPairWithSourceDetails
fetchMeasurementDataFilesAndPairWithSourceDetails(acceptFileType: string, exportConfig: ExportConfig)
Parameters :
Name Type Optional
acceptFileType string No
exportConfig ExportConfig No
Returns : Promise<DataToExportWithBackendCreatedFile[]>
Async getDatapointsExceedingLimit
getDatapointsExceedingLimit(exportConfig: ExportConfig)

Checks if any of measurements requests may exceeded the limit, after which the export data is processed by the backend and the generated CSV/Excel file is sent by email.

The threshold is set to 50_000 records in application's core properties (export.data.synchronous.limit).

Parameters :
Name Type Optional Description
exportConfig ExportConfig No
  • The export configuration.

A promise that returns an array of objects representing datapoints files that will be sent by email.

getLimitExceededMessage
getLimitExceededMessage(hasNoExportableData: boolean, emailDeliverableCount?: number, browserDownloadableCount?: number, nonRetrievableCount?: number, totalDatapointsSelectedForExportCount?: number)

Retrieves the message to be displayed when the limit of datapoints is exceeded during file export.

Parameters :
Name Type Optional Description
hasNoExportableData boolean No
  • Indicates if there is no exportable data because the date range of all selected datapoints exceeds 1,000,000 records.
emailDeliverableCount number Yes
  • The number of datapoint exports that exceed the limit, will be proceeded by the backend and sent by email.
browserDownloadableCount number Yes
  • The number of datapoint exports that can be downloaded directly.
nonRetrievableCount number Yes
totalDatapointsSelectedForExportCount number Yes
  • Total number of datapoint selected for exports.
Returns : string

The message that can be injected.

Async getSourcesWithPermissionsToRead
getSourcesWithPermissionsToRead(datapointDetails: DatapointDetails[])
Parameters :
Name Type Optional
datapointDetails DatapointDetails[] No
Returns : Promise<string[]>
Async mergeMeasurementsWithItsSourceDetails
mergeMeasurementsWithItsSourceDetails(details: DatapointDetails, measurementFile: IFetchResponse)
Parameters :
Name Type Optional
details DatapointDetails No
measurementFile IFetchResponse No
Returns : Promise<DataToExportWithBackendCreatedFile>
showSendViaEmailInfoAlert
showSendViaEmailInfoAlert(fileType: string, datapointsExceedingLimit: DatapointsExceedingLimit[])

Displays an information alert about sending data via email.

Only measurements API can send files via email.

Parameters :
Name Type Optional Description
fileType string No
  • The type of file to be sent.
datapointsExceedingLimit DatapointsExceedingLimit[] No
  • The array of datapoints exceeding the limit.
Returns : void

results matching ""

    No results matching ""