Revision 59816
Added by Argiro Kokogiannaki over 3 years ago
bulkClaim.component.ts | ||
---|---|---|
6 | 6 |
import {Dates, DOI} from '../../../utils/string-utils.class'; |
7 | 7 |
import {EnvProperties} from '../../../utils/properties/env-properties'; |
8 | 8 |
import {ClaimEntity} from "../../claim-utils/claimHelper.class"; |
9 |
import {Subscriber} from "rxjs"; |
|
9 | 10 |
|
10 | 11 |
declare var UIkit: any; |
11 | 12 |
|
... | ... | |
123 | 124 |
|
124 | 125 |
ngOnInit() { |
125 | 126 |
} |
126 |
|
|
127 |
subscriptions = []; |
|
128 |
ngOnDestroy() { |
|
129 |
this.subscriptions.forEach(subscription => { |
|
130 |
if (subscription instanceof Subscriber) { |
|
131 |
subscription.unsubscribe(); |
|
132 |
} |
|
133 |
}); |
|
134 |
} |
|
127 | 135 |
upload() { |
128 | 136 |
this.enableUpload = false; |
129 | 137 |
this.showReport = false; |
... | ... | |
238 | 246 |
} |
239 | 247 |
|
240 | 248 |
fetchResult(id: string, accessMode: string, date: string, row: number) { |
241 |
this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties, true).subscribe( |
|
249 |
this.subscriptions.push(this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties, true).subscribe(
|
|
242 | 250 |
data => { |
243 | 251 |
|
244 | 252 |
const result:ClaimEntity = data[1][0]; |
... | ... | |
264 | 272 |
this.notFoundIdsRow.push(row); |
265 | 273 |
this.endOfFetching(); |
266 | 274 |
} |
267 |
); |
|
275 |
));
|
|
268 | 276 |
} |
269 | 277 |
|
270 | 278 |
searchInDatacite(id: string, accessMode: string, date: string, row: number) { |
271 |
this._searchDataciteService.getDataciteResultByDOI(id, this.properties, true).subscribe( |
|
279 |
this.subscriptions.push(this._searchDataciteService.getDataciteResultByDOI(id, this.properties, true).subscribe(
|
|
272 | 280 |
result => { |
273 | 281 |
|
274 | 282 |
if (result) { |
... | ... | |
293 | 301 |
this.notFoundIdsRow.push(row); |
294 | 302 |
this.endOfFetching(); |
295 | 303 |
} |
296 |
); |
|
304 |
));
|
|
297 | 305 |
} |
298 | 306 |
|
299 | 307 |
endOfFetching() { |
Also available in: Unified diff
[Library|Trunk]
code clean up:
-remove app.* files from library
-remove unused imports, code, files (Old search pages for results, dataproviders, map search page, etc)
-remove Freeguard from modules
-unsubscribe all subscriptions
-Services: configuration, isvocabularies, user management: unsubscribe from app component or the component that uses them (clearSubscriptions())
-Fetchers: unsubscribe from the component that uses them (clearSubscriptions())