Project

General

Profile

« Previous | Next » 

Revision 51830

fixed some bugs - fixed number of events shown in content/events

View differences:

modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-interface-form.component.html
13 13
    </div>
14 14
    <div class="whiteFilm"></div>
15 15
  </div>
16
  <div *ngIf="group" [formGroup]="group">
16
  <div *ngIf="group && (!loadingMessage || loadingMessage==='')" [formGroup]="group">
17 17
    <div *ngIf="successMessage" class="uk-alert uk-alert-success" style="clear: both">{{ successMessage }}</div>
18 18
    <div *ngIf="errorMessage" class="uk-alert uk-alert-danger" style="clear: both">{{ errorMessage }}</div>
19 19
    <div *ngIf="groupErrorMessage" class="uk-alert uk-alert-danger" style="clear: both">{{ groupErrorMessage }}</div>
modules/uoa-repository-dashboard-gui/trunk/app/pages/metrics/metrics-show.component.html
33 33
                <div class="whiteFilm"></div>
34 34
              </div>
35 35
              <div *ngIf="repoMetrics">
36
                <a class="uk-button uk-button-link"
37
                   [routerLink]="['/getImpact/usagestats',repoId]" title="">Get statistics report</a>
38
                <div class="uk-margin-medium-bottom">
39
                  <div>
40
                    <div class="uk-child-width-1-3@m uk-grid-small uk-grid-match uk-grid" uk-grid="">
41
                      <div class="metrics-openaire uk-first-column">
42
                        <div class="uk-tile uk-tile-default uk-padding-small">
43
                          <div class="uk-text-center">   {{ pageViews }}</div>
44
                          <div class="uk-text-center"> views in OpenAIRE</div>
36
                <div class="uk-grid">
37
                  <div class="uk-width-1-1 uk-margin-bottom">
38
                    <div class="uk-float-right">
39
                      <a class="uk-button uk-button-primary"
40
                         [routerLink]="['/getImpact/usagestats',repoId]" title="">Get statistics report</a>
41
                    </div>
42
                  </div>
43
                  <div class="uk-width-1-1 uk-margin-medium-bottom">
44
                    <div>
45
                      <div class="uk-child-width-1-3@m uk-grid-small uk-grid-match uk-grid" uk-grid="">
46
                        <div class="metrics-openaire uk-first-column">
47
                          <div class="uk-tile uk-tile-default uk-padding-small">
48
                            <div class="uk-text-center">   {{ pageViews }}</div>
49
                            <div class="uk-text-center"> views in OpenAIRE</div>
50
                          </div>
45 51
                        </div>
46
                      </div>
47
                      <div class="metrics-views">
48
                        <div class="uk-tile uk-tile-muted uk-padding-small">
49
                          <div class="uk-text-center">  {{ totalViews }}
50
                            <span *ngIf="repoMetrics.metricsNumbers.total_openaire_views">( {{ repoMetrics.metricsNumbers.total_openaire_views }} from OpenAIRE )</span>
52
                        <div class="metrics-views">
53
                          <div class="uk-tile uk-tile-muted uk-padding-small">
54
                            <div class="uk-text-center">  {{ totalViews }}
55
                              <span *ngIf="repoMetrics.metricsNumbers.total_openaire_views">( {{ repoMetrics.metricsNumbers.total_openaire_views }} from OpenAIRE )</span>
56
                            </div>
57
                            <div class="uk-text-center">views in local repository</div>
51 58
                          </div>
52
                          <div class="uk-text-center">views in local repository</div>
53 59
                        </div>
54
                      </div>
55
                      <div class="metrics-downloads">
56
                        <div class="uk-tile uk-tile-primary uk-padding-small">
57
                          <div class="uk-text-center">  {{ totalDownloads }}
58
                            <span *ngIf="repoMetrics.metricsNumbers.total_openaire_downloads">( {{ repoMetrics.metricsNumbers.total_openaire_downloads }} from OpenAIRE )</span></div>
59
                          <div class="uk-text-center">downloads in local repository</div>
60
                        <div class="metrics-downloads">
61
                          <div class="uk-tile uk-tile-primary uk-padding-small">
62
                            <div class="uk-text-center">  {{ totalDownloads }}
63
                              <span *ngIf="repoMetrics.metricsNumbers.total_openaire_downloads">( {{ repoMetrics.metricsNumbers.total_openaire_downloads }} from OpenAIRE )</span></div>
64
                            <div class="uk-text-center">downloads in local repository</div>
65
                          </div>
60 66
                        </div>
61 67
                      </div>
62 68
                    </div>
63 69
                  </div>
70
                  <div class="uk-width-1-1 uk-text-center uk-card uk-card-default uk-card-hover uk-scrollspy-inview uk-animation-slide-top-medium uk-margin-bottom uk-padding">
71
                    <iframe class="statsFrame" [src]="viewsUrl"></iframe>
72
                  </div>
73
                  <div class="uk-width-1-1 uk-text-center uk-card uk-card-default uk-card-hover uk-scrollspy-inview uk-animation-slide-top-medium uk-margin-bottom uk-padding">
74
                    <iframe class="statsFrame" [src]="downloadsUrl"></iframe>
75
                  </div>
64 76
                </div>
65
                <div class="uk-text-center uk-card uk-card-default uk-card-hover uk-scrollspy-inview uk-animation-slide-top-medium uk-margin-bottom uk-padding">
66
                  <iframe class="statsFrame" [src]="viewsUrl"></iframe>
67
                </div>
68
                <div class="uk-text-center uk-card uk-card-default uk-card-hover uk-scrollspy-inview uk-animation-slide-top-medium uk-margin-bottom uk-padding">
69
                  <iframe class="statsFrame" [src]="downloadsUrl"></iframe>
70
                </div>
71 77
              </div>
72 78

  
73 79
            </div>
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-events.component.html
19 19
        <!-- MIDDLE -->
20 20
        <div class=" uk-width-expand@m">
21 21

  
22
          <repository-tiles [parent]="'contentEvents'"></repository-tiles>
22
          <div>
23
            <div class="uk-width-1-1 uk-grid">
24
              <div class="uk-width-1-1 uk-first-column uk-margin-bottom">
25
                <div class="uk-float-right">
26
                  <a class="grid-view" [class.active]="tilesView" (click)="toggleTiles()">
27
                    <i class="fa fa-th"></i>
28
                  </a>
29
                  <a class="grid-view"  [class.active]="!tilesView" (click)="toggleTiles()">
30
                    <i class="fa fa-th-list"></i>
31
                  </a>
32
                </div>
33
              </div>
34
              <div class="uk-width-1-1">
35
                <div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div>
36
                <div *ngIf="noDatasourcesMessage" class="uk-alert uk-alert-warning">{{ noDatasourcesMessage }}</div>
37
                <div *ngIf="loadingMessage" class="loading-big">
38
                  <div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">
39
                    {{ loadingMessage }}
40
                  </div>
41
                  <div class="whiteFilm"></div>
42
                </div>
23 43

  
44
                <!--TILES VIEW-->
45
                <div *ngIf="tilesView && datasourcesOfUser.length>0" class="uk-grid-large uk-grid-margin-large uk-grid repos-grid uk-height-1-1">
46
                  <div *ngFor="let repo of datasourcesOfUser" class="uk-width-expand@m uk-width-auto\@m uk-first-column uk-margin-bottom" style="min-width: 300px; max-width: 22%;">
47
                    <div class="uk-margin uk-grid-match uk-child-width-1-1 uk-grid-small uk-grid-divider uk-grid uk-scrollspy-inview uk-animation-slide-top-medium uk-grid-stack">
48
                      <div class="uk-first-column">
49
                        <div class="">
50
                          <a class="el-link uk-vertical-align-middle uk-height-1-1" [routerLink]="[repo['first']['value']]">
51
                            <div class="el-item uk-panel uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="">
52
                              <div class="uk-child-width-expand uk-grid-medium uk-flex-middle uk-grid uk-grid-stack" uk-grid="">
53
                                <div class="uk-width-1-3@m uk-first-column" style="width: 90px;">
54
                                  <img *ngIf="!repo['second']" class="el-image uk-border-rounded" src="/assets/imgs/yourLogoHere.jpg" alt="">
55
                                  <img *ngIf="repo['second']" class="el-image uk-border-rounded" src="{{ repo['second'] }}" alt="">
56
                                </div>
57
                                <div class="uk-first-column">
58
                                  <h3 class="el-title uk-margin uk-h5 uk-margin-remove-adjacent uk-margin-small-bottom">{{ repo['first']['value'] }}</h3>
59
                                  <div class="el-meta uk-margin uk-text-meta">
60
                                    <span>({{ repo['first']['size'] }} events)</span>
61
                                  </div>
62
                                </div>
63
                              </div>
64
                            </div>
65
                          </a>
66
                        </div>
67
                      </div>
68
                    </div>
69
                  </div>
70
                </div>
71

  
72
                <!-- LIST VIEW -->
73
                <div *ngIf="!tilesView && datasourcesOfUser.length>0" class="uk-grid-large uk-grid-margin-large uk-grid repos-list">
74
                  <div class="uk-width-1-1@m uk-first-column">
75
                    <div class="uk-overflow-auto uk-scrollspy-inview uk-animation-slide-top-medium">
76
                      <div>
77
                        <table class="uk-table uk-table-striped uk-table-middle">
78
                          <thead>
79
                          <tr>
80
                            <th class="uk-text-nowrap">Logo</th>
81
                            <th class="uk-text-nowrap">Name</th>
82
                            <th class="uk-text-nowrap"># of Events</th>
83
                          </tr>
84
                          </thead>
85
                          <tbody>
86
                          <tr class="el-item" *ngFor="let repo of datasourcesOfUser">
87
                            <td class="uk-table-shrink">
88
                              <img *ngIf="repo['second']" class="el-image uk-preserve-width" src="{{ repo['second'] }}" style="height: 45px;">
89
                              <img *ngIf="!repo['second']" class="el-image uk-preserve-width" src="assets/imgs/yourLogoHere.jpg" alt="[Repo Logo]" style="height: 45px;">
90
                            </td>
91
                            <td class="uk-text-nowrap uk-table-shrink">
92
                              <a [routerLink]="[repo['first']['value']]">{{ repo['first']['value'] }}</a>
93
                            </td>
94
                            <td class="uk-text-nowrap uk-table-shrink">
95
                              {{ repo['first']['size'] }}
96
                            </td>
97
                          </tr>
98
                          </tbody>
99
                        </table>
100
                      </div>
101
                    </div>
102
                  </div>
103
                </div>
104

  
105
              </div>
106

  
107
            </div>
108
          </div>
109

  
110

  
24 111
        </div>
25 112

  
26 113
        <!-- RIGHT HELP CONTENT -->
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-events.component.ts
1
import {Component, OnInit} from "@angular/core";
1
import {Component, Input, OnInit} from "@angular/core";
2
import {AuthenticationService} from "../../services/authentication.service";
3
import {BrokerService} from "../../services/broker.service";
4
import {loadingRepoMessage, loadingUserRepoInfoEmpty, reposRetrievalError} from "../../domain/shared-messages";
2 5

  
3 6
@Component ({
4 7
  selector: 'app-content-events',
......
6 9
})
7 10

  
8 11
export class ContentEventsComponent implements OnInit {
12
  datasourcesOfUser = [];
13
  tilesView: boolean;
14
  errorMessage: string;
15
  noDatasourcesMessage: string;
16
  loadingMessage: string;
9 17

  
10
  constructor() {}
18
  @Input() parent: string = '';
11 19

  
12
  ngOnInit() {}
20
  constructor(private authService: AuthenticationService,
21
              private brokerService: BrokerService) {}
22

  
23
  ngOnInit() {
24
    this.tilesView = true;
25
    this.getDatasourcesOfUser();
26
  }
27

  
28

  
29
  getDatasourcesOfUser() {
30
    this.loadingMessage = loadingRepoMessage;
31
    this.brokerService.getDatasourcesOfUser(this.authService.getUserEmail()).subscribe(
32
      res => {
33
        this.datasourcesOfUser = res['datasourcesOfUser'];
34
      },
35
      error => {
36
        console.log(error);
37
        this.loadingMessage = '';
38
        this.errorMessage = reposRetrievalError;
39
      },
40
      () => {
41
        this.loadingMessage = '';
42
        if (!this.datasourcesOfUser.length) {
43
          this.noDatasourcesMessage = loadingUserRepoInfoEmpty;
44
        /*} else {
45
          this.datasourcesOfUser.forEach(
46
            d => {
47
              console.log( d['first']['value'],' -> ',d['first']['size'] );
48
            }
49
          );*/
50
        }
51
      }
52
    );
53
  }
54

  
55
  toggleTiles(){
56
    this.tilesView = !this.tilesView;
57
  }
58

  
13 59
}
modules/uoa-repository-dashboard-gui/trunk/app/services/broker.service.ts
34 34
      .catch(this.handleError).share();
35 35
  }
36 36

  
37
  getDatasourcesOfUser(userEmail: string): Observable<Repository[]> {
38
    let url = `${this.apiUrl}getDatasourcesOfUser?user=${userEmail}&includeShared=true&includeByOthers=true`;
37
  getDatasourcesOfUser(userEmail: string) {
38
    let url = `${this.apiUrl}getDatasourcesOfUser?user=${userEmail}&includeShared=false&includeByOthers=false`;
39 39
    console.log(`knocking on: ${url}`);
40 40

  
41 41
    httpOptions.withCredentials = true;
42
    return this.http.post(url,httpOptions)
43
      .map( res => <Repository[]>res.json())
42
    return this.http.get(url,httpOptions)
43
      .map( res => res.json())
44 44
      .catch(this.handleError).share();
45 45
  }
46 46

  
modules/uoa-repository-dashboard-gui/trunk/app/shared/topmenu/topmenu.component.html
35 35
              </div>
36 36
            </div>
37 37
            <div>
38
              <div class="uk-panel" id="module-tm-2">
38
              <!--<div class="uk-panel" id="module-tm-2">
39 39
                <div id="search-tm-2" action="#" method="post" role="search"
40 40
                      class="uk-search uk-search-default uk-icon">
41 41
                  <span class="uk-search-icon uk-icon"><svg width="20" height="20"
......
50 50
                  <input name="Itemid" value="1860" type="hidden">
51 51

  
52 52
                </div>
53
              </div>
53
              </div>-->
54 54
              <div>
55 55
                <a *ngIf="!getIsUserLoggedIn()" (click)="login()">Sign up/Register</a>
56 56
                <a *ngIf="getIsUserLoggedIn()">{{getUserName()}}</a>
modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/repository-tiles.component.html
9 9
          <i class="fa fa-th-list"></i>
10 10
        </a>
11 11
      </div>
12
      <div class="m-b-md">
12
<!--      <div class="m-b-md">
13 13
        <h4 class="uk-h4 uk-text-primary uk-scrollspy-inview">
14 14
          <span><ng-content></ng-content></span>
15 15
        </h4>
16
      </div>
16
      </div>-->
17 17
    </div>
18 18
    <div class="uk-width-1-1">
19 19
      <div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div>
......
40 40
                      <div class="uk-first-column">
41 41
                        <h3 class="el-title uk-margin uk-h5 uk-margin-remove-adjacent uk-margin-small-bottom">{{ repo.officialName }}</h3>
42 42
                        <div class="{{ getBadgeCSS(repo) }}">
43
                          <span *ngIf="parent == 'contentEvents'">(</span>
43
                          <!--<span *ngIf="parent == 'contentEvents'">(</span>-->
44 44
                          {{ getBadgeText(repo) }}
45
                          <span *ngIf="parent == 'contentEvents'"> events)</span>
45
                          <!--<span *ngIf="parent == 'contentEvents'"> events)</span>-->
46 46
                        </div>
47 47
                      </div>
48 48
                    </div>
......
65 65
                    <th class="uk-text-nowrap">Logo</th>
66 66
                    <th class="uk-text-nowrap">Name</th>
67 67
                    <th *ngIf="parent == 'metrics'" class="uk-text-nowrap">Status</th>
68
                    <th *ngIf="parent == 'contentEvents'" class="uk-text-nowrap"># of Events</th>
68
                    <!--<th *ngIf="parent == 'contentEvents'" class="uk-text-nowrap"># of Events</th>-->
69 69
                  </tr>
70 70
                </thead>
71 71
                <tbody>
......
83 83
                    <td *ngIf="parent == 'metrics'" class="uk-text-nowrap uk-table-shrink">
84 84
                      <div class="{{ getBadgeCSS(repo) }}">{{ getBadgeText(repo) }}</div>
85 85
                    </td>
86
                    <td *ngIf="parent=='contentEvents'" class="uk-text-nowrap uk-table-shrink">
86
                    <!--<td *ngIf="parent=='contentEvents'" class="uk-text-nowrap uk-table-shrink">
87 87
                      {{ getBadgeText(repo) }}
88
                    </td>
88
                    </td>-->
89 89
                  </tr>
90 90
                </tbody>
91 91
              </table>
modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/repository-tiles.component.ts
3 3
import { RepositoryService } from '../../services/repository.service';
4 4
import { AuthenticationService } from '../../services/authentication.service';
5 5
import { loadingReposMessage, loadingUserRepoInfoEmpty, reposRetrievalError } from '../../domain/shared-messages';
6
import {BrokerService} from "../../services/broker.service";
6 7

  
7 8
@Component ({
8 9
  selector: 'repository-tiles',
......
21 22
              private repoService: RepositoryService) {}
22 23

  
23 24
  ngOnInit() {
25
    this.tilesView = true;
24 26
    this.getReposOfUser();
25
    this.tilesView = true;
26 27
  }
27 28

  
28 29
  getReposOfUser(): void {
......
65 66
      }
66 67
    } else if(this.parent == 'sourcesUpdate' || this.parent == 'compatibilityMonitor'){
67 68
      return repo.id;
68
    } else if(this.parent == 'contentEvents') {
69
      return repo.officialName;
69
    /*} else if(this.parent == 'contentEvents') {
70
      return repo.officialName;*/
70 71
    }
71 72
  }
72 73

  
......
81 82
      } else {
82 83
        return 'uk-badge uk-badge-danger';
83 84
      }
84
    } else if(this.parent=='contentEvents'){
85
      return 'el-meta uk-margin uk-text-meta';
85
    /*} else if(this.parent=='contentEvents'){
86
      return 'el-meta uk-margin uk-text-meta';*/
86 87
    }
87 88
  }
88 89

  
......
98 99
        return 'not enabled';
99 100
      }
100 101

  
101
    } else if(this.parent=='contentEvents') {
102
      return this.getRepoEvents(repo);
102
    /*} else if(this.parent=='contentEvents') {
103
      return this.getRepoEvents(repo);*/
103 104
    }
104 105
  }
105 106

  
106 107
  getRepoEvents(repo: Repository): string {
107
    //return repo.events
108 108
    return '0';
109 109
  }
110 110

  
modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-array.interface.ts
31 31
    </div>
32 32

  
33 33

  
34
    <confirmation-dialog #confirmDelete [title]="'Delete Interface'" [isModalShown]="isModalShown"
34
    <confirmation-dialog #confirmDelete [title]="'Delete '+ description.label" [isModalShown]="isModalShown"
35 35
                         [confirmActionButton]="'Yes, delete it'" (emitObject)="confirmedRemove($event)">
36
      Are you sure you want to delete this interface?
36
      Are you sure you want to delete this {{description.label}}?
37 37
    </confirmation-dialog>
38 38

  
39 39
  `

Also available in: Unified diff