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 <punwaiw@gmail.com>
This commit is contained in:
punwai
2020-04-19 20:57:05 +05:30
committed by GitHub
co-authored by punwai
parent 793cc59899
commit cbefd744fe
2 changed files with 13 additions and 1 deletions
@@ -46,7 +46,7 @@
</div>
<div fxFlex="50%" *ngIf="adhocQueryData.reportRunFrequency">
{{ adhocQueryData.reportRunFrequency }}
{{ reportRunFrequency }}
</div>
<div fxFlex="50%" class="mat-body-strong">
@@ -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.
*/