Variables and functions in components of landing pages are set correctly to private or public (those which are used in templates are public) | Project landing: links to advanced search in tabs fixed | Landing Pages: responsive tabs: some spaces added for button in small view - sizes changed for views

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@48790 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-07-28 16:40:08 +00:00
parent c196b0f1d3
commit 79141b06e1
15 changed files with 237 additions and 221 deletions

View File

@ -65,7 +65,7 @@
[_dataproviderService]="_dataproviderService">
</tabs-->
<div *ngIf="showTabs">
<ul *ngIf="dataProviderInfo.tabs != undefined" class="uk-tab uk-visible@m" uk-tab="connect: #tab-content">
<ul *ngIf="dataProviderInfo.tabs != undefined" class="uk-tab uk-visible@xl" uk-tab="connect: #tab-content">
<li *ngFor="let tab of dataProviderInfo.tabs; let i=index" id="{{dataProviderInfo.tabs[i].content}}"
[class]="activeTab==tab.name?'uk-active':''">
<a
@ -91,11 +91,11 @@
</li>
</ul>
<button class="uk-button uk-button-default uk-hidden@m" type="button">
<button class="uk-button uk-button-default uk-hidden@xl" type="button">
<span uk-navbar-toggle-icon></span> <span class="uk-margin-small-left">{{activeTab}}</span>
</button>
<ul *ngIf="dataProviderInfo.tabs != undefined" id="toggle-small-tabs" class="uk-subnav uk-subnav-pill uk-dropdown uk-hidden@m" uk-switcher="connect: #tab-content" uk-dropdown="mode: click" uk-toggle="target: #toggle-small-tabs">
<ul *ngIf="dataProviderInfo.tabs != undefined" id="toggle-small-tabs" class="uk-subnav uk-subnav-pill uk-dropdown uk-hidden@xl" uk-switcher="connect: #tab-content" uk-dropdown="mode: click" uk-toggle="target: #toggle-small-tabs">
<li *ngFor="let tab of dataProviderInfo.tabs; let i=index" id="{{dataProviderInfo.tabs[i].content}}"
[class]="activeTab==tab.name?'uk-active':''">
<a

View File

@ -25,63 +25,65 @@ import 'rxjs/add/operator/switchMap';
})
export class DataProviderComponent {
sub1: any;// = new Observable<DataProviderInfo>();
sub: any;
piwiksub: any;
datasourceId: string;
public dataProviderInfo: DataProviderInfo;
public datasourceId: string;
private showAllReferences: boolean = false;
private showAllRelResData: boolean = false;
private showAllSimilPubl: boolean = false;
private showAllBioentities: boolean = false;
private showFundingDetails: boolean = false;
private bioentitiesNum: number = 0;
private result ;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
// This will change
// currently related content providers tab requests only for publications or research data
// Later both requests will be executed
public relatedDataprovidersResultsType: string;
public paramsForSearchLink = {};//: string = "";
public reloadPublications: boolean = true;
public reloadDatasets: boolean = true;
public reloadProjects: boolean = true;
public reloadDataproviders: boolean = true;
public reloadRelatedDatasources: boolean = true;
// Variable to specify requests with either collectedFrom or hostedBy
public paramsForSearchLink = {};
// Metrics tab variables
public metricsClicked: boolean;
private viewsFrameUrl: string;
private downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
private pageViews: number;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
private activeTab: string = "";
// Statistics tab variables
public statsClicked: boolean = false;
private docsTimelineUrl: string;
private docsTypesUrl:string;
private docsFunderUrl:string;
private dataProjectsUrl:string ;
private pubsProjectsUrl:string;
public docsTimelineUrl: string;
public docsTypesUrl:string;
public docsFunderUrl:string;
public dataProjectsUrl:string ;
public pubsProjectsUrl:string;
// Variables for publications, research data, projects, content providers, related content providers tabs
public fetchPublications : FetchPublications;
public fetchDatasets: FetchDatasets;
public fetchProjects: FetchProjects;
public fetchDataproviders: FetchDataproviders;
public fetchResultsAggregators: any;
private nativeElement : Node;
// Active tab variable for responsiveness - show tabs only if main request is completed
public activeTab: string = "";
public showTabs:boolean = false;
public routerHelper:RouterHelper = new RouterHelper();
showTabs:boolean = false;
public errorCodes:ErrorCodes = new ErrorCodes();
// Request results of each tab only the one time (first time tab is clicked)
private reloadPublications: boolean = true;
private reloadDatasets: boolean = true;
private reloadProjects: boolean = true;
private reloadDataproviders: boolean = true;
private reloadRelatedDatasources: boolean = true;
private nativeElement : Node;
sub1: any;// = new Observable<DataProviderInfo>();
sub: any;
piwiksub: any;
constructor (private element: ElementRef,
private _dataproviderService: DataProviderService,
private _piwikService:PiwikService,
@ -170,7 +172,7 @@ export class DataProviderComponent {
this.sub1.unsubscribe();
}
}
getDataProviderInfo(id:string) {
private getDataProviderInfo(id:string) {
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
@ -206,21 +208,22 @@ export class DataProviderComponent {
);
}
}
updateDescription(description:string){
private updateDescription(description:string){
this._meta.updateMeta("description", description);
this._meta.updateProperty("og:description", description);
}
updateTitle(title:string){
private updateTitle(title:string){
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title );
this._meta.updateProperty("og:title",_title);
}
updateUrl(url:string){
private updateUrl(url:string){
this._meta.updateProperty("og:url", url);
}
public initTabs(){
private initTabs(){
if(this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) {
this.reloadPublications = true;
@ -289,7 +292,7 @@ export class DataProviderComponent {
}
}
private search(content: string, page: number, size: number) {
public search(content: string, page: number, size: number) {
if(content=='publicationsTab') {
this.searchPublications(page, size);
} else if(content=='datasetsTab') {

View File

@ -55,7 +55,7 @@ export class RelatedDatasourcesTabComponent {
@Input() fetchResults : any;
public linkToSearchResults: string = "";
public searchLinkToDataProvider: string = "";
//public searchLinkToDataProvider: string = "";
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
@ -70,7 +70,7 @@ export class RelatedDatasourcesTabComponent {
} else {
this.linkToSearchResults = OpenaireProperties.getLinkToAdvancedSearchDatasets();
}
this.searchLinkToDataProvider = OpenaireProperties.getsearchLinkToDataProvider();
//this.searchLinkToDataProvider = OpenaireProperties.getsearchLinkToDataProvider();
/*queryParams.push("hostedBy");
queryParams.push("ho");
queryParams.push("collectedFrom");

View File

@ -47,9 +47,8 @@
</li>
</ul>
<div *ngIf="datasetInfo.description != ''">
<div class="uk-text-justify descriptionText">{{datasetInfo.description}}</div>
<div *ngIf="datasetInfo.description" class="uk-margin-bottom uk-text-justify descriptionText">
{{datasetInfo.description}}
</div>
<!--div class="uk-clearfix uk-margin-top uk-margin-bottom">
@ -59,7 +58,7 @@
</span> Links to research Results</a>
</div-->
<ul class="uk-tab uk-visible@l" uk-tab="connect: #tab-content">
<ul class="uk-tab uk-visible@m" uk-tab="connect: #tab-content">
<li (click)="activeTab='Related Research Results'"
[class]="activeTab == 'Related Research Results'?'uk-active':''">
<a>
@ -91,11 +90,11 @@
</li>
</ul>
<button class="uk-button uk-button-default uk-hidden@l" type="button">
<button class="uk-button uk-button-default uk-hidden@m" type="button">
<span uk-navbar-toggle-icon></span> <span class="uk-margin-small-left">{{activeTab}}</span>
</button>
<ul id="toggle-small-tabs" class="uk-subnav uk-subnav-pill uk-dropdown uk-hidden@l" uk-switcher="connect: #tab-content" uk-dropdown="mode: click" uk-toggle="target: #toggle-small-tabs">
<ul id="toggle-small-tabs" class="uk-subnav uk-subnav-pill uk-dropdown uk-hidden@m" uk-switcher="connect: #tab-content" uk-dropdown="mode: click" uk-toggle="target: #toggle-small-tabs">
<li (click)="activeTab='Related Research Results'"
[class]="activeTab == 'Related Research Results'?'uk-active':''">
<a>

View File

@ -15,37 +15,38 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
export class DatasetComponent {
public datasetInfo: DatasetInfo;
public datasetId : string ;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllPublishedIn: boolean = false;
public showAllFundedBy: boolean = false;
private showStyle: boolean = false;
private showAllReferences: boolean = false;
private showAllRelResData: boolean = false;
private showAllSimilPubl: boolean = false;
private showAllBioentities: boolean = false;
private datasetId : string ;
private result ;
sub: any; piwiksub: any;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
private activeTab: string = "Related Research Results";
private metricsClicked: boolean;
private viewsFrameUrl: string;
private downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
private pageViews: number;
// Active tab variable for responsiveness
public activeTab: string = "Related Research Results";
// Map counting variable
public relatedResearchResultsNum: number = 0;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper();
private result ;
sub: any; piwiksub: any;
constructor (private element: ElementRef,
private _datasetService: DatasetService,
private _piwikService:PiwikService,
@ -90,11 +91,11 @@ export class DatasetComponent {
ngOnDestroy() {
this.sub.unsubscribe();
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
this.piwiksub.unsubscribe();
}
}
getDatasetInfo(id:string) {
private getDatasetInfo(id:string) {
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
@ -131,26 +132,27 @@ export class DatasetComponent {
);
}
showChange($event) {
this.showAllReferences=$event.value;
}
// showChange($event) {
// this.showAllReferences=$event.value;
// }
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
updateDescription(description:string){
private updateDescription(description:string){
this._meta.updateMeta("description", description);
this._meta.updateProperty("og:description", description);
}
updateTitle(title:string){
private updateTitle(title:string){
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title );
this._meta.updateProperty("og:title",_title);
}
updateUrl(url:string){
private updateUrl(url:string){
this._meta.updateProperty("og:url", url);
}

View File

@ -43,9 +43,9 @@ declare var UIkit: any;
`
})
export class HtmlProjectReportComponent{
public projectId: string;
public totalResults: number = 10;
public resultsType: string = "publication";
private projectId: string;
private totalResults: number = 10;
private resultsType: string = "publication";
public header1: string = "";
public header2: string = "";
@ -101,11 +101,11 @@ export class HtmlProjectReportComponent{
ngOnDestroy() {
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
this.piwiksub.unsubscribe();
}
}
createHeaders() {
private createHeaders() {
this._projectService.getHTMLInfo(this.projectId).subscribe(
data => {
this.createHeader1(data);
@ -127,7 +127,7 @@ export class HtmlProjectReportComponent{
this.header2 = this.totalResults+((this.resultsType == "publication")?" publications":" research data");
}
createClipboard() {
private createClipboard() {
let intro: string = '<!doctype html>';
intro += '<html lang="en-gb" dir="ltr" vocab="http://schema.org/">';
intro += '<head>';
@ -191,7 +191,7 @@ export class HtmlProjectReportComponent{
this.createClipboard();
}
copied() {
public copied() {
UIkit.notification({
message : '<strong>Raw html is copied. Please paste it on an html file.<strong>',
status : 'success',
@ -200,17 +200,17 @@ export class HtmlProjectReportComponent{
});
}
updateDescription(description:string){
private updateDescription(description:string){
this._meta.updateMeta("description", description);
this._meta.updateProperty("og:description", description);
}
updateTitle(title:string){
private updateTitle(title:string){
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title );
this._meta.updateProperty("og:title",_title);
}
updateUrl(url:string){
private updateUrl(url:string){
this._meta.updateProperty("og:url", url);
}
}

View File

@ -166,9 +166,10 @@ export class MetricsComponent {
@Input() pageViews: number = 0;
public metrics: Metrics;
public errorCodes:ErrorCodes;
public status: number;
private sub: Subscription;
public status: number;
constructor (private _metricsService: MetricsService) {}
ngOnInit() {
@ -181,7 +182,7 @@ export class MetricsComponent {
this.sub.unsubscribe();
}
getMetrics() {
private getMetrics() {
//if(this.id == undefined || this.id == "") {
// console.log("supplied id in metrics is not acceptable");
//}

View File

@ -48,9 +48,11 @@
</li>
</ul>
<button class="uk-button uk-button-default uk-hidden@m" type="button">
<span uk-navbar-toggle-icon></span> <span class="uk-margin-small-left">{{activeTab}}</span>
</button>
<div class="uk-hidden@m uk-margin-top">
<button class="uk-button uk-button-default" type="button">
<span uk-navbar-toggle-icon></span> <span class="uk-margin-small-left">{{activeTab}}</span>
</button>
</div>
<ul id="toggle-small-tabs" class="uk-subnav uk-subnav-pill uk-dropdown uk-hidden@m" uk-switcher="connect: #tab-content" uk-dropdown="mode: click" uk-toggle="target: #toggle-small-tabs">
<li (click)="activeTab='Publications'" [class]="activeTab == 'Publications'?'uk-active':''">

View File

@ -26,49 +26,58 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
})
export class OrganizationComponent {
public organizationInfo: OrganizationInfo;
public organizationId: string;
organizationInfo: OrganizationInfo;
//private metrics: string;
private organizationId: string;
private projectsNum: number = 0;
private fundersSet: Set<string>;
private emptyFundersSet: boolean = true;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
// CSV variables
public downloadURLAPI: string;
public csvProjectParamsHead: string;
public csvPublicationParamsHead: string;
public csvParamsTail: string;
sub: any;
piwiksub: any;
// Active tab variable for responsiveness
public activeTab: string = "Publications";
public reloadDataproviders: boolean = true;
public projectsClicked: boolean = false;
// Variables for publications, projects, dataproviders tabs
public fetchPublications: FetchPublications;
public linkToSearchPublications: string = "";
public fetchProjects: FetchProjects;
public fetchDataproviders : FetchDataproviders;
public linkToSearchDataproviders:string = "";
@ViewChild (SearchingProjectsTabComponent) searchingProjectsTabComponent : SearchingProjectsTabComponent ;
public projectFunders:string[] = [];
//public projectFunders:string[] = [];
public routerHelper:RouterHelper = new RouterHelper();
// Variables for projects query (query results only if projects tab is clicked)
public projectsClicked: boolean = false;
@ViewChild (SearchingProjectsTabComponent) searchingProjectsTabComponent : SearchingProjectsTabComponent ;
@ViewChild (ModalLoading) loading : ModalLoading ;
// Alert box when CSV: Project Publications for a funder is requested
@ViewChild('AlertModalApplyAll') alertApplyAll;
// Alert box when something is wrong with CSV requests
@ViewChild('AlertModalCsvError') alertCsvError;
public funder: string;
public funderId: string;
public count: number;
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
//private projectsNum: number = 0;
//private fundersSet: Set<string>;
//private emptyFundersSet: boolean = true;
// Request results for content providers only the one time (first time tab is clicked)
private reloadDataproviders: boolean = true;
// Helper variables to specify funder in downloadPublicationsFile function
private funder: string;
private funderId: string;
private funderCountPublications: number;
sub: any;
piwiksub: any;
constructor (private element: ElementRef,
private _organizationService: OrganizationService,
private _piwikService:PiwikService,
@ -120,8 +129,8 @@ export class OrganizationComponent {
ngOnDestroy() {
this.sub.unsubscribe();
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
this.piwiksub.unsubscribe();
}
}
private getOrganizationInfo () {
@ -186,6 +195,7 @@ export class OrganizationComponent {
);
}
*/
/*
private handleClick(funder: string) {
if(this.emptyFundersSet) {
this.fundersSet.clear();
@ -207,7 +217,7 @@ export class OrganizationComponent {
console.info(funder+" funder added");
}
}
*/
//private getProjectsData(key: string): any {
//return this.projectsData;
//}
@ -234,13 +244,13 @@ export class OrganizationComponent {
}
}
private searchDataprovidersInit() {
public searchDataprovidersInit() {
if(this.reloadDataproviders && this.fetchDataproviders.searchUtils.totalResults > 0) {
this.searchDataproviders();
}
}
downloadFile(url:string){
public downloadFile(url:string){
console.log("Downloading file: "+ url);
this.openLoading();
@ -262,7 +272,7 @@ export class OrganizationComponent {
() => console.log('Completed file download.'));
}
downloadPublicationsFile(funder: string, funderId:string, count:number){
private downloadPublicationsFile(funder: string, funderId:string, count:number){
console.log("Downloading publications file");
this.openLoading();
@ -382,37 +392,38 @@ export class OrganizationComponent {
// error => console.log("Error getting number of publications for project."));
// }//);
}
updateDescription(description:string){
private updateDescription(description:string){
this._meta.updateMeta("description", description);
this._meta.updateProperty("og:description", description);
}
updateTitle(title:string){
private updateTitle(title:string){
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title );
this._meta.updateProperty("og:title",_title);
}
updateUrl(url:string){
private updateUrl(url:string){
this._meta.updateProperty("og:url", url);
}
public openLoading(){
private openLoading(){
if(this.loading){
this.loading.open();
}
}
public closeLoading(){
private closeLoading(){
if(this.loading){
this.loading.close();
}
}
public setMessageLoading(message: string){
private setMessageLoading(message: string){
if(this.loading){
this.loading.message = message;
}
}
confirmOpenApplyAll(funder: string, funderId:string, count:number){
public confirmOpenApplyAll(funder: string, funderId:string, funderCountPublications:number){
this.alertApplyAll.cancelButton = true;
this.alertApplyAll.okButton = true;
this.alertApplyAll.alertTitle = "CSV FILE";
@ -423,13 +434,13 @@ export class OrganizationComponent {
this.funder = funder;
this.funderId = funderId;
this.count = count;
this.funderCountPublications = funderCountPublications;
}
confirmCloseApplyAll(data){
this.downloadPublicationsFile(this.funder, this.funderId, this.count);
public confirmCloseApplyAll(data){
this.downloadPublicationsFile(this.funder, this.funderId, this.funderCountPublications);
}
confirmOpenCsvError(){
public confirmOpenCsvError(){
this.alertCsvError.cancelButton = false;
this.alertCsvError.okButton = true;
this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE";

View File

@ -34,10 +34,6 @@
<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"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
<span *ngIf="organization.acronym">{{organization.acronym}}</span><span
@ -148,7 +144,7 @@
<div *ngIf="fetchPublications.searchUtils.totalResults > 0">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" >
<a [queryParams]="routerHelper.createQueryParams(['projectId', 'pr'], [projectId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['project', 'pr'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text">
View all {{fetchPublications.searchUtils.totalResults}} results
</a>
@ -173,7 +169,7 @@
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['projectId', 'pr'], [projectId, 'and'])"
<a [queryParams]="routerHelper.createQueryParams(['project', 'pr'], [projectId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text">
View all {{fetchDatasets.searchUtils.totalResults}} results
</a>

View File

@ -23,48 +23,59 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
templateUrl: 'project.component.html',
})
export class ProjectComponent{
public projectId : string ;
public projectInfo: ProjectInfo;
public projectId : string ;
public projectName: string;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
private pageViews: number;
// Statistics tab variables
public statsClicked: boolean;
public chartScientificResultsUrl: string;
public chartAccessModeUrl: string;
public chartDatasourcesUrl: string;
// HTML variables in APP BOX
public publications_dynamic: string;
public datasets_dynamic: string;
public project ;
// CSV variables
public downloadURLAPI: string;
public csvParams: string;
public csvParamsDatasets: string;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
sub: any;piwiksub: any;
// Active tab variable for responsiveness
public activeTab: string = "Publications";
public reloadDatasets: boolean = true;
// Request results for research data only the one time (first time tab is clicked)
private reloadDatasets: boolean = true;
// Variables for publications, research data tabs
public fetchPublications : FetchPublications;
public linkToSearchPublications = "";
public fetchDatasets : FetchDatasets;
public linkToSearchDatasets = "";
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
@ViewChild (ModalLoading) loading : ModalLoading ;
sub: any;piwiksub: any;
constructor ( private element: ElementRef,
private _projectService: ProjectService,
private _piwikService:PiwikService,
@ -132,11 +143,11 @@ export class ProjectComponent{
ngOnDestroy() {
this.sub.unsubscribe();
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
this.piwiksub.unsubscribe();
}
}
createClipboard() {
private createClipboard() {
if(typeof window !== 'undefined') {
let publ_clipboard, datasets_clipboard;
@ -165,7 +176,7 @@ export class ProjectComponent{
//this.activeTab = "Research Data";
}
private searchDatasetsInit() {
public searchDatasetsInit() {
console.info("searchDatasetsInit");
if(this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) {
this.searchDatasets();
@ -175,7 +186,7 @@ export class ProjectComponent{
}
}
getProjectInfo (id:string) {
private getProjectInfo (id:string) {
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
@ -183,7 +194,7 @@ export class ProjectComponent{
this._projectService.getProjectInfo(id).subscribe(
data => {
this.projectInfo = data;
console.info(this.projectInfo.title);
this.projectName = this.projectInfo.acronym;
if(this.projectName == undefined || this.projectName == '') {
this.projectName = this.projectInfo.title;
@ -197,13 +208,8 @@ console.info(this.projectInfo.title);
this.project= { funderId: "", funderName: this.projectInfo.funder, projectId: this.projectId, projectName: this.projectInfo.title, projectAcronym: this.projectInfo.acronym, startDate: this.projectInfo.startDate, endDate: this.projectInfo.endDate };
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"projRepoViews","projTitle":"'+this.projectId+'","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":"","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';
/*this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"projViewsTimeline","projTitle":"'+this.projectId+'","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":"","yaxisheaders":["Monthly views"],"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';
*/
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"projRepoDownloads","projTitle":"'+this.projectId+'","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":"","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';
/*
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"projDownloadsTimeline","projTitle":"'+this.projectId+'","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":"","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';
*/
//stats tab charts
this.chartScientificResultsUrl='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"projScient","projTitle":"'+this.projectId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "spline", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
@ -216,10 +222,11 @@ console.info(this.projectInfo.title);
console.log(err);
this.errorMessage = 'No project found';
this.showLoading = false;
}
}
);
}
downloadfile(url:string){
public downloadfile(url:string){
this.openLoading();
this.setMessageLoading("Downloading CSV file");
@ -233,6 +240,7 @@ console.info(this.projectInfo.title);
);
}
/*
showHTML(){
let info:string = "<h1>Publications of Project ";
@ -264,40 +272,42 @@ console.info(this.projectInfo.title);
error => console.log("Error downloading the file."),
() => console.log('Completed file download.'));
}
funct(data) {
var win = window.open(window.URL.createObjectURL(data));
}
*/
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
this.pageViews = $event.pageViews;
}
updateDescription(description:string){
private updateDescription(description:string){
this._meta.updateMeta("description", description);
this._meta.updateProperty("og:description", description);
}
updateTitle(title:string){
private updateTitle(title:string){
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title );
this._meta.updateProperty("og:title",_title);
}
updateUrl(url:string){
private updateUrl(url:string){
this._meta.updateProperty("og:url", url);
}
public openLoading(){
private openLoading(){
if(this.loading){
this.loading.open();
}
}
public closeLoading(){
private closeLoading(){
if(this.loading){
this.loading.close();
}
}
public setMessageLoading(message: string){
private setMessageLoading(message: string){
if(this.loading){
this.loading.message = message;
}

View File

@ -3,7 +3,6 @@
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-margin-top publication">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" role="alert">{{warningMessage}}</div>
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top" role="alert">{{errorMessage}}</div>
<div *ngIf="showLoading" 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>
@ -61,10 +60,9 @@
</li>
</ul>
<div *ngIf="publicationInfo.description">
<div class="uk-text-justify descriptionText">{{publicationInfo.description}}</div>
</div>
<div *ngIf="publicationInfo.description" class="uk-margin-bottom uk-text-justify descriptionText">
{{publicationInfo.description}}
</div>
<div class="uk-clearfix"><div class="uk-button-group uk-float-right">

View File

@ -18,51 +18,51 @@ import { Meta} from '../../../angular2-meta';
})
export class PublicationComponent {
public publicationInfo: PublicationInfo;
public articleId: string;
// APP BOX variables
public showAllCollectedFrom: boolean = false;
public showAllDownloadFrom: boolean = false;
public showAllFundedBy: boolean = false;
public showAllPublishedIn: boolean = false;
sub: any;piwiksub: any;
articleId: string;
public publicationInfo: PublicationInfo;
private metricsClicked: boolean;
private viewsFrameUrl: string;
private downloadsFrameUrl: string;
private totalViews: number;
private totalDownloads: number;
private pageViews: number;
// Metrics tab variables
public metricsClicked: boolean;
public viewsFrameUrl: string;
public downloadsFrameUrl: string;
public totalViews: number;
public totalDownloads: number;
public pageViews: number;
//public showAllReferences: boolean = false;
// Custom tab paging variables
public referencesPage: number = 1;
public organizationsPage: number = 1;
public softwarePage: number = 1;
public bioentitiesPage: number = 1;
public pageSize: number = 10;
/*
public startt: number = 0;
public stopp: number = 0;
*/
public showAllRelResData: boolean = false;
public showAllSimilPubl: boolean = false;
public showFundingDetails: boolean = false;
// Active tab variable for responsiveness
public activeTab: string = "References";
// Map counting variables
public bioentitiesNum: number = 0;
public relatedResearchResultsNum: number = 0;
private doi: string;
public result ;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
public routerHelper:RouterHelper = new RouterHelper();
public activeTab: string = "References";
public startt: number = 0;
public stopp: number = 0;
public pageSize: number = 10;
private doi: string;
private result;
sub: any;piwiksub: any;
constructor ( private element: ElementRef,
private _publicationService: PublicationService,
@ -95,27 +95,23 @@ export class PublicationComponent {
}
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.articleId+'", "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":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["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(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';
/*this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.articleId+'", "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":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["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&persistent=false';
*/
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.articleId+'", "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":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["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(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';
/*this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.articleId+'", "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":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["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(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';
*/
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
});
}
ngOnDestroy() {
this.sub.unsubscribe();
if(this.piwiksub){
this.piwiksub.unsubscribe();
}
this.piwiksub.unsubscribe();
}
}
getPublicationInfo(id:string) {
private getPublicationInfo(id:string) {
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
@ -185,10 +181,6 @@ export class PublicationComponent {
);
}
/*showChange($event) {
this.showAllReferences=$event.value;
}*/
public downloadClicked($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;
@ -256,22 +248,22 @@ export class PublicationComponent {
tooltipContent+="</div>"
return tooltipContent;
}
updateDescription(description:string){
private updateDescription(description:string){
this._meta.updateMeta("description", description);
this._meta.updateProperty("og:description", description);
}
updateTitle(title:string){
private updateTitle(title:string){
var _prefix ="OpenAIRE | ";
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
this._meta.setTitle(_title );
this._meta.updateProperty("og:title",_title);
}
updateUrl(url:string){
private updateUrl(url:string){
this._meta.updateProperty("og:url", url);
}
totalPages(totalResults: number): number {
public totalPages(totalResults: number): number {
let totalPages:any = totalResults/this.pageSize;
if(!(Number.isInteger(totalPages))) {
totalPages = (parseInt(totalPages, this.pageSize) + 1);
@ -279,22 +271,30 @@ export class PublicationComponent {
return totalPages;
}
updateReferencesPage($event) {
public updateReferencesPage($event) {
this.referencesPage = $event.value;
}
updateOrganizationsPage($event) {
public updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
}
updateSoftwarePage($event) {
public updateSoftwarePage($event) {
this.softwarePage = $event.value;
}
updateBioentitiesPage($event) {
public updateBioentitiesPage($event) {
this.bioentitiesPage = $event.value;
}
public keysToArray(bioentities: Map<string, string>) : string[] {
let keys: string[] = [];
bioentities.forEach(function (value, key, map) {
keys.push(key);
});
return keys;
}
/*
start(i: number, bioentitiesPage: number) {
let sum = 0;
let index=0;
@ -355,13 +355,6 @@ export class PublicationComponent {
this.stopp = retValue;
return retValue;
}
keysToArray(bioentities: Map<string, string>) : string[] {
let keys: string[] = [];
bioentities.forEach(function (value, key, map) {
keys.push(key);
});
return keys;
}
*/
}

View File

@ -58,12 +58,13 @@ export class SearchingProjectsTabComponent {
@Input() organizationId:string = "";
public page :number = 1;
public size :number = 10;
public linkToSearchProjects;
private filterQuery:string = "";
public linkToSearchProjects: string;
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
private filterQuery:string = "";
constructor (private route: ActivatedRoute,
private _searchProjectsService: SearchProjectsService) {
}
@ -80,24 +81,24 @@ export class SearchingProjectsTabComponent {
}
search(refine:boolean, filterQuery:string){
private search(refine:boolean, filterQuery:string){
var refineFields:string [] = ["funder"];
this.fetchProjects.getResultsForOrganizations(this.organizationId, filterQuery, this.page, this.size,(refine)?refineFields:[]);
}
pageChange($event) {
public pageChange($event) {
this.page=$event.value;
this.search(false, this.filterQuery);
}
filterChange($event) {
public filterChange($event) {
console.log("Filter Changed");
this.updateFilters();
//this.search(true, this.filterQuery);
this.search(false, this.filterQuery);
}
updateFilters (){
private updateFilters (){
this.filterQuery = "";
for (let filter of this.fetchProjects.filters){
var filterLimits="";

View File

@ -43,7 +43,7 @@ export class ShowAuthorsComponent {
@Input() authors: { [key: string]: string }[];
@Input() searchPage:string ="publications"
private showAll: boolean = false;
public showAll: boolean = false;
public routerHelper:RouterHelper = new RouterHelper();
constructor (private element: ElementRef) {