diff --git a/frontend/src/app/common/services/business-licence.service.ts b/frontend/src/app/common/services/business-licence.service.ts index 1f68310d..42c70526 100644 --- a/frontend/src/app/common/services/business-licence.service.ts +++ b/frontend/src/app/common/services/business-licence.service.ts @@ -1,4 +1,4 @@ -import { HttpClient } from '@angular/common/http'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable, of } from 'rxjs'; import { environment } from '../../../environments/environment'; @@ -7,6 +7,8 @@ import { environment } from '../../../environments/environment'; providedIn: 'root' }) export class BusinessLicenceService { + textHeaders = new HttpHeaders().set('Content-Type', 'text/plain; charset=utf-8'); + constructor(private httpClient: HttpClient) { } getUploadHistory( @@ -29,6 +31,11 @@ export class BusinessLicenceService { return this.httpClient.get(url); } + downloadErrors(id: number): Observable { + return this.httpClient.get(`${environment.API_HOST}/rentallistingreports/uploads/${id}/errorfile`, + { headers: this.textHeaders, responseType: 'text' as 'json' }); + } + uploadFile(file: any, orgId: number): Observable { const formData = new FormData(); formData.append('organizationId', orgId.toString()); diff --git a/frontend/src/app/features/components/bulk-compliance-notice/bulk-compliance-notice.component.ts b/frontend/src/app/features/components/bulk-compliance-notice/bulk-compliance-notice.component.ts index e15198eb..857563be 100644 --- a/frontend/src/app/features/components/bulk-compliance-notice/bulk-compliance-notice.component.ts +++ b/frontend/src/app/features/components/bulk-compliance-notice/bulk-compliance-notice.component.ts @@ -152,7 +152,6 @@ export class BulkComplianceNoticeComponent implements OnInit { } onListingSelected(e: any): void { - console.log(e); if (e.checked) { this.selectedListings = this.listings.filter(l => l.listingStatusType !== 'I'); } else { diff --git a/frontend/src/app/features/components/bulk-takedown-request/bulk-takedown-request.component.ts b/frontend/src/app/features/components/bulk-takedown-request/bulk-takedown-request.component.ts index bfc7c598..918aca9d 100644 --- a/frontend/src/app/features/components/bulk-takedown-request/bulk-takedown-request.component.ts +++ b/frontend/src/app/features/components/bulk-takedown-request/bulk-takedown-request.component.ts @@ -96,7 +96,6 @@ export class BulkTakedownRequestComponent implements OnInit { } onListingSelected(e: any): void { - console.log(e); if (e.checked) { this.selectedListings = this.listings.filter(l => l.listingStatusType !== 'I'); } else { diff --git a/frontend/src/app/features/components/export-listings/export-listings.component.ts b/frontend/src/app/features/components/export-listings/export-listings.component.ts index c193afca..e6586740 100644 --- a/frontend/src/app/features/components/export-listings/export-listings.component.ts +++ b/frontend/src/app/features/components/export-listings/export-listings.component.ts @@ -39,8 +39,6 @@ export class ExportListingsComponent implements OnInit { this.loaderService.loadingStart(); this.listingService.getJurisdictions().subscribe({ next: (jurisdictions) => { - console.log(jurisdictions); - if (jurisdictions) { this.jurisdictions = jurisdictions; this.dateLastUpdated = this.jurisdictions[0].updDtm; diff --git a/frontend/src/app/features/components/upload-business-license/upload-business-license.component.html b/frontend/src/app/features/components/upload-business-license/upload-business-license.component.html index 34d4ce72..4287a9ed 100644 --- a/frontend/src/app/features/components/upload-business-license/upload-business-license.component.html +++ b/frontend/src/app/features/components/upload-business-license/upload-business-license.component.html @@ -46,6 +46,14 @@ + + Errors + + + Upload Date @@ -74,6 +82,17 @@ {{uploadHistory.status}} {{ uploadHistory.total }} + + + + {{0}} + + {{ uploadHistory.updDtm |date:'YYYY-MM-dd' }} {{ uploadHistory.givenNm }} {{uploadHistory.familyNm}} diff --git a/frontend/src/app/features/components/upload-business-license/upload-business-license.component.ts b/frontend/src/app/features/components/upload-business-license/upload-business-license.component.ts index 3e5d1700..614bb0c5 100644 --- a/frontend/src/app/features/components/upload-business-license/upload-business-license.component.ts +++ b/frontend/src/app/features/components/upload-business-license/upload-business-license.component.ts @@ -135,10 +135,26 @@ export class UploadBusinessLicenseComponent implements OnInit { } onPageChange(e: any): void { - console.log(e.page + 1); this.getHistoryRecords(e.page + 1); } + onDownloadErrors(rowId: number, platform: string, date: string): void { + this.loaderService.loadingStart(' It may take several minutes to prepare your download file. Please do not close this tab until your download is complete.'); + this.BLService.downloadErrors(rowId).subscribe({ + next: (content) => { + const element = document.createElement('a'); + element.setAttribute('href', `data:text/plain;charset=utf-8,${encodeURIComponent(content)}`); + element.setAttribute('download', `errors_${platform}_${date}.csv`); + + element.click(); + }, + complete: () => { + this.loaderService.loadingEnd(); + this.cd.detectChanges(); + }, + }); + } + private getHistoryRecords(selectedPageNumber: number = 1): void { this.loaderService.loadingStart(); this.BLService.getUploadHistory(