Project

General

Profile

« Previous | Next » 

Revision 51052

Remove available data providers from community-edit-form

View differences:

modules/uoa-admin-portal/trunk/app/pages/community/community-edit-form.component.html
5 5
            <p> Description: <input placeholder="description" type="text" class="uk-input uk-width-medium"/> </p>
6 6
            <p> Logo: </p>
7 7

  
8
                <div class="js-upload uk-placeholder uk-text-center uk-width-medium">
9
                    <div uk-form-custom>
10
                        <span uk-icon="icon: cloud-upload"></span>
11
                        <input type="file">
12
                    </div>
13
                </div>
14

  
15
            <p> Available data providers: </p>
16

  
17
            <ul>
18
              <li *ngFor="let item of res; let i = index">
19
                {{item.result["metadata"]["oaf:entity"]["oaf:datasource"]["officialname"]}}
20
              </li>
21
            </ul>
22

  
23

  
24 8
      </div>
25

  
26 9
            <progress id="js-progressbar" class="uk-progress" value="0" max="100" hidden></progress>
27 10

  
28 11
</div>
29

  
30
<script>
31

  
32
    var bar = document.getElementById('js-progressbar');
33

  
34
    UIkit.upload('.js-upload', {
35

  
36
        url: '',
37
        multiple: true,
38

  
39
        beforeSend: function () {
40
            console.log('beforeSend', arguments);
41
        },
42
        beforeAll: function () {
43
            console.log('beforeAll', arguments);
44
        },
45
        load: function () {
46
            console.log('load', arguments);
47
        },
48
        error: function () {
49
            console.log('error', arguments);
50
        },
51
        complete: function () {
52
            console.log('complete', arguments);
53
        },
54

  
55
        loadStart: function (e) {
56
            console.log('loadStart', arguments);
57

  
58
            bar.removeAttribute('hidden');
59
            bar.max = e.total;
60
            bar.value = e.loaded;
61
        },
62

  
63
        progress: function (e) {
64
            console.log('progress', arguments);
65

  
66
            bar.max = e.total;
67
            bar.value = e.loaded;
68
        },
69

  
70
        loadEnd: function (e) {
71
            console.log('loadEnd', arguments);
72

  
73
            bar.max = e.total;
74
            bar.value = e.loaded;
75
        },
76

  
77
        completeAll: function () {
78
            console.log('completeAll', arguments);
79

  
80
            setTimeout(function () {
81
                bar.setAttribute('hidden', 'hidden');
82
            }, 1000);
83

  
84
            alert('Upload Completed');
85
        }
86

  
87
 });
88

  
89
</script>
modules/uoa-admin-portal/trunk/app/pages/community/community-edit-form.component.ts
20 20

  
21 21

  
22 22
    ngOnInit(){
23
         this._helpContentService.getDataProviders().subscribe(
24
             res => {
25
                this.res = res;
26
                console.log(res);
27
            });
23
         
28 24
    }
29 25

  
30 26
    public get form() {
modules/uoa-admin-portal/trunk/app/services/help-content.service.ts
385 385
        return Observable.throw(error.json().error || 'Server error');
386 386
    }
387 387

  
388
    getDataProviders() {
389
        //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);
390
        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);
391
    }
392

  
393 388
    getStatistics(community_pid: string) {
394 389
        return this.http.get(this._helpContentUrl + 'statistics/'+community_pid)
395 390
            .map(res => <CommunityStatistics> res.json())

Also available in: Unified diff