1. Remove searchDataproviders.service and searchProjects.service from /src/app/services (added in openaireLibrary/connect).
2. Use searchDataproviders.service and searchProjects.service from openaireLibrary/connect. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51658 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
985fa06e99
commit
a982c6b235
|
@ -11,7 +11,7 @@ import {SearchDataProvidersModule} from '../../openaireLibrary/searchPages/simpl
|
|||
import {SearchPageTableViewModule} from '../../openaireLibrary/searchPages/searchUtils/searchPageTableView.module';
|
||||
//import {DataProvidersServiceModule} from '../../openaireLibrary/services/dataProvidersService.module';
|
||||
import {SearchFormModule} from '../../openaireLibrary/searchPages/searchUtils/searchForm.module';
|
||||
import {SearchDataprovidersServiceModule} from '../../services/searchDataprovidersService.module';
|
||||
import {SearchDataprovidersServiceModule} from '../../openaireLibrary/connect/contentProviders/searchDataprovidersService.module';
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule,
|
||||
|
|
|
@ -9,7 +9,7 @@ import {SearchFields, FieldDetails} from '../../openaireLibrary/utils/properties
|
|||
import {SearchPageTableViewComponent } from '../../openaireLibrary/searchPages/searchUtils/searchPageTableView.component';
|
||||
import {SearchUtilsClass } from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class';
|
||||
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
||||
import {SearchCommunityDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchCommunityDataprovidersService} from '../../openaireLibrary/connect/contentProviders/searchDataproviders.service';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -9,7 +9,7 @@ import {SearchFields, FieldDetails} from '../../openaireLibrary/utils/properties
|
|||
import {SearchPageTableViewComponent } from '../../openaireLibrary/searchPages/searchUtils/searchPageTableView.component';
|
||||
import {SearchUtilsClass } from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class';
|
||||
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
||||
import {SearchCommunityProjectsService} from '../../services/searchProjects.service';
|
||||
import {SearchCommunityProjectsService} from '../../openaireLibrary/connect/projects/searchProjects.service';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -13,7 +13,7 @@ import { SearchProjectsModule} from '../../openaireLibrary/searchPages/simple/se
|
|||
import { SearchPageTableViewModule} from '../../openaireLibrary/searchPages/searchUtils/searchPageTableView.module';
|
||||
import {DataProvidersServiceModule} from '../../openaireLibrary/services/dataProvidersService.module';
|
||||
import {SearchFormModule} from '../../openaireLibrary/searchPages/searchUtils/searchForm.module';
|
||||
import {SearchProjectsServiceModule} from '../../services/searchProjectsService.module';
|
||||
import {SearchProjectsServiceModule} from '../../openaireLibrary/connect/projects/searchProjectsService.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import {SearchResult} from '../openaireLibrary/utils/entities/searchResult';
|
||||
import {RefineResultsUtils} from '../openaireLibrary/services/servicesUtils/refineResults.class';
|
||||
import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||
|
||||
@Injectable()
|
||||
export class SearchCommunityDataprovidersService {
|
||||
constructor(private http: Http ) {}
|
||||
|
||||
searchDataproviders (properties:EnvProperties, communityId: string):any {
|
||||
let url = properties.communityAPI+communityId+"/contentproviders";
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
import { NgModule} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import {SearchCommunityDataprovidersService} from './searchDataproviders.service';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule
|
||||
],
|
||||
declarations: [
|
||||
],
|
||||
providers:[
|
||||
SearchCommunityDataprovidersService
|
||||
],
|
||||
exports: [
|
||||
]
|
||||
})
|
||||
export class SearchDataprovidersServiceModule { }
|
|
@ -1,47 +0,0 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import {SearchResult} from '../openaireLibrary/utils/entities/searchResult';
|
||||
import {RefineResultsUtils} from '../openaireLibrary/services/servicesUtils/refineResults.class';
|
||||
import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||
|
||||
@Injectable()
|
||||
export class SearchCommunityProjectsService {
|
||||
constructor(private http: Http ) {}
|
||||
|
||||
searchProjects (properties:EnvProperties, communityId: string):any {
|
||||
let url = properties.communityAPI+communityId+"/projects";
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
//.do(res => console.info(res))
|
||||
//.map(res => this.parseResults(res));
|
||||
}
|
||||
|
||||
/*
|
||||
parseResults(data: any): SearchResult[] {
|
||||
console.info(data);
|
||||
let results = [];
|
||||
|
||||
let length = Array.isArray(data) ? data.length : 1;
|
||||
|
||||
for(let i=0; i<length; i++) {
|
||||
let resData = Array.isArray(data) ? data[i] : data;
|
||||
|
||||
|
||||
var result = {"name": '', "acronym": '', "code": '', "grantId": ''};
|
||||
result.name = resData.name;
|
||||
result.acronym = resData.acronym;
|
||||
result.code = resData.code;
|
||||
result.grantId = resData.grantId;
|
||||
|
||||
results.push(result);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
*/
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
import { NgModule} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import {SearchCommunityProjectsService} from './searchProjects.service';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule
|
||||
],
|
||||
declarations: [
|
||||
],
|
||||
providers:[
|
||||
SearchCommunityProjectsService
|
||||
],
|
||||
exports: [
|
||||
]
|
||||
})
|
||||
export class SearchProjectsServiceModule { }
|
Loading…
Reference in New Issue