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
This commit is contained in:
argiro.kokogiannaki 2017-03-14 16:16:20 +00:00
parent fb466c2fbb
commit 65fc6976ec
31 changed files with 177 additions and 140 deletions

View File

@ -106,7 +106,7 @@ export function gethtmlProjectReportModule() {
return System.import('./landingPages/htmlProjectReport/htmlProjectReport.module' + (process.env.AOT ? '.ngfactory' : '')) return System.import('./landingPages/htmlProjectReport/htmlProjectReport.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'HtmlProjectReportModuleNgFactory' : 'HtmlProjectReportModule')]); .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' : '')) return System.import('./claims/myClaims/myClaims.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'MyClaimsModuleNgFactory' : 'MyClaimsModule')]); .then(mod => mod[(process.env.AOT ? 'MyClaimsModuleNgFactory' : 'MyClaimsModule')]);
} }
@ -122,7 +122,7 @@ export function getLinkingModule() {
export function getBulkLinkingModule() { export function getBulkLinkingModule() {
return System.import('./claims/linking/bulkLinking.module' + (process.env.AOT ? '.ngfactory' : '')) return System.import('./claims/linking/bulkLinking.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'BulkLinkingModuleNgFactory' : 'BulkLinkingModule')]); .then(mod => mod[(process.env.AOT ? 'BulkLinkingModuleNgFactory' : 'BulkLinkingModule')]);
} }*/
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule.forChild([ RouterModule.forChild([
@ -153,16 +153,10 @@ export function getBulkLinkingModule() {
{ path: 'search/advanced/projects', loadChildren: getAdvancedSearchProjectsModule }, { path: 'search/advanced/projects', loadChildren: getAdvancedSearchProjectsModule },
{ path: 'search/advanced/people', loadChildren: getAdvancedSearchPeopleModule }, { path: 'search/advanced/people', loadChildren: getAdvancedSearchPeopleModule },
{ path: 'project-report', loadChildren: gethtmlProjectReportModule }, { path: 'project-report', loadChildren: gethtmlProjectReportModule },
{ path: 'myclaims', loadChildren: getMyClaimsModule }, // { path: 'myclaims', loadChildren: getMyClaimsModule },
{ path: 'claims', loadChildren: getClaimsAdminModule }, // { path: 'claims', loadChildren: getClaimsAdminModule },
{ path: 'bulk-linking', loadChildren: getBulkLinkingModule }, // { path: 'bulk-linking', loadChildren: getBulkLinkingModule },
{ path: 'linking', loadChildren: getLinkingModule }, // { path: 'linking', loadChildren: getLinkingModule },
]) ])
], ],
}) })

View File

@ -38,7 +38,7 @@ import {OrganizationService} from '../services/organization.service';
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0"> <div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
<p>Please use the information/contacts shown below to deposit your {{requestFor}}.</p> <p>Please use the information/contacts shown below to deposit your {{requestFor}}.</p>
<!--showDataProviders [dataProviders]=dataProviders></showDataProviders--> <!--showDataProviders [dataProviders]=dataProviders></showDataProviders-->
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div>
<search-result [(results)]="fetchDataproviders.results" <search-result [(results)]="fetchDataproviders.results"
[(status)]= "fetchDataproviders.searchUtils.status" [(status)]= "fetchDataproviders.searchUtils.status"
type="dataprovider" urlParam="datasourceId"> type="dataprovider" urlParam="datasourceId">

View File

@ -121,17 +121,9 @@
<addThis ></addThis> <addThis ></addThis>
</dd> </dd>
</dl> </dl>
</li> <altmetrics *ngIf="datasetInfo.identifiers != undefined && datasetInfo.identifiers.get('doi') != undefined"
<li> id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi">
<dl class="uk-description-list-line functionsSection"> </altmetrics >
<dt> </dt>
<dd>
<altmetrics *ngIf="datasetInfo.identifiers != undefined && datasetInfo.identifiers.get('doi') != undefined"
id="{{datasetInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics >
</dd>
</dl>
</li> </li>
<li *ngIf="datasetInfo.downloadFrom != undefined && datasetInfo.downloadFrom.size > 0"> <li *ngIf="datasetInfo.downloadFrom != undefined && datasetInfo.downloadFrom.size > 0">
<dl class="uk-description-list-line functionsSection"> <dl class="uk-description-list-line functionsSection">
@ -178,7 +170,7 @@
</mark> </mark>
</a> </a>
</dd> </dd>
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to projects</a></dd> <!--dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to projects</a></dd-->
</dl> </dl>
@ -198,7 +190,7 @@
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span>
</mark> </mark>
</dd> </dd>
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to contexts</a></dd> <!--dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to contexts</a></dd-->
</dl> </dl>
</li> </li>

View File

@ -157,21 +157,21 @@
</dl> </dl>
</li> </li>
<ng-container *ngIf="organizationInfo.projects != undefined"> <ng-container *ngIf="searchingProjectsTabComponent && searchingProjectsTabComponent.fetchProjects.funders.length > 0">
<li *ngFor="let key of organizationInfo.projects.keys()"> <li *ngFor="let funder of searchingProjectsTabComponent.fetchProjects.funders">
<!--a href="{{downloadURLAPI}}resources?size={{organizationInfo.projects.get(key).length}}&{{csvProjectParamsHead}}{{organizationInfo.projects.get(key)[0]['funderId']}}{{csvParamsTail}}"> <!--a href="{{downloadURLAPI}}resources?size={{organizationInfo.projects.get(key).length}}&{{csvProjectParamsHead}}{{organizationInfo.projects.get(key)[0]['funderId']}}{{csvParamsTail}}">
Download projects report (CSV) for {{key}} Download projects report (CSV) for {{key}}
</a--> </a-->
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?size='+organizationInfo.projects.get(key).length+'&'+csvProjectParamsHead+organizationInfo.projects.get(key)[0]['funderId']+csvParamsTail)"> <span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?size='+funder.number+'&'+csvProjectParamsHead+funder.id+csvParamsTail)">
<span aria-hidden="true" class="glyphicon glyphicon-download"></span> <span aria-hidden="true" class="glyphicon glyphicon-download"></span>
<span class="uk-icon-download"> Projects report(CSV) for {{key}}</span> <span class="uk-icon-download"> Projects report(CSV) for {{funder.name}}</span>
</span> </span>
</li> </li>
<li *ngFor="let key of organizationInfo.projects.keys()"> <li *ngFor="let funder of searchingProjectsTabComponent.fetchProjects.funders">
<span class="clickable" (click)="downloadPublicationsFile(key)"> <span class="clickable" (click)="downloadPublicationsFile(funder.name,funder.id, funder.number)">
<span aria-hidden="true" class="glyphicon glyphicon-download"></span> <span aria-hidden="true" class="glyphicon glyphicon-download"></span>
<span class="uk-icon-download"> Publications report(CSV) for {{key}}</span> <span class="uk-icon-download"> Publications report(CSV) for {{funder.name}}</span>
</span> </span>
</li> </li>
</ng-container> </ng-container>

View File

@ -8,6 +8,7 @@ import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataprov
import {SearchPublicationsService} from '../../services/searchPublications.service'; import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service'; import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {SearchProjectsService} from '../../services/searchProjects.service';
import {OpenaireProperties} from '../../utils/properties/openaireProperties'; import {OpenaireProperties} from '../../utils/properties/openaireProperties';
import {SearchingProjectsTabComponent} from '../searchingProjectsInTab.component'; import {SearchingProjectsTabComponent} from '../searchingProjectsInTab.component';
@ -39,12 +40,14 @@ export class OrganizationComponent {
private fetchDataproviders : FetchDataproviders; private fetchDataproviders : FetchDataproviders;
private linkToSearchDataproviders = ""; private linkToSearchDataproviders = "";
@ViewChild (SearchingProjectsTabComponent) searchingProjectsTabComponent : SearchingProjectsTabComponent ; @ViewChild (SearchingProjectsTabComponent) searchingProjectsTabComponent : SearchingProjectsTabComponent ;
private projectFunders:string[] = [];
constructor (private _organizationService: OrganizationService, constructor (private _organizationService: OrganizationService,
private route: ActivatedRoute, private route: ActivatedRoute,
private _searchDataprovidersService: SearchDataprovidersService, private _searchDataprovidersService: SearchDataprovidersService,
private _reportsService: ReportsService, private _reportsService: ReportsService,
private _searchPublicationsService: SearchPublicationsService) { private _searchPublicationsService: SearchPublicationsService,
private _searchProjectsService: SearchProjectsService) {
console.info('organization constructor'); console.info('organization constructor');
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
@ -181,43 +184,85 @@ export class OrganizationComponent {
() => console.log('Completed file download.')); () => console.log('Completed file download.'));
} }
downloadPublicationsFile(funder: string){ downloadPublicationsFile(funder: string, funderId:string, count:number){
console.log("Downloading publications file"); console.log("Downloading publications file");
let response: string[] = []; let response: string[] = [];
let totalResponse: 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)) { let url: string;
this._searchPublicationsService.numOfEntityPublications(project.id, "projects/").subscribe( if(index == 0) {
data => url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special&size="+data;
{ } else {
let index: number = this.organizationInfo.projects.get(funder).indexOf(project); url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special-notitle&size="+data;
}
let url: string; this._reportsService.getCSVResponse(url).subscribe(
if(index == 0) { data =>
url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-special&size="+data; {
} else { counter--;
url = this.downloadURLAPI+"projects/"+project.id+"/publications?format=csv-special-notitle&size="+data;
}
this._reportsService.getCSVResponse(url).subscribe( response[index] = data;
data =>
{
counter--;
response[index] = data; if(counter == 0) {
for(let i=0; i<count; i++) {
totalResponse += response[i]+"\n";
}
window.open(window.URL.createObjectURL(new Blob([totalResponse], { type: 'text/csv' })));
}
},
error => 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<this.organizationInfo.projects.get(funder).length; i++) { error => console.log("Error getting projects project."));
totalResponse += response[i]+"\n";
} // let counter: number = this.organizationInfo.projects.get(funder).length;
window.open(window.URL.createObjectURL(new Blob([totalResponse], { type: 'text/csv' }))); //
} // for(let project of this.organizationInfo.projects.get(funder)) {
}, // this._searchPublicationsService.numOfEntityPublications(project.id, "projects/").subscribe(
error => console.log("Error downloading the file."), // data =>
() => console.log('Completed file download.')); // {
}, // let index: number = this.organizationInfo.projects.get(funder).indexOf(project);
error => console.log("Error getting number of publications for 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<this.organizationInfo.projects.get(funder).length; i++) {
// totalResponse += response[i]+"\n";
// }
// window.open(window.URL.createObjectURL(new Blob([totalResponse], { type: 'text/csv' })));
// }
// },
// error => console.log("Error downloading the file."),
// () => console.log('Completed file download.'));
// },
// error => console.log("Error getting number of publications for project."));
// }//);
} }
} }

View File

@ -13,6 +13,7 @@ import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module'; import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
import {ReportsServiceModule} from '../../services/reportsService.module'; import {ReportsServiceModule} from '../../services/reportsService.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module'; import {PublicationsServiceModule} from '../../services/publicationsService.module';
import {ProjectsServiceModule} from '../../services/projectsService.module';
import { SearchingProjectsTabModule} from '../searchingProjectsInTab.module'; import { SearchingProjectsTabModule} from '../searchingProjectsInTab.module';
@ -27,7 +28,8 @@ import { SearchingProjectsTabModule} from '../searchingProjectsInTab.module';
OrganizationServiceModule, OrganizationServiceModule,
SearchingProjectsTabModule, SearchingProjectsTabModule,
OrganizationServiceModule, OrganizationServiceModule,
PublicationsServiceModule PublicationsServiceModule,
ProjectsServiceModule
], ],
declarations: [ declarations: [

View File

@ -219,13 +219,13 @@
<span>{{projectInfo.funder}} progress report (CSV)</span> <span>{{projectInfo.funder}} progress report (CSV)</span>
</span> </span>
</li> </li>
<li> <!--li>
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> <a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i>
Link to research results Link to research results
</a> </a>
</li> </li-->
<li> <li>
<a href="/deposit-publications"> <a routerLinkActive="router-link-active" routerLink="/deposit-publications">
Deposit Publications Deposit Publications
</a> </a>
</li> </li>

View File

@ -261,7 +261,10 @@
<addThis></addThis> <addThis></addThis>
</dd> </dd>
</dl> </dl>
<altmetrics *ngIf="publicationInfo.identifiers != undefined && publicationInfo.identifiers.get('doi') != undefined" id="{{publicationInfo.identifiers.get('doi')[0]}}" type="doi"> </altmetrics>
</li> </li>
<li *ngIf="publicationInfo.downloadFrom != undefined && publicationInfo.downloadFrom.size > 0"> <li *ngIf="publicationInfo.downloadFrom != undefined && publicationInfo.downloadFrom.size > 0">
<dl class="uk-description-list-line"> <dl class="uk-description-list-line">
<dt class="title">Download from</dt> <dt class="title">Download from</dt>
@ -378,7 +381,7 @@
View more View more
</a> </a>
</dd> </dd>
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to projects</a></dd> <!--dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to projects</a></dd-->
</dl> </dl>
</li> </li>
@ -397,7 +400,7 @@
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span> <span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span>
</mark> </mark>
</dd> </dd>
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to contexts</a></dd> <!--dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Add links to contexts</a></dd-->
</dl> </dl>
</li> </li>
@ -426,9 +429,6 @@
</dl> </dl>
</li> </li>
</ul> </ul>
<altmetrics *ngIf="publicationInfo.identifiers != undefined && publicationInfo.identifiers.get('doi') != undefined"
id="{{publicationInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
</div> </div>
</div> </div>
</div> </div>

View File

@ -18,12 +18,12 @@ import {StringUtils} from '../utils/string-utils.class';
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults > 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchProjects.totalResults > 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.totalResults}} results</a></div>
<div class= "searchPaging uk-panel uk-margin-top"> <div class= "searchPaging uk-panel uk-margin-top">
<div class="uk-float-right" *ngIf="fetchProjects.results && fetchProjects.searchUtils.totalResults > fetchProjects.searchUtils.size"> <div class="uk-float-right" *ngIf="fetchProjects.results && fetchProjects.searchUtils.totalResults > fetchProjects.searchUtils.size">
<paging-no-load [currentPage]="page" [totalResults]="fetchProjects.searchUtils.totalResults" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load> <paging-no-load [currentPage]="page" [totalResults]="fetchProjects.searchUtils.totalResults" [navigateTo]="navigateTo" [term]="keyword" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load>
</div> </div>
<ul class="uk-list uk-list-line"> <ul *ngIf = "fetchProjects.funders.length > 1" class="uk-list uk-list-line">
<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">
@ -50,7 +50,6 @@ export class SearchingProjectsTabComponent {
public size :number = 10; public size :number = 10;
public linkToSearchProjects; public linkToSearchProjects;
private filterQuery:string = ""; private filterQuery:string = "";
public totalResults = 0;
constructor (private _searchProjectsService: SearchProjectsService) { constructor (private _searchProjectsService: SearchProjectsService) {
this.fetchProjects = new FetchProjects(this._searchProjectsService); this.fetchProjects = new FetchProjects(this._searchProjectsService);

View File

@ -20,7 +20,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields" [(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
[(searchUtils)] = "searchUtils" [(searchUtils)] = "searchUtils"
(queryChange)="queryChanged($event)" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources"> [csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/dataproviders">
</advanced-search-page> </advanced-search-page>
` `

View File

@ -19,7 +19,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(searchUtils)] = "searchUtils" [(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields" [(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources"> [csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/datasets">
</advanced-search-page> </advanced-search-page>
` `

View File

@ -19,7 +19,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(searchUtils)] = "searchUtils" [(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields" [(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources"> [csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/organizations">
</advanced-search-page> </advanced-search-page>
` `

View File

@ -19,7 +19,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(searchUtils)] = "searchUtils" [(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields" [(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources"> [csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/people">
</advanced-search-page> </advanced-search-page>
` `

View File

@ -18,7 +18,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(searchUtils)] = "searchUtils" [(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields" [(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources"> [csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/projects">
</advanced-search-page> </advanced-search-page>
` `

View File

@ -19,7 +19,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(searchUtils)] = "searchUtils" [(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields" [(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources"> [csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/publications">
</advanced-search-page> </advanced-search-page>
` `
}) })

View File

@ -40,42 +40,42 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
<ul class="uk-tab uk-tab-left uk-width-large-1-5 uk-width-small-1-1 " data-uk-switcher="{connect:'#searchtabs'}"> <ul class="uk-tab uk-tab-left uk-width-large-1-5 uk-width-small-1-1 " data-uk-switcher="{connect:'#searchtabs'}">
<li (click)="searchPublications()" > <li (click)="searchPublications()" >
<a href="#pubsTab"> <a>
Publications Publications
<span *ngIf = "fetchPublications.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span> <span *ngIf = "fetchPublications.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchPublications.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchPublications.searchUtils.totalResults+')':'')}}</span> <span *ngIf = "fetchPublications.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchPublications.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchDatasets()"> <li (click)="searchDatasets()">
<a href="#dataTab" (click)="searchDatasets()"> <a>
Datasets Datasets
<span *ngIf = "fetchDatasets.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span> <span *ngIf = "fetchDatasets.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchDatasets.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchDatasets.searchUtils.totalResults+')':'')}}</span> <span *ngIf = "fetchDatasets.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchDatasets.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchProjects()" > <li (click)="searchProjects()" >
<a href="#projectsTab"> <a>
Projects Projects
<span *ngIf = "fetchProjects.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span> <span *ngIf = "fetchProjects.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchProjects.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchProjects.searchUtils.totalResults+')':'')}}</span> <span *ngIf = "fetchProjects.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchProjects.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchDataProviders()" > <li (click)="searchDataProviders()" >
<a href="#dataProviderTab"> <a>
Data Providers Data Providers
<span *ngIf = "fetchDataproviders.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span> <span *ngIf = "fetchDataproviders.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchDataproviders.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchDataproviders.searchUtils.totalResults+')':'')}}</span> <span *ngIf = "fetchDataproviders.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchDataproviders.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchOrganizations()" > <li (click)="searchOrganizations()" >
<a href="#organizationsTab" > <a>
Organizations Organizations
<span *ngIf = "fetchOrganizations.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span> <span *ngIf = "fetchOrganizations.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchOrganizations.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchOrganizations.searchUtils.totalResults+')':'')}}</span> <span *ngIf = "fetchOrganizations.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchOrganizations.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchPeople()" > <li (click)="searchPeople()" >
<a href="#peopleTab" > <a>
People People
<span *ngIf = "fetchPeople.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span> <span *ngIf = "fetchPeople.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchPeople.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchPeople.searchUtils.totalResults+')':'')}}</span> <span *ngIf = "fetchPeople.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchPeople.searchUtils.totalResults+')':'')}}</span>
@ -89,7 +89,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
<ul id="searchtabs" class="uk-switcher uk-margin-left uk-width-large-3-4 uk-width-small-1-1"> <ul id="searchtabs" class="uk-switcher uk-margin-left uk-width-large-3-4 uk-width-small-1-1">
<li id="pubsTab" class="uk-active"> <li id="pubsTab" class="uk-active">
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div>
<search-result [(results)]="fetchPublications.results" <search-result [(results)]="fetchPublications.results"
[(status)]= "fetchPublications.searchUtils.status" showLoading = true [(status)]= "fetchPublications.searchUtils.status" showLoading = true
type="publication" urlParam="articleId"> type="publication" urlParam="articleId">
@ -101,7 +101,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
</li> </li>
<li id="dataTab"> <li id="dataTab">
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div>
<search-result [(results)]="fetchDatasets.results" <search-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.searchUtils.status" showLoading = true [(status)]= "fetchDatasets.searchUtils.status" showLoading = true
type="dataset" urlParam="datasetId"> type="dataset" urlParam="datasetId">
@ -113,7 +113,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
</li> </li>
<li id="projectsTab" > <li id="projectsTab" >
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults> 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults> 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div>
<search-result [(results)]="fetchProjects.results" <search-result [(results)]="fetchProjects.results"
[(status)]= "fetchProjects.searchUtils.status" showLoading = true [(status)]= "fetchProjects.searchUtils.status" showLoading = true
type="project" urlParam="projectId"> type="project" urlParam="projectId">
@ -125,7 +125,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
</li> </li>
<li id="dataProviderTab"> <li id="dataProviderTab">
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div>
<search-result [(results)]="fetchDataproviders.results" <search-result [(results)]="fetchDataproviders.results"
[(status)]= "fetchDataproviders.searchUtils.status" showLoading = true [(status)]= "fetchDataproviders.searchUtils.status" showLoading = true
type="dataprovider" urlParam="datasourceId"> type="dataprovider" urlParam="datasourceId">
@ -137,7 +137,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
</li> </li>
<li id="organizationsTab" > <li id="organizationsTab" >
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchOrganizations.searchUtils.totalResults> 10" ><a [href] = "linkToSearchOrganizations" >View all {{fetchOrganizations.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchOrganizations.searchUtils.totalResults> 10" ><a [href] = "linkToSearchOrganizations" >View all {{fetchOrganizations.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div>
<search-result [(results)]="fetchOrganizations.results" <search-result [(results)]="fetchOrganizations.results"
[(status)]= "fetchOrganizations.searchUtils.status" showLoading = true [(status)]= "fetchOrganizations.searchUtils.status" showLoading = true
type="organization" urlParam="organizationId"> type="organization" urlParam="organizationId">
@ -149,7 +149,7 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
</li> </li>
<li id="peopleTab"> <li id="peopleTab">
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchPeople.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPeople" >View all {{fetchPeople.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchPeople.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPeople" >View all {{fetchPeople.searchUtils.totalResults}} results <i class="uk-icon-angle-double-right"></i></a></div>
<search-result [(results)]="fetchPeople.results" <search-result [(results)]="fetchPeople.results"
[(status)]= "fetchPeople.searchUtils.status" showLoading = true [(status)]= "fetchPeople.searchUtils.status" showLoading = true
type="person" urlParam="personId"> type="person" urlParam="personId">

View File

@ -17,8 +17,8 @@ import {Dates} from '../../utils/string-utils.class';
<td *ngIf = "i != 0" class=""><select [(ngModel)]="selectedField.operatorId" name="selectOp_{{i}}" > <td *ngIf = "i != 0" class=""><select [(ngModel)]="selectedField.operatorId" name="selectOp_{{i}}" >
<option *ngFor="let op of operators" (change)="fieldOperatorChanged(i, op.id, op.id)" (click)="fieldOperatorChanged(i, op.id, op.id)" [value]="op.id">{{op.id}}</option> <option *ngFor="let op of operators" (change)="fieldOperatorChanged(i, op.id, op.id)" (click)="fieldOperatorChanged(i, op.id, op.id)" [value]="op.id">{{op.id}}</option>
</select></td> </select></td>
<td ><select [(ngModel)]="selectedField.id" name="selectField_{{i}}" (click)="fieldIdsChanged(i)" > <td ><select [(ngModel)]="selectedField.id" name="selectField_{{i}}" (click)="fieldIdsChanged(i)" >
<option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}}</option> <option *ngFor="let id of fieldIds" [value]="id" >{{fieldIdsMap[id].name}}</option>
</select> </td> </select> </td>
<td *ngIf = "selectedField.type == 'keyword'" ><input type="text" class="form-control" placeholder="Type keywords..." <td *ngIf = "selectedField.type == 'keyword'" ><input type="text" class="form-control" placeholder="Type keywords..."
[(ngModel)]="selectedField.value" name="value[{{i}}]"></td> [(ngModel)]="selectedField.value" name="value[{{i}}]"></td>
@ -126,7 +126,14 @@ export class AdvancedSearchFormComponent {
} }
fieldIdsChanged(index: number) { fieldIdsChanged(index: number) {
var id =this.selectedFields[index].id; console.log("Field index::"+index + this.selectedFields[index].id );
var id= this.fieldIds[0];
this.selectedFields[index].name = this.fieldIdsMap[id].name;
this.selectedFields[index].type = this.fieldIdsMap[id].type;
this.selectedFields[index].value = "";
this.selectedFields[index].param = this.fieldIdsMap[id].param;
var id =this.selectedFields[index].id;
this.selectedFields[index].name = this.fieldIdsMap[id].name; this.selectedFields[index].name = this.fieldIdsMap[id].name;
this.selectedFields[index].type = this.fieldIdsMap[id].type; this.selectedFields[index].type = this.fieldIdsMap[id].type;
this.selectedFields[index].value = ""; this.selectedFields[index].value = "";

View File

@ -18,6 +18,7 @@ import {StringUtils, Dates} from '../../utils/string-utils.class';
<h1>{{pageTitle}}</h1> <h1>{{pageTitle}}</h1>
</div> </div>
<div> <div>
<a *ngIf = "simpleSearchLink && simpleSearchLink.length > 0" routerLinkActive="router-link-active" [routerLink]=simpleSearchLink class="uk-float-right" >Simple search <i class="uk-icon-angle-double-right"></i></a>
<advanced-search-form <advanced-search-form
[entityType] = "entityType" [entityType] = "entityType"
[(fieldIds)]="fieldIds" [(fieldIds)]="fieldIds"
@ -55,6 +56,9 @@ export class AdvancedSearchPageComponent {
@ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild (ModalLoading) loading : ModalLoading ;
@Input() csvParams: string; @Input() csvParams: string;
@Input() csvPath: string; @Input() csvPath: string;
@Input() simpleSearchLink: string = "";
public parameterNames:string[] =[]; public parameterNames:string[] =[];
public parameterValues:string[] =[]; public parameterValues:string[] =[];

View File

@ -1,6 +1,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{AdvancedSearchPageComponent} from './advancedSearchPage.component'; import{AdvancedSearchPageComponent} from './advancedSearchPage.component';
import{SearchResultsModule} from './searchResults.module'; import{SearchResultsModule} from './searchResults.module';
@ -13,7 +14,7 @@ import {AdvancedSearchFormModule} from '../searchUtils/advancedSearchForm.module
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, AdvancedSearchFormModule, SearchDownloadModule CommonModule, FormsModule, RouterModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, AdvancedSearchFormModule, SearchDownloadModule
], ],
declarations: [ declarations: [
AdvancedSearchPageComponent, AdvancedSearchPageComponent,

View File

@ -1,7 +1,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 { MyDatePickerModule } from 'mydatepicker'; import { MyDatePickerModule } from 'mydatepicker';
import {DateFilterComponent} from './dateFilter.component'; import {DateFilterComponent} from './dateFilter.component';
@NgModule({ @NgModule({
imports: [ imports: [

View File

@ -32,6 +32,7 @@ import {ModalLoading} from '../../utils/modal/loading.component';
</span> </span>
<a (click)="clearFilters()" class = "btn uk-text-right"> Clear Filters[<i class="uk-icon-remove"></i>]</a> <a (click)="clearFilters()" class = "btn uk-text-right"> Clear Filters[<i class="uk-icon-remove"></i>]</a>
</div> </div>
<a *ngIf = "advancedSearchLink && advancedSearchLink.length > 0" routerLinkActive="router-link-active" class="uk-float-right" [routerLink]=advancedSearchLink >More search options <i class="uk-icon-angle-double-right"></i></a>
</div> </div>
<div class="uk-grid uk-width-1-1 uk-margin"> <div class="uk-grid uk-width-1-1 uk-margin">
<div class=" search-filters uk-width-large-1-4 uk-width-medium-1-4 uk-width-small-1-1"> <div class=" search-filters uk-width-large-1-4 uk-width-medium-1-4 uk-width-small-1-1">
@ -85,6 +86,7 @@ export class SearchPageComponent {
@Input() refineFields = []; @Input() refineFields = [];
@Input() csvParams: string; @Input() csvParams: string;
@Input() csvPath: string; @Input() csvPath: string;
@Input() advancedSearchLink: string = "";
@ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild (ModalLoading) loading : ModalLoading ;
public fieldIdsMap;//: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }}; public fieldIdsMap;//: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }};
private searchFieldsHelper:SearchFields = new SearchFields(); private searchFieldsHelper:SearchFields = new SearchFields();
@ -125,8 +127,6 @@ export class SearchPageComponent {
} }
public getQueryParametersFromUrl(params){ public getQueryParametersFromUrl(params){
//TODO when final search is done-allFqs/fq
// var parameters = ""; // var parameters = "";
var allFqs = ""; var allFqs = "";
@ -168,6 +168,8 @@ export class SearchPageComponent {
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
doiQuery += "&"+doisParams; doiQuery += "&"+doisParams;
}else {
keywordQuery += "&q="+StringUtils.URIEncode(keyword);
} }
}else{ }else{
keywordQuery += "&q="+StringUtils.URIEncode(keyword); keywordQuery += "&q="+StringUtils.URIEncode(keyword);

View File

@ -1,6 +1,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{SearchPageComponent} from './searchPage.component'; import{SearchPageComponent} from './searchPage.component';
import{SearchFormModule} from './searchForm.module'; import{SearchFormModule} from './searchForm.module';
@ -13,7 +14,7 @@ import {SearchDownloadModule} from './searchDownload.module';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, SearchFormModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchDownloadModule CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchDownloadModule
], ],
declarations: [ declarations: [
SearchPageComponent, SearchPageComponent,

View File

@ -18,7 +18,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
type="data providers" entityType="dataprovider" [(filters)] = "filters" type="data providers" entityType="dataprovider" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" [(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)" (queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="datasources"> [csvParams]="csvParams" csvPath="datasources" advancedSearchLink="/search/advanced/dataproviders">
</search-page> </search-page>
` `

View File

@ -19,7 +19,7 @@ import {DOI} from '../../utils/string-utils.class';
type="datasets" entityType="dataset" [(filters)] = "filters" type="datasets" entityType="dataset" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="datasets"> [csvParams]="csvParams" csvPath="datasets" advancedSearchLink="/search/advanced/datasets">
</search-page> </search-page>
` `
}) })

View File

@ -17,7 +17,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
type="organizations" entityType="organization" [(filters)] = "filters" type="organizations" entityType="organization" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="organizations"> [csvParams]="csvParams" csvPath="organizations" advancedSearchLink="/search/advanced/organizations">
</search-page> </search-page>
` `

View File

@ -19,7 +19,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
type="people" entityType="person" [(filters)] = "filters" type="people" entityType="person" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [showRefine]=false [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [showRefine]=false
[csvParams]="csvParams" csvPath="people"> [csvParams]="csvParams" csvPath="people" advancedSearchLink="/search/advanced/people">
</search-page> </search-page>
` `

View File

@ -17,7 +17,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
type="projects" entityType="project" [(filters)] = "filters" type="projects" entityType="project" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="projects"> [csvParams]="csvParams" csvPath="projects" advancedSearchLink="/search/advanced/projects">
</search-page> </search-page>
` `
@ -66,7 +66,6 @@ export class SearchProjectsComponent {
firstLoad = false; firstLoad = false;
//get page from url parameters //get page from url parameters
this.searchUtils.page = (params['page']=== undefined)?1:+params['page']; this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size);
}); });

View File

@ -22,7 +22,7 @@ import {DOI} from '../../utils/string-utils.class';
[(filters)] = "filters" [(results)] = "results" [(filters)] = "filters" [(results)] = "results"
[(searchUtils)] = "searchUtils" [(baseUrl)] = baseUrl [(searchUtils)] = "searchUtils" [(baseUrl)] = baseUrl
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)" (queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="publications"> [csvParams]="csvParams" csvPath="publications" advancedSearchLink="/search/advanced/publications">
</search-page> </search-page>
` `
@ -73,9 +73,7 @@ export class SearchPublicationsComponent {
} }
firstLoad = false; firstLoad = false;
this.searchUtils.page = (params['page']=== undefined)?1:+params['page']; this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size);
}); });
} }

View File

@ -24,13 +24,13 @@ import 'rxjs/Rx';
<li><a routerLinkActive="router-link-active" routerLink="search/find/dataproviders">Data Providers</a></li> <li><a routerLinkActive="router-link-active" routerLink="search/find/dataproviders">Data Providers</a></li>
<li><a routerLinkActive="router-link-active" routerLink="search/find/organizations">Organizations</a></li> <li><a routerLinkActive="router-link-active" routerLink="search/find/organizations">Organizations</a></li>
<li><a routerLinkActive="router-link-active" routerLink="search/find/people">People</a></li> <li><a routerLinkActive="router-link-active" routerLink="search/find/people">People</a></li>
<li class="uk-nav-divider"></li> <!--li class="uk-nav-divider"></li>
<li><a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication" >Publication </a></li> <li><a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication" >Publication </a></li>
<li><a [queryParams]="{datasetId: 'datacite____::430ac1c41b7f99b7b543ef737dc41a74'}" routerLinkActive="router-link-active" routerLink="search/dataset" >Dataset </a></li> <li><a [queryParams]="{datasetId: 'datacite____::430ac1c41b7f99b7b543ef737dc41a74'}" routerLinkActive="router-link-active" routerLink="search/dataset" >Dataset </a></li>
<li><a [queryParams]="{projectId: 'corda_______::2c37878a0cede85dbbd1081bb9b4a2f8'}" routerLinkActive="router-link-active" routerLink="search/project" >Project </a></li> <li><a [queryParams]="{projectId: 'corda_______::2c37878a0cede85dbbd1081bb9b4a2f8'}" routerLinkActive="router-link-active" routerLink="search/project" >Project </a></li>
<li><a [queryParams]="{personId: 'datacite____::9da3a037961b36a634fcd40ab0bf6535'}" routerLinkActive="router-link-active" routerLink="search/person" >Person </a></li> <li><a [queryParams]="{personId: 'datacite____::9da3a037961b36a634fcd40ab0bf6535'}" routerLinkActive="router-link-active" routerLink="search/person" >Person </a></li>
<li><a [queryParams]="{organizationId: 'dedup_wf_001::f686277c34bf457bbdf19e03589b5e81'}" routerLinkActive="router-link-active" routerLink="search/organization" >Organization </a></li> <li><a [queryParams]="{organizationId: 'dedup_wf_001::f686277c34bf457bbdf19e03589b5e81'}" routerLinkActive="router-link-active" routerLink="search/organization" >Organization </a></li>
<li><a [queryParams]="{datasourceId: 'opendoar____::798ed7d4ee7138d49b8828958048130a'}" routerLinkActive="router-link-active" routerLink="search/dataprovider" >Data Provider </a></li> <li><a [queryParams]="{datasourceId: 'opendoar____::798ed7d4ee7138d49b8828958048130a'}" routerLinkActive="router-link-active" routerLink="search/dataprovider" >Data Provider </a></li-->
</ul> </ul>
</div> </div>
@ -48,7 +48,7 @@ import 'rxjs/Rx';
</div> </div>
</li> </li>
<li class="uk-parent" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false"> <!--li class="uk-parent" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false">
<a routerLinkActive="router-link-active" routerLink="search/advanced/publications">Advanced Search</a> <a routerLinkActive="router-link-active" routerLink="search/advanced/publications">Advanced Search</a>
<div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" aria-hidden="true" style="top: 40px; left: 0px;" tabindex=""> <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" aria-hidden="true" style="top: 40px; left: 0px;" tabindex="">
@ -62,7 +62,7 @@ import 'rxjs/Rx';
</ul> </ul>
</div> </div>
</li> </li-->
<li class="uk-parent" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false"> <li class="uk-parent" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false">
<a routerLinkActive="router-link-active" routerLink="deposit-publications" >Deposit</a> <a routerLinkActive="router-link-active" routerLink="deposit-publications" >Deposit</a>
@ -74,7 +74,7 @@ import 'rxjs/Rx';
</div> </div>
</li> </li>
<li class="uk-parent" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false"> <!--li class="uk-parent" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false">
<a routerLinkActive="router-link-active" routerLink="linking" >Linking</a> <a routerLinkActive="router-link-active" routerLink="linking" >Linking</a>
<div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" aria-hidden="true" style="top: 40px; left: 0px;" tabindex=""> <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" aria-hidden="true" style="top: 40px; left: 0px;" tabindex="">
@ -85,7 +85,7 @@ import 'rxjs/Rx';
</ul> </ul>
</div> </div>
</li> </li-->
</ul> </ul>
@ -131,7 +131,7 @@ import 'rxjs/Rx';
</div> </div>
</li> </li>
<li class="" aria-expanded="false" > <!--li class="" aria-expanded="false" >
<a href="#">Advanced Search</a> <a href="#">Advanced Search</a>
<div ><ul class="uk-nav-sub" role="menu"> <div ><ul class="uk-nav-sub" role="menu">
@ -144,7 +144,7 @@ import 'rxjs/Rx';
</ul> </ul>
</div> </div>
</li> </li-->
<li class="" aria-expanded="false" > <li class="" aria-expanded="false" >
<a href="#">Deposit</a> <a href="#">Deposit</a>

View File

@ -18,22 +18,18 @@ export class AltMetricsComponent {
private sub:any; private sub:any;
constructor(private route: ActivatedRoute) { constructor(private route: ActivatedRoute) {
console.log("####constr");
// if (typeof document !== 'undefined') { // if (typeof document !== 'undefined') {
// let yourModule = require('../utils/altmetrics.js'); // let yourModule = require('../utils/altmetrics.js');
// } // }
} }
ngOnInit() { ngOnInit() {
console.log("####init");
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
console.log("####params");
if(this.type == "doi"){ if(this.type == "doi"){
this.altmetrics='<div data-badge-popover="right" data-hide-no-mentions="true" data-badge-type="donut" data-doi="'+this.id+'" class="altmetric-embed"> </div>'; this.altmetrics='<div data-badge-popover="right" data-hide-no-mentions="true" data-badge-type="donut" data-doi="'+this.id+'" class="altmetric-embed uk-text-center"> </div>';
}else{ }else{
this.altmetrics='<div data-badge-popover="right" data-hide-no-mentions="true" data-badge-type="donut" data-arxiv-id="'+this.id+'" class="altmetric-embed"> </div>'; this.altmetrics='<div data-badge-popover="right" data-hide-no-mentions="true" data-badge-type="donut" data-arxiv-id="'+this.id+'" class="altmetric-embed uk-text-center"> </div>';
} }
console.log("####params loadAltmetrics");
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
// let yourModule = require('../utils/altmetrics.js'); // let yourModule = require('../utils/altmetrics.js');
loadAltmetrics("altmetric-embed-js","https://d1bxh8uas1mnw7.cloudfront.net/assets/altmetric_badges-8f271adb184c21cc5169a7f67f7fe5ab.js"); loadAltmetrics("altmetric-embed-js","https://d1bxh8uas1mnw7.cloudfront.net/assets/altmetric_badges-8f271adb184c21cc5169a7f67f7fe5ab.js");
@ -43,16 +39,5 @@ export class AltMetricsComponent {
ngOnDestroy() { ngOnDestroy() {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
update(){
// console.log("Altmetrics update!");
// if (typeof document !== 'undefined') {
// let yourModule = require('../utils/altmetrics.js');
// }
// if(this.type == "doi"){
// this.altmetrics='<div data-badge-popover="right" data-hide-no-mentions="true" data-badge-type="donut" data-doi="'+this.id+'" class="altmetric-embed"> </div>';
// }else{
// this.altmetrics='<div data-badge-popover="right" data-hide-no-mentions="true" data-badge-type="donut" data-arxiv-id="'+this.id+'" class="altmetric-embed"> </div>';
// }
}
} }

View File

@ -6,7 +6,8 @@ export class FetchProjects{
public results =[]; public results =[];
public filters; // for getResultsForOrganizations public filters; // for getResultsForOrganizations
public totalResults; // for getResultsForOrganizations // this is total results before filtering public totalResults; // for getResultsForOrganizations // this is total results with the initial query - before filtering
public funders:any = []; // for getResultsForOrganizations // this is filled with the initial query - before filtering
public sub: any; public sub: any;
public subResults: any; public subResults: any;
@ -96,10 +97,7 @@ export class FetchProjects{
if(refineFields && refineFields.length > 0){ if(refineFields && refineFields.length > 0){
this.filters = data[2]; this.filters = data[2];
filterquery = decodeURIComponent(filterquery); filterquery = decodeURIComponent(filterquery);
console.log("---filterquery:"+filterquery);
for(var i = 0; i < this.filters.length; i++){ for(var i = 0; i < this.filters.length; i++){
if(filterquery.indexOf(this.filters[i].filterId) !== -1){ if(filterquery.indexOf(this.filters[i].filterId) !== -1){
console.log("this.filters[i].filterId:"+this.filters[i].filterId); console.log("this.filters[i].filterId:"+this.filters[i].filterId);
for(var j = 0; j < this.filters[i].values.length; j++){ for(var j = 0; j < this.filters[i].values.length; j++){
@ -114,6 +112,16 @@ export class FetchProjects{
if(!this.totalResults && filterquery == ""){ if(!this.totalResults && filterquery == ""){
this.totalResults = this.searchUtils.totalResults; this.totalResults = this.searchUtils.totalResults;
this.funders = [];
for(var i = 0; i < this.filters.length; i++){
console.log("this.filters[i].filterId:"+this.filters[i].filterId);
if(this.filters[i].filterId == "funderid"){
this.funders = (this.filters[i].values);
}
}
console.log(" this.funders:"+ this.funders);
} }
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.DONE; this.searchUtils.status = errorCodes.DONE;