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
andWithBlob
with one interface. I choseWithBlobPart
because BlobPart is conveniently defined asBufferSource | Blob | string
.data
can still also be a function or Promise. - Update
isDownloadAction()
andhasData()
accordingly, deletehasBlob()
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.
- Backup page: Choose "Backup & Restore" in the main menu, create a backup and download it
- 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