Revision 59816
Added by Argiro Kokogiannaki over 3 years ago
dataProvider.component.ts | ||
---|---|---|
1 |
import {merge as observableMerge} from 'rxjs'; |
|
2 | 1 |
import {Component, Input, ViewChild} from '@angular/core'; |
3 | 2 |
import {ActivatedRoute, Router} from '@angular/router'; |
4 | 3 |
import {Meta, Title} from '@angular/platform-browser'; |
... | ... | |
26 | 25 |
import {ResultPreview} from "../../utils/result-preview/result-preview"; |
27 | 26 |
import {IndexInfoService} from "../../utils/indexInfo.service"; |
28 | 27 |
import {properties} from "../../../../environments/environment"; |
28 |
import {Subscriber} from "rxjs"; |
|
29 | 29 |
|
30 | 30 |
|
31 | 31 |
@Component({ |
... | ... | |
43 | 43 |
public warningMessage = ""; |
44 | 44 |
public errorMessage = ""; |
45 | 45 |
public showLoading: boolean = true; |
46 |
|
|
47 |
// Variable to specify requests with either collectedFrom or hostedBy |
|
48 |
public paramsForSearchLink = {}; |
|
49 |
public resultParamsForSearchLink = {}; |
|
50 |
|
|
46 |
|
|
51 | 47 |
// Metrics tab variables |
52 | 48 |
public metricsClicked: boolean; |
53 | 49 |
public viewsFrameUrl: string; |
... | ... | |
58 | 54 |
|
59 | 55 |
// Statistics tab variables |
60 | 56 |
public statsClicked: boolean = false; |
61 |
public docsTimelineUrl: string; |
|
62 |
public docsTypesUrl: string; |
|
63 |
public docsFunderUrl: string; |
|
64 |
public dataProjectsUrl: string; |
|
65 |
public pubsProjectsUrl: string; |
|
66 | 57 |
|
67 | 58 |
@ViewChild('statisticsModal') statisticsModal; |
68 | 59 |
@ViewChild('relatedDatasourcesModal') relatedDatasourcesModal; |
... | ... | |
74 | 65 |
public fetchOrps: FetchResearchResults; |
75 | 66 |
public fetchProjects: FetchProjects; |
76 | 67 |
public fetchDataproviders: FetchDataproviders; |
77 |
public fetchAggregatorsPublications: FetchResearchResults; |
|
78 |
public fetchAggregatorsDatasets: FetchResearchResults; |
|
79 |
public fetchAggregatorsSoftware: FetchResearchResults; |
|
80 |
public fetchAggregatorsOrps: FetchResearchResults; |
|
81 | 68 |
public fetchAggregatorsResults: FetchResearchResults; |
82 | 69 |
public searchNumber: number = 5; |
83 | 70 |
|
... | ... | |
89 | 76 |
public activeTab: string = ""; |
90 | 77 |
public showTabs: boolean = false; |
91 | 78 |
|
92 |
public firstTab: string = ""; |
|
93 | 79 |
public _numberOfTabs: number = 0; |
94 | 80 |
public tabsAreInitialized: boolean = false; |
95 | 81 |
|
... | ... | |
123 | 109 |
public showFeedback: boolean = false; |
124 | 110 |
public feedbackFields: string [] = ['Name', 'Organizations', 'Country', 'Other']; |
125 | 111 |
|
126 |
sub: any; |
|
127 |
piwiksub: any; |
|
128 |
subInfo: any; |
|
129 |
relatedDatasourcesSub: any; |
|
112 |
subscriptions = []; |
|
130 | 113 |
properties: EnvProperties = properties; |
131 | 114 |
|
132 | 115 |
constructor(private _dataproviderService: DataProviderService, |
... | ... | |
153 | 136 |
|
154 | 137 |
ngOnInit() { |
155 | 138 |
if (typeof document !== 'undefined') { |
156 |
this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { |
|
139 |
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
|
|
157 | 140 |
if (lastIndexUpdate) { |
158 | 141 |
this.indexUpdateDate = new Date(lastIndexUpdate); |
159 | 142 |
} |
160 |
}); |
|
143 |
}));
|
|
161 | 144 |
} |
162 | 145 |
//this.getDivContents(); |
163 | 146 |
this.getPageContents(); |
164 | 147 |
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url); |
165 |
this.sub = this.route.queryParams.subscribe(data => {
|
|
148 |
this.subscriptions.push(this.route.queryParams.subscribe(data => {
|
|
166 | 149 |
this.updateTitle("Content provider"); |
167 | 150 |
this.updateDescription(""); |
168 | 151 |
this.datasourceId = data['datasourceId']; |
... | ... | |
180 | 163 |
} |
181 | 164 |
|
182 | 165 |
HelperFunctions.scroll(); |
183 |
}); |
|
166 |
}));
|
|
184 | 167 |
} |
185 | 168 |
|
186 | 169 |
public initializeValues() { |
... | ... | |
205 | 188 |
} |
206 | 189 |
|
207 | 190 |
private getPageContents() { |
208 |
this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => { |
|
191 |
this.subscriptions.push(this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
|
|
209 | 192 |
this.pageContents = contents; |
210 |
}) |
|
193 |
}));
|
|
211 | 194 |
} |
212 | 195 |
|
213 | 196 |
private getDivContents() { |
214 |
this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => { |
|
197 |
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
|
|
215 | 198 |
this.divContents = contents; |
216 |
}) |
|
199 |
}));
|
|
217 | 200 |
} |
218 | 201 |
|
219 | 202 |
ngOnDestroy() { |
220 |
if (this.sub) { |
|
221 |
this.sub.unsubscribe(); |
|
222 |
} |
|
223 |
if (this.piwiksub) { |
|
224 |
this.piwiksub.unsubscribe(); |
|
225 |
} |
|
226 |
if (this.subInfo) { |
|
227 |
this.subInfo.unsubscribe(); |
|
228 |
} |
|
229 |
|
|
230 |
if (this.relatedDatasourcesSub) { |
|
231 |
this.relatedDatasourcesSub.unsubscribe(); |
|
232 |
} |
|
203 |
this.subscriptions.forEach(subscription => { |
|
204 |
if (subscription instanceof Subscriber) { |
|
205 |
subscription.unsubscribe(); |
|
206 |
} |
|
207 |
}); |
|
208 |
this.fetchDatasets.clearSubscriptions(); |
|
209 |
this.fetchPublications.clearSubscriptions(); |
|
210 |
this.fetchSoftware.clearSubscriptions(); |
|
211 |
this.fetchPublications.clearSubscriptions(); |
|
212 |
this.fetchDataproviders.clearSubscriptions(); |
|
213 |
this.fetchProjects.clearSubscriptions(); |
|
233 | 214 |
} |
234 | 215 |
|
235 | 216 |
private getDataProviderInfo(id: string) { |
... | ... | |
244 | 225 |
this.showLoading = false; |
245 | 226 |
this.warningMessage = "No valid datasource id"; |
246 | 227 |
} else { |
247 |
this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe(
|
|
228 |
this.subscriptions.push(this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe(
|
|
248 | 229 |
data => { |
249 | 230 |
this.dataProviderInfo = data; |
250 | 231 |
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url); |
... | ... | |
260 | 241 |
this.updateTitle(this.dataProviderInfo.title.name); |
261 | 242 |
this.updateDescription("Content provider, " + this.dataProviderInfo.title.name); |
262 | 243 |
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { |
263 |
this.piwiksub = this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe();
|
|
244 |
this.subscriptions.push(this._piwikService.trackView(this.properties, this.dataProviderInfo.title.name, this.piwikSiteId).subscribe());
|
|
264 | 245 |
} |
265 | 246 |
|
266 | 247 |
this.showLoading = false; |
... | ... | |
284 | 265 |
this.showLoading = false; |
285 | 266 |
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToDataProviders); |
286 | 267 |
} |
287 |
); |
|
268 |
));
|
|
288 | 269 |
} |
289 | 270 |
} |
290 | 271 |
|
291 | 272 |
private getDataProviderAggregationStatus(originalId: string) { |
292 |
this.subInfo = this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
|
|
273 |
this.subscriptions.push(this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
|
|
293 | 274 |
data => { |
294 | 275 |
this.dataProviderInfo.aggregationStatus = data; |
295 | 276 |
}, |
... | ... | |
300 | 281 |
() => { |
301 | 282 |
this.aggregationStatusIsInitialized = true; |
302 | 283 |
} |
303 |
); |
|
284 |
));
|
|
304 | 285 |
} |
305 | 286 |
|
306 | 287 |
private updateDescription(description: string) { |
... | ... | |
340 | 321 |
this.metricsClicked = false; |
341 | 322 |
|
342 | 323 |
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoViews","dtsrcName":"' + this.datasourceId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; |
343 |
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; |
|
344 |
*/ |
|
345 |
|
|
346 | 324 |
this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"dtsrcRepoDownloads","dtsrcName":"' + this.datasourceId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; |
347 |
/* |
|
348 |
this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true'; |
|
349 |
*/ |
|
350 |
|
|
351 |
//if({"name": "Publications", "content": "publicationsTab"} in this.dataProviderInfo.tabs) { |
|
352 |
//if(this.dataProviderInfo.tabs.some(function (tab) { |
|
353 |
// return tab.name === 'Publications'; |
|
354 |
//})) { |
|
355 |
// this.relatedDataprovidersResultsType = 'publications'; |
|
356 |
|
|
357 |
// this.fetchAggregatorsPublications = new FetchResearchResults(this._searchResearchResultsService); |
|
358 |
// //} else { |
|
359 |
// // this.relatedDataprovidersResultsType = 'datasets'; |
|
360 |
// this.fetchAggregatorsDatasets = new FetchResearchResults(this._searchResearchResultsService); |
|
361 |
// //} |
|
362 |
// this.fetchAggregatorsSoftware = new FetchResearchResults(this._searchResearchResultsService); |
|
363 |
// this.fetchAggregatorsOrps = new FetchResearchResults(this._searchResearchResultsService); |
|
364 | 325 |
this.fetchAggregatorsResults = new FetchResearchResults(this._searchResearchResultsService); |
365 |
//} |
|
366 |
// if (this.dataProviderInfo.resultsBy == "collectedFrom") { |
|
367 |
// //this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and"; |
|
368 |
// this.paramsForSearchLink = this.routerHelper.createQueryParams(['f0', 'fv0'], ["collectedfromdatasourceid", this.datasourceId]); |
|
369 |
// this.resultParamsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl', 'qf'], [this.datasourceId, 'and', 'false']); |
|
370 |
// } else if (this.dataProviderInfo.resultsBy == "hostedBy") { |
|
371 |
// //this.paramsForSearchLink = "?hostedBy="+this.datasourceId+"&ho=and"; |
|
372 |
// this.paramsForSearchLink = this.routerHelper.createQueryParams(['f0', 'fv0'], ["resulthostingdatasourceid", this.datasourceId]); |
|
373 |
// this.resultParamsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs', 'qf'], [this.datasourceId, 'and', 'false']); |
|
374 |
// } |
|
375 |
|
|
326 |
|
|
376 | 327 |
} |
377 | 328 |
|
378 | 329 |
public getParamsForSearchLink(type: string = "") { |
379 |
let resultsBy: string = ""; |
|
380 |
// if(this.dataProviderInfo.resultsBy == "collectedFrom") { |
|
381 |
// resultsBy = "collectedfromdatasourceid" |
|
382 |
// } else if (this.dataProviderInfo.resultsBy == "hostedBy") { |
|
383 |
// resultsBy = "resulthostingdatasourceid"; |
|
384 |
// } |
|
385 |
|
|
330 |
|
|
386 | 331 |
if (type) { |
387 | 332 |
return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf', 'sortBy'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId, type, "false", 'resultdateofacceptance,descending']); |
388 | 333 |
} else { |
... | ... | |
391 | 336 |
} |
392 | 337 |
|
393 | 338 |
private count(page: number, size: number) { |
394 |
//for (let i = 0; i < this.dataProviderInfo.tabs.length; i++) { |
|
395 |
//let content: string = this.dataProviderInfo.tabs[i].content; |
|
396 |
|
|
397 |
//if (content == 'publicationsTab') { |
|
339 |
|
|
398 | 340 |
this.countPublications(page, size); |
399 |
//} else if (content == 'datasetsTab') { |
|
400 | 341 |
this.countDatasets(page, size); |
401 |
//} else if (content == 'softwareTab') { |
|
402 | 342 |
this.countSoftware(page, size); |
403 |
//} else if (content == 'orpsTab') { |
|
404 | 343 |
this.countOrps(page, size); |
405 |
//} else if (content == 'projectsTab') { |
|
406 | 344 |
this.countProjects(page, size); |
407 |
//} else if (content == 'datasourcesTab') { |
|
408 | 345 |
this.countDatasources(page, size); |
409 |
//}// else if(content=='relatedDatasourcesTab') { |
|
410 |
// this.countRelatedDatasources(page, size); |
|
411 |
//} |
|
412 |
//} |
|
346 |
|
|
413 | 347 |
} |
414 | 348 |
|
415 | 349 |
public search(content: string, page: number, size: number) { |
... | ... | |
560 | 494 |
(this.fetchAggregatorsResults.searchUtils.status == this.errorCodes.DONE && this.fetchAggregatorsResults.searchUtils.totalResults > 0) |
561 | 495 |
) |
562 | 496 |
) { |
563 |
this.relatedDatasourcesSub = this.fetchAggregatorsResults.requestComplete.subscribe(
|
|
497 |
this.subscriptions.push(this.fetchAggregatorsResults.requestComplete.subscribe(
|
|
564 | 498 |
data => { |
565 | 499 |
}, |
566 | 500 |
err => { |
... | ... | |
570 | 504 |
this.dataProviderInfo.relatedDatasources = this.fetchAggregatorsResults.results; |
571 | 505 |
this.loadingRelatedDatasources = false; |
572 | 506 |
} |
573 |
); |
|
507 |
));
|
|
574 | 508 |
|
575 | 509 |
this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties); |
576 | 510 |
} else { |
... | ... | |
582 | 516 |
} |
583 | 517 |
|
584 | 518 |
private countRelatedDatasources(page: number, size: number) { |
585 |
// this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties); |
|
586 |
// this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties); |
|
587 |
// this.fetchAggregatorsSoftware.getAggregatorResults("software", this.datasourceId, page, size, this.properties); |
|
588 |
// this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties); |
|
589 | 519 |
this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties); |
590 | 520 |
} |
591 |
|
|
592 |
|
|
593 |
// private preprocessRelatedDatasources() { |
|
594 |
// if (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE || |
|
595 |
// this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE || |
|
596 |
// this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE || |
|
597 |
// this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE) { |
|
598 |
// this.dataProviderInfo.relatedDatasources = new Map<string, { "name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string }>(); |
|
599 |
// } |
|
600 |
// for (let result of this.fetchAggregatorsPublications.results) { |
|
601 |
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) { |
|
602 |
// this.dataProviderInfo.relatedDatasources.set(result.id, { |
|
603 |
// "name": result.name, |
|
604 |
// "countPublications": result.count, |
|
605 |
// "countDatasets": "0", |
|
606 |
// "countSoftware": "0", |
|
607 |
// "countOrps": "0" |
|
608 |
// }); |
|
609 |
// } else { |
|
610 |
// this.dataProviderInfo.relatedDatasources.get(result.id).countPublications = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countPublications + result.count) + ""; |
|
611 |
// } |
|
612 |
// } |
|
613 |
// |
|
614 |
// for (let result of this.fetchAggregatorsDatasets.results) { |
|
615 |
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) { |
|
616 |
// this.dataProviderInfo.relatedDatasources.set(result.id, { |
|
617 |
// "name": result.name, |
|
618 |
// "countPublications": "0", |
|
619 |
// "countDatasets": result.count, |
|
620 |
// "countSoftware": "0", |
|
621 |
// "countOrps": "0" |
|
622 |
// }); |
|
623 |
// } else { |
|
624 |
// this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count) + ""; |
|
625 |
// } |
|
626 |
// } |
|
627 |
// |
|
628 |
// for (let result of this.fetchAggregatorsSoftware.results) { |
|
629 |
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) { |
|
630 |
// this.dataProviderInfo.relatedDatasources.set(result.id, { |
|
631 |
// "name": result.name, |
|
632 |
// "countPublications": "0", |
|
633 |
// "countDatasets": "0", |
|
634 |
// "countSoftware": result.count, |
|
635 |
// "countOrps": "0" |
|
636 |
// }); |
|
637 |
// } else { |
|
638 |
// this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware + result.count) + ""; |
|
639 |
// } |
|
640 |
// } |
|
641 |
// |
|
642 |
// for (let result of this.fetchAggregatorsOrps.results) { |
|
643 |
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) { |
|
644 |
// this.dataProviderInfo.relatedDatasources.set(result.id, { |
|
645 |
// "name": result.name, |
|
646 |
// "countPublications": "0", |
|
647 |
// "countDatasets": "0", |
|
648 |
// "countSoftware": "0", |
|
649 |
// "countOrps": result.count |
|
650 |
// }); |
|
651 |
// } else { |
|
652 |
// this.dataProviderInfo.relatedDatasources.get(result.id).countOrps = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countOrps + result.count) + ""; |
|
653 |
// } |
|
654 |
// } |
|
655 |
// this.loadingRelatedDatasources = false; |
|
656 |
// } |
|
657 |
|
|
521 |
|
|
658 | 522 |
public metricsResults($event) { |
659 | 523 |
this.totalViews = $event.totalViews; |
660 | 524 |
this.totalDownloads = $event.totalDownloads; |
... | ... | |
776 | 640 |
|| !!this.dataProviderInfo.oaiPmhURL || !!this.dataProviderInfo.openDoarId || !!this.dataProviderInfo.r3DataId |
777 | 641 |
); |
778 | 642 |
} |
779 |
|
|
780 |
// public numberOfTabs(): number { |
|
781 |
// if(this.tabsAreInitialized) { |
|
782 |
// return this._numberOfTabs; |
|
783 |
// } |
|
784 |
// |
|
785 |
// // if(!this.dataProviderInfo || !this.aggregationStatusIsInitialized |
|
786 |
// // || this.fetchProjects.searchUtils.status == this.errorCodes.LOADING |
|
787 |
// // || this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING |
|
788 |
// // || this.fetchPublications.searchUtils.status == this.errorCodes.LOADING |
|
789 |
// // || this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING |
|
790 |
// // || this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING |
|
791 |
// // || this.fetchOrps.searchUtils.status == this.errorCodes.LOADING) { |
|
792 |
// // return 0; |
|
793 |
// // } |
|
794 |
// |
|
795 |
// if(this.dataProviderInfo |
|
796 |
// && this.fetchProjects.searchUtils.status != this.errorCodes.LOADING |
|
797 |
// && this.fetchDataproviders.searchUtils.status != this.errorCodes.LOADING |
|
798 |
// && this.fetchPublications.searchUtils.status != this.errorCodes.LOADING |
|
799 |
// && this.fetchDatasets.searchUtils.status != this.errorCodes.LOADING |
|
800 |
// && this.fetchSoftware.searchUtils.status != this.errorCodes.LOADING |
|
801 |
// && this.fetchOrps.searchUtils.status != this.errorCodes.LOADING) { |
|
802 |
// this.tabsAreInitialized = true; |
|
803 |
// } |
|
804 |
// |
|
805 |
// this._numberOfTabs = 0; |
|
806 |
// //if (this.hasPrimaryInfo || this.hasSecondaryInfo) { |
|
807 |
// this.firstTab = "summary"; |
|
808 |
// this._numberOfTabs++; |
|
809 |
// //} |
|
810 |
// if(this.fetchProjects.searchUtils.totalResults > 0) { |
|
811 |
// /*if( this._numberOfTabs == 0) { |
|
812 |
// this.firstTab = "projects"; |
|
813 |
// this.searchProjects(1, this.searchNumber); |
|
814 |
// }*/ |
|
815 |
// this._numberOfTabs++; |
|
816 |
// } |
|
817 |
// if(this.fetchDataproviders.searchUtils.totalResults > 0) { |
|
818 |
// /*if( this._numberOfTabs == 0) { |
|
819 |
// this.firstTab = "datasources"; |
|
820 |
// this.searchDatasources(1, this.searchNumber); |
|
821 |
// }*/ |
|
822 |
// this._numberOfTabs++; |
|
823 |
// } |
|
824 |
// if(this.fetchPublications.searchUtils.totalResults > 0 || this.fetchDatasets.searchUtils.totalResults > 0 |
|
825 |
// || this.fetchSoftware.searchUtils.totalResults > 0 || this.fetchOrps.searchUtils.totalResults > 0) { |
|
826 |
// /*if( this._numberOfTabs == 0) { |
|
827 |
// this.firstTab = "relatedDatasources"; |
|
828 |
// this.searchRelatedDatasources(1, this.searchNumber); |
|
829 |
// }*/ |
|
830 |
// this._numberOfTabs += 2; |
|
831 |
// |
|
832 |
// if(this.fetchPublications.searchUtils.totalResults > 0) { |
|
833 |
// this._numberOfTabs++; |
|
834 |
// } |
|
835 |
// if(this.fetchDatasets.searchUtils.totalResults > 0) { |
|
836 |
// this._numberOfTabs++; |
|
837 |
// } |
|
838 |
// if(this.fetchSoftware.searchUtils.totalResults > 0) { |
|
839 |
// this._numberOfTabs++; |
|
840 |
// } |
|
841 |
// if(this.fetchOrps.searchUtils.totalResults > 0) { |
|
842 |
// this._numberOfTabs++; |
|
843 |
// } |
|
844 |
// } |
|
845 |
// //this.activeTab = this.firstTab; |
|
846 |
// //this.tabsAreInitialized = true; |
|
847 |
// return this._numberOfTabs; |
|
848 |
// } |
|
643 |
|
|
849 | 644 |
} |
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())