Skip to content

Simplify DownloadAction type

Currently, DownloadActions must specify either a data (type string) or a blob (type Blob) property containing the data that should be downloaded. This caused issues in the ExportModule rewrite (essentially, when providing an Exporter, we don't know which property the corresponding DownloadAction has). Hence, these two properties should be merged into a single data property.

Instructions

In actions.commons:

  • Replace WithData and WithBlob with one interface. I chose WithBlobPart because BlobPart is conveniently defined as BufferSource | Blob | string. data can still also be a function or Promise.
  • Update isDownloadAction() and hasData() accordingly, delete hasBlob()

In action.service:

  • Modify getBlobFromAction() to work with the updated DownloadAction.

Then, find all DownloadActions with the blob property and rename it to data (only concerns downloadZipActionFactory afaik).

Testing

The existing DownloadActions should work as before. Namely, this is the backup page and the Report exports.

  1. Backup page: Choose "Backup & Restore" in the main menu, create a backup and download it
  2. Report exports: Serve HCP app, click "Scan QR code", scan a symptom check shared from the PAT app, click "Open therapy data", click on the Report, all the exports should work
Edited by Noel Simmel