minor changes in Filters

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44051 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2016-10-12 14:30:45 +00:00
parent c9c13f4b29
commit 13522d3c35
2 changed files with 11 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import {Http, Response} from '@angular/http';
import {Observable} from 'rxjs/Observable';
// import {RefineParsingUtils} from './services-utils/refineResults.class';
import { Filter, Value} from '../../searchPages/searchUtils/searchHelperClasses.class';
import { SearchFields} from '../../utils/properties/searchFields';
@Injectable()
export class RefineResultsService {
@ -22,13 +23,14 @@ export class RefineResultsService {
}
public parseRefineResults (data, fields:string[]):Filter[] {
// var data = this.json.refineReuslts;
var searchFields:SearchFields = new SearchFields();
var filters:Filter[] = [];
for(let j=0; j<data.length; j++) {
var filter:Filter = new Filter();
console.log("Parsing field :" + fields[j] );
filter.title = fields[j];
filter.title = searchFields.FIELDS_NAMES[fields[j]];
filter.filterId = fields[j];
filter.originalFilterId = fields[j];
let field = data[j][fields[j]];

View File

@ -24,6 +24,14 @@ export class SearchFields {
public PROJECT_PARAM_FIELDS:string[] = ["funder","fl0","fl1", "fl2", "start","end","sc39"];
public FIELDS_NAMES: { [key:string]:string } = {["funderid"]:"Funder",["fundinglevel0_id"]:"Funding Level 0",
["fundinglevel1_id"]:"Funding Level 1", ["fundinglevel2_id"]:"Funding Level 2", ["relfunderid"]:"Funder",
["relfundinglevel0_id"]:"Funding Level 0",["relfundinglevel1_id"]:"Funding Level 1", ["relfundinglevel2_id"]:"Funding Level 2",
["instancetypenameid"]:"Type",["resultlanguageid"]: "Language",["communityid"]: "Context",["resultacceptanceyear"]:"Year",
["resultbestlicense"]:"Access Mode",["resulthostingdatasourceid"]:"Hosting Data provider",
["collectedfromdatasourceid"]:"Collected from", ["datasourcetypeuiid"]:"Compatibility Type", ["datasourceodlanguages"]:"Language",
["datasourceodcontenttypes"]: "Type", ["datasourcecompatibilityid"]:"Compatibility Type", ["organizationcountryid"]:"Country",
["organizationeclegalbody"]:"Type",["projectstartyear"]:"Start Year",["projectendyear"]:"End Year",["projectecsc39"]:"Special Clause 39"};
public getPROJECT_FIELDS(){
return this.PROJECT_FIELDS;
}