From f2c58a0289c826e590222fe563c6ea237a60b50c Mon Sep 17 00:00:00 2001 From: Manuel Abascal Date: Tue, 20 Feb 2024 19:35:40 +0200 Subject: [PATCH] Fixed Compliance reports are not being generated when the filters of the associated dashboard are applied (#471) --- .../utm-compliance-schedule-create.component.ts | 2 +- .../compliance-export/compliance-export.component.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/compliance/shared/components/utm-compliance-schedule-create/utm-compliance-schedule-create.component.ts b/frontend/src/app/compliance/shared/components/utm-compliance-schedule-create/utm-compliance-schedule-create.component.ts index b7c431577..1d686867d 100644 --- a/frontend/src/app/compliance/shared/components/utm-compliance-schedule-create/utm-compliance-schedule-create.component.ts +++ b/frontend/src/app/compliance/shared/components/utm-compliance-schedule-create/utm-compliance-schedule-create.component.ts @@ -124,7 +124,7 @@ export class UtmComplianceScheduleCreateComponent implements OnInit, OnDestroy { complianceId: this.reportId, filterDef: this.convertToFilterDefs(), scheduleString: this.cron, - urlWithParams: `/dashboard/export-compliance/${this.reportId}${params}` + urlWithParams: `/dashboard/export-compliance/${this.reportId}?${params}` }; if (this.report) { reportCompliance.id = this.report.id; diff --git a/frontend/src/app/dashboard/compliance-export/compliance-export.component.ts b/frontend/src/app/dashboard/compliance-export/compliance-export.component.ts index e156714f9..f8ca9f609 100644 --- a/frontend/src/app/dashboard/compliance-export/compliance-export.component.ts +++ b/frontend/src/app/dashboard/compliance-export/compliance-export.component.ts @@ -119,10 +119,12 @@ export class ComplianceExportComponent implements OnInit, AfterViewInit { } getTimeFilterValue() { - this.filterTime = { - from: this.resolveFromDate(this.getTime()), - to: this.resolveToDate(this.getTime()), - }; + if (this.getTime()) { + this.filterTime = { + from: this.resolveFromDate(this.getTime()), + to: this.resolveToDate(this.getTime()), + }; + } } getTime() { @@ -211,7 +213,7 @@ export class ComplianceExportComponent implements OnInit, AfterViewInit { } resolveFromDate(date: { from: any, to: any }): string { - if (!isNaN(Date.parse(date.from))) { + if (date && !isNaN(Date.parse(date.from))) { return date.from; } else { return buildFormatInstantFromDate(date).timeFrom;