Commit 55030dce authored by Administrator's avatar Administrator
Browse files

list datastets ok

parent 48c841b4
<h3>Here list of datasets directly from the openapi GET</h3> <h3>Here list of datasets directly from the repository api </h3>
<h3>where you can choose what to publish in FDP</h3>
<form> <form>
<div> <div>
<button type="submit" (click)="listdatasets()" class="btn btn-primary">List datasets</button> <button type="submit" (click)="listdatasets()" class="btn btn-primary">List datasets</button>
</div> </div>
<p><strong>{{dataresult}}</strong></p> <p><strong>Total datasets found: {{dataresult}}</strong></p>
<p><strong>Datasets examples: </strong></p> <p><strong>Examples of datasets found: </strong></p>
<ul> <ul>
<li *ngFor="let item of itemsdatasets; let i = index"><a href={{item.url}} target="_blank" >{{item.entity_id}} {{item.name}} </a> <br> {{item.description}}</li> <li *ngFor="let item of itemsdatasets; let i = index"><a href={{item.url}} target="_blank" >{{item.entity_id}} {{item.name}} </a> <br> {{item.description}}</li>
</ul> </ul>
......
...@@ -2,14 +2,15 @@ import { Component, OnInit } from '@angular/core'; ...@@ -2,14 +2,15 @@ import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
import { AppConfiguration } from '../AppConfiguration'; import { AppConfiguration } from '../AppConfiguration';
import { FileSaverService } from 'ngx-filesaver'; import { FileSaverService } from 'ngx-filesaver';
import { resolve } from 'url';
import { Observable } from 'rxjs';
@Component({ @Component({
selector: 'app-datasets', selector: 'app-datasets',
templateUrl: './datasets.component.html', templateUrl: './datasets.component.html',
styleUrls: ['./datasets.component.scss'] styleUrls: ['./datasets.component.scss']
}) })
export class DatasetsComponent implements OnInit { export class DatasetsComponent implements OnInit {
dataresult: any; dataresult: any;
itemsdatasets: any; itemsdatasets: any;
...@@ -24,10 +25,7 @@ export class DatasetsComponent implements OnInit { ...@@ -24,10 +25,7 @@ export class DatasetsComponent implements OnInit {
} }
listdatasets() { listdatasets() {
var myHeaders = new Headers(); var myHeaders = new Headers();
myHeaders.append("Content-Type", "Application/json"); myHeaders.append("Content-Type", "Application/json");
...@@ -39,18 +37,12 @@ export class DatasetsComponent implements OnInit { ...@@ -39,18 +37,12 @@ export class DatasetsComponent implements OnInit {
.then(response => { .then(response => {
response.json() response.json()
.then(data => { .then(data => {
this.dataresult = 'Total des datasets trouvés: ' + JSON.stringify(data['data']['total_count']); this.dataresult =JSON.stringify(data['data']['total_count']);
this.itemsdatasets = data['data']['items']; this.itemsdatasets = data['data']['items'];
console.log(this.itemsdatasets); });
}); });
});
return null; return null;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment