message 'There are no XXX' renamed to 'No XXX available' | Project landing: organizations legalname also parsed and if both legalshortname and legalname exist, legalname is dispayed in tooltip | in search results and basic info of landing pages: organizations renamed to organization (same for all in plural) | organization component: projects tab: more than one checkboxes (funders) can be chosen | showTitle: on init every time parameter of url changes | metrics: cards changed to tiles and messages not only for publications, explanation added as uk-article-meta | dataprovider.component: commented code for proper subscriptions

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@48781 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-07-28 07:39:42 +00:00
parent ce90988310
commit 74dc21a1a9
28 changed files with 254 additions and 121 deletions

View File

@ -249,7 +249,7 @@ export class DepositResultComponent {
organizationSelected(id: string) { organizationSelected(id: string) {
console.info("organization selected"); console.info("organization selected");
if(id && id.length > 0){ if(id && id.length > 0 && id != this.organizationId){
this.organization = null; this.organization = null;
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;

View File

@ -172,10 +172,10 @@
<!-- *ngIf=" tab.content=='statisticsTab' && statsClicked"--> <!-- *ngIf=" tab.content=='statisticsTab' && statsClicked"-->
<div *ngIf="activeTab=='Statistics' && statsClicked"> <div *ngIf="activeTab=='Statistics' && statsClicked">
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary"> <!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
There are no statistics No statistics available
</div--> </div-->
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE" <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no statistics</div> class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR" <div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR"
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
@ -210,8 +210,10 @@
</div> </div>
<!--*ngIf=" tab.content=='metricsTab'"--> <!--*ngIf=" tab.content=='metricsTab'"-->
<!--[name]="dataProviderInfo.title['name']"-->
<metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews" <metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"
[id]="datasourceId" [type]="'datasources'" [name]="dataProviderInfo.title['name']" (metricsResults)="metricsResults($event)"> [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
(metricsResults)="metricsResults($event)">
</metrics> </metrics>
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0" <i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">

View File

@ -16,6 +16,9 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
import {RouterHelper} from '../../utils/routerHelper.class'; import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service'; import {PiwikService} from '../../utils/piwik/piwik.service';
import 'rxjs/add/operator/switch';
import 'rxjs/add/operator/switchMap';
@Component({ @Component({
selector: 'dataprovider', selector: 'dataprovider',
templateUrl: 'dataProvider.component.html', templateUrl: 'dataProvider.component.html',
@ -23,6 +26,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
export class DataProviderComponent { export class DataProviderComponent {
sub1: any;// = new Observable<DataProviderInfo>();
sub: any; sub: any;
piwiksub: any; piwiksub: any;
datasourceId: string; datasourceId: string;
@ -98,27 +102,73 @@ export class DataProviderComponent {
ngOnInit() { ngOnInit() {
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
this.updateTitle("Content provider"); this.updateTitle("Content provider");
this.updateDescription("Content provider, search, repositories, open access"); this.updateDescription("Content provider, search, repositories, open access");
this.datasourceId = data['datasourceId']; this.datasourceId = data['datasourceId'];
if(this.datasourceId){ if(this.datasourceId){
this.getDataProviderInfo(this.datasourceId); this.getDataProviderInfo(this.datasourceId);
}else{ }else{
// console.info("Content Provider id not found"); // console.info("Content Provider id not found");
} }
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView(); this.element.nativeElement.scrollIntoView();
} }
}); });
} }
/*
ngOnInit(): void {
console.info("On Init");
//this.route.paramMap
this.route.queryParams
.do(params => console.info("param changed"))
.do((params) => this.datasourceId = params['datasourceId'])
.do(params => console.info("aaa "+this.datasourceId))
.switchMap((params) => this._dataproviderService.getDataproviderInfo(params['datasourceId']))
.do(
(data: DataProviderInfo) => {
this.dataProviderInfo = data;
console.info(this.dataProviderInfo);
this.initTabs();
this.showTabs = true ;
this.updateTitle(this.dataProviderInfo.title.name);
this.updateDescription("Content provider, search, repositories, open access,"+this.dataProviderInfo.title.name);
// if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
// this.piwiksub = this._piwikService.trackView(this.dataProviderInfo.title.name).subscribe();
// }
this.showLoading = false;
if(this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.activeTab = this.dataProviderInfo.tabs[0].name;
}
console.info("all good");
},
(err) => {
console.log(err)
// console.info("error");
this.errorMessage = 'No dataProvider found';
this.showLoading = false;
}
)
.mergeMap((data: DataProviderInfo) => (OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined'))
? this._piwikService.trackView(data.title.name)
: Observable.of<null>()
)
.subscribe();
}
*/
ngOnDestroy() { ngOnDestroy() {
this.sub.unsubscribe(); //this.sub.unsubscribe();
if(this.piwiksub){ if(this.piwiksub){
this.piwiksub.unsubscribe(); this.piwiksub.unsubscribe();
} }
if(this.sub1) {
this.sub1.unsubscribe();
}
} }
getDataProviderInfo(id:string) { getDataProviderInfo(id:string) {
this.warningMessage = ''; this.warningMessage = '';
@ -130,7 +180,7 @@ export class DataProviderComponent {
this.showLoading = false; this.showLoading = false;
this.warningMessage="No valid datasource id"; this.warningMessage="No valid datasource id";
}else{ }else{
this._dataproviderService.getDataproviderInfo(this.datasourceId).subscribe( this.sub1 = this._dataproviderService.getDataproviderInfo(this.datasourceId).subscribe(
data => { data => {
this.dataProviderInfo = data; this.dataProviderInfo = data;
this.initTabs(); this.initTabs();

View File

@ -6,13 +6,12 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
@Component({ @Component({
selector: 'datasetsTab', selector: 'datasetsTab',
template: ` template: `
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no research data</div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No research data available</div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert"> <!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
There are no research data No research data available
</div--> </div-->
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0"> <div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
@ -24,7 +23,7 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
</div> </div>
<tab-result [(results)]="fetchDatasets.results" <tab-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.searchUtils.status" [(status)]= "fetchDatasets.searchUtils.status"
type="research data" urlParam="datasetId"> type="dataset" urlParam="datasetId">
</tab-result> </tab-result>
</div> </div>
` `

View File

@ -6,13 +6,13 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
@Component({ @Component({
selector: 'datasourcesTab', selector: 'datasourcesTab',
template: ` template: `
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no content providers</div> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No content providers available</div>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<!--div *ngIf="fetchDataproviders.searchUtils.totalResults == 0" class = "uk-alert"> <!--div *ngIf="fetchDataproviders.searchUtils.totalResults == 0" class = "uk-alert">
There are no content providers No content providers available
</div--> </div-->
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0"> <div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">

View File

@ -4,7 +4,7 @@ import {Component, Input} from '@angular/core';
selector: 'organizationsTab', selector: 'organizationsTab',
template: ` template: `
<div *ngIf=" !organizations || organizations.length == 0" class="uk-alert uk-alert-primary uk-animation-fade" role="alert"> <div *ngIf=" !organizations || organizations.length == 0" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">
There are no organizations No organizations available
</div> </div>
<div *ngIf=" organizations && organizations.length > 0"> <div *ngIf=" organizations && organizations.length > 0">

View File

@ -7,13 +7,13 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
@Component({ @Component({
selector: 'projectsTab', selector: 'projectsTab',
template: ` template: `
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no projects</div> <div *ngIf="fetchProjects.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No projects available</div>
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchProjects.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchProjects.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchProjects.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<!--div *ngIf="fetchProjects.searchUtils.totalResults == 0" class = "uk-alert"> <!--div *ngIf="fetchProjects.searchUtils.totalResults == 0" class = "uk-alert">
There are no projects No projects available
</div--> </div-->
<div *ngIf="fetchProjects.searchUtils.totalResults > 0"> <div *ngIf="fetchProjects.searchUtils.totalResults > 0">

View File

@ -6,13 +6,13 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
@Component({ @Component({
selector: 'publicationsTab', selector: 'publicationsTab',
template: ` template: `
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no publications</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No publications available</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert"> <!--div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert">
There are no publications No publications available
</div--> </div-->
<div *ngIf="fetchPublications.searchUtils.totalResults > 0"> <div *ngIf="fetchPublications.searchUtils.totalResults > 0">

View File

@ -9,13 +9,13 @@ import {RouterHelper} from '../../utils/routerHelper.class';
@Component({ @Component({
selector: 'relatedDatasourcesTab', selector: 'relatedDatasourcesTab',
template: ` template: `
<div *ngIf="fetchResults.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no related content providers</div> <div *ngIf="fetchResults.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No related content providers available</div>
<div *ngIf="fetchResults.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchResults.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchResults.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchResults.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchResults.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchResults.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<!--div *ngIf="fetchResults.results.length == 0" class = "uk-alert"> <!--div *ngIf="fetchResults.results.length == 0" class = "uk-alert">
There are no related content providers No related content providers available
</div--> </div-->
<div *ngIf="fetchResults.results.length > 0"> <div *ngIf="fetchResults.results.length > 0">

View File

@ -8,7 +8,7 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
template: ` template: `
<div *ngIf="show"> <div *ngIf="show">
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.NONE && DatasetsComponent.searchUtils.status == errorCodes.NONE" <div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.NONE && DatasetsComponent.searchUtils.status == errorCodes.NONE"
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no statistics</div> class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.ERROR || DatasetsComponent.searchUtils.status == errorCodes.ERROR" <div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.ERROR || DatasetsComponent.searchUtils.status == errorCodes.ERROR"
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.NOT_AVAILABLE || DatasetsComponent.searchUtils.status == errorCodes.NOT_AVAILABLE" <div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.NOT_AVAILABLE || DatasetsComponent.searchUtils.status == errorCodes.NOT_AVAILABLE"
@ -17,7 +17,7 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<!--div *ngIf="searchPublicationsComponent.searchUtils.totalResults == 0 && searchDatasetsComponent.searchUtils.totalResults == 0" class = "uk-alert"> <!--div *ngIf="searchPublicationsComponent.searchUtils.totalResults == 0 && searchDatasetsComponent.searchUtils.totalResults == 0" class = "uk-alert">
There are no statistics No statistics available
</div--> </div-->
<div *ngIf="searchPublicationsComponent.searchUtils.totalResults != 0 || searchDatasetsComponent.searchUtils.totalResults != 0"> <div *ngIf="searchPublicationsComponent.searchUtils.totalResults != 0 || searchDatasetsComponent.searchUtils.totalResults != 0">
<p class="uk-text-bold">Latest Documents Timeline</p> <p class="uk-text-bold">Latest Documents Timeline</p>

View File

@ -81,7 +81,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<div *ngIf=" tab.content=='statisticsTab' && statsClicked"> <div *ngIf=" tab.content=='statisticsTab' && statsClicked">
<div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert"> <div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
There are no statistics No statistics available
</div> </div>
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)"> <div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
<p class="uk-text-bold">Latest Documents Timeline</p> <p class="uk-text-bold">Latest Documents Timeline</p>
@ -109,7 +109,9 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</div> </div>
<metrics *ngIf=" tab.content=='metricsTab' && metricsClicked" <metrics *ngIf=" tab.content=='metricsTab' && metricsClicked"
[id]="id" [type]="'datasources'" [name]="name" (metricsResults)="metricsResults($event)"> [id]="id" [entityType]="'datasources'" [entity]="'content provider'"
[name]="name"
(metricsResults)="metricsResults($event)">
</metrics> </metrics>
<i-frame *ngIf=" tab.content=='metricsTab' && metricsClicked && totalViews > 0" <i-frame *ngIf=" tab.content=='metricsTab' && metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">

View File

@ -131,7 +131,7 @@
<div class="uk-margin custom-tab-content"> <div class="uk-margin custom-tab-content">
<div *ngIf="activeTab=='Related Research Results'" class="uk-animation-fade"> <div *ngIf="activeTab=='Related Research Results'" class="uk-animation-fade">
<div *ngIf="!datasetInfo.relatedResearchResults" class = "uk-alert uk-alert-primary" > <div *ngIf="!datasetInfo.relatedResearchResults" class = "uk-alert uk-alert-primary" >
There are no related research results No related research results available
</div> </div>
<div *ngIf="datasetInfo.relatedResearchResults"> <div *ngIf="datasetInfo.relatedResearchResults">
<div *ngFor="let provenanceaction of datasetInfo.relatedResearchResults.keys()"> <div *ngFor="let provenanceaction of datasetInfo.relatedResearchResults.keys()">
@ -144,7 +144,7 @@
<div *ngIf="activeTab=='Similar Research Results'" class="uk-animation-fade"> <div *ngIf="activeTab=='Similar Research Results'" class="uk-animation-fade">
<div *ngIf="!datasetInfo.similarResearchResults" class = "uk-alert uk-alert-primary" > <div *ngIf="!datasetInfo.similarResearchResults" class = "uk-alert uk-alert-primary" >
There are no similar research results No similar research results available
</div> </div>
<div *ngIf="datasetInfo.similarResearchResults"> <div *ngIf="datasetInfo.similarResearchResults">
<tabTable [info]="datasetInfo.similarResearchResults"></tabTable> <tabTable [info]="datasetInfo.similarResearchResults"></tabTable>
@ -153,7 +153,8 @@
<div *ngIf="activeTab=='Metrics'" class="uk-animation-fade"> <div *ngIf="activeTab=='Metrics'" class="uk-animation-fade">
<!-- Page Views: {{pageViews}} --> <!-- Page Views: {{pageViews}} -->
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="datasetId" [type]="'results'" (metricsResults)="metricsResults($event)"> [id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
(metricsResults)="metricsResults($event)">
</metrics> </metrics>
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"
[url]=viewsFrameUrl width="100%" height="250"> [url]=viewsFrameUrl width="100%" height="250">

View File

@ -319,7 +319,9 @@ export class ParsingFunctions {
researchResult['id'] = relation['to'].content; researchResult['id'] = relation['to'].content;
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : relation['title'].content; let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : relation['title'].content;
researchResult['name'] = titleName; researchResult['name'] = titleName;
researchResult['date'] = relation.dateofacceptance.substring(0,4);; var date:string = ((Array.isArray(relation.dateofacceptance))?(relation.dateofacceptance[0]):(relation.dateofacceptance))+""; // transform to string in case it is an integer
researchResult['date'] = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
//researchResult['date'] = relation.dateofacceptance.substring(0,4);;
researchResult['trust'] = Math.round(relation.trust*100); researchResult['trust'] = Math.round(relation.trust*100);
return researchResult; return researchResult;
} }

View File

@ -3,6 +3,7 @@
import { NgModule} from '@angular/core'; import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import {TabPagingComponent} from './tabPaging.component'; import {TabPagingComponent} from './tabPaging.component';
import {ShowTitleComponent} from './showTitle.component'; import {ShowTitleComponent} from './showTitle.component';
@ -12,7 +13,7 @@ import {PreviousRouteRecorder} from'../utils/piwik/previousRouteRecorder.guard';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, PiwikServiceModule CommonModule, FormsModule, RouterModule, PiwikServiceModule
], ],
declarations: [ declarations: [
TabPagingComponent, ShowTitleComponent, AddThisComponent TabPagingComponent, ShowTitleComponent, AddThisComponent

View File

@ -3,6 +3,8 @@ import {Metrics} from '../utils/entities/metrics';
import {MetricsService } from '../services/metrics.service'; import {MetricsService } from '../services/metrics.service';
import {ErrorCodes} from '../utils/properties/openaireProperties'; import {ErrorCodes} from '../utils/properties/openaireProperties';
import { Subscription } from 'rxjs/Subscription';
@Component({ @Component({
selector: 'metrics', selector: 'metrics',
template: ` template: `
@ -30,7 +32,7 @@ import {ErrorCodes} from '../utils/properties/openaireProperties';
<div *ngIf="status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div> <div *ngIf="status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div *ngIf="metrics != undefined" class="uk-child-width-1-3@m uk-grid-small uk-grid-match uk-grid" uk-grid=""> <div *ngIf="metrics != undefined" class="uk-child-width-1-3@m uk-grid-small uk-grid-match uk-grid" uk-grid="">
<div class="uk-first-column"> <div class="uk-first-column">
<div class="uk-card uk-card-default uk-padding-small"> <div class="uk-tile uk-tile-default uk-padding-small">
<!--div class="uk-clearfix"> <!--div class="uk-clearfix">
<div class="uk-float-left " uk-tooltip="pos:right; delay:5" <div class="uk-float-left " uk-tooltip="pos:right; delay:5"
title='<div class= "uk-margin uk-padding-small"> title='<div class= "uk-margin uk-padding-small">
@ -40,12 +42,15 @@ import {ErrorCodes} from '../utils/properties/openaireProperties';
</span> </span>
</div> </div>
</div--> </div-->
<div class="uk-text-center">Page Views</div> <div *ngIf="entityType=='results'" class="uk-text-center">Page views</div>
<div *ngIf="entityType!='results'" class="uk-text-center">Research results page views</div>
<div class="uk-text-center">{{pageViews}}</div> <div class="uk-text-center">{{pageViews}}</div>
<p class="uk-article-meta uk-margin-top">Research results page views in OpenAIRE</p>
</div> </div>
</div> </div>
<div> <div>
<div class="uk-card uk-card-default uk-padding-small"> <div class="uk-tile uk-tile-muted uk-padding-small">
<!--div class="uk-clearfix"> <!--div class="uk-clearfix">
<div class="uk-float-left " uk-tooltip="pos:right; delay:5" <div class="uk-float-left " uk-tooltip="pos:right; delay:5"
title='<div class= "uk-margin uk-padding-small"> title='<div class= "uk-margin uk-padding-small">
@ -55,18 +60,36 @@ import {ErrorCodes} from '../utils/properties/openaireProperties';
</span> </span>
</div> </div>
</div--> </div-->
<div *ngIf="type=='results'" class="uk-text-center">Total views</div> <div *ngIf="entityType=='results'" class="uk-text-center">Total views</div>
<div *ngIf="type!='results'" class="uk-text-center"> Total <span [innerHTML]="name"></span> Publication Views</div> <div *ngIf="entityType!='results'" class="uk-text-center"> Total research results views</div>
<!--div *ngIf="type!='results'" class="uk-text-center"> Total <span [innerHTML]="name"></span> Research Results Views</div-->
<div class="uk-text-center"> {{metrics.totalViews}} <div class="uk-text-center"> {{metrics.totalViews}}
<span *ngIf="metrics.totalViews > 0 && metrics.totalOpenaireViews > 0"> <span *ngIf="metrics.totalViews > 0 && metrics.totalOpenaireViews > 0">
( {{metrics.totalOpenaireViews}} from OpenAIRE ) ( {{metrics.totalOpenaireViews}} from OpenAIRE )
</span></div> </span></div>
<div class="uk-margin-top uk-article-meta">
<div *ngIf="entityType == 'projects'">
Research results page views in Repositories
</div>
<div *ngIf="entityType == 'datasources'">
Research results page views in Repository
</div>
<div *ngIf="entityType == 'results'">
Publication page views in Repositories
</div>
<div *ngIf="entityType!='datasources' && metrics.totalOpenaireViews > 0">
Of the {{metrics.totalViews}} views, repositories accessed {{metrics.totalOpenaireViews}} times from OpenAIRE
</div>
<div *ngIf="entityType=='datasources' && metrics.totalOpenaireViews > 0">
Of the {{metrics.totalViews}} views, repository accessed {{metrics.totalOpenaireViews}} times from OpenAIRE
</div>
</div>
</div> </div>
</div> </div>
<div> <div>
<div class="uk-card uk-card-default uk-padding-small"> <div class="uk-tile uk-tile-primary uk-padding-small">
<!--div class="uk-clearfix"> <!--div class="uk-clearfix">
<div class="uk-float-left " uk-tooltip="pos:right; delay:5" <div class="uk-float-left " uk-tooltip="pos:right; delay:5"
title='<div class= "uk-margin uk-padding-small"> title='<div class= "uk-margin uk-padding-small">
@ -76,14 +99,33 @@ import {ErrorCodes} from '../utils/properties/openaireProperties';
</span> </span>
</div> </div>
</div--> </div-->
<div *ngIf="type=='results'" class="uk-text-center">Total Downloads</div> <div *ngIf="entityType=='results'" class="uk-text-center">Total downloads</div>
<div *ngIf="type!='results'" class="uk-text-center">Total <span [innerHTML]="name"></span> Publication Downloads</div> <div *ngIf="entityType!='results'" class="uk-text-center"> Total research results downloads</div>
<!--div *ngIf="type!='results'" class="uk-text-center">Total <span [innerHTML]="name"></span> Research Results Downloads</div-->
<div class="uk-text-center"> {{metrics.totalDownloads}} <div class="uk-text-center"> {{metrics.totalDownloads}}
<span *ngIf="metrics.totalDownloads > 0 && metrics.totalOpenaireDownloads > 0"> <span *ngIf="metrics.totalDownloads > 0 && metrics.totalOpenaireDownloads > 0">
( {{metrics.totalOpenaireDownloads}} from OpenAIRE ) ( {{metrics.totalOpenaireDownloads}} from OpenAIRE )
</span></div> </span></div>
<div class="uk-margin-top uk-article-meta">
<div *ngIf="entityType == 'projects'">
Research results page downloads in Repositories
</div>
<div *ngIf="entityType == 'datasources'">
Research results page downloads in Repository
</div>
<div *ngIf="entityType == 'results'">
Publication page downloads in Repositories
</div>
<div *ngIf="entityType!='datasources' && metrics.totalOpenaireDownloads > 0">
Of the {{metrics.totalDownloads}} downloads, repositories accessed {{metrics.totalOpenaireDownloads}} times from OpenAIRE
</div>
<div *ngIf="entityType=='datasources' && metrics.totalOpenaireDownloads > 0">
Of the {{metrics.totalDownloads}} downloads, repository accessed {{metrics.totalOpenaireDownloads}} times from OpenAIRE
</div>
</div>
</div> </div>
</div> </div>
@ -127,12 +169,14 @@ import {ErrorCodes} from '../utils/properties/openaireProperties';
export class MetricsComponent { export class MetricsComponent {
@Output() metricsResults = new EventEmitter(); @Output() metricsResults = new EventEmitter();
@Input() id: string; @Input() id: string;
@Input() type: string; @Input() entityType: string;
@Input() name: string = ""; @Input() entity: string;
//@Input() name: string = "";
@Input() pageViews: number = 0; @Input() pageViews: number = 0;
public metrics: Metrics; public metrics: Metrics;
public errorCodes:ErrorCodes; public errorCodes:ErrorCodes;
public status: number; public status: number;
private sub: Subscription;
constructor (private _metricsService: MetricsService) {} constructor (private _metricsService: MetricsService) {}
@ -142,6 +186,9 @@ export class MetricsComponent {
this.getMetrics(); this.getMetrics();
} }
ngOnDestroy() {
this.sub.unsubscribe();
}
getMetrics() { getMetrics() {
//if(this.id == undefined || this.id == "") { //if(this.id == undefined || this.id == "") {
@ -151,7 +198,7 @@ export class MetricsComponent {
// console.log("supplied id in metrics is not acceptable"); // console.log("supplied id in metrics is not acceptable");
//} //}
this._metricsService.getMetrics(this.id, this.type).subscribe( this.sub = this._metricsService.getMetrics(this.id, this.entityType).subscribe(
data => { data => {
this.metrics = data; this.metrics = data;
this.status = this.errorCodes.DONE; this.status = this.errorCodes.DONE;

View File

@ -85,7 +85,7 @@
<div class="uk-margin custom-tab-content"> <div class="uk-margin custom-tab-content">
<div *ngIf="activeTab=='Publications'" class="uk-animation-fade"> <div *ngIf="activeTab=='Publications'" class="uk-animation-fade">
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no publications</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No publications available</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
@ -110,10 +110,10 @@
<div *ngIf="activeTab=='Content Providers'" class="uk-animation-fade"> <div *ngIf="activeTab=='Content Providers'" class="uk-animation-fade">
<!--showDataProviders [dataProviders]="organizationInfo.dataProviders"></showDataProviders--> <!--showDataProviders [dataProviders]="organizationInfo.dataProviders"></showDataProviders-->
<!--div *ngIf="fetchDataproviders.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary"> <!--div *ngIf="fetchDataproviders.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
There are no content providers No content providers available
</div--> </div-->
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no content providers</div> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No content providers available</div>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>

View File

@ -28,18 +28,25 @@
<li *ngIf="projectInfo.startDate"><span class="uk-text-bold">Start Date:</span> {{projectInfo.startDate}}</li> <li *ngIf="projectInfo.startDate"><span class="uk-text-bold">Start Date:</span> {{projectInfo.startDate}}</li>
<li *ngIf="projectInfo.endDate"><span class="uk-text-bold">End Date:</span> {{projectInfo.endDate}}</li> <li *ngIf="projectInfo.endDate"><span class="uk-text-bold">End Date:</span> {{projectInfo.endDate}}</li>
<li *ngIf="projectInfo.openAccessMandate != undefined && !projectInfo.openAccessMandate "><span class="uk-text-bold">Open Access mandate:</span> no</li> <li *ngIf="projectInfo.openAccessMandate != undefined && !projectInfo.openAccessMandate "><span class="uk-text-bold">Open Access mandate:</span> no</li>
<li *ngIf="projectInfo.organizations && projectInfo.organizations.length > 0"><span class="uk-text-bold">Organizations:</span> <li *ngIf="projectInfo.organizations && projectInfo.organizations.length > 0"><span class="uk-text-bold">Organization:</span>
<span class="list-horizontal-line"> <span class="list-horizontal-line">
<span *ngFor="let organization of projectInfo.organizations let i=index"> <span *ngFor="let organization of projectInfo.organizations let i=index"
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name">
<!--
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name"
-->
<a *ngIf="organization.id" <a *ngIf="organization.id"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization"> [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
{{organization.name}}</a> <span *ngIf="organization.acronym">{{organization.acronym}}</span><span
<span *ngIf="!organization.acronym && organization.name">{{organization.name}}</span></a>
<span
*ngIf="!organization.id"> *ngIf="!organization.id">
{{organization.name}}</span> <span *ngIf="organization.acronym">{{organization.acronym}}</span><span
*ngIf="!organization.acronym && organization.name">{{organization.name}}</span></span>
</span> </span>
</span> </span>
</li> </li>
@ -136,9 +143,9 @@
<div *ngIf="activeTab=='Publications'" class="uk-animation-fade"> <div *ngIf="activeTab=='Publications'" class="uk-animation-fade">
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary" > <!--div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary" >
There are no publications No publications available
</div--> </div-->
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no publications</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No publications available</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
@ -160,9 +167,9 @@
<div *ngIf="activeTab == 'Research Data'" class="uk-animation-fade"> <div *ngIf="activeTab == 'Research Data'" class="uk-animation-fade">
<!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary"> <!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
There are no research data No research data available
</div--> </div-->
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no research data</div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No research data available</div>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
@ -178,16 +185,16 @@
</div> </div>
<tab-result [(results)]="fetchDatasets.results" <tab-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.searchUtils.status" [(status)]= "fetchDatasets.searchUtils.status"
type="research data" urlParam="datasetId"> type="dataset" urlParam="datasetId">
</tab-result> </tab-result>
</div> </div>
</div> </div>
<div *ngIf="activeTab == 'Statistics'" class="uk-animation-fade"> <div *ngIf="activeTab == 'Statistics'" class="uk-animation-fade">
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary"> <!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
There are no statistics No statistics available
</div--> </div-->
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE" <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no statistics</div> class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR" <div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR"
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
@ -209,8 +216,10 @@
</div> </div>
<div *ngIf="activeTab=='Metrics'" class="uk-animation-fade"> <div *ngIf="activeTab=='Metrics'" class="uk-animation-fade">
<!--[name]="projectName"-->
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="projectId" [type]="'projects'" [name]="projectName" (metricsResults)="metricsResults($event)"> [id]="projectId" [enitityType]="'projects'" [entity]="'Project'"
(metricsResults)="metricsResults($event)">
</metrics> </metrics>
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="800" height="350"></i-frame--> <!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="800" height="350"></i-frame-->
<i-frame *ngIf="metricsClicked && totalViews > 0" <i-frame *ngIf="metricsClicked && totalViews > 0"

View File

@ -162,38 +162,45 @@ export class ProjectService {
if(data[2] != null) { if(data[2] != null) {
this.projectInfo.organizations = [];//new Map<string, string>(); this.projectInfo.organizations = [];//new Map<string, string>();
let name = ""; let acronym: string = "";
let id = ""; let name: string = "";
let id: string = "";
if(!Array.isArray(data[2])) { if(!Array.isArray(data[2])) {
if(data[2].hasOwnProperty("legalshortname")) { if(data[2].hasOwnProperty("legalshortname")) {
name = data[2].legalshortname; acronym = data[2].legalshortname;
} else if(data[2].hasOwnProperty("legalname")) { }
name = data[2].legalname; if(data[2].hasOwnProperty("legalname")) {
name = data[2].legalname;
}
if(!acronym && !name){
// acronym is displayed with link and name only in tooltip
acronym = "[no title available]";
} }
if(data[2].hasOwnProperty("to") && name != "") { if(data[2].hasOwnProperty("to")) {
id = data[2]['to'].content; id = data[2]['to'].content;
} }
if(name != "") {
this.projectInfo.organizations.push({"name": name, "id": id}); this.projectInfo.organizations.push({"acronym": acronym, "name": name, "id": id});
}
} else { } else {
for(let i=0; i<data[2].length; i++) { for(let i=0; i<data[2].length; i++) {
if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class == "hasParticipant") { if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class == "hasParticipant") {
if(data[2][i].hasOwnProperty("legalshortname")) { if(data[2][i].hasOwnProperty("legalshortname")) {
name = data[2][i].legalshortname; acronym = data[2][i].legalshortname;
} else if(data[2][i].hasOwnProperty("legalname")) { }
name = data[2][i].legalname; if(data[2][i].hasOwnProperty("legalname")) {
name = data[2][i].legalname;
}
if(!acronym && !name){
acronym = "[no title available]";
} }
if(data[2][i].hasOwnProperty("to") && name!="") { if(data[2][i].hasOwnProperty("to")) {
id = /*OpenaireProperties.getsearchLinkToOrganization()+*/data[2][i]['to'].content; id = data[2][i]['to'].content;
} }
if(name != "") { this.projectInfo.organizations.push({"acronym": acronym, "name": name, "id": id});
this.projectInfo.organizations.push({"name": name, "id": id});
}
} }
} }
} }

View File

@ -233,7 +233,7 @@
<div class="uk-margin custom-tab-content"> <div class="uk-margin custom-tab-content">
<div *ngIf="activeTab == 'References'" class="uk-animation-fade"> <div *ngIf="activeTab == 'References'" class="uk-animation-fade">
<div *ngIf="!publicationInfo.references" class = "uk-alert uk-alert-primary" > <div *ngIf="!publicationInfo.references" class = "uk-alert uk-alert-primary" >
There are no references No references available
</div> </div>
<div *ngIf="publicationInfo.references"> <div *ngIf="publicationInfo.references">
@ -277,7 +277,7 @@
<div *ngIf="activeTab == 'Related Research Results'" class="uk-animation-fade"> <div *ngIf="activeTab == 'Related Research Results'" class="uk-animation-fade">
<div *ngIf="!publicationInfo.relatedResearchResults" class = "uk-alert uk-alert-primary"> <div *ngIf="!publicationInfo.relatedResearchResults" class = "uk-alert uk-alert-primary">
There are no related research results No related research results available
</div> </div>
<div *ngIf="publicationInfo.relatedResearchResults"> <div *ngIf="publicationInfo.relatedResearchResults">
<div *ngFor="let provenanceaction of publicationInfo.relatedResearchResults.keys()"> <div *ngFor="let provenanceaction of publicationInfo.relatedResearchResults.keys()">
@ -291,7 +291,7 @@
<div *ngIf="activeTab == 'Similar Research Results'" class="uk-animation-fade"> <div *ngIf="activeTab == 'Similar Research Results'" class="uk-animation-fade">
<div *ngIf="!publicationInfo.similarResearchResults" class = "uk-alert uk-alert-primary"> <div *ngIf="!publicationInfo.similarResearchResults" class = "uk-alert uk-alert-primary">
There are no similar research results No similar research results available
</div> </div>
<div *ngIf="publicationInfo.similarResearchResults"> <div *ngIf="publicationInfo.similarResearchResults">
@ -301,7 +301,7 @@
<div *ngIf="activeTab == 'Related Organizations'" class="uk-animation-fade"> <div *ngIf="activeTab == 'Related Organizations'" class="uk-animation-fade">
<div *ngIf="!publicationInfo.organizations" class = "uk-alert uk-alert-primary"> <div *ngIf="!publicationInfo.organizations" class = "uk-alert uk-alert-primary">
There are no related organizations No related organizations available
</div> </div>
<div *ngIf="publicationInfo.organizations"> <div *ngIf="publicationInfo.organizations">
<div *ngIf="publicationInfo.organizations && publicationInfo.organizations.length > pageSize" class="uk-margin-bottom"> <div *ngIf="publicationInfo.organizations && publicationInfo.organizations.length > pageSize" class="uk-margin-bottom">
@ -416,7 +416,8 @@
<div *ngIf="activeTab == 'Metrics'" class="uk-animation-fade"> <div *ngIf="activeTab == 'Metrics'" class="uk-animation-fade">
<!-- Page Views: {{pageViews}} --> <!-- Page Views: {{pageViews}} -->
<metrics [pageViews]="pageViews" <metrics [pageViews]="pageViews"
[id]="articleId" [type]="'results'" (metricsResults)="metricsResults($event)"> [id]="articleId" [entityType]="'results'" [entity]="'Publication'"
(metricsResults)="metricsResults($event)">
</metrics> </metrics>
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame--> <!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame-->
<i-frame *ngIf="metricsClicked && totalViews>0" <i-frame *ngIf="metricsClicked && totalViews>0"

View File

@ -12,9 +12,9 @@ import {RouterHelper} from '../utils/routerHelper.class';
selector: 'searchingProjectsTab', selector: 'searchingProjectsTab',
template: ` template: `
<!--div *ngIf="fetchProjects.searchUtils.totalResults == 0" class = "uk-alert"> <!--div *ngIf="fetchProjects.searchUtils.totalResults == 0" class = "uk-alert">
There are no projects No projects available
</div--> </div-->
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">There are no projects</div> <div *ngIf="fetchProjects.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No projects available</div>
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="fetchProjects.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="fetchProjects.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div> <div *ngIf="fetchProjects.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
@ -34,7 +34,7 @@ import {RouterHelper} from '../utils/routerHelper.class';
</div> </div>
<ul *ngIf = "fetchProjects.funders.length > 1" class="uk-list uk-list-divider"> <ul *ngIf = "fetchProjects.funders.length > 1" class="uk-list uk-list-divider">
<li *ngFor="let filter of fetchProjects.filters " > <li *ngFor="let filter of fetchProjects.filters " >
<div class="text-bold">Filter by {{filter.title}}:</div> <!--div class="text-bold">Filter by {{filter.title}}:</div-->
<span *ngFor = "let value of filter.values" class = "uk-animation-fade"> <span *ngFor = "let value of filter.values" class = "uk-animation-fade">
<input [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" /> <input [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
<span title = "{{value.name}}"> {{value.name}}</span><span *ngIf = "showResultCount === true" > ({{value.number}})</span> <span title = "{{value.name}}"> {{value.name}}</span><span *ngIf = "showResultCount === true" > ({{value.number}})</span>
@ -93,7 +93,8 @@ export class SearchingProjectsTabComponent {
filterChange($event) { filterChange($event) {
console.log("Filter Changed"); console.log("Filter Changed");
this.updateFilters(); this.updateFilters();
this.search(true, this.filterQuery); //this.search(true, this.filterQuery);
this.search(false, this.filterQuery);
} }
updateFilters (){ updateFilters (){
@ -102,11 +103,14 @@ export class SearchingProjectsTabComponent {
var filterLimits=""; var filterLimits="";
for (let value of filter.values){ for (let value of filter.values){
if(value.selected == true){ if(value.selected == true){
filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(value.id)+'"'; //filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(value.id)+'"';
filterLimits+=((filterLimits.length == 0)?'':' or ')+filter.filterId+' exact ';
filterLimits+='"'+ StringUtils.URIEncode(value.id)+'"';
} }
} }
if(filterLimits.length > 0){ if(filterLimits.length > 0){
this.filterQuery+=' and '+filter.filterId + ' exact '+ filterLimits + ' '; //this.filterQuery+=' and '+filter.filterId + ' exact '+ filterLimits + ' ';
this.filterQuery+=' and ( ' + filterLimits + ' ) ';
} }
} }

View File

@ -8,7 +8,7 @@ import {Component, Input} from '@angular/core';
<div *ngIf="(subjects != undefined && subjects.length > 0) || <div *ngIf="(subjects != undefined && subjects.length > 0) ||
(otherSubjects != undefined && otherSubjects.size > 0) || (otherSubjects != undefined && otherSubjects.size > 0) ||
(classifiedSubjects != undefined && classifiedSubjects.size > 0)"> (classifiedSubjects != undefined && classifiedSubjects.size > 0)">
<span class="uk-text-bold">Subjects:</span> <span class="uk-text-bold">Subject:</span>
<span *ngIf="subjects != undefined && subjects.length > 0"> {{subjects.join(" | ")}} </span> <span *ngIf="subjects != undefined && subjects.length > 0"> {{subjects.join(" | ")}} </span>
<ul class="uk-list"> <ul class="uk-list">

View File

@ -1,5 +1,5 @@
import {Component, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
@Component({ @Component({
selector: 'showTitle', selector: 'showTitle',
@ -43,12 +43,21 @@ export class ShowTitleComponent {
@Input() title: { [key: string]: string }; @Input() title: { [key: string]: string };
@Input() iconClass:string; @Input() iconClass:string;
constructor () { constructor (private route: ActivatedRoute) {}
}
ngOnInit() { ngOnInit() {
if(this.title['accessMode'] == undefined) { this.route.queryParams.subscribe(
params => {
console.info("onInit showTitle");
if(this.title['accessMode'] == undefined) {
this.title['accessMode'] = ""; this.title['accessMode'] = "";
}
} }
);
}
ngOnDestroy() {
console.info("onDestroy showTitle");
} }
} }

View File

@ -45,7 +45,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<div *ngIf="result.country != undefined && result.country != ''">Country: {{result.country}}</div> <div *ngIf="result.country != undefined && result.country != ''">Country: {{result.country}}</div>
<div *ngIf="result['projects'] != undefined"> <div *ngIf="result['projects'] != undefined">
<span> Projects: </span> <span> Project: </span>
<span *ngFor="let project of result['projects'].slice(0,15) let i=index"> <span *ngFor="let project of result['projects'].slice(0,15) let i=index">
<!--a *ngIf="project.url != undefined" href="{{project.url}}"--> <!--a *ngIf="project.url != undefined" href="{{project.url}}"-->
<a *ngIf="project.id" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project"> <a *ngIf="project.id" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project">
@ -71,7 +71,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<div *ngIf="result['funders'] != undefined"> <div *ngIf="result['funders'] != undefined">
<span> Funders: </span> <span> Funder: </span>
<span *ngFor="let funder of result['funders'] let i=index"> <span *ngFor="let funder of result['funders'] let i=index">
<span *ngIf="funder.funderShortname"> <span *ngIf="funder.funderShortname">
@ -82,7 +82,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<span *ngIf="result.startYear && result.endYear"> (start {{result.startYear}} - end {{result.endYear}})</span> <span *ngIf="result.startYear && result.endYear"> (start {{result.startYear}} - end {{result.endYear}})</span>
</div> </div>
<div *ngIf="result['organizations'] != undefined && result['organizations'].length > 0"> <div *ngIf="result['organizations'] != undefined && result['organizations'].length > 0">
<span> Organizations: </span> <span> Organization: </span>
<span *ngFor="let organization of result['organizations'].slice(0,10) let i=index"> <span *ngFor="let organization of result['organizations'].slice(0,10) let i=index">
<!--a *ngIf="organization.url != undefined" href="{{organization.url}}"--> <!--a *ngIf="organization.url != undefined" href="{{organization.url}}"-->
<a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization"> <a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
@ -97,6 +97,9 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</div> </div>
<div *ngIf="result['type'] != undefined && result['type'] != ''">Type: {{result['type']}}</div> <div *ngIf="result['type'] != undefined && result['type'] != ''">Type: {{result['type']}}</div>
<div *ngIf="result['countries'] && result['countries'].length > 0">
Country: <span *ngFor="let country of result['countries'].slice(0,10) let i = index">{{country}}{{(i < ( result['countries'].slice(0,10).length-1))?", ":""}}{{(i == result['countries'].slice(0,10).length-1 && result['countries'].length > 10)?"...":""}}</span>
</div>
<div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''"> <div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''">
<span>Website URL: </span> <span>Website URL: </span>
<span> <span>
@ -118,11 +121,8 @@ import {RouterHelper} from '../../utils/routerHelper.class';
Compatibility: {{result.compatibility}} Compatibility: {{result.compatibility}}
</div> </div>
<div *ngIf="result['countries'] && result['countries'].length > 0">
Countries: <span *ngFor="let country of result['countries'].slice(0,10) let i = index">{{country}}{{(i < ( result['countries'].slice(0,10).length-1))?", ":""}}{{(i == result['countries'].slice(0,10).length-1 && result['countries'].length > 10)?"...":""}}</span>
</div>
<div *ngIf="showSubjects && result['subjects'] && result['subjects'].length > 0"> <div *ngIf="showSubjects && result['subjects'] && result['subjects'].length > 0">
Subjects: <span *ngFor="let subject of result['subjects'].slice(0,10) let i = index">{{subject}}{{(i < ( result['subjects'].slice(0,10).length-1))?", ":""}}{{(i == result['subjects'].slice(0,10).length-1 && result['subjects'].length > 10)?"...":""}}</span> Subject: <span *ngFor="let subject of result['subjects'].slice(0,10) let i = index">{{subject}}{{(i < ( result['subjects'].slice(0,10).length-1))?", ":""}}{{(i == result['subjects'].slice(0,10).length-1 && result['subjects'].length > 10)?"...":""}}</span>
</div> </div>

View File

@ -49,7 +49,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<div *ngIf="result.country != undefined && result.country != ''">Country: {{result.country}}</div> <div *ngIf="result.country != undefined && result.country != ''">Country: {{result.country}}</div>
<div *ngIf="result['projects'] != undefined"> <div *ngIf="result['projects'] != undefined">
<span> Projects: </span> <span> Project: </span>
<span *ngFor="let project of result['projects'].slice(0,15) let i=index"> <span *ngFor="let project of result['projects'].slice(0,15) let i=index">
<!--a *ngIf="project.url != undefined" href="{{project.url}}"--> <!--a *ngIf="project.url != undefined" href="{{project.url}}"-->
<a *ngIf="project.id" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project"> <a *ngIf="project.id" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project">
@ -86,7 +86,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</div> </div>
<div *ngIf="showOrganizations && result['organizations'] != undefined && result['organizations'].length > 0"> <div *ngIf="showOrganizations && result['organizations'] != undefined && result['organizations'].length > 0">
<span> Organizations: </span> <span> Organization: </span>
<span *ngFor="let organization of result['organizations'].slice(0, 10) let i=index"> <span *ngFor="let organization of result['organizations'].slice(0, 10) let i=index">
<!--a *ngIf="organization.url != undefined" href="{{organization.url}}"--> <!--a *ngIf="organization.url != undefined" href="{{organization.url}}"-->
<a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization"> <a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
@ -101,6 +101,9 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</div> </div>
<div *ngIf="result['type'] != undefined && result['type'] != ''">Type: {{result['type']}}</div> <div *ngIf="result['type'] != undefined && result['type'] != ''">Type: {{result['type']}}</div>
<div *ngIf="result['countries'] && result['countries'].length > 0">
Country: {{result.countries}}
</div>
<div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''"> <div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''">
<span>Website URL: </span> <span>Website URL: </span>
<span> <span>
@ -122,10 +125,6 @@ import {RouterHelper} from '../../utils/routerHelper.class';
Compatibility: {{result.compatibility}} Compatibility: {{result.compatibility}}
</div> </div>
<div *ngIf="result['countries'] && result['countries'].length > 0">
Countries: {{result.countries}}
</div>
</li> </li>
</ul> </ul>
` `

View File

@ -11,10 +11,10 @@ export class MetricsService {
constructor(private http: Http, public _cache: CacheService) {} constructor(private http: Http, public _cache: CacheService) {}
getMetrics (id: string, entity: string):any { getMetrics (id: string, entityType: string):any {
console.info("getMetrics in service"); console.info("getMetrics in service");
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json"; //let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
let url = OpenaireProperties.getMetricsAPIURL()+entity+"/"+id+"/clicks"; let url = OpenaireProperties.getMetricsAPIURL()+entityType+"/"+id+"/clicks";
let key = url; let key = url;
if (this._cache.has(key)) { if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)) return Observable.of(this._cache.get(key))

View File

@ -9,7 +9,7 @@ export class ProjectInfo {
endDate: string; endDate: string;
openAccessMandate: string; openAccessMandate: string;
specialClause39: string; specialClause39: string;
organizations: { "name": string, "id": string }[];//Map<string, string>; organizations: { "acronym": string, "name": string, "id": string }[];//Map<string, string>;
url: string; url: string;
urlInfo: string; urlInfo: string;

View File

@ -5,7 +5,7 @@ import {Component, Input} from '@angular/core';
template: ` template: `
<div *ngIf="dataProviders == undefined" class = "alert alert-info "> <div *ngIf="dataProviders == undefined" class = "alert alert-info ">
There are no content providers No content providers available
</div> </div>
<div *ngIf="dataProviders != undefined"> <div *ngIf="dataProviders != undefined">

View File

@ -139,7 +139,7 @@ export class StaticAutoCompleteComponent implements OnChanges{
value: this.list value: this.list
}); });
if(this.list == null || this.list.length == 0 ){ if(this.list == null || this.list.length == 0 ){
this.warningMessage = "There are no results"; this.warningMessage = "No results available";
return; return;
} }
this.done = true; this.done = true;