Revision 61262
Added by Konstantina Galouni almost 3 years ago
organization.component.ts | ||
---|---|---|
92 | 92 |
private funderId: string; |
93 | 93 |
private funderCount: number; |
94 | 94 |
subscriptions = []; |
95 |
innerReportSubscriptions = []; |
|
95 | 96 |
properties: EnvProperties; |
96 | 97 |
public indexUpdateDate: Date; |
97 | 98 |
public showFeedback: boolean = false; |
... | ... | |
188 | 189 |
subscription.unsubscribe(); |
189 | 190 |
} |
190 | 191 |
}); |
192 |
this.innerReportSubscriptions.forEach(subscription => { |
|
193 |
if(subscription instanceof Subscriber) { |
|
194 |
subscription.unsubscribe(); |
|
195 |
} |
|
196 |
}); |
|
197 |
|
|
191 | 198 |
this.fetchDatasets.clearSubscriptions(); |
192 | 199 |
this.fetchPublications.clearSubscriptions(); |
193 | 200 |
this.fetchSoftware.clearSubscriptions(); |
... | ... | |
390 | 397 |
data => { |
391 | 398 |
projects = data[1]; |
392 | 399 |
for (let index = 0; index < projects.length; index++) { |
393 |
this.subscriptions.push(this._searchResearchResultsService.numOfEntityResults(this.funderContentType, projects[index].id, "project", this.properties).subscribe(
|
|
400 |
this.innerReportSubscriptions.push(this._searchResearchResultsService.numOfEntityResults(this.funderContentType, projects[index].id, "project", this.properties).subscribe(
|
|
394 | 401 |
data => { |
395 | 402 |
//if(data == 0 && title) { // if no publications for this project |
396 | 403 |
if (data == 0 && (counter > 1 || title)) { // if no publications for this project |
... | ... | |
435 | 442 |
} |
436 | 443 |
title = true; |
437 | 444 |
|
438 |
this.subscriptions.push(this._reportsService.getCSVResponse(url).subscribe(
|
|
445 |
this.innerReportSubscriptions.push(this._reportsService.getCSVResponse(url).subscribe(
|
|
439 | 446 |
data => { |
440 | 447 |
counter--; |
441 | 448 |
response[index] = data; |
... | ... | |
473 | 480 |
|
474 | 481 |
this.closeLoading(); |
475 | 482 |
this.confirmOpenCsvError(); |
483 |
this.innerReportSubscriptions.forEach(subscription => subscription.unsubscribe()); |
|
476 | 484 |
}/*, |
477 | 485 |
() => console.log('Completed file download.')*/ |
478 | 486 |
) ); |
... | ... | |
481 | 489 |
err => { |
482 | 490 |
this.handleError("Error getting number of publications for project with id: " + projects[index].id, err); |
483 | 491 |
this.closeLoading(); |
492 |
this.confirmOpenCsvError(); |
|
493 |
this.innerReportSubscriptions.forEach(subscription => subscription.unsubscribe()); |
|
484 | 494 |
})); |
485 | 495 |
} |
486 | 496 |
}, |
Also available in: Unified diff
[Trunk | Library]:
1. timeout-interceptor.service.ts: Added whitelist, so that urls included in the list are not cut by this timeout interceptor.
2. services/reports.service.ts & landingPages/htmlProjectReport/htmlProjectReport.service.ts: In calls for CSV and HTML reports, added timeout 10 in seconds.
3. organization.component.ts: Created array "innerReportSubscriptions" where inner request of "downloading research results of a funder" are added - on error, all innerReportSubscriptions are unsubscribed.