From 65fc6976ec88ca1af43a7e91a7a5757ea8fa92cb Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Tue, 14 Mar 2017 16:16:20 +0000 Subject: [PATCH] comment claim functionalities | tidy up navbar links | extra query for projects of an organization when requiring pubs report | remove href from home page tabs git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46271 d315682c-612b-4755-9ff5-7f18f6832af3 --- portal-2/src/app/app-routing.module.ts | 18 +-- .../app/deposit/depositResult.component.ts | 2 +- .../dataset/dataset.component.html | 18 +-- .../organization/organization.component.html | 14 +-- .../organization/organization.component.ts | 107 +++++++++++++----- .../organization/organization.module.ts | 4 +- .../project/project.component.html | 6 +- .../publication/publication.component.html | 10 +- .../searchingProjectsInTab.component.ts | 5 +- .../advancedSearchDataProviders.component.ts | 2 +- .../advancedSearchDatasets.component.ts | 2 +- .../advancedSearchOrganizations.component.ts | 2 +- .../advancedSearchPeople.component.ts | 2 +- .../advancedSearchProjects.component.ts | 2 +- .../advancedSearchPublications.component.ts | 2 +- .../app/searchPages/find/search.component.ts | 24 ++-- .../advancedSearchForm.component.ts | 13 ++- .../advancedSearchPage.component.ts | 4 + .../searchUtils/advancedSearchPage.module.ts | 3 +- .../searchUtils/dateFilter.module.ts | 2 +- .../searchUtils/searchPage.component.ts | 6 +- .../searchUtils/searchPage.module.ts | 3 +- .../simple/searchDataproviders.component.ts | 2 +- .../simple/searchDatasets.component.ts | 2 +- .../simple/searchOrganizations.component.ts | 2 +- .../simple/searchPeople.component.ts | 2 +- .../simple/searchProjects.component.ts | 3 +- .../simple/searchPublications.component.ts | 4 +- .../navigationBar.component.ts | 16 +-- .../src/app/utils/altmetrics.component.ts | 19 +--- .../fetchProjects.class.ts | 16 ++- 31 files changed, 177 insertions(+), 140 deletions(-) diff --git a/portal-2/src/app/app-routing.module.ts b/portal-2/src/app/app-routing.module.ts index ce5419e6..83866a12 100644 --- a/portal-2/src/app/app-routing.module.ts +++ b/portal-2/src/app/app-routing.module.ts @@ -106,7 +106,7 @@ export function gethtmlProjectReportModule() { return System.import('./landingPages/htmlProjectReport/htmlProjectReport.module' + (process.env.AOT ? '.ngfactory' : '')) .then(mod => mod[(process.env.AOT ? 'HtmlProjectReportModuleNgFactory' : 'HtmlProjectReportModule')]); } -export function getMyClaimsModule() { +/*export function getMyClaimsModule() { return System.import('./claims/myClaims/myClaims.module' + (process.env.AOT ? '.ngfactory' : '')) .then(mod => mod[(process.env.AOT ? 'MyClaimsModuleNgFactory' : 'MyClaimsModule')]); } @@ -122,7 +122,7 @@ export function getLinkingModule() { export function getBulkLinkingModule() { return System.import('./claims/linking/bulkLinking.module' + (process.env.AOT ? '.ngfactory' : '')) .then(mod => mod[(process.env.AOT ? 'BulkLinkingModuleNgFactory' : 'BulkLinkingModule')]); -} +}*/ @NgModule({ imports: [ RouterModule.forChild([ @@ -153,16 +153,10 @@ export function getBulkLinkingModule() { { path: 'search/advanced/projects', loadChildren: getAdvancedSearchProjectsModule }, { path: 'search/advanced/people', loadChildren: getAdvancedSearchPeopleModule }, { path: 'project-report', loadChildren: gethtmlProjectReportModule }, - { path: 'myclaims', loadChildren: getMyClaimsModule }, - { path: 'claims', loadChildren: getClaimsAdminModule }, - { path: 'bulk-linking', loadChildren: getBulkLinkingModule }, - { path: 'linking', loadChildren: getLinkingModule }, - - - - - - + // { path: 'myclaims', loadChildren: getMyClaimsModule }, + // { path: 'claims', loadChildren: getClaimsAdminModule }, + // { path: 'bulk-linking', loadChildren: getBulkLinkingModule }, + // { path: 'linking', loadChildren: getLinkingModule }, ]) ], }) diff --git a/portal-2/src/app/deposit/depositResult.component.ts b/portal-2/src/app/deposit/depositResult.component.ts index fc7f429e..154ef989 100644 --- a/portal-2/src/app/deposit/depositResult.component.ts +++ b/portal-2/src/app/deposit/depositResult.component.ts @@ -38,7 +38,7 @@ import {OrganizationService} from '../services/organization.service';

Please use the information/contacts shown below to deposit your {{requestFor}}.

- + diff --git a/portal-2/src/app/landingPages/dataset/dataset.component.html b/portal-2/src/app/landingPages/dataset/dataset.component.html index 3ed6de9f..5fed37ca 100644 --- a/portal-2/src/app/landingPages/dataset/dataset.component.html +++ b/portal-2/src/app/landingPages/dataset/dataset.component.html @@ -121,17 +121,9 @@ - -
  • -
    -
    -
    - - - -
    -
    + +
  • @@ -178,7 +170,7 @@ -
    Add links to projects
    +
    @@ -198,7 +190,7 @@ : {{item['labelConcept']}} -
    Add links to contexts
    +
  • diff --git a/portal-2/src/app/landingPages/organization/organization.component.html b/portal-2/src/app/landingPages/organization/organization.component.html index 23ae35b0..1573550d 100644 --- a/portal-2/src/app/landingPages/organization/organization.component.html +++ b/portal-2/src/app/landingPages/organization/organization.component.html @@ -157,21 +157,21 @@ - -
  • + +
  • - + - Projects report(CSV) for {{key}} + Projects report(CSV) for {{funder.name}}
  • -
  • - +
  • + - Publications report(CSV) for {{key}} + Publications report(CSV) for {{funder.name}}
  • diff --git a/portal-2/src/app/landingPages/organization/organization.component.ts b/portal-2/src/app/landingPages/organization/organization.component.ts index cd44f726..f37ee730 100644 --- a/portal-2/src/app/landingPages/organization/organization.component.ts +++ b/portal-2/src/app/landingPages/organization/organization.component.ts @@ -8,6 +8,7 @@ import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataprov import {SearchPublicationsService} from '../../services/searchPublications.service'; import {SearchDataprovidersService} from '../../services/searchDataproviders.service'; +import {SearchProjectsService} from '../../services/searchProjects.service'; import {OpenaireProperties} from '../../utils/properties/openaireProperties'; import {SearchingProjectsTabComponent} from '../searchingProjectsInTab.component'; @@ -39,12 +40,14 @@ export class OrganizationComponent { private fetchDataproviders : FetchDataproviders; private linkToSearchDataproviders = ""; @ViewChild (SearchingProjectsTabComponent) searchingProjectsTabComponent : SearchingProjectsTabComponent ; + private projectFunders:string[] = []; constructor (private _organizationService: OrganizationService, private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService, private _reportsService: ReportsService, - private _searchPublicationsService: SearchPublicationsService) { + private _searchPublicationsService: SearchPublicationsService, + private _searchProjectsService: SearchProjectsService) { console.info('organization constructor'); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); @@ -181,43 +184,85 @@ export class OrganizationComponent { () => console.log('Completed file download.')); } - downloadPublicationsFile(funder: string){ + downloadPublicationsFile(funder: string, funderId:string, count:number){ console.log("Downloading publications file"); let response: string[] = []; let totalResponse: string = ""; - let counter: number = this.organizationInfo.projects.get(funder).length; + let projects = []; + let counter: number = count; + this._searchProjectsService.getProjectsForOrganizations(this.organizationId,' and (funderid exact '+ funderId + ' ) ',1,count,[]).subscribe( + data => + { + projects = data[1]; + for(let index=0; index < projects.length; index++) { + this._searchPublicationsService.numOfEntityPublications(projects[index].id, "projects/").subscribe( + data => + { + // let index: number = this.organizationInfo.projects.get(funder).indexOf(project); - for(let project of this.organizationInfo.projects.get(funder)) { - this._searchPublicationsService.numOfEntityPublications(project.id, "projects/").subscribe( - data => - { - let index: number = this.organizationInfo.projects.get(funder).indexOf(project); + let url: string; + if(index == 0) { + url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special&size="+data; + } else { + url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special-notitle&size="+data; + } - let url: string; - if(index == 0) { - url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-special&size="+data; - } else { - url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-special-notitle&size="+data; - } + this._reportsService.getCSVResponse(url).subscribe( + data => + { + counter--; - this._reportsService.getCSVResponse(url).subscribe( - data => - { - counter--; + response[index] = data; - response[index] = data; + if(counter == 0) { + for(let i=0; i console.log("Error downloading the file."), + () => console.log('Completed file download.')); + }, + error => console.log("Error getting number of publications for project.")); + }//); - if(counter == 0) { - for(let i=0; i console.log("Error downloading the file."), - () => console.log('Completed file download.')); - }, - error => console.log("Error getting number of publications for project.")); - }//); + }, + error => console.log("Error getting projects project.")); + + // let counter: number = this.organizationInfo.projects.get(funder).length; + // + // for(let project of this.organizationInfo.projects.get(funder)) { + // this._searchPublicationsService.numOfEntityPublications(project.id, "projects/").subscribe( + // data => + // { + // let index: number = this.organizationInfo.projects.get(funder).indexOf(project); + // + // let url: string; + // if(index == 0) { + // url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-special&size="+data; + // } else { + // url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-special-notitle&size="+data; + // } + // + // this._reportsService.getCSVResponse(url).subscribe( + // data => + // { + // counter--; + // + // response[index] = data; + // + // if(counter == 0) { + // for(let i=0; i console.log("Error downloading the file."), + // () => console.log('Completed file download.')); + // }, + // error => console.log("Error getting number of publications for project.")); + // }//); } } diff --git a/portal-2/src/app/landingPages/organization/organization.module.ts b/portal-2/src/app/landingPages/organization/organization.module.ts index d8fc99c4..9e2c72ba 100644 --- a/portal-2/src/app/landingPages/organization/organization.module.ts +++ b/portal-2/src/app/landingPages/organization/organization.module.ts @@ -13,6 +13,7 @@ import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults. import {DataProvidersServiceModule} from '../../services/dataProvidersService.module'; import {ReportsServiceModule} from '../../services/reportsService.module'; import {PublicationsServiceModule} from '../../services/publicationsService.module'; +import {ProjectsServiceModule} from '../../services/projectsService.module'; import { SearchingProjectsTabModule} from '../searchingProjectsInTab.module'; @@ -27,7 +28,8 @@ import { SearchingProjectsTabModule} from '../searchingProjectsInTab.module'; OrganizationServiceModule, SearchingProjectsTabModule, OrganizationServiceModule, - PublicationsServiceModule + PublicationsServiceModule, + ProjectsServiceModule ], declarations: [ diff --git a/portal-2/src/app/landingPages/project/project.component.html b/portal-2/src/app/landingPages/project/project.component.html index 80b82520..c2a94d7e 100644 --- a/portal-2/src/app/landingPages/project/project.component.html +++ b/portal-2/src/app/landingPages/project/project.component.html @@ -219,13 +219,13 @@ {{projectInfo.funder}} progress report (CSV) -
  • +
  • - + Deposit Publications
  • diff --git a/portal-2/src/app/landingPages/publication/publication.component.html b/portal-2/src/app/landingPages/publication/publication.component.html index 08ffcd8a..767df58b 100644 --- a/portal-2/src/app/landingPages/publication/publication.component.html +++ b/portal-2/src/app/landingPages/publication/publication.component.html @@ -261,7 +261,10 @@ + + +
  • Download from
    @@ -378,7 +381,7 @@ View more -
    Add links to projects
    +
  • @@ -397,7 +400,7 @@ : {{item['labelConcept']}} -
    Add links to contexts
    + @@ -426,9 +429,6 @@ - -
    diff --git a/portal-2/src/app/landingPages/searchingProjectsInTab.component.ts b/portal-2/src/app/landingPages/searchingProjectsInTab.component.ts index a3f98d9d..ae62005e 100644 --- a/portal-2/src/app/landingPages/searchingProjectsInTab.component.ts +++ b/portal-2/src/app/landingPages/searchingProjectsInTab.component.ts @@ -18,12 +18,12 @@ import {StringUtils} from '../utils/string-utils.class'; The results below are discovered through our pilot algorithms. Let us know how we are doing!

    -
    View all {{fetchProjects.totalResults}} results
    +
    View all {{fetchProjects.totalResults}} results
    -
    @@ -85,6 +86,7 @@ export class SearchPageComponent { @Input() refineFields = []; @Input() csvParams: string; @Input() csvPath: string; + @Input() advancedSearchLink: string = ""; @ViewChild (ModalLoading) loading : ModalLoading ; public fieldIdsMap;//: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }}; private searchFieldsHelper:SearchFields = new SearchFields(); @@ -125,8 +127,6 @@ export class SearchPageComponent { } public getQueryParametersFromUrl(params){ - //TODO when final search is done-allFqs/fq - // var parameters = ""; var allFqs = ""; @@ -168,6 +168,8 @@ export class SearchPageComponent { } if(doisParams.length > 0){ doiQuery += "&"+doisParams; + }else { + keywordQuery += "&q="+StringUtils.URIEncode(keyword); } }else{ keywordQuery += "&q="+StringUtils.URIEncode(keyword); diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts index 29bc40a8..93cd4f27 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts @@ -1,6 +1,7 @@ import { NgModule} from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; import{SearchPageComponent} from './searchPage.component'; import{SearchFormModule} from './searchForm.module'; @@ -13,7 +14,7 @@ import {SearchDownloadModule} from './searchDownload.module'; @NgModule({ imports: [ - CommonModule, FormsModule, SearchFormModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchDownloadModule + CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchDownloadModule ], declarations: [ SearchPageComponent, diff --git a/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts b/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts index f6327adf..9221672f 100644 --- a/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts +++ b/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts @@ -18,7 +18,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; type="data providers" entityType="dataprovider" [(filters)] = "filters" [(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)" - [csvParams]="csvParams" csvPath="datasources"> + [csvParams]="csvParams" csvPath="datasources" advancedSearchLink="/search/advanced/dataproviders"> ` diff --git a/portal-2/src/app/searchPages/simple/searchDatasets.component.ts b/portal-2/src/app/searchPages/simple/searchDatasets.component.ts index cf72efbf..6b50447b 100644 --- a/portal-2/src/app/searchPages/simple/searchDatasets.component.ts +++ b/portal-2/src/app/searchPages/simple/searchDatasets.component.ts @@ -19,7 +19,7 @@ import {DOI} from '../../utils/string-utils.class'; type="datasets" entityType="dataset" [(filters)] = "filters" [(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" - [csvParams]="csvParams" csvPath="datasets"> + [csvParams]="csvParams" csvPath="datasets" advancedSearchLink="/search/advanced/datasets"> ` }) diff --git a/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts b/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts index 46d693ba..9a36842e 100644 --- a/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts +++ b/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts @@ -17,7 +17,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; type="organizations" entityType="organization" [(filters)] = "filters" [(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" - [csvParams]="csvParams" csvPath="organizations"> + [csvParams]="csvParams" csvPath="organizations" advancedSearchLink="/search/advanced/organizations"> ` diff --git a/portal-2/src/app/searchPages/simple/searchPeople.component.ts b/portal-2/src/app/searchPages/simple/searchPeople.component.ts index e714a024..3b07f73b 100644 --- a/portal-2/src/app/searchPages/simple/searchPeople.component.ts +++ b/portal-2/src/app/searchPages/simple/searchPeople.component.ts @@ -19,7 +19,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; type="people" entityType="person" [(filters)] = "filters" [(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [showRefine]=false - [csvParams]="csvParams" csvPath="people"> + [csvParams]="csvParams" csvPath="people" advancedSearchLink="/search/advanced/people"> ` diff --git a/portal-2/src/app/searchPages/simple/searchProjects.component.ts b/portal-2/src/app/searchPages/simple/searchProjects.component.ts index 104b4785..0fbe2b24 100644 --- a/portal-2/src/app/searchPages/simple/searchProjects.component.ts +++ b/portal-2/src/app/searchPages/simple/searchProjects.component.ts @@ -17,7 +17,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; type="projects" entityType="project" [(filters)] = "filters" [(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" - [csvParams]="csvParams" csvPath="projects"> + [csvParams]="csvParams" csvPath="projects" advancedSearchLink="/search/advanced/projects"> ` @@ -66,7 +66,6 @@ export class SearchProjectsComponent { firstLoad = false; //get page from url parameters this.searchUtils.page = (params['page']=== undefined)?1:+params['page']; - var queryParameters = this.searchPage.getQueryParametersFromUrl(params); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size); }); diff --git a/portal-2/src/app/searchPages/simple/searchPublications.component.ts b/portal-2/src/app/searchPages/simple/searchPublications.component.ts index 2a56e3a9..5bb61674 100644 --- a/portal-2/src/app/searchPages/simple/searchPublications.component.ts +++ b/portal-2/src/app/searchPages/simple/searchPublications.component.ts @@ -22,7 +22,7 @@ import {DOI} from '../../utils/string-utils.class'; [(filters)] = "filters" [(results)] = "results" [(searchUtils)] = "searchUtils" [(baseUrl)] = baseUrl (queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)" - [csvParams]="csvParams" csvPath="publications"> + [csvParams]="csvParams" csvPath="publications" advancedSearchLink="/search/advanced/publications"> ` @@ -73,9 +73,7 @@ export class SearchPublicationsComponent { } firstLoad = false; this.searchUtils.page = (params['page']=== undefined)?1:+params['page']; - var queryParameters = this.searchPage.getQueryParametersFromUrl(params); - this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size); }); } diff --git a/portal-2/src/app/sharedComponents/navigationBar.component.ts b/portal-2/src/app/sharedComponents/navigationBar.component.ts index a40707f0..df65b34c 100644 --- a/portal-2/src/app/sharedComponents/navigationBar.component.ts +++ b/portal-2/src/app/sharedComponents/navigationBar.component.ts @@ -24,13 +24,13 @@ import 'rxjs/Rx';
  • Data Providers
  • Organizations
  • People
  • -
  • +
    @@ -48,7 +48,7 @@ import 'rxjs/Rx';
    - - -