Revision 58676
Added by Konstantina Galouni almost 4 years ago
community.component.ts | ||
---|---|---|
78 | 78 |
@ViewChild(StatisticsForDashboardComponent) statistics: StatisticsForDashboardComponent = null; |
79 | 79 |
public activeTab = "summary"; |
80 | 80 |
public show: string = 'overview'; |
81 |
public analyticsActiveTab = ""; |
|
81 | 82 |
|
82 | 83 |
searchLinkToResults: string = null; |
83 | 84 |
|
... | ... | |
473 | 474 |
public countSubscribersEvent($event){ |
474 | 475 |
this.subscribers = $event.value; |
475 | 476 |
} |
477 |
|
|
478 |
public checkStatistics(type: string) { |
|
479 |
// if(this.isEntityEnabled(type) |
|
480 |
// && this.statistics && this.statistics.statisticsDisplay && this.statistics.statisticsDisplay.isActive |
|
481 |
// && this.statistics.statisticsSum && this.statistics.statisticsSum[type].total>0 |
|
482 |
// && |
|
483 |
// ( this.statistics.statisticsDisplay.entities[type].numbers.map['total']['showInMonitor'] |
|
484 |
// || this.statistics.statisticsDisplay.entities[type].numbers.map['project']['showInMonitor'] |
|
485 |
// || this.statistics.statisticsDisplay.entities[type].numbers.map['open']['showInMonitor'] |
|
486 |
// || this.statistics.statisticsDisplay.entities[type].numbers.map['closed']['showInMonitor'] |
|
487 |
// || this.statistics.statisticsDisplay.entities[type].numbers.map['embargo']['showInMonitor'] |
|
488 |
// || this.statistics.statisticsDisplay.entities[type].numbers.map['restricted']['showInMonitor'] |
|
489 |
// || ( this.statistics.allowedEntitiesMode['showInMonitor'] && this.statistics.statisticsSum |
|
490 |
// && this.statistics.allowedChartsMode['showInMonitor'] && this.statistics.statisticsSum[type] |
|
491 |
// && this.statistics.allowedChartsMode['showInMonitor'][type] && this.statistics.statisticsSum[type].total > 0 |
|
492 |
// && this.statistics.allowedChartsMode['showInMonitor'][type].length > 0))) { |
|
493 |
// return true; |
|
494 |
// } else { |
|
495 |
// return false; |
|
496 |
// } |
|
497 |
if(this.isEntityEnabled(type) |
|
498 |
&& this.statistics && this.statistics.statisticsDisplay && this.statistics.statisticsDisplay.isActive |
|
499 |
&& this.statistics.statisticsSum && this.statistics.statisticsSum[type] && this.statistics.statisticsSum[type].total>0 |
|
500 |
&& |
|
501 |
( this.statistics.statisticsDisplay.entities[type].numbers.map['total']['showInMonitor'] |
|
502 |
|| this.statistics.statisticsDisplay.entities[type].numbers.map['project']['showInMonitor'] |
|
503 |
|| this.statistics.statisticsDisplay.entities[type].numbers.map['open']['showInMonitor'] |
|
504 |
|| this.statistics.statisticsDisplay.entities[type].numbers.map['closed']['showInMonitor'] |
|
505 |
|| this.statistics.statisticsDisplay.entities[type].numbers.map['embargo']['showInMonitor'] |
|
506 |
|| this.statistics.statisticsDisplay.entities[type].numbers.map['restricted']['showInMonitor'] |
|
507 |
|| ( this.statistics.allowedEntitiesMode['showInMonitor'] |
|
508 |
&& this.statistics.allowedChartsMode['showInMonitor'][type] |
|
509 |
&& this.statistics.allowedChartsMode['showInMonitor'][type].length > 0))) { |
|
510 |
return true; |
|
511 |
} else { |
|
512 |
return false; |
|
513 |
} |
|
514 |
} |
|
515 |
|
|
516 |
public initializeAnalyticsActiveTab() { |
|
517 |
if(!this.analyticsActiveTab) { |
|
518 |
if(this.checkStatistics("publication")) { |
|
519 |
this.analyticsActiveTab = "publication"; |
|
520 |
} else if(this.checkStatistics("dataset")) { |
|
521 |
this.analyticsActiveTab = "dataset"; |
|
522 |
} else if(this.checkStatistics("software")) { |
|
523 |
this.analyticsActiveTab = "software"; |
|
524 |
} else if(this.checkStatistics("orp")) { |
|
525 |
this.analyticsActiveTab = "orp"; |
|
526 |
} |
|
527 |
} |
|
528 |
} |
|
529 |
|
|
530 |
public showAnalyticsTab() { |
|
531 |
this.initializeAnalyticsActiveTab(); |
|
532 |
if(!this.analyticsActiveTab) { |
|
533 |
return false; |
|
534 |
} else { |
|
535 |
return true; |
|
536 |
} |
|
537 |
} |
|
476 | 538 |
} |
Also available in: Unified diff
[Trunk | Connect]:
1. assets/connect-assets/home/entities: svg files added for entity types in community first page.
2. connect-custom.css: Classes added for icons in entity types in community first page.
3. community.component: Analytics tab redesigned - entity tabs added & charts in cards.