Project

General

Profile

« Previous | Next » 

Revision 57496

[Monitor_dashboard]:Initialize monitor admin. Home page has been created.

View differences:

modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/learn-how/learn-how.component.ts
1
import {Component} from '@angular/core';
2
import {ActivatedRoute, Router} from '@angular/router';
3
import {Meta, Title} from '@angular/platform-browser';
4
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
5
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
6
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
7
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
8

  
9
@Component({
10
  selector: 'learn-how',
11
  template: `
12
    <schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
13

  
14
    <ng-template #one>
15
      <h5 class="uk-text-bold uk-margin-small-bottom">1. Understanding your needs</h5>
16
      <div>
17
        First, we learn about your requirements and challenges. We help you understand Open Science practices within
18
        EOSC and together we’ll talk about how OpenAIRE RCD fits as a solution.
19
      </div>
20
    </ng-template>
21
    <ng-template #two>
22
      <h5 class=" uk-text-bold uk-margin-small-bottom">2. Develop a pilot</h5>
23
      <div>
24
        How do you work today, and how would you like to work tomorrow? We translate your needs into rules and processes
25
        and we configure operational OpenAIRE services. By the end of this phase, we’ll have defined the basic
26
        configuration of your Community Gateway.
27
      </div>
28
    </ng-template>
29
    <ng-template #three>
30
      <h5 class="uk-text-bold uk-margin-small-bottom">3. Test and Validate</h5>
31
      <div>
32
        You validate and test your new Community Gateway (portal) with your experts and community to ensure all
33
        workflows are in place and quality of data meets your standards. If needed, we work together in another
34
        iteration to further refine and adapt to your needs.
35
      </div>
36
    </ng-template>
37
    <ng-template #four>
38
      <h5 class=" uk-text-bold uk-margin-small-bottom">4. Roll out the service</h5>
39
      <div>
40
        We jointly roll out your new Community Gateway. You take over the business operations and start engaging your
41
        researchers, we take care of the smooth operation of the e-service.
42
      </div>
43
    </ng-template>
44
    <div class="image-front-topbar"
45
         uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}"
46
         tm-header-transparent="light" tm-header-transparent-placeholder="">
47
      <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
48
              [texts]="pageContents['top']"></helper>
49
      <!--<div style=" min-height: calc(7.89999px + 60vh); background-image: url('assets/about/background.png') !important;"
50
           class="uk-section uk-background-norepeat uk-background-cover uk-section-overlap uk-position-relative uk-preserve-color">
51
        <div class="uk-container uk-container-large uk-section uk-margin-top uk-padding-remove-top">
52
          <div class="uk-margin-large-top uk-grid">
53
            <h1 class="uk-width-1-1 font-41 uk-text-bold">Learn the process</h1>
54
            <div class="uk-width-1-2@l uk-width-1-1@s uk-h5 uk-margin-top">Build a <b>Gateway to your community's</b>
55
              open and linked research outcomes. Customized to your needs.
56
            </div>
57
          </div>
58
          <div class="uk-margin-large-top uk-flex uk-child-width-1-3@m uk-child-width-1-1@s uk-flex-center" uk-grid>
59
            <div class="uk-flex uk-child-width-1-1@m uk-child-width-1-2@s" uk-grid>
60
              <div>
61
                <ng-container *ngTemplateOutlet="one"></ng-container>
62
              </div>
63
              <div class="uk-visible@m">
64
                <ng-container *ngTemplateOutlet="four"></ng-container>
65
              </div>
66
              <div class="uk-hidden@m">
67
                <ng-container *ngTemplateOutlet="two"></ng-container>
68
              </div>
69
            </div>
70
            <div>
71
              <img src="../../assets/about/cycle.png">
72
            </div>
73
            <div class="uk-flex uk-child-width-1-1@m uk-child-width-1-2@s" uk-grid>
74
              <div class="uk-visible@m">
75
                <ng-container *ngTemplateOutlet="two"></ng-container>
76
              </div>
77
              <div class="uk-hidden@m uk-visible@s">
78
                <ng-container *ngTemplateOutlet="four"></ng-container>
79
              </div>
80
              <div>
81
                <ng-container *ngTemplateOutlet="three"></ng-container>
82
              </div>
83
              <div class="uk-hidden@s uk-visible@xs">
84
                <ng-container *ngTemplateOutlet="four"></ng-container>
85
              </div>
86
            </div>
87
          </div>
88
          <div class="uk-width-1-1 uk-text-center uk-text-large uk-margin-large-top">
89
            <a class="uk-button portal-button uk-text-uppercase" routerLinkActive="router-link-active"
90
               routerLink="/about/learn-in-depth"> Learn more details</a>
91
          </div>
92
        </div>
93
      </div>
94
      <div style="background-image: url('assets/cloud/abstract.png') !important;"
95
        class="uk-background-norepeat uk-section uk-background-center uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color">
96
        <div class="uk-container uk-container-large">
97
          <gif-slider [gifs]="gifs"></gif-slider>
98
        </div>
99
      </div>
100
      <div style="background-color: #CFDEF1;"
101
        class="uk-background-norepeat uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color">
102
        <div class="uk-container uk-container-large uk-section">
103
          <div class="uk-flex uk-flex-middle uk-padding" uk-grid>
104
            <div class="uk-width-expand">
105
              <div class="uk-text-bold uk-h4">We look forward to working together and helping you unlock the full
106
                potential of your research community through open science.
107
              </div>
108
              <div class="uk-margin-medium">Get in touch with our team to find out how.</div>
109
              <div class="uk-inline">
110
                <a class="uk-button portal-button" routerLinkActive="router-link-active" routerLink="/contact-us">
111
                  CONTACT US</a>
112
              </div>
113
            </div>
114
            <div class="uk-text-center uk-width-1-1@s uk-width-1-3@m">
115
              <img width="263" height="250" src="assets/connect-assets/contact/3.png">
116
            </div>
117
          </div>
118
        </div>
119
      </div>-->
120
    </div>
121
  `
122
})
123
export class LearnHowComponent {
124
  public piwiksub: any;
125
  public gifs: { "gif": string, "header": string, "text" }[] = [];
126
  public pageContents = null;
127
  public divContents = null;
128

  
129
  public url: string = null;
130
  public pageTitle: string = "OpenAIRE - Connect | Learn How";
131

  
132
  properties: EnvProperties;
133

  
134
  constructor(
135
    private route: ActivatedRoute,
136
    private _router: Router,
137
    private _meta: Meta,
138
    private _title: Title,
139
    private seoService: SEOService,
140
    private _piwikService: PiwikService,
141
    private helper: HelperService) {}
142

  
143
  public ngOnInit() {
144
    this.route.data
145
      .subscribe((data: { envSpecific: EnvProperties }) => {
146
        this.properties = data.envSpecific;
147

  
148
        if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
149
          this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe();
150
        }
151
        this.url = this.properties.baseLink + this._router.url;
152
        this.seoService.createLinkForCanonicalURL(this.url);
153
        this.updateUrl(this.url);
154
        this.updateTitle(this.pageTitle);
155
        this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
156

  
157
        //this.getDivContents();
158
        this.getPageContents();
159
      });
160
    this.createGifs();
161
  }
162

  
163
  private getPageContents() {
164
    this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
165
      this.pageContents = contents;
166
    })
167
  }
168

  
169
  private getDivContents() {
170
    this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
171
      this.divContents = contents;
172
    })
173
  }
174

  
175
  public ngOnDestroy() {
176
    if (this.piwiksub) {
177
      this.piwiksub.unsubscribe();
178
    }
179
  }
180

  
181
  private createGifs() {
182
    this.gifs.push({
183
      gif: "assets/connect-assets/about/gifs/profile.gif",
184
      header: "Profile",
185
      text: "Edit community information, change logo url, add community managers or organizations related to community."
186
    });
187
    this.gifs.push({
188
      gif: "assets/connect-assets/about/gifs/content.gif",
189
      header: "Content",
190
      text: "Manage projects, content providers, subjects and zenodo communities that are related to the research community."
191
    });
192
    this.gifs.push({
193
      gif: "assets/connect-assets/about/gifs/statistics.gif",
194
      header: "Statistics & Charts",
195
      text: "Manage statistical numbers & charts that will be displayed in the community overview and graph analysis views."
196
    });
197
    this.gifs.push({
198
      gif: "assets/connect-assets/about/gifs/links.gif",
199
      header: "Links",
200
      text: " Manage user claims related to the research community."
201
    });
202
    this.gifs.push({
203
      gif: "assets/connect-assets/about/gifs/help.gif",
204
      header: " Help texts",
205
      text: "Add or edit help text in research community pages."
206
    });
207
    this.gifs.push({
208
      gif: "assets/connect-assets/about/gifs/users.gif",
209
      header: "Users",
210
      text: "Invite more users to subscribe, manage community subscribers, your personal info and notification settings."
211
    });
212
  }
213

  
214
  private updateDescription(description: string) {
215
    this._meta.updateTag({content: description}, "name='description'");
216
    this._meta.updateTag({content: description}, "property='og:description'");
217
  }
218

  
219
  private updateTitle(title: string) {
220
    var _title = ((title.length > 50) ? title.substring(0, 50) : title);
221
    this._title.setTitle(_title);
222
    this._meta.updateTag({content: _title}, "property='og:title'");
223
  }
224

  
225
  private updateUrl(url: string) {
226
    this._meta.updateTag({content: url}, "property='og:url'");
227
  }
228
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/learn-how/learn-how.module.ts
1
import { NgModule}      from '@angular/core';
2
import { CommonModule } from '@angular/common';
3
import { RouterModule } from '@angular/router';
4

  
5
import {FreeGuard}      from '../openaireLibrary/login/freeGuard.guard';
6
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
7
import {PiwikService}          from '../openaireLibrary/utils/piwik/piwik.service';
8

  
9
import {LearnHowComponent} from "./learn-how.component";
10
import {LearnHowRoutingModule} from "./learn-how-routing.module";
11
import {GifSliderModule} from "../openaireLibrary/utils/gif-slider/gif-slider.module";
12
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
13
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
14
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
15
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
16

  
17
@NgModule({
18
  imports: [
19
    CommonModule, RouterModule, LearnHowRoutingModule, GifSliderModule, HelperModule,
20
    Schema2jsonldModule, SEOServiceModule
21
  ],
22
  declarations: [
23
    LearnHowComponent
24
  ],
25
  exports: [
26
    LearnHowComponent
27
  ],
28
  providers:[
29
    FreeGuard, PreviousRouteRecorder, PiwikService, IsRouteEnabled
30
  ]
31
})
32
export class LearnHowModule { }
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/learn-how/learn-how-routing.module.ts
1
import {NgModule}     from '@angular/core';
2
import {RouterModule} from '@angular/router';
3

  
4
import {FreeGuard}              from '../openaireLibrary/login/freeGuard.guard';
5
import {PreviousRouteRecorder}  from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
6
import {LearnHowComponent} from "./learn-how.component";
7
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
8

  
9
@NgModule({
10
  imports: [
11
    RouterModule.forChild([
12
     	{ path: '', component: LearnHowComponent, canActivate: [FreeGuard, IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] }
13

  
14
    ])
15
  ]
16
})
17
export class LearnHowRoutingModule { }
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/learn-how/learnInDepth/learn-in-depth.component.ts
1
import {Component} from '@angular/core';
2
import {ActivatedRoute, Router} from '@angular/router';
3
import {Meta, Title} from '@angular/platform-browser';
4
import {PiwikService} from '../../openaireLibrary/utils/piwik/piwik.service';
5
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
6
import {HelperService} from "../../openaireLibrary/utils/helper/helper.service";
7
import {SEOService} from "../../openaireLibrary/sharedComponents/SEO/SEO.service";
8

  
9
@Component({
10
  selector: 'learn-in-depth',
11
  template: `
12
    <schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
13

  
14
    <div class="image-front-topbar"
15
         uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}"
16
         tm-header-transparent="light" tm-header-transparent-placeholder="">
17
      <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
18
              [texts]="pageContents['top']"></helper>
19
      <!--<div
20
        class="uk-background-norepeat uk-background-cover uk-section uk-padding-remove-bottom uk-section-overlap uk-position-relative uk-preserve-color"
21
        style="min-height: calc(7.89999px + 60vh); background-image: url('assets/cloud/background.png') !important;">
22
        <div class="uk-container uk-container-large uk-section uk-margin-top uk-padding-remove-top">
23
          <div uk-grid>
24
            <div class="uk-margin-large-top uk-width-3-4@m uk-width-1-1@s">
25
              <h1 class="uk-width-3-4  uk-margin-medium-bottom">Let’s set up a Gateway for your Community
26
                <b>Together</b></h1>
27
              <div class="uk-width-4-5@m uk-width-1-1@s uk-h5">
28
                <div class="uk-margin-bottom">You don’t have to go alone.</div>
29
                <div>
30
                  We work with you in <b>4 collaborative steps</b> to identify your needs, putting in practice our
31
                  expertise on open science so you get the most out of OpenAIRE’s operational services.
32
                </div>
33
              </div>
34
            </div>
35
            <div class="uk-margin-large-top uk-width-expand">
36
              <img width="308" height="285" src="assets/connect-assets/banner/together.png">
37
            </div>
38
          </div>
39
        </div>
40
      </div>
41
      <div class="uk-container uk-container-large uk-section uk-padding-remove-top">
42
        <ul class="uk-breadcrumb">
43
          <li><a routerLinkActive="router-link-active" routerLink="/about">About</a></li>
44
          <li><span class="active">Learn in-depth</span></li>
45
        </ul>
46
        <div uk-grid>
47
          <div class="uk-width-1-6 uk-position-relative uk-flex uk-flex-column">
48
            <img src="assets/connect-assets/about/1.png" class="uk-align-center" width="100px" height="100px">
49
            <img src="assets/connect-assets/sketch_line_arrow.svg" class="uk-align-center">
50
          </div>
51
          <div class="uk-width-expand">
52
            <div class="uk-margin-medium uk-text-bold uk-h4">1. Analyse your needs</div>
53
            <i>Identify the scope and goals. Understand open science practices within EOSC and the OpenAIRE
54
              services</i>
55

  
56
            <p>
57
              In this stage, you get to talk to the OpenAIRE team.
58
              Share your expectations with us and let us give you all the details about the operational OpenAIRE
59
              services, which will be integrated into the Gateway for your community.
60
            </p>
61
            <p>
62
              Here are the most important questions that the OpenAIRE team will ask you, in order to understand your
63
              scope and goals:
64
            </p>
65
            <ul class="uk-list uk-list-bullet">
66
              <li>
67
                Do you want a gateway, where researchers can have access to all research products of a discipline?
68
                Do you want a gateway that gathers any research outcome, produced thanks to the funding and services
69
                of a given research infrastructure?
70
              </li>
71
              <li>
72
                Is your community (in)formally organized in sub-communities?
73
                Would you like to browse research products and get statistics also for these sub-communities?
74
                For example, the European Grid Infrastructure (EGI) features “virtual organizations” that represent
75
                discipline-specific communities and/or specific research projects.
76
                The research infrastructure DARIAH, on the other hand, is organised in national nodes (e.g.
77
                DARIAH-IT, DARIAH-DE).
78
              </li>
79
              <li>
80
                How can the OpenAIRE team identify the research products of your community, among all those
81
                available in the OpenAIRE Graph?
82
                Through a series of steps: set of keywords, acknowledgment statements, set of projects, set of
83
                repositories, etc.
84
                This can be partial and provisional information that will serve as a starting point to the OpenAIRE
85
                team.
86
                You will be able to refine and update this information, in the second phase “Develop a pilot”.
87
              </li>
88
            </ul>
89
          </div>
90
        </div>
91

  
92
        <div uk-grid uk-height-match>
93
          <div class="uk-width-1-6 uk-position-relative uk-flex uk-flex-column">
94
            <img src="assets/connect-assets/about/2.png" class="uk-align-center" width="100px" height="100px">
95
            <img src="assets/connect-assets/sketch_line_arrow.svg" class="uk-align-center">
96
          </div>
97
          <div class="uk-width-expand">
98
            <div class="uk-margin-medium uk-text-bold uk-h4">2. Develop a pilot</div>
99
            <i>We translate your needs into rules and processes and we configure operational OpenAIRE services.</i>
100

  
101
            <p>
102
              Based on the information gathered in phase 1 “Analyse your needs”, the OpenAIRE team will set up a
103
              pilot Gateway.
104
              We will configure the OpenAIRE mining algorithms to identify research products of the OpenAIRE Graph
105
              that are relevant to your community.
106
              Those, together with some basic statistics, will be available in the pilot version of the Community
107
              Gateway that will be deployed on the OpenAIRE BETA infrastructure.
108
            </p>
109
            <p>
110
              The OpenAIRE team will give you a demo of the Community Gateway, with details on how to refine and
111
              update the configuration of the Community Gateway, both in terms of criteria for including research
112
              products and in terms of logo and visible portal pages.
113
            </p>
114
          </div>
115
        </div>
116
        <div uk-grid uk-height-match>
117
          <div class="uk-width-1-6 uk-position-relative uk-flex uk-flex-column">
118
            <img src="assets/connect-assets/about/3.png" class="uk-align-center" width="100px" height="100px">
119
            <img src="assets/connect-assets/sketch_line_arrow_large.svg" class="uk-align-center">
120
          </div>
121
          <div class="uk-width-expand">
122
            <div class="uk-margin-medium uk-text-bold uk-h4">3. Test and Validate</div>
123
            <i>You validate and test your new Community Gateway (portal). If needed, we further refine and adapt to
124
              your needs</i>
125

  
126
            <p>
127
              Upon the completion of phase 2, take the time you need to test all its features, from search and
128
              browse for research products, to addition/removal of statistics from the portal.
129
              You can report any issue you might find and ask questions directly to the dedicated OpenAIRE team, via
130
              a specially designed collaboration tool.
131
            </p>
132
            <p>
133
              Typically, this phase takes some months, as you will have to go through certain procedures.
134
              Change the configuration of the criteria to include research products, wait for the new configuration
135
              to be applied on the OpenAIRE graph and validate the results, before you actually decide that the
136
              coverage of research products for your community is adequate.
137
            </p>
138
            <p>
139
              For some communities, the OpenAIRE team may also be able to implement dedicated mining algorithms
140
              (e.g. to find acknowledgement statements to your community/infrastructure in the full-texts of
141
              research articles) that may require several rounds of application, validation, and fine-tuning, before
142
              it reaches a high precision and recall.
143
              Your feedback is very important to minimize the effort and time needed for this process to complete.
144
            </p>
145

  
146
            <div class="uk-width-1-1 uk-text-center uk-margin-medium ">
147
              <img src="assets/connect-assets/OpenAIRE-RCD_howtos.png" width="auto" height="auto">
148
            </div>
149
          </div>
150
        </div>
151
        <div uk-grid uk-height-match>
152
          <div class="uk-width-1-6 uk-position-relative">
153
            <img src="assets/connect-assets/about/4.png" class="uk-align-center" width="100px" height="100px">
154
          </div>
155
          <div class="uk-width-expand">
156
            <div class="uk-margin-medium  uk-text-bold uk-h4">4. Roll out the service</div>
157
            <i>We jointly roll out your new portal. You take over the business operations and start engaging your
158
              researchers</i>
159

  
160
            <p>
161
              Here we are: the coverage of research products is good, interesting statistics and charts have been
162
              selected, and the portal pages available for end-users are ready.
163
              We can roll out the Community Gateway and make it available to all the researchers of the community!
164
            </p>
165
            <p>
166
              You, as a Community manager, become the main “promoter” of the Community Gateway.
167
              Engage the researchers of your community and, when applicable, inform the managers of the research
168
              infrastructure about the availability of tools for impact monitoring.
169
            </p>
170
            <p>
171
              Remember that you will still be able to change the configuration of the Community Gateway in order to
172
              address any issue that may arise and to follow the evolution of the community (e.g. a new project or a
173
              new content provider that was not previously available in OpenAIRE).
174
            </p>
175
            <p>
176
              Remember that you don’t have to go alone: the dedicated issue tracker you used in the “Test and
177
              Validate” phase is always available for you to contact the OpenAIRE team and ask for support.
178
            </p>
179
          </div>
180
        </div>
181
      </div>
182
      <div style="background-color: #CFDEF1;"
183
        class="uk-background-norepeat uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color">
184
        <div class="uk-container uk-container-large uk-section">
185
          <div class="uk-flex uk-flex-middle uk-padding" uk-grid>
186
            <div class="uk-text-center uk-width-1-1@s uk-width-1-2@m">
187
              <img width="329" height="250" src="assets/connect-assets/contact/2.png">
188
            </div>
189
            <div class="uk-width-expand">
190
              <div class="uk-text-bold uk-h4">
191
                <div>Let us help you develop a collaborative Open Science Gateway for your community. It is fast. It
192
                  is reliable.
193
                </div>
194
              </div>
195
              <div class="uk-margin-medium">Get in touch with our team to find out how.</div>
196
              <div class="uk-inline">
197
                <a class="uk-button portal-button" routerLink="/contact-us" routerLinkActive="router-link-active">
198
                  CONTACT
199
                  US</a>
200
              </div>
201
            </div>
202
          </div>
203
        </div>
204
      </div>-->
205
    </div>
206
  `
207
})
208
export class LearnInDepthComponent {
209
  public piwiksub: any;
210
  public pageContents = null;
211
  public divContents = null;
212

  
213
  public url: string = null;
214
  public pageTitle: string = "OpenAIRE - Connect | Learn In Depth";
215

  
216
  properties: EnvProperties;
217

  
218
  constructor(
219
    private route: ActivatedRoute,
220
    private _router: Router,
221
    private _meta: Meta,
222
    private _title: Title,
223
    private seoService: SEOService,
224
    private _piwikService: PiwikService,
225
    private helper: HelperService) {
226
  }
227

  
228
  public ngOnInit() {
229
    this.route.data
230
      .subscribe((data: { envSpecific: EnvProperties }) => {
231
        this.properties = data.envSpecific;
232

  
233
        if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
234
          this.piwiksub = this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe();
235
        }
236
        this.url = this.properties.baseLink + this._router.url;
237
        this.seoService.createLinkForCanonicalURL(this.url);
238
        this.updateUrl(this.url);
239
        this.updateTitle(this.pageTitle);
240
        this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
241

  
242
        //this.getDivContents();
243
        this.getPageContents();
244
      });
245
  }
246

  
247
  private getPageContents() {
248
    this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
249
      this.pageContents = contents;
250
    })
251
  }
252

  
253
  private getDivContents() {
254
    this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
255
      this.divContents = contents;
256
    })
257
  }
258

  
259
  public ngOnDestroy() {
260
    if (this.piwiksub) {
261
      this.piwiksub.unsubscribe();
262
    }
263
  }
264

  
265
  private updateDescription(description: string) {
266
    this._meta.updateTag({content: description}, "name='description'");
267
    this._meta.updateTag({content: description}, "property='og:description'");
268
  }
269

  
270
  private updateTitle(title: string) {
271
    var _title = ((title.length > 50) ? title.substring(0, 50) : title);
272
    this._title.setTitle(_title);
273
    this._meta.updateTag({content: _title}, "property='og:title'");
274
  }
275

  
276
  private updateUrl(url: string) {
277
    this._meta.updateTag({content: url}, "property='og:url'");
278
  }
279
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/learn-how/learnInDepth/learn-in-depth.module.ts
1
import { NgModule}      from '@angular/core';
2
import { CommonModule } from '@angular/common';
3
import { RouterModule } from '@angular/router';
4

  
5
import {FreeGuard}      from '../../openaireLibrary/login/freeGuard.guard';
6
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
7
import {PiwikService}          from '../../openaireLibrary/utils/piwik/piwik.service';
8

  
9
import {LearnInDepthComponent} from "./learn-in-depth.component";
10
import {LearnInDepthRoutingModule} from "./learn-in-depth-routing.module";
11
import {HelperModule} from "../../openaireLibrary/utils/helper/helper.module";
12
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard";
13
import {Schema2jsonldModule} from "../../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
14
import {SEOServiceModule} from "../../openaireLibrary/sharedComponents/SEO/SEOService.module";
15

  
16
@NgModule({
17
  imports: [
18
    CommonModule, RouterModule, LearnInDepthRoutingModule, HelperModule,
19
    Schema2jsonldModule, SEOServiceModule
20
  ],
21
  declarations: [
22
    LearnInDepthComponent
23
  ],
24
  exports: [
25
    LearnInDepthComponent
26
  ],
27
  providers:[
28
    FreeGuard, PreviousRouteRecorder, PiwikService, IsRouteEnabled
29
  ]
30
})
31
export class LearnInDepthModule { }
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/learn-how/learnInDepth/learn-in-depth-routing.module.ts
1
import {NgModule}     from '@angular/core';
2
import {RouterModule} from '@angular/router';
3

  
4
import {FreeGuard}              from '../../openaireLibrary/login/freeGuard.guard';
5
import {PreviousRouteRecorder}  from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
6
import {LearnInDepthComponent} from "./learn-in-depth.component";
7
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard";
8

  
9
@NgModule({
10
  imports: [
11
    RouterModule.forChild([
12
      { path: '', component: LearnInDepthComponent, canActivate: [FreeGuard, IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] }
13

  
14
    ])
15
  ]
16
})
17
export class LearnInDepthRoutingModule { }
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sidebar/sidebar-open.service.ts
1
import {Injectable} from "@angular/core";
2
import {BehaviorSubject} from "rxjs";
3

  
4
@Injectable({
5
  providedIn: 'root'
6
})
7
export class SidebarOpenService {
8

  
9
  private openSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
10

  
11
  constructor() {}
12

  
13
  get open(): boolean {
14
    return this.openSubject.getValue();
15
  }
16

  
17
  setOpen(value: boolean) {
18
    this.openSubject.next(value);
19
  }
20
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sidebar/sideBar.component.html
1
<aside id="sidebar_main">
2
<!--  <div class="sidebar_main_header">-->
3
<!--    <div *ngIf="name" class="uk-margin-top uk-margin-left">-->
4
<!--      <div class="uk-text-bold">{{name}}</div>-->
5
<!--      <div>Monitor Dashboard</div>-->
6
<!--    </div>-->
7
<!--  </div>-->
8

  
9
  <div class="menu_section" >
10
    <ul>
11
      <ng-template ngFor [ngForOf]="items" let-item let-i="index">
12
        <li [class.current_section]="isTheActiveMenu(item.route)"
13
            [class.art_section]="item.open"
14
            [title]="item.name"
15
            [class.submenu_trigger]="item.items.length > 1">
16
          <a *ngIf="item.items.length < 1 && item.route" [routerLink]="item.route">
17
            <span *ngIf="item.icon" class="menu_icon"><i class="material-icons">{{item.icon}}</i></span>
18
            <span class="menu_title">{{item.name}}</span>
19
          </a>
20
          <ng-template [ngIf]="item.items.length > 1">
21
            <a (click)="item.open = !item.open">
22
              <span *ngIf="item.icon" class="menu_icon"><i class="material-icons">{{item.icon}}</i></span>
23
              <span class="menu_title">{{item.name}}</span>
24
            </a>
25
            <ul [style.display]="(item.open?'block':'none')">
26
              <ng-template ngFor [ngForOf]="item.items" let-subItem let-j="index">
27
                <li *ngIf="subItem.route" [class.act_item]="isTheActiveMenu(subItem.route)">
28
                  <a [routerLink]="subItem.route">
29
                    <span *ngIf="subItem.icon" class="menu_icon"><i class="material-icons">{{subItem.icon}}</i></span>
30
                    <span class="menu_title">{{subItem.name}}</span>
31
                  </a>
32
                </li>
33
              </ng-template>
34
            </ul>
35
          </ng-template>
36
        </li>
37
      </ng-template>
38
    </ul>
39
  </div>
40
</aside>
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sidebar/sideBar.component.ts
1
import {Component, Input, OnInit} from '@angular/core';
2
import {Router} from "@angular/router";
3
import {Item} from "../../utils/entities/sidebar";
4

  
5
@Component({
6
  selector: 'dashboard-sidebar',
7
  templateUrl: 'sideBar.component.html'
8
})
9
export class SideBarComponent implements OnInit {
10
  @Input() items: Item[] = [];
11
  @Input() name = null;
12

  
13
  constructor(private router: Router) {
14
  }
15

  
16
  ngOnInit(): void {
17
  }
18

  
19
  private getCurrentRoute(): string {
20
    return this.router.url.split('?')[0];
21
  }
22

  
23
  isTheActiveMenu(route: string): boolean {
24
    return this.getCurrentRoute().indexOf(route) !== -1;
25
  }
26
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sidebar/sideBar.module.ts
1
import {NgModule} from '@angular/core';
2
import {CommonModule} from '@angular/common';
3

  
4
import {RouterModule} from "@angular/router";
5

  
6
import {SideBarComponent} from './sideBar.component';
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule,
11
    RouterModule
12
  ],
13
  declarations: [
14
    SideBarComponent
15
  ],
16
  providers: [],
17
  exports: [
18
    SideBarComponent
19
  ]
20
})
21
export class SideBarModule {
22
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/entities/sidebar.ts
1
import {ElementRef, TemplateRef} from "@angular/core";
2

  
3
export class Header {
4
  name: string;
5
  dashboard: string;
6
  logoUrl: string;
7

  
8
  constructor(name: string, dashboard: string, logoUrl: string = null) {
9
    this.name = name;
10
    this.dashboard = dashboard;
11
    this.logoUrl = logoUrl
12
  }
13
}
14

  
1 15
export class Item {
2 16
  name: string;
3 17
  route: string;
4 18
  items: Item[];
5 19
  icon: string;
6 20
  open: boolean;
21
  action: TemplateRef<ElementRef>;
7 22

  
8
  constructor(name: string, route: string, items: Item[], icon, open: boolean) {
23
  constructor(name: string, route: string, items: Item[], icon, open: boolean, action: TemplateRef<ElementRef> = null) {
9 24
    this.name = name;
10 25
    this.route = route;
11 26
    this.items = items;
12 27
    this.icon = icon;
13 28
    this.open = open;
29
    this.action = action;
14 30
  }
15 31
}
16 32

  
17 33
export class Sidebar {
18 34
  items: Item[];
35
  header: Header;
19 36

  
20
  constructor(items: Item[]) {
37
  constructor(items: Item[], header: Header) {
21 38
    this.items = items;
39
    this.header = header;
22 40
  }
23 41
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/services/stakeholder.service.ts
1 1
import {Injectable} from "@angular/core";
2 2
import {HttpClient} from "@angular/common/http";
3 3
import {BehaviorSubject, Observable} from "rxjs";
4
import {Indicator, Stakeholder} from "../utils/entities/stakeholder";
5
import {map} from "rxjs/operators";
4
import {Stakeholder} from "../utils/entities/stakeholder";
6 5

  
7
@Injectable()
6
@Injectable({
7
  providedIn: "root"
8
})
8 9
export class StakeholderService {
9 10

  
11
  private stakeholderSubject: BehaviorSubject<Stakeholder> = null;
12

  
10 13
  constructor(private http: HttpClient) {
14
    this.stakeholderSubject = new BehaviorSubject<Stakeholder>(null);
11 15
  }
12 16

  
13 17
  getStakeholder(alias: string): Observable<Stakeholder> {
14
    /*return this.http.get<any>('./assets/stakeholders.json').pipe(map(json => {
15
      let stakeholder = json.stakeholders.filter(stakeholder => stakeholder.alias === alias)[0];
16
      if (stakeholder) {
17
        stakeholder.topics = stakeholder.topics.filter(topic => topic.isActive && topic.isPublic);
18
        return stakeholder;
19
      } else {
20
        throw new HttpErrorResponse({
21
          error: {
22
            message: 'No Stakeholder has been found',
23
            status: 404
24
          }
25
        })
26
      }
27
    }));*/
28 18
    return new BehaviorSubject<Stakeholder>(Stakeholder.createECStakeholder()).asObservable();
29 19
  }
20

  
21
  getStakeholderAsObservable(): Observable<Stakeholder> {
22
    return this.stakeholderSubject.asObservable();
23
  }
24

  
25
  get stakeholder(): Stakeholder {
26
    return this.stakeholderSubject.getValue();
27
  }
28

  
29
  setStakeholder(stakeholder: Stakeholder) {
30
    this.stakeholderSubject.next(stakeholder);
31
  }
30 32
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/sidebar/sideBar.component.ts
1
import {Component, Input, OnInit} from '@angular/core';
2
import {Router} from "@angular/router";
3
import {Header, Item} from "../../../utils/entities/sidebar";
4

  
5
@Component({
6
  selector: 'dashboard-sidebar',
7
  templateUrl: 'sideBar.component.html'
8
})
9
export class SideBarComponent implements OnInit {
10
  @Input() items: Item[] = [];
11
  // TODO remove it
12
  @Input() name = null;
13
  @Input() header: Header = null;
14

  
15
  constructor(private router: Router) {
16
  }
17

  
18
  ngOnInit(): void {
19
  }
20

  
21
  private getCurrentRoute(): string {
22
    return this.router.url.split('?')[0];
23
  }
24

  
25
  isTheActiveMenu(route: string): boolean {
26
    return this.getCurrentRoute().indexOf(route) !== -1;
27
  }
28
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/sidebar/sideBar.module.ts
1
import {NgModule} from '@angular/core';
2
import {CommonModule} from '@angular/common';
3

  
4
import {RouterModule} from "@angular/router";
5

  
6
import {SideBarComponent} from './sideBar.component';
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule,
11
    RouterModule
12
  ],
13
  declarations: [
14
    SideBarComponent
15
  ],
16
  providers: [],
17
  exports: [
18
    SideBarComponent
19
  ]
20
})
21
export class SideBarModule {
22
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/sidebar/sideBar.component.html
1
<aside id="sidebar_main">
2
  <div class="sidebar_main_header">
3
    <div *ngIf="name" class="uk-padding-small">
4
      <div class="uk-text-bold">{{name}}</div>
5
      <div>Monitor Dashboard</div>
6
    </div>
7
    <div *ngIf="header" class="uk-padding-small">
8
      <img *ngIf="header.logoUrl" [src]="header.logoUrl">
9
      <div class="uk-text-bold uk-margin-top">{{header.name}}</div>
10
      <div>{{header.dashboard}}</div>
11
    </div>
12
  </div>
13
  <div class="menu_section">
14
    <ul>
15
      <ng-template ngFor [ngForOf]="items" let-item let-i="index">
16
        <li [class.current_section]="isTheActiveMenu(item.route)"
17
            [class.act_section]="item.open"
18
            [title]="item.name"
19
            [class.submenu_trigger]="item.items.length > 1">
20
          <a *ngIf="item.items.length <= 1 && item.route" [routerLink]="item.route">
21
            <span *ngIf="item.icon" class="menu_icon"><i class="material-icons">{{item.icon}}</i></span>
22
            <span class="menu_title">{{item.name}}</span>
23
          </a>
24
          <ng-template [ngIf]="item.items.length > 1">
25
            <a (click)="item.open = !item.open">
26
              <span *ngIf="item.icon" class="menu_icon"><i class="material-icons">{{item.icon}}</i></span>
27
              <span class="menu_title">{{item.name}}</span>
28
            </a>
29
            <ul [style.display]="(item.open?'block':'none')">
30
              <ng-template ngFor [ngForOf]="item.items" let-subItem let-j="index">
31
                <li *ngIf="subItem.route" [class.act_item]="isTheActiveMenu(subItem.route)">
32
                  <a [routerLink]="subItem.route">
33
                    <span *ngIf="subItem.icon" class="menu_icon"><i class="material-icons">{{subItem.icon}}</i></span>
34
                    <span class="menu_title">{{subItem.name}}</span>
35
                  </a>
36
                </li>
37
              </ng-template>
38
            </ul>
39
          </ng-template>
40
        </li>
41
      </ng-template>
42
    </ul>
43
  </div>
44
</aside>
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/sidebar/sideBar.service.ts
1
import {Injectable} from "@angular/core";
2
import {BehaviorSubject, Observable} from "rxjs";
3
import {Header, Item} from "../../../utils/entities/sidebar";
4

  
5
@Injectable({
6
  providedIn: 'root'
7
})
8
export class SideBarService {
9

  
10
  private openSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
11
  private hasSidebarSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
12

  
13
  constructor() {
14
  }
15

  
16
  get open(): boolean {
17
    return this.openSubject.getValue();
18
  }
19

  
20
  setOpen(value: boolean) {
21
    this.openSubject.next(value);
22
  }
23

  
24
  get hasSidebar(): Observable<boolean> {
25
    return this.hasSidebarSubject.asObservable();
26
  }
27

  
28
  setHasSidebar(value: boolean) {
29
    this.hasSidebarSubject.next(value);
30
  }
31
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app.component.html
1
<!--disable_transitions -->
2
<div class="sidebar_main_swipe" [class.sidebar_main_active]="open && hasSidebar">
3
  <div id="header_main" [class.header_full]="!hasSidebar">
4
    <nav class="uk-light">
5
      <a *ngIf="hasSidebar" id="sidebar_main_toggle" (click)="toggleOpen()" class="sSwitch sSwitch_left">
6
        <span class="sSwitchIcon"></span>
7
      </a>
8
    </nav>
9
  </div>
10
  <router-outlet></router-outlet>
11
</div>
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app.component.ts
1
import {Component} from '@angular/core';
2
import {ActivatedRoute, NavigationStart, Router} from '@angular/router';
1
import {ChangeDetectorRef, Component} from '@angular/core';
2
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router';
3 3

  
4 4
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
5
import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
6 5
import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
7
import {CommunitiesService} from "./openaireLibrary/connect/communities/communities.service";
8
import {Session, User} from './openaireLibrary/login/utils/helper.class';
9
import {ConnectHelper} from './openaireLibrary/connect/connectHelper';
10
import {SubscribeService} from './openaireLibrary/utils/subscribe/subscribe.service';
11
import {HelperFunctions} from "./openaireLibrary/utils/HelperFunctions.class";
6
import {User} from './openaireLibrary/login/utils/helper.class';
12 7
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
8
import {SideBarService} from "./library/sharedComponents/sidebar/sideBar.service";
9
import {StakeholderService} from "./services/stakeholder.service";
13 10

  
14 11
@Component({
15
  //changeDetection: ChangeDetectionStrategy.Default,
16
  //encapsulation: ViewEncapsulation.Emulated,
17 12
  selector: 'app-root',
18
  styles: [`
19
  `],
20
  template: `
21
    <div [class]="(community)?(community.id +'App'):'connectApp'">
22
      <div>
23
        <main>
24
          <router-outlet></router-outlet>
25
        </main>
26
      </div>
27
      <!--feedback *ngIf= "isClient && properties" portalName="Connect" [feedbackQuestionaire]=properties.feedbackQuestionaire></feedback-->
28
      <cookie-law *ngIf="isClient" position="bottom">
29
        OpenAIRE uses cookies in order to function properly.<br>
30
        Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing
31
        experience possible.
32
        By using the OpenAIRE portal you accept our use of cookies. <a
33
        href="//ec.europa.eu/ipg/basics/legal/cookies/index_en.htm" target="_blank"> Read more <span class="uk-icon">
34
            <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-right"
35
                 ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03"
36
                                     points="7 4 13 10 7 16"></polyline></svg>
37
            </span></a>
38
      </cookie-law>
39
    </div>
40
  `
41

  
13
  templateUrl: './app.component.html'
42 14
})
43 15
export class AppComponent {
44
  isClient: boolean = false;
45

  
46
  userMenuItems: MenuItem[] = [];
47

  
48

  
49
  menuItems: RootMenuItem [] = [];
50
  bottomMenuItems: MenuItem[] = [];
51
  public community = null;
52 16
  properties: EnvProperties;
53
  showMenu: boolean = false;
54
  communities = null;
55
  subscriberOfCommunities = false;
56
  managerOfCommunities = false;
57 17
  user: User;
58 18
  loginCheck: boolean = false;
19
  hasSidebar: boolean = false;
59 20

  
60
  //  community: {id:string, name:string, logoUrl:string};
61
  constructor(private  route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
62
              private _communitiesService: CommunitiesService, private _subscribeService: SubscribeService,
63
              private router: Router, private userManagementService: UserManagementService) {
64
    router.events.forEach((event) => {
65
      if (event instanceof NavigationStart) {
66
        HelperFunctions.scroll();
67
      }
68
    });
21
  constructor(private  route: ActivatedRoute,
22
              private propertiesService: EnvironmentSpecificService,
23
              private router: Router,
24
              private userManagementService: UserManagementService,
25
              private sideBarService: SideBarService,
26
              private stakeholderService: StakeholderService,
27
              private cdr: ChangeDetectorRef) {
69 28
  }
70 29

  
71 30
  ngOnInit() {
31
    this.router.events.forEach((event) => {
32
      if (event instanceof NavigationEnd) {
33
        let r = this.route;
34
        while (r.firstChild) {
35
          r = r.firstChild;
36
        }
37
        r.params.subscribe(params => {
38
          if(params['stakeholder']) {
39
            if(!this.stakeholderService.stakeholder ||
40
              this.stakeholderService.stakeholder.alias !== params['stakeholder']) {
41
              this.stakeholderService.getStakeholder(params['stakeholder']).subscribe(stakeholder => {
42
                this.stakeholderService.setStakeholder(stakeholder);
43
              });
44
            }
45
          } else {
46
            this.stakeholderService.setStakeholder(null);
47
          }
48
        });
49
      }
50
    });
72 51
    this.propertiesService.loadEnvironment()
73
      .then(es => {
74
        this.properties = this.propertiesService.envSpecific;
75
        var communityId: string = "";
76
        this._communitiesService.updateCommunities(this.properties, this.properties.communitiesAPI);
77
        this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe( user => {
52
      .then(properties => {
53
        this.properties = properties;
54
        this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe(user => {
78 55
          this.user = user;
79 56
          this.loginCheck = true;
80
          if (this.properties.environment == "development") {
81
            this.showMenu = false;
82
            this.route.queryParams.subscribe(params => {
83
              communityId = (params['communityId']) ? params['communityId'] : '';
84
              this.buildMenu(communityId);
85
            })
86
          } else {
87
            this.showMenu = false;
88
            communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
89
            this.buildMenu(communityId);
90
          }
91
          if (typeof document !== 'undefined') {
92
            try {
93
              this.isClient = true;
94
            } catch (e) {
95
            }
96
          }
97 57
        }, error => {
98 58
          console.log("App couldn't fetch properties");
99 59
          console.log(error);
100

  
101 60
        });
102
        });
61
      });
62
    this.sideBarService.hasSidebar.subscribe(hasSidebar => {
63
      this.hasSidebar = hasSidebar;
64
      this.cdr.detectChanges();
65
    });
103 66
  }
104 67

  
105
  public buildMenu(communityId: string) {
106
    let community = null;
107
    this.community = null;
108
    this._communitiesService.getCommunitiesState().subscribe(
109
      communities => {
110
        if (!communities || communities.length == 0 && communityId !== null && communityId !== '') {
111
          return;
112
        }
113
        for (var com of communities) {
114
          if ((communityId && communityId != "" && com.communityId == communityId
115
            && community != null) ||
116
            (
117
              !(communityId && communityId != "" && com.communityId == communityId)
118
              &&
119
              this.managerOfCommunities && this.subscriberOfCommunities)) {
120
            break;
121
          }
122
          if (this.user && com['status'] != "hidden") {
123
            if (Session.isCommunityCurator(this.user) || Session.isPortalAdministrator(this.user)) {
124
              this.managerOfCommunities = true;
125
            } else if (com.managers.indexOf(this.user.email) != -1) {
126
              this.managerOfCommunities = true;
127
            }
128
          }
68
  public get open() {
69
    return this.sideBarService.open;
70
  }
129 71

  
130 72

  
131
          if (communityId && communityId != "" && com.communityId == communityId) {
132
            community = com;
133
            let isCommunityManager: boolean = false;
134
            if (Session.isCommunityCurator(this.user) || Session.isPortalAdministrator(this.user)) {
135
              isCommunityManager = true;
136
            } else if (this.user && com.managers.indexOf(this.user.email) != -1) {
137
              isCommunityManager = true;
138
            }
139
            this.community = {
140
              id: community.communityId,
141
              name: (community.shortTitle) ? community.shortTitle : community.title,
142
              logoUrl: community.logoUrl
143
            };
144
            this.menuItems = [];
145

  
146
            this.menuItems.push(
147
              {
148
                rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find", "/search/find/publications", "/search/find/datasets", "/search/find/software", "/search/find/other", "/search/find/projects", "/search/find/dataproviders"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
149
                items: [new MenuItem("", "Publications", "", "/search/find/publications", false, ["publication"], ["/search/find/publications"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
150
                  new MenuItem("", "Research Data", "", "/search/find/datasets", false, ["dataset"], ["/search/find/datasets"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
151
                  new MenuItem("", "Software", "", "/search/find/software", false, ["software"], ["/search/find/software"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
152
                  new MenuItem("", "Other Research Products", "", "/search/find/other", false, ["orp"], ["/search/find/other"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
153
                  new MenuItem("", "Projects", "", "/search/find/projects/", false, ["project"], ["/search/find/projects"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
154
                  new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
155
                ]
156
              });
157

  
158
            this.menuItems.push({
159
              rootItem: new MenuItem("deposit", "Deposit", "", "/participate/deposit/learn-how", false, [], ["/participate/deposit/learn-how"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
160
              items: [
161
                /*
162
                new MenuItem("","Zenodo Communities","","/participate/share-zenodo",false,[],["/participate/share-zenodo"],this.properties.environment!="development"?{}:{communityId:community.communityId}),
163
                new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],this.properties.environment!="development"?{}:{communityId:community.communityId}),
164
                new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],this.properties.environment!="development"?{}:{communityId:community.communityId})
165
                */
166
              ]
167
            });
168
            this.menuItems.push(
169
              {
170
                rootItem: new MenuItem("link", "Link", "", "/participate/claim", false, [], ["/participate/claim"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
171
                items: [
172
                  new MenuItem("", "Start linking", "", "/participate/claim", false, [], ["/participate/claim"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
173
                  new MenuItem("", "Learn more", this.properties.claimsInformationLink, "", false, [], [], {})
174
                ]
175
              });
176
            if (isCommunityManager) {
177
              this.menuItems.push(
178
                {
179
                  rootItem: new MenuItem("manage", "Manage", 'https://beta.admin.connect.openaire.eu/dashboard?communityId=' + community.communityId, "", false, [], [], {}),
180
                  items: []
181
                });
182
            }
183

  
184
          }
185

  
186
        }
187
        if (community == null) {
188
          this.menuItems = [];
189
          this.menuItems.push({
190
            rootItem: new MenuItem("about", "About", "", "/about/learn-how", false, [], null, {}),
191
            items: []
192
          });
193
          var myCommunities = [];
194
          /*if(this.managerOfCommunities){
195
            myCommunities.push( new MenuItem("","Managing communities","","/search/find/communities",false,[],[],{role:"%22manager%22"}))
196
          }
197
          if(Session.isLoggedIn()){
198
            this._subscribeService.getCommunitiesSubscribedTo(this.properties, Session.getUserEmail()).subscribe (
199
              pids => {
200
                if(pids.length > 0 ) {
201
                  myCommunities.push( new MenuItem("","Subscribed to communities","","/search/find/communities",false,[],[],{status:"%22subscribed%22"}))
202
                }
203
              },
204
              error => {
205
                console.error("Error fetching your subscribed communities")
206
              });
207
          }*/
208
          this.menuItems.push({
209
            rootItem: new MenuItem("communities", "Communities", "", "/search/find/communities", false, [], null, {}),
210
            items: []
211
          });
212
          this.menuItems.push({
213
            rootItem: new MenuItem("join", "Join", "", "/contact-us", false, [], null, {}),
214
            items: []
215
          });
216
          /*if(this.managerOfCommunities || this.subscriberOfCommunities){
217
            let myCommunitiesMenu =   new MenuItem("myCommunities","My Communities","","",false,[],[],{});
218
            myCommunitiesMenu.setMarkAsActive(false);
219
            this.menuItems.push({rootItem: myCommunitiesMenu, items: myCommunities});
220
          }*/
221

  
222

  
223
          this.bottomMenuItems = [
224
            new MenuItem("", "About", "https://beta.openaire.eu/project-factsheets", "", false, [], [], {}),
225
            new MenuItem("", "News - Events", "https://beta.openaire.eu/news-events", "", false, [], [], {}),
226
            new MenuItem("", "Blog", "https://blogs.openaire.eu/", "", false, [], [], {}),
227
            new MenuItem("", "Contact us", "https://beta.openaire.eu/contact-us", "", false, [], [], {})
228
          ];
229
          // if(this.properties.showContent){
230
          //   this.bottomMenuItems.push(new MenuItem("","Content Policy","","/content",false,[],[],{}));
231
          // }
232
          this.userMenuItems = [
233
            // new MenuItem("","My links","","/myclaims",false,[],["/myclaims"],(data['communityId'] && typeof document !== 'undefined' && ConnectHelper.isProduction(document.location.hostname))?{}:{communityId:data['communityId']}),
234
          ];
235
          if (Session.isPortalAdministrator(this.user)) {
236
            //((this.properties.environment == "beta") ? "https://beta.admin.connect.openaire.eu" : "https://admin.explore.openaire.eu") + "/dashboard?communityId=openaire"
237
            this.userMenuItems.push(new MenuItem("", "Manage Helptexts",
238
              ((this.properties.environment == "production") ? "https://admin.explore.openaire.eu" : "https://beta.admin.connect.openaire.eu") + "/dashboard?communityId=connect",
239
              "", false, [], [], {}))
240
          }
241
          /*if(this.managerOfCommunities){
242
            this.userMenuItems.push( new MenuItem("","Managing communities","","/search/find/communities",false,[],[],{role:"%22manager%22"}))
243
          }
244
          if(Session.isLoggedIn()){
245
            this._subscribeService.getCommunitiesSubscribedTo(this.properties, Session.getUserEmail()).subscribe (
246
              pids => {
247
                if(pids.length > 0 ) {
248
                  this.userMenuItems.push( new MenuItem("","Subscribed to communities","","/search/find/communities",false,[],[],{status:"%22subscribed%22"}))
249
                }
250
              },
251
              error => {
252
                console.error("Error fetching your subscribed communities")
253
              });
254
          }*/
255
          if (this.user) {
256
            this.userMenuItems.push(new MenuItem("my-communities", "My Communities", "",
257
              "/myCommunities", false, [], [], {}));
258
          }
259
        } else {
260
          this.bottomMenuItems = [
261
            // new MenuItem("","About","","/about",false,[],["/about"],this.properties.environment!="development"?{}:{communityId:community.communityId}),
262
            new MenuItem("", "Organizations", "", "/organizations", false, [], ["/organizations"], this.properties.environment != "development" ? {} : {communityId: community.communityId})
263
          ];
264
          if (this.properties.showContent) {
265
            this.bottomMenuItems.push(new MenuItem("", "Content Policy", "", "/content", false, [], [], {}));
266
          }
267
          this.userMenuItems = [ /*new MenuItem("","My profile","","",false,[],[],{}),*/
268
            new MenuItem("", "My links", "", "/myclaims", false, [], ["/myclaims"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
269
            new MenuItem("", "Invite users", "", "/invite", false, [], [], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
270
          ];
271
          if (this.managerOfCommunities) {
272
            this.userMenuItems.push(new MenuItem("", "Support", "https://openaire-connect.d4science.org/group/openaire-connect-gateway/explore?siteId=172366611", "", false, [], [], {}))
273
          }
274
        }
275
        this.showMenu = true;
276
      });
73
  public toggleOpen(event = null) {
74
    if(!event) {
75
      this.sideBarService.setOpen(!this.open);
76
    } else if(event && event['value'] === true) {
77
      this.sideBarService.setOpen(false);
78
    }
277 79
  }
278 80
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/monitor/monitor.module.ts
13 13
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
14 14
import {MonitorRoutingModule} from "./monitor-routing.module";
15 15
import {MonitorComponent} from "./monitor.component";
16
import {StakeholderService} from "../services/stakeholder.service";
17 16
import {StatisticsService} from "../utils/services/statistics.service";
18
import {SideBarModule} from "../library/sidebar/sideBar.module";
17
import {SideBarModule} from "../library/sharedComponents/sidebar/sideBar.module";
19 18
import {ModalModule} from "../openaireLibrary/utils/modal/modal.module";
20 19

  
21 20
@NgModule({
......
28 27
  ],
29 28
  providers: [
30 29
    FreeGuard, PreviousRouteRecorder,
31
    PiwikService, StakeholderService,
30
    PiwikService,
32 31
    StatisticsService
33 32
  ],
34 33
  exports: [
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/monitor/monitor.component.ts
14 14
import {Category, IndicatorPath, Stakeholder, SubCategory, Topic} from "../utils/entities/stakeholder";
15 15
import {StatisticsService} from "../utils/services/statistics.service";
16 16
import {Item, Sidebar} from "../utils/entities/sidebar";
17
import {SidebarOpenService} from "../library/sidebar/sidebar-open.service";
17
import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.service";
18 18

  
19 19
@Component({
20 20
  selector: 'monitor',
......
46 46
    private helper: HelperService,
47 47
    private stakeholderService: StakeholderService,
48 48
    private statisticsService: StatisticsService,
49
    private sidebarOpenService: SidebarOpenService,
49
    private sideBarService: SideBarService,
50 50
    private seoService: SEOService,
51 51
    private cdr: ChangeDetectorRef,
52 52
    private sanitizer: DomSanitizer) {
......
93 93
  }
94 94

  
95 95
  public get open() {
96
    return this.sidebarOpenService.open;
96
    return this.sideBarService.open;
97 97
  }
98 98

  
99 99
  public toggleOpen(event = null) {
100 100
    if(!event) {
101
      this.sidebarOpenService.setOpen(!this.open);
101
      this.sideBarService.setOpen(!this.open);
102 102
    } else if(event && event['value'] === true) {
103
      this.sidebarOpenService.setOpen(false);
103
      this.sideBarService.setOpen(false);
104 104
    }
105 105
  }
106 106

  
......
174 174
          subItems, null, open));
175 175
      }
176 176
    });
177
    this.sideBar = new Sidebar(items);
177
    this.sideBar = new Sidebar(items, null);
178 178
  }
179 179

  
180 180
  private setIndicators() {
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/home/home.module.ts
1
import {NgModule} from '@angular/core';
2
import {CommonModule} from '@angular/common';
3

  
4
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
5
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
6

  
7
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
8
import {HomeComponent} from "./home.component";
9
import {HomeRoutingModule} from "./home-routing.module";
10
import {ModalModule} from "../openaireLibrary/utils/modal/modal.module";
11
import {RouterModule} from "@angular/router";
12
import {FormsModule} from "@angular/forms";
13

  
14
@NgModule({
15
  imports: [
16
    CommonModule, HomeRoutingModule, ModalModule, RouterModule, FormsModule
17
  ],
18
  declarations: [
19
    HomeComponent
20
  ],
21
  providers: [
22
    FreeGuard, PreviousRouteRecorder,
23
    PiwikService
24
  ],
25
  exports: [
26
    HomeComponent
27
  ]
28
})
29
export class HomeModule {
30
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/home/home-routing.module.ts
1
import {NgModule} from '@angular/core';
2
import {RouterModule} from '@angular/router';
3
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
4
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
5
import {HomeComponent} from "./home.component";
6

  
7
@NgModule({
8
  imports: [
9
    RouterModule.forChild([
10
      {
11
        path: '',
12
        component: HomeComponent,
13
        canActivate: [FreeGuard],
14
        canDeactivate: [PreviousRouteRecorder]
15
      }
16
    ])
17
  ]
18
})
19
export class HomeRoutingModule {
20
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/home/home.component.html
1
<aside *ngIf="stakeholder" id="sidebar_main">
2
  <div class="sidebar_main_header">
3
    <div class="uk-padding-small">
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff