import { Component } from '@angular/core'; import { PolicyService } from '@core/services/policy.service'; import { AdHocReportingAPI } from '@core/typings/api/ad-hoc-reporting.typing'; import { SFTPAPI } from '@core/typings/api/sftp.typing'; import { DataFeedsService } from '@features/reporting/services/data-feeds.service'; import { SFTPService } from '@features/sftp/sftp.service'; import { TopLevelFilter } from '@yourcause/common'; import { I18nService } from '@yourcause/common/i18n'; @Component({ selector: 'gc-data-feeds-list-view-page', templateUrl: './data-feeds-list-view-page.component.html', styleUrls: ['./data-feeds-list-view-page.component.scss'] }) export class DataFeedsListViewPageComponent { rows: SFTPAPI.SFTPCredentialsListView[] = this.sftpService.userCredentials; drilldownInfo: any; canManageAdHoc = this.policyService.dataExport.canManageAdHoc(); canDownloadDataFeeds = this.policyService.system.canDownloadDataFeeds(); AccessType = AdHocReportingAPI.AdHocReportAccessType; topLevelFilters = [ new TopLevelFilter( 'text', 'destinationServer', '', this.i18n.translate( 'reporting:lblSearchByConnectionName', {}, 'Search by connection name' ) ) ]; constructor ( private i18n: I18nService, private sftpService: SFTPService, private policyService: PolicyService, private dataFeedService: DataFeedsService ) {} async onDrilldown (row: SFTPAPI.SFTPCredentialsListView) { this.drilldownInfo = null; const drillDownInfo = await this.dataFeedService.getDataFeedDrilldownInfo(row.id); this.drilldownInfo = drillDownInfo; } downloadReport (url: string) { window.open(url); } }