diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 209f3c9..c39fdf5 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -82,7 +82,10 @@ export class AppComponent implements OnInit {
openDownloadDialog() {
this.export();
- const data = this.downloadJsonHref;
+ const data = {
+ filename: this.store.getResults().filename,
+ url: this.downloadJsonHref
+ };
const dialogRef = this.dialog.open(DownloadDialogComponent, {
data: data
});
diff --git a/src/components/download-dialog/download-dialog.component.html b/src/components/download-dialog/download-dialog.component.html
index 646b7ef..fed11c5 100644
--- a/src/components/download-dialog/download-dialog.component.html
+++ b/src/components/download-dialog/download-dialog.component.html
@@ -8,8 +8,8 @@
Download
On pushing the Download Button the test results are copied to your standard download folder on your computer. File
name: [2-digit country code]_[OS type]_[timestamp].json
.
- Download
+
Download
diff --git a/src/interfaces/model.interface.ts b/src/interfaces/model.interface.ts
index cffb429..45f0621 100644
--- a/src/interfaces/model.interface.ts
+++ b/src/interfaces/model.interface.ts
@@ -13,7 +13,7 @@
* `20220117-NL-ANDROID.json`
* `20220117-NL-IOS.json`
*/
- import * as _ from 'lodash';
+import * as _ from 'lodash';
/**
* Target platforms
@@ -71,8 +71,17 @@ export interface ITestResultEntry {
}
export class TestResult implements ITestResult {
+
metadata: ITestResultMetadata;
results: ITestResultEntry[];
+
+ get filename(): string {
+ const cc = this.metadata.country || 'country';
+ const pl = this.metadata.platform || 'platform';
+ const ts = this.metadata.completedOn || 'timestamp';
+ return `${cc}_${pl}_${ts}.json`;
+ }
+
constructor() {
this.metadata = new TestResultMetadata();
// TODO: Should this become a more smart collect?
@@ -127,7 +136,7 @@ export class TestResultMetadata implements ITestResultMetadata {
/**
* The Rich representation of an EU DCC
*/
- export interface IQRCode {
+export interface IQRCode {
/** Unique ID (is the same with the file) */
id: string;
/** The country issued this DCC. */
@@ -147,7 +156,7 @@ export class TestResultMetadata implements ITestResultMetadata {
}
export class Analytics {
- constructor(private rqCodes: Array, private results: TestResult) {}
+ constructor(private rqCodes: Array, private results: TestResult) { }
/**
* @returns The number of all the QR Codes for testing.
@@ -163,6 +172,6 @@ export class Analytics {
public progress(category: TestResultEnum | null): number {
// Return all
if (!category) return this.results.results.length;
- return this.results.results.filter(value => value.result === category).length
+ return this.results.results.filter(value => value.result === category).length
}
}
\ No newline at end of file