From a982c6b235f4858001f0e6db38a7f6a2bf7ca47c Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 4 Apr 2018 12:31:14 +0000 Subject: [PATCH] 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 --- .../simple/searchDataProviders.module.ts | 2 +- .../simple/searchDataproviders.component.ts | 2 +- .../simple/searchProjects.component.ts | 2 +- .../simple/searchProjects.module.ts | 2 +- .../services/searchDataproviders.service.ts | 21 --------- .../searchDataprovidersService.module.ts | 20 -------- src/app/services/searchProjects.service.ts | 47 ------------------- .../services/searchProjectsService.module.ts | 20 -------- 8 files changed, 4 insertions(+), 112 deletions(-) delete mode 100644 src/app/services/searchDataproviders.service.ts delete mode 100644 src/app/services/searchDataprovidersService.module.ts delete mode 100644 src/app/services/searchProjects.service.ts delete mode 100644 src/app/services/searchProjectsService.module.ts diff --git a/src/app/searchPages/simple/searchDataProviders.module.ts b/src/app/searchPages/simple/searchDataProviders.module.ts index 45f131e..a9aff75 100644 --- a/src/app/searchPages/simple/searchDataProviders.module.ts +++ b/src/app/searchPages/simple/searchDataProviders.module.ts @@ -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, diff --git a/src/app/searchPages/simple/searchDataproviders.component.ts b/src/app/searchPages/simple/searchDataproviders.component.ts index 7eb08c3..560acca 100644 --- a/src/app/searchPages/simple/searchDataproviders.component.ts +++ b/src/app/searchPages/simple/searchDataproviders.component.ts @@ -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({ diff --git a/src/app/searchPages/simple/searchProjects.component.ts b/src/app/searchPages/simple/searchProjects.component.ts index c37f501..a0dcd4a 100644 --- a/src/app/searchPages/simple/searchProjects.component.ts +++ b/src/app/searchPages/simple/searchProjects.component.ts @@ -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({ diff --git a/src/app/searchPages/simple/searchProjects.module.ts b/src/app/searchPages/simple/searchProjects.module.ts index d04f46a..e069cee 100644 --- a/src/app/searchPages/simple/searchProjects.module.ts +++ b/src/app/searchPages/simple/searchProjects.module.ts @@ -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: [ diff --git a/src/app/services/searchDataproviders.service.ts b/src/app/services/searchDataproviders.service.ts deleted file mode 100644 index 78dcd2f..0000000 --- a/src/app/services/searchDataproviders.service.ts +++ /dev/null @@ -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 => res.json()) - } -} diff --git a/src/app/services/searchDataprovidersService.module.ts b/src/app/services/searchDataprovidersService.module.ts deleted file mode 100644 index 3c33cf7..0000000 --- a/src/app/services/searchDataprovidersService.module.ts +++ /dev/null @@ -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 { } diff --git a/src/app/services/searchProjects.service.ts b/src/app/services/searchProjects.service.ts deleted file mode 100644 index 070651f..0000000 --- a/src/app/services/searchProjects.service.ts +++ /dev/null @@ -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 => 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