diff --git a/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.component.ts b/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.component.ts
index f6fd8018..91fce6c2 100644
--- a/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.component.ts
+++ b/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.component.ts
@@ -17,8 +17,8 @@ import {Dates} from '../../utils/string-utils.class';
{{op.id}}
-
- {{fieldIdsMap[id].name}}
+
+ {{fieldIdsMap[id].name}}
@@ -126,7 +126,14 @@ export class AdvancedSearchFormComponent {
}
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].type = this.fieldIdsMap[id].type;
this.selectedFields[index].value = "";
diff --git a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts
index f5e85f5d..1b9fce2d 100644
--- a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts
+++ b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts
@@ -18,6 +18,7 @@ import {StringUtils, Dates} from '../../utils/string-utils.class';
{{pageTitle}}
+ 0" routerLinkActive="router-link-active" class="uk-float-right" [routerLink]=advancedSearchLink >More search options
@@ -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';
-
+
Deposit
@@ -74,7 +74,7 @@ import 'rxjs/Rx';
-
+
@@ -131,7 +131,7 @@ import 'rxjs/Rx';
-
+
Deposit
diff --git a/portal-2/src/app/utils/altmetrics.component.ts b/portal-2/src/app/utils/altmetrics.component.ts
index 674b78de..ab3c7292 100644
--- a/portal-2/src/app/utils/altmetrics.component.ts
+++ b/portal-2/src/app/utils/altmetrics.component.ts
@@ -18,22 +18,18 @@ export class AltMetricsComponent {
private sub:any;
constructor(private route: ActivatedRoute) {
- console.log("####constr");
// if (typeof document !== 'undefined') {
// let yourModule = require('../utils/altmetrics.js');
// }
}
ngOnInit() {
- console.log("####init");
this.sub = this.route.queryParams.subscribe(data => {
- console.log("####params");
if(this.type == "doi"){
- this.altmetrics='
';
+ this.altmetrics='
';
}else{
- this.altmetrics='
';
+ this.altmetrics='
';
}
- console.log("####params loadAltmetrics");
if (typeof document !== 'undefined') {
// let yourModule = require('../utils/altmetrics.js');
loadAltmetrics("altmetric-embed-js","https://d1bxh8uas1mnw7.cloudfront.net/assets/altmetric_badges-8f271adb184c21cc5169a7f67f7fe5ab.js");
@@ -43,16 +39,5 @@ export class AltMetricsComponent {
ngOnDestroy() {
this.sub.unsubscribe();
}
- update(){
- // console.log("Altmetrics update!");
- // if (typeof document !== 'undefined') {
- // let yourModule = require('../utils/altmetrics.js');
- // }
- // if(this.type == "doi"){
- // this.altmetrics='
';
- // }else{
- // this.altmetrics='
';
- // }
- }
}
diff --git a/portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts b/portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts
index 97109d3c..7c92cdd3 100644
--- a/portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts
+++ b/portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts
@@ -6,7 +6,8 @@ export class FetchProjects{
public results =[];
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 subResults: any;
@@ -96,10 +97,7 @@ export class FetchProjects{
if(refineFields && refineFields.length > 0){
this.filters = data[2];
filterquery = decodeURIComponent(filterquery);
-
- console.log("---filterquery:"+filterquery);
for(var i = 0; i < this.filters.length; i++){
-
if(filterquery.indexOf(this.filters[i].filterId) !== -1){
console.log("this.filters[i].filterId:"+this.filters[i].filterId);
for(var j = 0; j < this.filters[i].values.length; j++){
@@ -114,6 +112,16 @@ export class FetchProjects{
if(!this.totalResults && filterquery == ""){
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();
this.searchUtils.status = errorCodes.DONE;