From 1c2f118991fbb79fe723e9939a42104249f9d1b3 Mon Sep 17 00:00:00 2001 From: "sofia.baltzi" Date: Fri, 26 Jan 2018 10:00:45 +0000 Subject: [PATCH] Add test for community edit form git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@50414 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../community/community-edit-form.component.html | 9 +++++++++ app/pages/community/community-edit-form.component.ts | 11 ++++++++++- app/services/help-content.service.ts | 5 +++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/pages/community/community-edit-form.component.html b/app/pages/community/community-edit-form.component.html index 75177b6..8a85b34 100644 --- a/app/pages/community/community-edit-form.component.html +++ b/app/pages/community/community-edit-form.component.html @@ -12,6 +12,15 @@ +

Available data providers:

+ + + + diff --git a/app/pages/community/community-edit-form.component.ts b/app/pages/community/community-edit-form.component.ts index 7355708..27d1727 100644 --- a/app/pages/community/community-edit-form.component.ts +++ b/app/pages/community/community-edit-form.component.ts @@ -14,9 +14,18 @@ export class CommunityEditFormComponent implements OnInit{ public errorMessage: string; + public res=[]; + constructor(public _fb: FormBuilder, private _helpContentService: HelpContentService){} - ngOnInit(): void {} + + ngOnInit(){ + this._helpContentService.getDataProviders().subscribe( + res => { + this.res = res; + console.log(res); + }); + } public get form() { return this._fb.group({ diff --git a/app/services/help-content.service.ts b/app/services/help-content.service.ts index 4cc408b..b8843b8 100644 --- a/app/services/help-content.service.ts +++ b/app/services/help-content.service.ts @@ -276,4 +276,9 @@ export class HelpContentService { return Observable.throw(error.json().error || 'Server error'); } + getDataProviders() { + //return this.http.get('https://beta.services.openaire.eu/search/v2/api/datasources?format=json').map(res => res.json()).map(res => res.results).do(res => {console.log(res)}).catch(this.handleError); + return this.http.get('https://beta.services.openaire.eu/search/v2/api/datasources?format=json').map(res => res.json()).map(res => res.results).do(res => {console.log(res)}).catch(this.handleError); + } + }