1. Add searchDataproviders.service and searchProjects.service in openaireLibrary/connect.
2. Remove connect/approvedByCommunity/approved.service.ts: Duplicate of searchDataproviders.service. 3. approved.component: Use searchDataproviders.service from openaireLibrary/connect/contentProviders/ folder. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51659 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
815c5cd3ee
commit
b830fb2a78
|
@ -4,7 +4,7 @@ import { ActivatedRoute } from '@angular/router';
|
||||||
import { EnvProperties} from '../../utils/properties/env-properties';
|
import { EnvProperties} from '../../utils/properties/env-properties';
|
||||||
|
|
||||||
import {ConnectHelper} from '../connectHelper';
|
import {ConnectHelper} from '../connectHelper';
|
||||||
import {ApprovedByCommunityService} from './approved.service';
|
import {SearchCommunityDataprovidersService} from '../contentProviders/searchDataproviders.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'approved-by-community',
|
selector: 'approved-by-community',
|
||||||
|
@ -22,7 +22,7 @@ export class ApprovedByCommunityComponent {
|
||||||
|
|
||||||
properties:EnvProperties;
|
properties:EnvProperties;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: ApprovedByCommunityService) {}
|
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
this.route.data
|
this.route.data
|
||||||
|
|
|
@ -3,18 +3,16 @@ import { CommonModule } from '@angular/common';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import { ApprovedByCommunityComponent } from './approved.component';
|
import { ApprovedByCommunityComponent } from './approved.component';
|
||||||
import { ApprovedByCommunityService } from './approved.service';
|
import { SearchDataprovidersServiceModule } from '../contentProviders/searchDataprovidersService.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, RouterModule
|
CommonModule, RouterModule, SearchDataprovidersServiceModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
ApprovedByCommunityComponent
|
ApprovedByCommunityComponent
|
||||||
],
|
],
|
||||||
providers:[
|
providers:[],
|
||||||
ApprovedByCommunityService
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
ApprovedByCommunityComponent
|
ApprovedByCommunityComponent
|
||||||
]
|
]
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {Http} from '@angular/http';
|
||||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ApprovedByCommunityService {
|
export class SearchCommunityDataprovidersService {
|
||||||
constructor(private http: Http ) {}
|
constructor(private http: Http ) {}
|
||||||
|
|
||||||
searchDataproviders (properties:EnvProperties, communityId: string):any {
|
searchDataproviders (properties:EnvProperties, communityId: string):any {
|
|
@ -0,0 +1,20 @@
|
||||||
|
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 { }
|
|
@ -0,0 +1,15 @@
|
||||||
|
import {Injectable} from '@angular/core';
|
||||||
|
import {Http} from '@angular/http';
|
||||||
|
import{EnvProperties} from '../../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())
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
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