Project

General

Profile

« Previous | Next » 

Revision 62321

View differences:

modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/read-more.component.ts
1
/**
2
 * Created by stefania on 4/6/17.
3
 */
4
import {AfterContentInit, AfterViewInit, Component, ElementRef, Input, OnChanges, ViewChild} from "@angular/core";
5

  
6
@Component({
7
    selector: "read-more",
8
    template: `
9
        <div [class.collapsed]="isCollapsed" [style.height]="isCollapsed ? maxHeight+'px' : 'auto'" #readMoreDiv>
10
            <ng-content></ng-content>
11
        </div>
12
        <a *ngIf="isCollapsable" (click)="isCollapsed =! isCollapsed">View {{isCollapsed ? 'more' : 'less'}}...</a>
13
    `,
14
    styles: [`
15
        div.collapsed {
16
            overflow: hidden;
17
        }
18
    `]
19
})
20
export class ReadMoreComponent implements AfterContentInit {
21
    //the text that need to be put in the container
22
    //@Input() text: string;
23
    //maximum height of the container
24
    @Input("maxHeight") maxHeight: number = 100;
25
    @ViewChild("readMoreDiv", { static: true })
26
    readMoreDiv: ElementRef;
27
    //set these to false to get the height of the expended container
28
    public isCollapsed: boolean = false;
29
    public isCollapsable: boolean = false;
30

  
31
    constructor(public elementRef: ElementRef) {
32
    }
33

  
34
    ngAfterContentInit() {
35
        setTimeout(_ => {
36
            let currentHeight = this.readMoreDiv.nativeElement.offsetHeight;
37
            //collapsable only if the contents make container exceed the max height
38
            if (currentHeight > this.maxHeight) {
39
                this.isCollapsed = true;
40
                this.isCollapsable = true;
41
            } else {
42
            }
43
        }, 200);
44
    }
45
}
46

  
47
@Component({
48
    selector: "read-more-text",
49
    template: `
50
        <div [innerHTML]="text" [class.collapsed]="isCollapsed" [style.height]="isCollapsed ? maxHeight+'px' : 'auto'" #readMoreDiv>
51
            <!--{{text}}-->
52
        </div>
53
        <a *ngIf="isCollapsable" (click)="isCollapsed =! isCollapsed">View {{isCollapsed ? 'more' : 'less'}}...</a>
54
    `,
55
    styles: [`
56
        div.collapsed {
57
            overflow: hidden;
58
        }
59
    `]
60
})
61
export class ReadMoreTextComponent extends ReadMoreComponent implements OnChanges, AfterViewInit {
62
    @Input()
63
    text: string = "";
64

  
65
    ngAfterViewInit(): void {
66
        this.ngAfterContentInit();
67
    }
68

  
69
    ngOnChanges(): void {
70
        this.ngAfterContentInit();
71
    }
72
}
73

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/cookie-law/cookie-law.component.ts
1
/**
2
 * angular2-cookie-law
3
 *
4
 * Copyright 2016-2017, @andreasonny83, All rights reserved.
5
 *
6
 * @author: @andreasonny83 <andreasonny83@gmail.com>
7
 */
8

  
9
import {
10
  DomSanitizer,
11
  SafeHtml,
12
} from '@angular/platform-browser';
13

  
14
import {
15
  CookieLawService,
16
} from './cookie-law.service';
17
import { Component, EventEmitter, HostBinding, Input, OnInit, Output } from '@angular/core';
18
import { animate, AnimationEvent, state, style, transition, trigger } from '@angular/animations';
19

  
20
// import {
21
//   closeIcon,
22
// } from './icons';
23

  
24
export type CookieLawPosition = 'top' | 'bottom';
25
export type CookieLawAnimation = 'topIn' | 'bottomIn' | 'topOut' | 'bottomOut';
26
export type CookieLawTarget = '_blank' | '_self';
27

  
28
@Component({
29
  selector: 'cookie-law',
30
  // encapsulation: ViewEncapsulation.None,
31
  animations: [
32
    trigger('state', [
33
      state('bottomOut', style({ transform: 'translateY(100%)' })),
34
      state('topOut', style({ transform: 'translateY(-100%)' })),
35
      state('*', style({ transform: 'translateY(0)' })),
36

  
37
      transition('void => topIn', [
38
        style({ transform: 'translateY(-100%)' }),
39
        animate('1000ms ease-in-out'),
40
      ]),
41

  
42
      transition('void => bottomIn', [
43
        style({ transform: 'translateY(100%)' }),
44
        animate('1000ms ease-in-out'),
45
      ]),
46

  
47
      transition('* => *', animate('1000ms ease-out')),
48
    ])
49
  ],
50
  styleUrls: [ './cookie-law.css' ],
51
  templateUrl: './cookie-law.html',
52
})
53
export class CookieLawComponent implements OnInit {
54
  public cookieLawSeen: boolean;
55

  
56
  @Input('learnMore')
57
  get learnMore() { return this._learnMore; }
58
  set learnMore(value: string) {
59
    this._learnMore = (value !== null && `${value}` !== 'false') ? value : null;
60
  }
61

  
62
  @Input('target')
63
  get target() { return this._target; }
64
  set target(value: CookieLawTarget) {
65
    this._target = (value !== null && `${value}` !== 'false' &&
66
                      (`${value}` === '_blank' || `${value}` === '_self')
67
                     ) ? value : '_blank';
68
  }
69

  
70
  @Input('position')
71
  get position() { return this._position; }
72
  set position(value: CookieLawPosition) {
73
    this._position = (value !== null && `${value}` !== 'false' &&
74
                      (`${value}` === 'top' || `${value}` === 'bottom')
75
                     ) ? value : 'bottom';
76
  }
77

  
78
  @Output('isSeen')
79
  private isSeenEvt: EventEmitter<boolean>;
80

  
81
  @HostBinding('attr.seen')
82
  public isSeen: boolean;
83

  
84
  private animation: CookieLawAnimation;
85
  private closeSvg: SafeHtml;
86
  private currentStyles: {};
87
  private _learnMore: string;
88
  private _target: CookieLawTarget;
89
  private _position: CookieLawPosition;
90

  
91
  constructor(
92
    private _service: CookieLawService,
93
    private domSanitizer: DomSanitizer,
94
  ) {
95
    this.isSeenEvt = new EventEmitter<boolean>();
96
    this.animation = 'topIn';
97
    this._position = 'bottom';
98
    this.cookieLawSeen = this._service.seen();
99
  }
100

  
101
  ngOnInit(): void {
102
    if (typeof document !== 'undefined') {
103
      this.animation = this.position === 'bottom' ? 'bottomIn' : 'topIn';
104

  
105
      this.closeSvg = `
106
            <span class="clickable uk-icon">
107
              <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1">
108
                <path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path>
109
                <path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path>
110
              </svg>
111
            </span>`;
112

  
113
      if (this.cookieLawSeen) {
114
        this.isSeen = true;
115
      }
116

  
117
      this.currentStyles = {
118
        'top': this.position === 'top' ? '0' : null,
119
        'bottom': this.position === 'top' ? 'initial' : null,
120
      };
121
    }
122
  }
123

  
124
  afterDismissAnimation(evt: AnimationEvent) {
125
    if (evt.toState === 'topOut' ||
126
        evt.toState === 'bottomOut') {
127
      this.isSeen = true;
128
      this.isSeenEvt.emit(this.isSeen);
129
    }
130
  }
131

  
132
  public dismiss(evt?: MouseEvent): void {
133
    if (evt) {
134
      evt.preventDefault();
135
    }
136

  
137
    this._service.storeCookie();
138
    this.animation = this.position === 'top' ? 'topOut' : 'bottomOut';
139
  }
140
}
0 141

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/cookie-law/cookie-law.module.ts
1
/**
2
 * angular2-cookie-law
3
 *
4
 * Copyright 2016-2017, @andreasonny83, All rights reserved.
5
 *
6
 * @author: @andreasonny83 <andreasonny83@gmail.com>
7
 */
8
import { NgModule } from '@angular/core';
9
import { CommonModule } from '@angular/common';
10
import { CookieLawComponent } from './cookie-law.component';
11
import { CookieLawService } from './cookie-law.service';
12

  
13
@NgModule({
14
  imports: [ CommonModule ],
15
  declarations: [ CookieLawComponent ],
16
  providers: [ CookieLawService ],
17
  exports: [ CookieLawComponent ]
18
})
19
export class CookieLawModule { }
20

  
21
export {
22
  CookieLawComponent,
23
  CookieLawService
24
};
0 25

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/confirmation-dialog.component.html
1
<!--<div *ngIf="isModalShown" [config]="{ show: true }" (onHidden)="onHidden()" bsModal #autoShownModal="bs-modal"-->
2
     <!--class="modal in fade" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">-->
3
  <!--<div class="modal-dialog">-->
4
    <!--<div class="modal-content">-->
5
      <!--<div class="modal-body">-->
6
        <!--<div>-->
7
          <!--<div>-->
8
            <!--<h2 class="uk-modal-title">{{title}}</h2>-->
9
            <!--<ng-content></ng-content>-->
10
          <!--</div>-->
11
          <!--<div class="uk-text-right">-->
12
            <!--<button (click)="hideModal()" class="uk-button uk-button-default uk-margin-small-right" type="button">{{ hideModalButton }}</button>-->
13
            <!--<button *ngIf="confirmActionButton" (click)="confirmedAction()" class="uk-button uk-button-primary" type="button">{{confirmActionButton}}</button>-->
14
          <!--</div>-->
15
        <!--</div>-->
16
      <!--</div>-->
17
    <!--</div>-->
18
  <!--</div>-->
19
<!--</div>-->
20

  
21

  
22
<div *ngIf="isModalShown" class="uk-modal {{isModalShown ? 'uk-open' : ''}}" bsModal #autoShownModal="bs-modal" (onHidden)="onHidden()" aria-hidden="false"
23
     [ngStyle]="{'display': isModalShown ? 'block' : 'none'}" style="overflow-y: auto">
24
  <div class="uk-modal-dialog" style="top: 95.5px;">
25
    <div class="uk-modal-header">
26
      <h3 class="uk-modal-title">{{title}}
27
        <!--<i class="material-icons" data-uk-tooltip="{pos:'top'}" title="headline tooltip"></i>-->
28
      </h3>
29
    </div>
30
    <ng-content></ng-content>
31
    <div class="uk-modal-footer uk-text-right">
32
      <button (click)="hideModal()" type="button" class="md-btn md-btn-flat uk-modal-close">{{ hideModalButton }}</button>
33
      <button *ngIf="confirmActionButton" (click)="confirmedAction()" type="button" class="md-btn md-btn-flat md-btn-flat-primary">{{confirmActionButton}}</button>
34
      <button *ngIf="confirmButNotCloseButton" (click)="confirmedButNotCloseAction()" type="button" class="md-btn md-btn-flat md-btn-flat-primary">{{confirmButNotCloseButton}}</button>
35
    </div>
36
  </div>
37
</div>
38

  
39

  
40
<!-- old-ui shelved Terms of Use modal version -->
41

  
42
<!--<div *ngIf="isModalShown" [config]="{ show: true }" (onHidden)="onHidden()" bsModal #autoShownModal="bs-modal"-->
43
<!--     class="modal in fade" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">-->
44
<!--  <div class="modal-dialog">-->
45
<!--    <h2 class="uk-modal-title uk-margin-top uk-margin-left">{{title}}</h2>-->
46
<!--    <div class="modal-content">-->
47
<!--      <div class="modal-body">-->
48
<!--        <div>-->
49
<!--          <ng-content></ng-content>-->
50
<!--        </div>-->
51
<!--      </div>-->
52
<!--      <div class="uk-text-right uk-margin-bottom uk-margin-right">-->
53
<!--        <button (click)="hideModal()" class="uk-button uk-button-default uk-margin-small-right" type="button">{{hideModalButton}}</button>-->
54
<!--        <button *ngIf="confirmActionButton" (click)="confirmedAction()" class="uk-button uk-button-primary" type="button">{{confirmActionButton}}</button>-->
55
<!--      </div>-->
56
<!--    </div>-->
57
<!--  </div>-->
58
<!--</div>-->
0 59

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/topmenudashboard/topmenu-dashboard.component.ts
1
import { Component, DoCheck, OnInit, ViewEncapsulation } from '@angular/core';
2
import { AuthenticationService } from '../../services/authentication.service';
3
import { environment } from '../../../environments/environment';
4

  
5
@Component({
6
  selector: 'top-menu-dashboard',
7
  templateUrl: './topmenu-dashboard.component.html',
8
  // styleUrls: ['./topmenu-dashboard.component.css'],
9
  // encapsulation: ViewEncapsulation.None
10
})
11

  
12
export class TopmenuDashboardComponent implements OnInit {
13
  userLoggedIn = false;
14
  userName = '';
15
  isUserAdmin = false;
16
  adminHomePage = environment.FAQ_HOMEPAGE;
17

  
18
  inBeta: boolean;
19

  
20
  showSideBar = true;
21

  
22
  constructor(public authService: AuthenticationService) { }
23

  
24
  ngOnInit() {
25
    this.getIsUserLoggedIn();
26
    this.getUserName();
27
    this.getIsUserAdmin();
28

  
29
    const baseUrl = window.location.origin;
30
    this.inBeta = ( baseUrl.includes('beta') || baseUrl.includes('athenarc') );
31
  }
32

  
33
  toggleSideMenu() {
34
    const body = document.getElementsByTagName('body')[0];
35
    if (this.showSideBar === true) {
36
      body.classList.remove('sidebar_main_open');
37
    } else {
38
      body.classList.add('sidebar_main_open');
39
    }
40
    this.showSideBar = !this.showSideBar;
41
  }
42

  
43
  onClick(id: string) {
44
    const el: HTMLElement = document.getElementById(id);
45
    el.classList.remove('uk-open');
46
  }
47

  
48

  
49
  login() {
50
    this.authService.loginWithState();
51
  }
52

  
53
  logout() {
54
    this.authService.logout();
55
  }
56

  
57

  
58
  getUserName() {
59
    this.userName = this.authService.getUserName();
60
    return this.userName;
61
  }
62

  
63
  getIsUserLoggedIn() {
64
    this.userLoggedIn = this.authService.getIsUserLoggedIn();
65
    return this.userLoggedIn;
66
  }
67

  
68
  parseUsername() {
69
    let firstLetters = "";
70
    let matches = this.getUserName().match(/\b(\w)/g);
71
    if(matches)
72
      firstLetters += matches.join('');
73
    return firstLetters;
74
  }
75

  
76
  getIsUserAdmin() {
77
    this.isUserAdmin = (this.authService.getUserRole().includes('SUPER_ADMINISTRATOR') ||
78
      this.authService.getUserRole().includes('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR'));
79
    return this.isUserAdmin;
80
  }
81
}
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/services/repository.service.ts
1
/*
2
* Created by myrto on 12/05/2017
3
*/
4

  
5
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
6
import { Injectable } from '@angular/core';
7
import { environment } from '../../environments/environment';
8
import {
9
  AggregationDetails,
10
  Country, MetricsInfo,
11
  Repository,
12
  RepositoryInterface,
13
  RepositorySnippet, RepositorySummaryInfo, TermsOfUse,
14
  Timezone,
15
  Typology, User
16
} from '../domain/typeScriptClasses';
17
import { Observable, of } from 'rxjs';
18
import { timezones } from '../domain/timezones';
19
import { typologies } from '../domain/typologies';
20
import {URLParameter} from '../domain/url-parameter';
21

  
22
const headerOptions = {
23
  headers : new HttpHeaders().set('Content-Type', 'application/json')
24
                             .set('Accept', 'application/json'),
25
  withCredentials: true
26
};
27

  
28

  
29
@Injectable ()
30
export class RepositoryService {
31
  private apiUrl = environment.API_ENDPOINT + '/repositories/';
32
  private dashboardAPIUrl = environment.API_ENDPOINT + '/dashboard/';
33

  
34
  constructor(private httpClient: HttpClient) { }
35

  
36
  addInterface(datatype: string, repoId: string, registeredBy: string, comment: string, newInterface: RepositoryInterface): Observable<RepositoryInterface> {
37
    let url;
38
    if (comment == null || comment === '') {
39
      url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}&registeredBy=${registeredBy}`;
40
    } else {
41
      url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}&registeredBy=${registeredBy}&comment=${comment}`;
42
    }
43
    console.log(`knocking on: ${url}`);
44
    console.log(`sending ${JSON.stringify(newInterface)}`);
45
    return this.httpClient.post<RepositoryInterface>(url, newInterface, headerOptions);
46
  }
47

  
48
  updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> {
49
    let url;
50
    if (comment == null || comment === '') {
51
      url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${registeredBy}`;
52
    } else {
53
      url  = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${registeredBy}&comment=${comment}`;
54
    }
55
    console.log(`knocking on: ${url}`);
56
    console.log(`sending ${JSON.stringify(interfaceInfo)}`);
57
    return this.httpClient.post<RepositoryInterface>(url, interfaceInfo, headerOptions);
58
  }
59

  
60
  deleteInterface(id: string, registeredBy: string) {
61
    const url = `${this.apiUrl}deleteInterface/?id=${id}&registeredBy=${registeredBy}`;
62
    console.log(`knocking on: ${url}`);
63

  
64
    return this.httpClient.delete(url, {withCredentials: true, responseType: 'text'});
65
  }
66

  
67
  addRepository(datatype: string, newRepository: Repository): Observable<Repository> {
68
    const url = `${this.apiUrl}addRepository?datatype=${datatype}`;
69
    console.log(`knocking on: ${url}`);
70
    console.log(`sending ${JSON.stringify(newRepository)}`);
71
    return this.httpClient.post<Repository>(url, newRepository, headerOptions);
72
  }
73

  
74
  // updateRepository(repoInfo: Repository): Observable<Repository> {
75
  //   const url = `${this.apiUrl}updateRepository`;
76
  //   console.log(`knocking on: ${url}`);
77
  //   console.log(`sending ${JSON.stringify(repoInfo)}`);
78
  //   return this.httpClient.post<Repository>(url, repoInfo, headerOptions);
79
  // }
80

  
81
  updateRepository(repoInfo: Repository): Observable<Repository> {
82
    const url = `${this.apiUrl}updateRepository`;
83
    console.log(`knocking on: ${url}`);
84
    console.log(`sending ${JSON.stringify(repoInfo)}`);
85
    return this.httpClient.post<Repository>(url, repoInfo, headerOptions);
86
  }
87

  
88
  updateRepositoriesTerms(termsList: any): Observable<TermsOfUse> {
89
    const url = `${this.apiUrl}terms`;
90
    console.log(`knocking on: ${url}`);
91
    console.log(`sending ${JSON.stringify(termsList)}`);
92
    return this.httpClient.post<TermsOfUse>(url, termsList, headerOptions);
93
  }
94

  
95
  getRepositoriesOfCountry(country: string, mode: string): Observable<RepositorySnippet[]> {
96
    const url = `${this.apiUrl}getRepositoriesByCountry/${country}/${mode}`;
97
    console.log(`knocking on: ${url}`);
98
    return this.httpClient.get<RepositorySnippet[]>(url, headerOptions);
99
  }
100

  
101
  getRepositoriesSnippetsOfUser(): Observable<RepositorySnippet[]> {
102
    const url = `${this.apiUrl}snippets/user`;
103
    console.log(`knocking on: ${url}`);
104
    return this.httpClient.get<RepositorySnippet[]>(url, headerOptions);
105
  }
106

  
107
  getRepositoryById(id: string): Observable<Repository> {
108
    const   url = `${this.apiUrl}getRepositoryById/${id}`;
109
    console.log(`knocking on: ${url}`);
110
    return this.httpClient.get<Repository>(url, headerOptions);
111
  }
112

  
113
  getRepositoryInterface(id: string): Observable<RepositoryInterface[]> {
114
    const url = `${this.apiUrl}getRepositoryInterface/${id}`;
115
    console.log(`knocking on: ${url}`);
116
    return this.httpClient.get<RepositoryInterface[]>(url, headerOptions);
117
  }
118

  
119
  getUrlsOfUserRepos(): Observable<string[]> {
120
    const url = `${this.apiUrl}getUrlsOfUserRepos/0/100/`;
121
    console.log(`knocking on: ${url}`);
122
    return this.httpClient.get<string[]>(url, headerOptions);
123
  }
124

  
125
  getRepositoryAggregations(id: string): Observable<AggregationDetails[]> {
126
    const url = `${this.apiUrl}getRepositoryAggregations/${id}`;
127
    console.log(`knocking on: ${url}`);
128
    return this.httpClient.get<AggregationDetails[]>(url, headerOptions);
129
  }
130

  
131
  getRepositoryAggregationsByYear(id: string): Observable<Map<string, AggregationDetails[]>> {
132
    const url = `${this.apiUrl}getRepositoryAggregationsByYear/${id}`;
133
    console.log(`knocking on: ${url}`);
134
    return this.httpClient.get<Map<string, AggregationDetails[]>>(url, headerOptions);
135
  }
136

  
137
  getTimezones(): Observable<Timezone[]> {
138
/*    const url = `${this.apiUrl}getTimezones`;
139
    console.log(`knocking on: ${url}`);
140
    return this.httpClient.get<Timezone[]>(url, headerOptions);*/
141
    return of(<Timezone[]>timezones);
142
  }
143

  
144
  getTypologies(): Observable<Typology[]> {
145
/*    const url = `${this.apiUrl}getTypologies`;
146
    console.log(`knocking on: ${url}`);
147
    return this.httpClient.get<Typology[]>(url, headerOptions);*/
148
    return of(<Typology[]>typologies);
149
  }
150

  
151
  getCountries(): Observable<Country[]> {
152
    const url = `${this.apiUrl}countries`;
153
    console.log(`knocking on: ${url}`);
154
    return this.httpClient.get<Country[]>(url, headerOptions);
155
  }
156

  
157

  
158
  getCompatibilityClasses (mode: string): Observable<Map<string, string>> {
159
    const url = `${this.apiUrl}getCompatibilityClasses/${mode}`;
160
    console.log(`knocking on: ${url}`);
161
    return this.httpClient.get<Map<string, string>>(url, headerOptions);
162
  }
163

  
164
  getDatasourceClasses(mode: string): Observable<Map<string, string>> {
165
    const url = `${this.apiUrl}getDatasourceClasses/${mode}`;
166
    console.log(`knocking on: ${url}`);
167
    return this.httpClient.get<Map<string, string>>(url, headerOptions);
168
  }
169

  
170

  
171
  getMetricsInfoForRepository (repoId: string): Observable<MetricsInfo> {
172
    const url = `${this.apiUrl}getMetricsInfoForRepository/${repoId}`;
173
    console.log(`knocking on: ${url}`);
174
    return this.httpClient.get<MetricsInfo>(url, headerOptions);
175
  }
176

  
177
  getListLatestUpdate(mode: string): Observable<any> {
178
    const url = `${this.apiUrl}getListLatestUpdate/${mode}`;
179
    console.log(`knocking on: ${url}`);
180
    return this.httpClient.get<any>(url, headerOptions);
181
  }
182

  
183
  searchRegisteredRepositories(page, size, urlParams: URLParameter[]) {
184
    const url = `${this.apiUrl}searchRegisteredRepositories/${page}/${size}`;
185
    console.log(`knocking on: ${url}`);
186
    let params = new HttpParams();
187
    for (const urlParameter of urlParams) {
188
      for (const value of urlParameter.value) {
189
        params = params.append(urlParameter.key, value);
190
      }
191
    }
192

  
193
    return this.httpClient.get<RepositorySnippet[]>(url, {params, withCredentials: true});
194
  }
195

  
196
  getRepositoriesSummaryInfo(): Observable<RepositorySummaryInfo[]> {
197
    const url = `${this.dashboardAPIUrl}getRepositoriesSummary/0/100`;
198
    console.log(`knocking on: ${url}`);
199
    return this.httpClient.get<RepositorySummaryInfo[]>(url, headerOptions);
200
  }
201

  
202
  getRepositoryAdmins(repoId: string): Observable<User[]> {
203
    const url = `${this.apiUrl}${repoId}/admins`;
204
    console.log(`knocking on: ${url}`);
205
    return this.httpClient.get<User[]>(url, headerOptions);
206
  }
207

  
208
  deleteRepositoryAdmin(repoId: string, repoAdminEmail: string) {
209
    const url = `${this.apiUrl}${repoId}/admins/${repoAdminEmail}`;
210
    console.log(`knocking on: ${url}`);
211

  
212
    return this.httpClient.delete(url, headerOptions);
213
  }
214

  
215
  addRepositoryAdmin(repoId: string, repoAdminEmail: string) {
216
    const url = `${this.apiUrl}${repoId}/admins`;
217
    return this.httpClient.post<string>(url, repoAdminEmail, headerOptions);
218
  }
219
}
0 220

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/topmenulanding/topmenu-landing.component.html
1
<div id="landingPage">
2
  <div class="uk-offcanvas-content">
3

  
4
    <!--MOBILE-->
5
    <div class="tm-header-mobile uk-hidden@m">
6
      <nav class="uk-navbar-container uk-navbar" uk-navbar="">
7
        <div class="uk-navbar-left">
8
          <a class="uk-navbar-toggle" href="#tm-mobile" uk-toggle="">
9
            <div uk-navbar-toggle-icon="" class="uk-navbar-toggle-icon uk-icon">
10
            </div>
11
          </a>
12
        </div>
13
        <div class="uk-navbar-center">
14
          <a class="uk-navbar-item uk-logo" [routerLink]="['/home']">
15
            <img src="../../../assets/imgs/OA_PROVIDE_A.png" alt="OpenAIRE"
16
                 class="uk-responsive-height"> </a>
17
        </div>
18
      </nav>
19
      <div id="tm-mobile" uk-offcanvas="" mode="slide" overlay="" class="uk-offcanvas">
20
        <div class="uk-offcanvas-bar">
21
          <button class="uk-offcanvas-close uk-close uk-icon" type="button" uk-close=""></button>
22
          <div class="uk-child-width-1-1 uk-grid" uk-grid="">
23
            <div>
24
              <div>
25
                <a *ngIf="!getIsUserLoggedIn()" (click)="login()">Sign in| Register</a>
26
                <span *ngIf="getIsUserLoggedIn()">{{getUserName()}}</span>
27
                <ul  class="uk-list uk-margin-top">
28
                  <li>
29
                    <a class="uk-search-input" [routerLink]="['home']" [routerLinkActive]="['uk-active']">Home</a>
30
                  </li>
31
                  <li>
32
                    <a class="uk-search-input" [routerLink]="['about']" [routerLinkActive]="['uk-active']">About</a>
33
                  </li>
34
                  <li>
35
                  <li *ngIf="getIsUserLoggedIn()">
36
                    <a class="uk-search-input" [routerLink]="['emptyPage']" [routerLinkActive]="['uk-active']">Dashboard</a>
37
                  </li>
38

  
39
                    <!--Sources-->
40
                    <!--<ul>-->
41
                      <!--<li><a [routerLink]="['sources', 'register']" [routerLinkActive]="['uk-active']">Register</a></li>-->
42
                      <!--<li><a [routerLink]="['sources', 'update']" [routerLinkActive]="['uk-active']">Update</a></li>-->
43
                    <!--</ul>-->
44
                  <!--</li>-->
45
                  <!--<li>-->
46
                    <!--Compatibility-->
47
                    <!--<ul>-->
48
                      <!--<li><a [routerLink]="['compatibility', 'validate']" [routerLinkActive]="['uk-active']">Validate</a></li>-->
49
                      <!--<li><a [routerLink]="['compatibility', 'browseHistory']" [routerLinkActive]="['uk-active']">Validation History</a></li>-->
50
                      <!--<li><a [routerLink]="['compatibility', 'monitor']" [routerLinkActive]="['uk-active']">Collection Monitor</a></li>-->
51
                    <!--</ul>-->
52
                  <!--</li>-->
53
                  <!--<li>-->
54
                    <!--Content-->
55
                    <!--<ul>-->
56
                      <!--<li><a [routerLink]="['content', 'events']" [routerLinkActive]="['uk-active']">Events</a></li>-->
57
                      <!--<li><a [routerLink]="['content', 'notifications']" [routerLinkActive]="['uk-active']">Notifications</a></li>-->
58
                    <!--</ul>-->
59
                  <!--</li>-->
60
                  <!--<li>-->
61
                    <!--<a class="uk-search-input" [routerLink]="['getImpact']" [routerLinkActive]="['uk-active']">Metrics</a>-->
62
                  <!--</li>-->
63
                  <!--<li *ngIf="getIsUserAdmin()">-->
64
                    <!--Admin-->
65
                    <!--<ul>-->
66
                      <!--<li><a href="{{adminHomePage}}" target="_blank">Help Texts</a></li>-->
67
                      <!--<li><a [routerLink]="['admin', 'metrics']" [routerLinkActive]="['uk-active']">Validate</a></li>s-->
68
                    <!--</ul>-->
69
                  <!--</li>-->
70
                  <li><a (click)="logout()">Logout</a></li>
71
                </ul>
72
              </div>
73
            </div>
74
          </div>
75

  
76
        </div>
77
      </div>
78
    </div>
79

  
80
    <!--LAPTOP-->
81
    <div class="tm-toolbar uk-visible@m">
82
      <div class="uk-container uk-flex uk-flex-middle uk-container-expand">
83

  
84

  
85
        <div class="uk-margin-auto-left">
86
          <div class="uk-grid-medium uk-child-width-auto uk-flex-middle uk-grid uk-grid-stack"
87
               uk-grid="margin: uk-margin-small-top">
88
            <div class="uk-first-column">
89
              <div class="uk-panel inner">
90
                <ul class="uk-subnav uk-subnav-line">
91
                  <li><a class="home-icon" href="https://{{ inBeta ? 'beta.' : '' }}openaire.eu" target="_blank">
92
                    <span class="uk-responsive-height">
93
                      <svg xml:space="preserve" enable-background="new 0 0 20 20" height="20px" id="Layer_1" version="1.1" viewBox="0 0 48 48" width="20px" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M44.715,23.711c-0.381,0.382-1,0.382-1.381,0l-8.939-8.938 c-0.064-0.051-0.119-0.106-0.17-0.171l-3.83-3.829c-0.064-0.051-0.119-0.106-0.17-0.171L24,4.377L4.667,23.711 c-0.381,0.382-1,0.382-1.381,0c-0.381-0.381-0.381-1,0-1.381L23.191,2.425c0.031-0.047,0.053-0.101,0.094-0.144 C23.482,2.085,23.742,1.994,24,2c0.258-0.006,0.518,0.084,0.715,0.281c0.043,0.042,0.062,0.096,0.096,0.144L30,7.616V4.997 c0,0,0,0,0,0c0-0.552,0.447-1,1-1h4c0.277,0,0.527,0.112,0.707,0.293C35.889,4.471,36,4.721,36,4.997v8.619l8.715,8.714 C45.096,22.711,45.096,23.33,44.715,23.711z M34,5.997h-2v3.619l2,2V5.997z M10,21.997c0.552,0,1,0.448,1,1v19c0,1.105,0.896,2,2,2 h6l0,0v-13c0-0.553,0.447-1,1-1h8c0.553,0,1,0.447,1,1v13l0,0h6c1.105,0,2-0.895,2-2v-19c0-0.552,0.447-1,1-1s1,0.448,1,1v19 c0,2.209-1.791,4-4,4H13c-2.209,0-4-1.791-4-4v-19C9,22.444,9.448,21.997,10,21.997z M27,43.996v-12h-6v12l0,0H27L27,43.996z" fill="#fff" fill-rule="evenodd" id="home"></path></svg>
94
                    </span></a></li>
95
                  <li uk-tooltip="title: Search in OA. Link your research; pos: bottom-left; cls: uk-active tooltipStyling uk-width-auto">
96
                    <a href="https://{{ inBeta ? 'beta.' : '' }}explore.openaire.eu" target="_blank">Explore</a></li>
97
                  <li uk-tooltip="title: Content Provider Dashboard; pos: bottom-left; cls: uk-active tooltipStyling uk-width-auto" class="custom-provide-li">
98
                    <a href="https://{{ inBeta ? 'beta.' : '' }}provide.openaire.eu/" target="_blank">Provide</a></li>
99
                  <li uk-tooltip="title: Research Community Dashboard; pos: bottom-left; cls: uk-active tooltipStyling uk-width-auto">
100
                    <a href="https://{{ inBeta ? 'beta.' : '' }}connect.openaire.eu" target="_blank">Connect</a></li>
101
                  <li uk-tooltip="title: Monitoring Dashboard; pos: bottom-left; cls: uk-active tooltipStyling uk-width-auto">
102
                    <a href="https://monitor.openaire.eu" target="_blank">Monitor</a></li>
103
                  <li uk-tooltip="title: APIs; pos: bottom-left; cls: uk-active tooltipStyling uk-width-auto">
104
                    <a href="https://develop.openaire.eu" target="_blank">Develop</a></li>
105
                </ul>
106
              </div>
107
            </div>
108
          </div>
109
        </div>
110

  
111
      </div>
112
    </div>
113

  
114
    <div class="tm-header uk-visible@m tm-header-transparent" uk-header="">
115
      <div class="uk-navbar-container uk-sticky uk-navbar-transparent" uk-sticky="top:0" media="768"
116
           cls-active="uk-active uk-navbar-sticky" style="" animation="uk-animation-slide-top"
117
           top=".tm-header + [class*=&quot;uk-section&quot;]" cls-inactive="uk-navbar-transparent">
118
        <div class="uk-container uk-container-expand">
119
          <nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
120
            <div class="uk-navbar-left">
121
              <a [routerLink]="['landing']" class="uk-logo uk-navbar-item">
122
                <img src="../../../assets/imgs/OA_PROVIDE_B.png" alt="OpenAIRE" class="uk-responsive-height">
123
              </a>
124
            </div>
125

  
126
            <div class="uk-navbar-right">
127

  
128
              <ul class="uk-navbar-nav" >
129
                <li class="uk-parent" [routerLinkActive]="['uk-active']">
130
                  <a [routerLink]="['home']" [routerLinkActive]="['uk-active']">
131
                    Home
132
                  </a>
133
                </li>
134
                <li class="uk-parent" [routerLinkActive]="['uk-active']">
135
                  <a [routerLink]="['about']" [routerLinkActive]="['uk-active']">
136
                    About
137
                  </a>
138
                </li>
139
                <li *ngIf="getIsUserLoggedIn()" class="uk-parent" [routerLinkActive]="['uk-active']">
140
                  <a [routerLink]="['join']" [routerLinkActive]="['uk-active']">
141
                    Dashboard
142
                  </a>
143
                </li>
144

  
145
                <li *ngIf="!getIsUserLoggedIn()" class="uk-parent">
146
                  <a class="" (click)="login()">
147
                    Sign in
148
                    <span class="uk-margin-small-left uk-icon">
149
                      <svg height="20" ratio="1" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">
150
                        <circle cx="9.9" cy="6.4" fill="none" r="4.4" stroke="#000" stroke-width="1.1"></circle>
151
                        <path d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2" fill="none" stroke="#000" stroke-width="1.1"></path>
152
                      </svg>
153
                    </span>
154
                  </a>
155
                </li>
156
                <li *ngIf="getIsUserLoggedIn()" class="uk-parent">
157
                  <a class="" aria-expanded="false">
158
                    {{ getUserName() }}
159
                    <span class="uk-margin-small-left uk-icon">
160
                      <svg height="20" ratio="1" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">
161
                        <circle cx="9.9" cy="6.4" fill="none" r="4.4" stroke="#000" stroke-width="1.1"></circle>
162
                        <path d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2" fill="none" stroke="#000" stroke-width="1.1"></path>
163
                      </svg>
164
                    </span>
165
                  </a>
166
                  <div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left" style="top: 80px; left: 106.55px;"
167
                       id="userMenu" (click)="onClick('userMenu')">
168
                    <div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
169
                      <div class="uk-first-column">
170
                        <ul class="uk-nav uk-navbar-dropdown-nav">
171
                          <!--<ul *ngIf="getIsUserAdmin()" class="uk-nav uk-navbar-dropdown-nav">-->
172
                          <!--<li class="uk-nav-header" style="display: block;">Admin</li>-->
173
                          <!--<li style="display: block"><a href="{{adminHomePage}}" target="_blank">Help Texts</a></li>-->
174
                          <!--<li style="display: block"><a [routerLink]="['/admin/metrics']">Metrics</a></li>-->
175
                          <!--<li style="display: block" class="uk-margin-small-bottom"><a [routerLink]="['/admin/registrations']">Registrations</a></li>-->
176
                          <!--</ul>-->
177
                          <li><a class="" (click)="logout()">Log out</a></li>
178
                        </ul>
179
                      </div>
180
                    </div>
181
                  </div>
182
                </li>
183

  
184
              </ul>
185

  
186
              <!--<div class="uk-navbar-item">-->
187

  
188
                <!--<ul *ngIf="!getIsUserLoggedIn()" class="uk-navbar-nav">-->
189
                  <!--<li class="uk-parent">-->
190
                    <!--<a class="" (click)="login()">-->
191
                      <!--Sign in-->
192
                      <!--<span class="uk-margin-small-left uk-icon">-->
193
                      <!--<svg height="20" ratio="1" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">-->
194
                        <!--<circle cx="9.9" cy="6.4" fill="none" r="4.4" stroke="#000" stroke-width="1.1"></circle>-->
195
                        <!--<path d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2" fill="none" stroke="#000" stroke-width="1.1"></path>-->
196
                      <!--</svg>-->
197
                    <!--</span>-->
198
                    <!--</a>-->
199
                  <!--</li>-->
200
                <!--</ul>-->
201

  
202
                <!--<ul *ngIf="getIsUserLoggedIn()" class="uk-navbar-nav">-->
203
                  <!--<li class="uk-parent">-->
204
                    <!--<a class="" aria-expanded="false">-->
205
                      <!--{{ getUserName() }}-->
206
                      <!--<span class="uk-margin-small-left uk-icon">-->
207
                      <!--<svg height="20" ratio="1" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">-->
208
                        <!--<circle cx="9.9" cy="6.4" fill="none" r="4.4" stroke="#000" stroke-width="1.1"></circle>-->
209
                        <!--<path d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2" fill="none" stroke="#000" stroke-width="1.1"></path>-->
210
                      <!--</svg>-->
211
                    <!--</span>-->
212
                    <!--</a>-->
213
                    <!--<div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left" style="top: 80px; left: 106.55px;"-->
214
                         <!--id="userMenu" (click)="onClick('userMenu')">-->
215
                      <!--<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">-->
216
                        <!--<div class="uk-first-column">-->
217
                          <!--<ul class="uk-nav uk-navbar-dropdown-nav">-->
218
                            <!--&lt;!&ndash;<ul *ngIf="getIsUserAdmin()" class="uk-nav uk-navbar-dropdown-nav">&ndash;&gt;-->
219
                              <!--&lt;!&ndash;<li class="uk-nav-header" style="display: block;">Admin</li>&ndash;&gt;-->
220
                              <!--&lt;!&ndash;<li style="display: block"><a href="{{adminHomePage}}" target="_blank">Help Texts</a></li>&ndash;&gt;-->
221
                              <!--&lt;!&ndash;<li style="display: block"><a [routerLink]="['/admin/metrics']">Metrics</a></li>&ndash;&gt;-->
222
                              <!--&lt;!&ndash;<li style="display: block" class="uk-margin-small-bottom"><a [routerLink]="['/admin/registrations']">Registrations</a></li>&ndash;&gt;-->
223
                            <!--&lt;!&ndash;</ul>&ndash;&gt;-->
224
                            <!--<li><a class="" (click)="logout()">Log out</a></li>-->
225
                          <!--</ul>-->
226
                        <!--</div>-->
227
                      <!--</div>-->
228
                    <!--</div>-->
229
                  <!--</li>-->
230
                <!--</ul>-->
231

  
232
              <!--</div>-->
233

  
234

  
235
            </div>
236

  
237
          </nav>
238
        </div>
239
      </div>
240

  
241
      <div class="uk-sticky-placeholder" style="height: 84px; margin: 0px;" hidden="hidden"></div>
242
    </div>
243

  
244
  </div>
245
</div>
246

  
0 247

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/sidemenu/sidemenu.component.html
1
<aside id="sidebar_main">
2

  
3
  <div class="sidebar_main_header uk-margin-remove-bottom">
4
    <div class="uk-padding-small">
5
      <a [routerLink]="['/home']" class="sSidebar_hide sidebar_logo_large">
6
        <img class="provideLogo" src="../../../assets/imgs/OA_PROVIDE_B.png">
7
      </a>
8
      <!--<h4 class="uk-text-bold uk-margin-remove">Repository manager's</h4>-->
9
      <!--<span class="uk-text-large">Admin Dashboard</span>-->
10
    </div>
11
  </div>
12
  <!--<div class="sidebar_main_header">-->
13
    <!--<div class="sidebar_logo">-->
14
      <!--<a [routerLink]="['/home']" class="sSidebar_hide sidebar_logo_large">-->
15
        <!--<img class="logo_regular" src="../../../assets/imgs/OA_PROVIDE_B.png" alt="" height="" width="200"/>-->
16
        <!--<img class="logo_light" src="assets/img/logo_main_white.png" alt="" height="15" width="71"/>-->
17
      <!--</a>-->
18
      <!--<a [routerLink]="['/home']" class="sSidebar_show sidebar_logo_small">-->
19
        <!--<img class="logo_regular" src="../../../assets/imgs/OA_PROVIDE_A.png" alt="" height="32" width="32"/>-->
20
        <!--<img class="logo_light" src="assets/img/logo_main_small_light.png" alt="" height="32" width="32"/>-->
21
      <!--</a>-->
22
    <!--</div>-->
23
    <!--&lt;!&ndash;<div class="sidebar_actions">&ndash;&gt;-->
24
      <!--&lt;!&ndash;<select id="lang_switcher" name="lang_switcher">&ndash;&gt;-->
25
        <!--&lt;!&ndash;<option value="gb" selected>English</option>&ndash;&gt;-->
26
      <!--&lt;!&ndash;</select>&ndash;&gt;-->
27
    <!--&lt;!&ndash;</div>&ndash;&gt;-->
28
  <!--</div>-->
29

  
30
  <div class="menu_section uk-margin-large-top">
31
    <ul>
32

  
33
      <li [routerLinkActive]="['current_section']" class="">
34
        <a [routerLink]="['/sources', 'register']">
35
        <!--<a [routerLink]="['/register']">-->
36
          <span class="menu_icon_circle_letter">R</span>
37
          <span class="menu_title">Register</span>
38
        </a>
39
      </li>
40

  
41
      <!--<li class="submenu_trigger" [ngClass]="{'act_section': checkIfCollapsed(2) }" routerLinkActive="current_section">-->
42
      <li class="submenu_trigger" [ngClass]="{'act_section': checkIfCollapsed(2) }">
43
        <a (click)="setToggle(2)">
44
          <span class="menu_icon_circle_letter">V</span>
45
          <span class="menu_title">Validator</span>
46
        </a>
47
        <ul [ngClass]="{'uk-display-block': checkIfCollapsed(2)}">
48
          <li routerLinkActive="act_item"><a [routerLink]="['/compatibility', 'validate']">Validate</a></li>
49
          <li routerLinkActive="act_item"><a [routerLink]="['/compatibility', 'browseHistory']">Validation History</a></li>
50
        </ul>
51
      </li>
52

  
53
      <li *ngIf="reposOfUser && reposOfUser.length>0" [routerLinkActive]="['current_section']" class="">
54
        <a [routerLink]="['/content', 'notifications']">
55
          <span class="menu_icon_circle_letter">N</span>
56
          <span class="menu_title">Notifications</span>
57
        </a>
58
      </li>
59

  
60
    </ul>
61
  </div>
62

  
63
  <div *ngIf="reposOfUser && reposOfUser.length>0" class="menu_section border_top">
64
    <div class="sidebar_heading">REPOSITORIES</div>
65
    <ul>
66

  
67
      <li *ngFor="let repo of visibleReposOfUser" [routerLinkActive]="['current_section']" class="">
68
        <!--<a [routerLink]="['/repository', '{{repo.id}}']">-->
69
        <a [routerLink]="['/repository/' + repo.id]">
70
          <span *ngIf="!repo.logoUrl" class="menu_icon_circle" style="background-image: url('../../../assets/imgs/yourLogoHere.jpg')">
71
          </span>
72
          <span *ngIf="repo.logoUrl" class="menu_icon_circle" [ngStyle]="{'background-image': 'url(' + repo.logoUrl + ')'}">
73
          </span>
74
          <!--<span class="menu_title ellipsis">{{repo.officialname}}</span>-->
75
          <span *ngIf="repo.officialname.length>30" class="menu_title">{{repo.officialname.substr(0,30)}}...</span>
76
          <span *ngIf="repo.officialname.length<=30" class="menu_title">{{repo.officialname}}</span>
77
        </a>
78
      </li>
79

  
80
      <li *ngIf="reposOfUser.length>5 && !allReposVisible" class="">
81
        <a (click)="showMoreRepos()">
82
          <span class="menu_icon"><i class="material-icons">keyboard_arrow_down</i></span>
83
          <span class="menu_title">Show more</span>
84
        </a>
85
      </li>
86

  
87
      <li *ngIf="reposOfUser.length>5 && allReposVisible" class="">
88
        <a (click)="showLessRepos()">
89
          <span class="menu_icon"><i class="material-icons">keyboard_arrow_up</i></span>
90
          <span class="menu_title">Show less</span>
91
        </a>
92
      </li>
93

  
94

  
95
    </ul>
96
  </div>
97

  
98
  <div *ngIf="getIsUserAdmin()" class="menu_section admin_menu_section border_top">
99
    <div class="sidebar_heading">ADMIN</div>
100
    <ul>
101

  
102
      <li [routerLinkActive]="['current_section']" class="">
103
        <a href="{{adminHomePage}}" target="_blank">
104
          <span class="menu_icon_circle_letter">H</span>
105
          <span class="menu_title">Help Texts</span>
106
        </a>
107
      </li>
108
      <!--<li class="">-->
109
      <li [routerLinkActive]="['current_section']" class="">
110
        <a [routerLink]="['/admin/registrations']">
111
          <span class="menu_icon_circle_letter">R</span>
112
          <span class="menu_title">Registrations</span>
113
        </a>
114
        <ul [ngClass]="{'uk-display-block': visibleAdminRepo}">
115
          <li class="act_item">
116
            <a *ngIf="adminRepository?.officialName && adminRepository.officialName.length>30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialName.substr(0,30)}}...</a>
117
            <a *ngIf="adminRepository?.officialName && adminRepository.officialName.length<=30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialName}}</a>
118
          </li>
119
        </ul>
120
      </li>
121
      <li [routerLinkActive]="['current_section']" class="">
122
        <a [routerLink]="['/admin/metrics']">
123
          <span class="menu_icon_circle_letter">M</span>
124
          <span class="menu_title">Metrics</span>
125
        </a>
126
      </li>
127

  
128
    </ul>
129
  </div>
130
</aside><!-- main sidebar end -->
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/footer/footer.component.css
1
/*#footer#3 {*/
2
/*margin-right: 280px;*/
3
/*}*/
4

  
5
/*#footer#9 a, #footer#11 a, #footer#13 a {*/
6
/*color: #dedede;*/
7
/*line-height: 22px;*/
8
/*padding: 2px 0;*/
9
/*}*/
10

  
11
#footer\#9 a,  #footer\#11 a,  #footer\#13 a {
12
  color: #dedede;
13
  line-height: 22px;
14
  padding: 2px 0;
15
}
16

  
17
#footer\#9 a:hover,#footer\#11 a:hover, #footer\#13 a:hover {
18
  color: rgba(255, 255, 255, 0.5);
19
}
20

  
21
@media all and (min-width: 640px) {
22
  #footer\#3 {
23
    margin-right: 280px;
24
  }
25
}
26

  
27
#footer\#7 a {
28
  color: rgba(255, 255, 255, 0.7) !important;
29
  text-align: left;
30
  font-size: 14px;
31
}
32

  
33

  
34
.uk-block-secondary {
35
  background: #003D8C none repeat scroll 0 0;
36
}
37

  
38
.uk-block-secondary:not(.tm-block-texture) {
39
  border-color: #003D8C;
40
}
41

  
42
.tm-bottom-d {
43
  color: #ffffff;
44
  font-size: 10px;
45
  letter-spacing: 4px;
46
  text-transform: uppercase;
47
}
48

  
49
.newsletter .uk-icon {
50
  padding-left: 0px;
51
  padding-bottom: 0px;
52
}
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/403-forbidden-page.component.html
1
<div id="page_content">
2
  <div id="page_content_inner">
3
    <h2 class="heading_b uk-margin-bottom uk-margin-large-top uk-text-center">Error: 403 Forbidden</h2>
4

  
5
    <!-- TOP HELP CONTENT -->
6
    <help-content #topHelperContent [position]="'top'"
7
                  [ngClass]="topHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'">
8
    </help-content>
9

  
10
    <div class="uk-grid">
11

  
12
      <!-- LEFT HELP CONTENT -->
13
      <aside-help-content #leftHelperContent [position]="'left'"
14
                          [ngClass]="leftHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'">
15
      </aside-help-content>
16

  
17
      <!-- MIDDLE -->
18
      <div class=" uk-width-expand@m">
19

  
20
        <div style="font-size: 180px; color: #28beFF; line-height: 1.2;" class="uk-text-center">
21
          <strong>403</strong>
22
        </div>
23

  
24
        <div class="uk-text-center">
25
          Sorry, access to this resource on the server is forbidden.<br>
26
          Either check the URL or <a href="/home">go home</a>
27
        </div>
28

  
29
      </div>
30

  
31
      <!-- RIGHT HELP CONTENT -->
32
      <aside-help-content #rightHelperContent [position]="'right'"
33
                          [ngClass]="rightHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'">
34
      </aside-help-content>
35

  
36
    </div>
37

  
38
    <!-- BOTTOM HELP CONTENT -->
39
    <help-content #bottomHelperContent [position]="'bottom'"
40
                  [ngClass]="bottomHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'">
41
    </help-content>
42

  
43
  </div>
44
</div>
0 45

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/reusable-components.module.ts
1
/**
2
 * Created by stefania on 4/6/17.
3
 */
4
import { InlineFormWrapper, MyGroup } from './forms/my-group.interface';
5
import { MyArray, MyArrayInline, MyArrayWrapper, MyInlineArrayWrapper } from './forms/my-array.interface';
6
import { MyFormDirective } from './forms/my-form.directive';
7
import { NgModule } from '@angular/core';
8
import { CommonModule } from '@angular/common';
9
import { RouterModule } from '@angular/router';
10
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
11
import { HttpClientModule } from '@angular/common/http';
12
import { AsideHelpContentComponent, HelpContentComponent } from './help-content.component';
13
import { ConfirmationDialogComponent } from './confirmation-dialog.component';
14
import { RepositoryTilesComponent } from './repository-tiles.component';
15
import { ForbiddenPageComponent } from './403-forbidden-page.component';
16
import { HelpContentService } from '../../services/help-content.service';
17
import { ModalModule, TabsModule } from 'ngx-bootstrap';
18
import { TopmenuLandingComponent } from '../topmenulanding/topmenu-landing.component';
19
import { FooterComponent } from '../footer/footer.component';
20
import { ReadMoreComponent, ReadMoreTextComponent } from './read-more.component';
21
import { SideMenuComponent } from "../sidemenu/sidemenu.component";
22
import { TopmenuDashboardComponent} from "../topmenudashboard/topmenu-dashboard.component";
23
import { DatasourceUpdateFormComponent } from "./sources-forms/datasource-update-form.component";
24
import { DatasourceCreateFormComponent } from "./sources-forms/datasource-create-form.component";
25
import { DatasourceNewInterfaceFormComponent } from "./sources-forms/datasource-new-interface-form.component";
26

  
27
const myGroups = [
28
  MyGroup,
29
  MyArray,
30
  MyArrayWrapper,
31
  MyArrayInline,
32
  MyFormDirective,
33
  MyInlineArrayWrapper,
34
  InlineFormWrapper
35
];
36

  
37
@NgModule({
38
  imports: [
39
    CommonModule,
40
    RouterModule,
41
    TabsModule.forRoot(),
42
    ModalModule.forRoot(),
43
    FormsModule,
44
    ReactiveFormsModule,
45
    HttpClientModule,
46
  ],
47
  entryComponents : [
48
    MyArrayWrapper
49
  ],
50
  declarations: [
51
    HelpContentComponent,
52
    AsideHelpContentComponent,
53
    ConfirmationDialogComponent,
54
    TopmenuLandingComponent,
55
    TopmenuDashboardComponent,
56
    SideMenuComponent,
57
    FooterComponent,
58
    RepositoryTilesComponent,
59
    ForbiddenPageComponent,
60
    ReadMoreComponent,
61
    ReadMoreTextComponent,
62
    DatasourceUpdateFormComponent,
63
    DatasourceCreateFormComponent,
64
    DatasourceNewInterfaceFormComponent,
65
    ...myGroups
66
  ],
67
  exports: [
68
    HelpContentComponent,
69
    AsideHelpContentComponent,
70
    ConfirmationDialogComponent,
71
    TopmenuLandingComponent,
72
    TopmenuDashboardComponent,
73
    SideMenuComponent,
74
    FooterComponent,
75
    RepositoryTilesComponent,
76
    ForbiddenPageComponent,
77
    ...myGroups,
78
    ReadMoreComponent,
79
    ReadMoreTextComponent,
80
    DatasourceUpdateFormComponent,
81
    DatasourceCreateFormComponent,
82
    DatasourceNewInterfaceFormComponent,
83
  ],
84
  providers: [
85
    HelpContentService
86
  ],
87
})
88

  
89
export class ReusableComponentsModule {
90
}
0 91

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/help-content.component.ts
1
/**
2
 * Created by stefania on 7/17/17.
3
 */
4
import { Component, Input, OnInit } from '@angular/core';
5
import { Content, PageContent } from '../../domain/page-content';
6
import { HelpContentService } from '../../services/help-content.service';
7
import { ActivatedRoute, Router } from '@angular/router';
8

  
9
@Component({
10
  selector: 'help-content',
11
  template: `
12
    <ng-template [ngIf]="contents && contents.length>0">
13
      <ng-template ngFor let-content [ngForOf]="contents">
14
        <div [innerHTML]="content.content" class="uk-margin-medium-bottom"></div>
15
      </ng-template>
16
    </ng-template>
17
  `,
18
})
19

  
20
export class HelpContentComponent implements OnInit {
21

  
22
  @Input('position')
23
  position: string;
24

  
25
  contents: Content[];
26
  errorMessage: string = null;
27

  
28
  constructor(private _helpContentService: HelpContentService, private route: ActivatedRoute, private router: Router) {
29
  }
30

  
31
  ngOnInit() {
32
    this.errorMessage = null;
33
    setTimeout(() => {
34
      this._helpContentService.getActivePageContent( this.router.url ).subscribe(
35
        pageContent => this.shiftThroughContent(pageContent),
36
        error => this.handleError(<any>error)
37
      );
38
    }, 50);
39
  }
40

  
41
  shiftThroughContent(pageContent: PageContent) {
42
    this.contents = pageContent.content[this.position];
43
    /*console.log(`help-service for ${this.router.url} -> ${this.position} responded: ${JSON.stringify(this.contents)}`);*/
44
  }
45

  
46
  isPresent() {
47
    return (this.contents && this.contents.length > 0);
48
  }
49

  
50
  handleError(error) {
51
    this.errorMessage = 'System error retrieving page content (Server responded: ' + error + ')';
52
  }
53
}
54

  
55
@Component({
56
  selector: 'aside-help-content',
57
  template: `
58
    <ng-template [ngIf]="contents && contents.length>0">
59
      <ng-template ngFor let-content [ngForOf]="contents">
60
        <!--<div [innerHTML]="content.content" class="uk-card uk-card-body uk-card-default sidemenu uk-margin-bottom"></div>-->
61
        <div [innerHTML]="content.content" class="uk-margin-bottom"></div>
62
      </ng-template>
63
    </ng-template>
64
  `,
65
})
66
export class AsideHelpContentComponent extends HelpContentComponent {
67

  
68
}
0 69

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/update/update-repo-admins.component.html
1
<div class="uk-margin-small-top">
2
  <div>Update the users who can access the dashboard to manage the datasource.</div>
3

  
4
  <div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{errorMessage}}</div>
5
  <div *ngIf="loadingMessage" class="loading-medium">
6
    <div class="loader-small" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">
7
      {{ loadingMessage }}
8
    </div>
9
    <div class="whiteFilm"></div>
10
  </div>
11

  
12
  <div *ngIf="!loadingMessage" >
13

  
14
    <div class="uk-margin-top">
15
      <div class="uk-flex uk-flex-right@m uk-flex-right@l">
16
        <a class="uk-button uk-button-primary action uk-flex uk-flex-middle" (click)="showAddRepoAdminModal()">
17
          <!--<i class="md-icon material-icons">clear</i>-->
18
          <span class="uk-margin-small-left">Invite admin</span>
19
        </a>
20
      </div>
21
    </div>
22

  
23
    <div class="uk-margin-medium-top">
24
      <div *ngFor="let repoAdmin of repoAdmins" class="uk-grid uk-grid-divider uk-flex uk-flex-middle" uk-grid="">
25
        <div class="uk-width-3-4@l uk-width-1-2@m uk-first-column">
26
          <div class="">
27
            <span class="uk-text-muted">Email: </span>
28
            <span class="uk-text-bold">{{repoAdmin.email}}</span>
29
          </div>
30
        </div>
31
        <div class="uk-width-expand">
32
          <div class="uk-flex uk-flex-center">
33
            <a class="uk-button uk-button-default action uk-flex uk-flex-middle" (click)="showDeletionModal(repoAdmin)">
34
              <i class="md-icon material-icons">clear</i>
35
              <span class="uk-margin-small-left">Remove</span>
36
            </a>
37
          </div>
38
        </div>
39
      </div>
40
    </div>
41

  
42
  </div>
43

  
44
</div>
45

  
46
<confirmation-dialog #deleteRepositoryAdminModal [title]="'Remove datasource admin'" [isModalShown]="isDeleteModalShown"
47
                     [confirmButNotCloseButton]="'Remove'" (emitObject)="deleteRepoAdmin($event)">
48

  
49
  <div *ngIf="modalErrorMessage" class="uk-alert uk-alert-danger">{{modalErrorMessage}}</div>
50

  
51
  <div *ngIf="modalLoadingMessage" class="loading-small">
52
    <div class="loader-small" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">
53
      {{ modalLoadingMessage }}
54
    </div>
55
    <div class="whiteFilm"></div>
56
  </div>
57

  
58
  <!--<div *ngIf="!modalLoadingMessage && !modalErrorMessage">-->
59

  
60
    <!--<div *ngIf="selectedAdminForDelete">-->
61
      <!--<h6>Are you sure you want to delete {{ selectedAdminForDelete.email }} from the list of repository admins?</h6>-->
62
    <!--</div>-->
63
  <!--</div>-->
64
  <div *ngIf="selectedAdminForDelete">
65
    <h6>Are you sure you want to remove this user admin?</h6>
66
    <pre>
67
      <ng-container *ngIf="selectedAdminForDelete.firstName || selectedAdminForDelete.lastName">
68
        {{selectedAdminForDelete.firstName}} {{selectedAdminForDelete.lastName}}
69
      </ng-container>
70
      {{ selectedAdminForDelete.email }}
71
    </pre>
72
  </div>
73

  
74
</confirmation-dialog>
75

  
76

  
77
<confirmation-dialog #addRepositoryAdminModal [title]="'Add new datasource admin'" [isModalShown]="isAddModalShown"
78
                     [confirmButNotCloseButton]="'Submit'" (emitObject)="addRepositoryAdmin()">
79

  
80
  <div *ngIf="modalErrorMessage" class="uk-alert uk-alert-danger">{{modalErrorMessage}}</div>
81

  
82
  <div *ngIf="modalLoadingMessage" class="loading-small">
83
    <div class="loader-small" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">
84
      {{ modalLoadingMessage }}
85
    </div>
86
    <div class="whiteFilm"></div>
87
  </div>
88

  
89
  <h6>Add the email address of the new user admin. Make sure the user already has an OpenAIRE account with this email address.</h6>
90
  <form>
91
    <div class="uk-margin">
92
      <input class="uk-input" placeholder="Enter email..." [formControl]="emailControl">
93
    </div>
94
  </form>
95
</confirmation-dialog>
96

  
97

  
98

  
99
<!--<div id="addAdminModal" uk-modal>-->
100
  <!--<div class="uk-modal-dialog" style="top: 95.5px;">-->
101
    <!--<div class="uk-modal-header">-->
102
      <!--<h3 class="uk-modal-title">Adding a new repository admin for this repository</h3>-->
103
    <!--</div>-->
104
    <!--<div class="uk-modal-body">-->
105
      <!--<p>Lorem ipsum.....</p>-->
106
    <!--</div>-->
107
    <!--<div class="uk-modal-footer uk-text-right">-->
108
      <!--<button type="button" class="md-btn md-btn-flat uk-modal-close">Cancel</button>-->
109
      <!--<button (click)="addRepositoryAdmin()" type="button" class="md-btn md-btn-flat md-btn-flat-primary">Add admin</button>-->
110
    <!--</div>-->
111
  <!--</div>-->
112

  
113

  
114

  
115
  <!--&lt;!&ndash;<div *ngIf="!loadingMessage" class="uk-modal-dialog uk-modal-body">&ndash;&gt;-->
116
    <!--&lt;!&ndash;<div *ngIf="selectedAdminForDelete">&ndash;&gt;-->
117
      <!--&lt;!&ndash;<h6>Are you sure you want to delete {{ selectedAdminForDelete.email }} from the list of repository admins?</h6>&ndash;&gt;-->
118
      <!--&lt;!&ndash;&lt;!&ndash;<p>Deleting a {{serviceORresource}} is an irreversible action.</p>&ndash;&gt;&ndash;&gt;-->
119
    <!--&lt;!&ndash;</div>&ndash;&gt;-->
120
    <!--&lt;!&ndash;<button class="uk-button uk-button-danger uk-modal-close" type="button" (click)="deleteRepoAdmin(selectedAdminForDelete.email)">Delete</button>&ndash;&gt;-->
121
    <!--&lt;!&ndash;<button class="uk-button uk-button-primary uk-modal-close" type="button" (click)="closeDeletionModal()">Cancel</button>&ndash;&gt;-->
122
  <!--&lt;!&ndash;</div>&ndash;&gt;-->
123
  <!--&lt;!&ndash;<div *ngIf="loadingMessage">&ndash;&gt;-->
124
    <!--&lt;!&ndash;<div class="loader-small" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">&ndash;&gt;-->
125
      <!--&lt;!&ndash;{{ loadingMessage }}&ndash;&gt;-->
126
    <!--&lt;!&ndash;</div>&ndash;&gt;-->
127
    <!--&lt;!&ndash;&lt;!&ndash;    <div class="whiteFilm"></div>&ndash;&gt;&ndash;&gt;-->
128
  <!--&lt;!&ndash;</div>&ndash;&gt;-->
129
<!--</div>-->
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/services/authentication.service.ts
1
import { Injectable } from '@angular/core';
2
import { ActivatedRoute, Router } from '@angular/router';
3
import { HttpClient } from '@angular/common/http';
4
import { environment } from '../../environments/environment';
5
import { deleteCookie, getCookie } from '../domain/utils';
6
import { BehaviorSubject } from 'rxjs';
7

  
8
@Injectable()
9
export class AuthenticationService {
10

  
11
  constructor(private route: ActivatedRoute,
12
              private router: Router,
13
              private http: HttpClient) {}
14

  
15
  private apiUrl: string = environment.API_ENDPOINT;
16
  private loginUrl = environment.API_ENDPOINT + '/openid_connect_login';
17

  
18
  // store the URL so we can redirect after logging in
19
  public redirectUrl: string;
20

  
21
  private _storage: Storage = sessionStorage;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff