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
This commit is contained in:
sofia.baltzi 2018-01-26 10:00:45 +00:00
parent aec61776ae
commit 1c2f118991
3 changed files with 24 additions and 1 deletions

View File

@ -12,6 +12,15 @@
</div>
</div>
<p> Available data providers: </p>
<ul>
<li *ngFor="let item of res; let i = index">
{{item.result["metadata"]["oaf:entity"]["oaf:datasource"]["officialname"]}}
</li>
</ul>
</div>
<progress id="js-progressbar" class="uk-progress" value="0" max="100" hidden></progress>

View File

@ -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({

View File

@ -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 => <any> 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 => <any> res.json()).map(res => res.results).do(res => {console.log(res)}).catch(this.handleError);
}
}