From cbefd744fec825ecf8aff936a1550359071c4eb9 Mon Sep 17 00:00:00 2001 From: punwai Date: Sun, 19 Apr 2020 16:27:05 +0100 Subject: [PATCH] fix: display report run frequency value (#556) - Display report run frequency value rather than the id in View Adhoc Query Fixes: #555 Co-authored-by: punwai --- .../view-adhoc-query/view-adhoc-query.component.html | 2 +- .../view-adhoc-query/view-adhoc-query.component.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.html b/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.html index 2d78f7877..6778618db 100644 --- a/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.html +++ b/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.html @@ -46,7 +46,7 @@
- {{ adhocQueryData.reportRunFrequency }} + {{ reportRunFrequency }}
diff --git a/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.ts b/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.ts index 9be43652b..351f86b3a 100644 --- a/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.ts +++ b/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.ts @@ -41,6 +41,18 @@ export class ViewAdhocQueryComponent implements OnInit { ngOnInit() { } + /** + * Retrieves the report run frequency value from id + * @returns {string} Report run frequency value. + */ + get reportRunFrequency(): string { + for (const reportRunFrequency of this.adhocQueryData.reportRunFrequencies) { + if (reportRunFrequency.id === this.adhocQueryData.reportRunFrequency) { + return reportRunFrequency.value; + } + } + } + /** * Deletes the adhoc query and redirects to adhoc queries. */