Revision 60872
Added by Konstantinos Triantafyllou almost 3 years ago
modules/uoa-graph-portal/trunk/src/app/app.component.spec.ts | ||
---|---|---|
1 |
import { TestBed, async } from '@angular/core/testing'; |
|
2 |
|
|
3 |
import { AppComponent } from './app.component'; |
|
4 |
|
|
5 |
describe('AppComponent', () => { |
|
6 |
beforeEach(async(() => { |
|
7 |
TestBed.configureTestingModule({ |
|
8 |
declarations: [ |
|
9 |
AppComponent |
|
10 |
], |
|
11 |
}).compileComponents(); |
|
12 |
})); |
|
13 |
|
|
14 |
it('should create the app', async(() => { |
|
15 |
const fixture = TestBed.createComponent(AppComponent); |
|
16 |
const app = fixture.debugElement.componentInstance; |
|
17 |
expect(app).toBeTruthy(); |
|
18 |
})); |
|
19 |
|
|
20 |
it(`should have as title 'app'`, async(() => { |
|
21 |
const fixture = TestBed.createComponent(AppComponent); |
|
22 |
const app = fixture.debugElement.componentInstance; |
|
23 |
expect(app.title).toEqual('app'); |
|
24 |
})); |
|
25 |
|
|
26 |
it('should render title in a h1 tag', async(() => { |
|
27 |
const fixture = TestBed.createComponent(AppComponent); |
|
28 |
fixture.detectChanges(); |
|
29 |
const compiled = fixture.debugElement.nativeElement; |
|
30 |
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); |
|
31 |
})); |
|
32 |
}); |
modules/uoa-graph-portal/trunk/src/app/home/home.component.ts | ||
---|---|---|
1 |
import {Component} from '@angular/core'; |
|
1 |
import {Component, OnDestroy, OnInit} from '@angular/core';
|
|
2 | 2 |
import {Subscription} from 'rxjs'; |
3 | 3 |
import {ActivatedRoute, Router} from '@angular/router'; |
4 | 4 |
import {Location} from '@angular/common'; |
... | ... | |
18 | 18 |
templateUrl: 'home.component.html', |
19 | 19 |
styleUrls: ['home.component.css'] |
20 | 20 |
}) |
21 |
export class HomeComponent { |
|
21 |
export class HomeComponent implements OnInit, OnDestroy {
|
|
22 | 22 |
public pageTitle = 'OpenAIRE - Research Graph'; |
23 | 23 |
public portals: any[] = portals; |
24 | 24 |
public state: number = 0; |
... | ... | |
79 | 79 |
} |
80 | 80 |
|
81 | 81 |
public ngOnDestroy() { |
82 |
for (let sub of this.subs) { |
|
83 |
sub.unsubscribe(); |
|
84 |
} |
|
82 |
this.subs.forEach(sub => { |
|
83 |
if(sub instanceof Subscription) { |
|
84 |
sub.unsubscribe(); |
|
85 |
} |
|
86 |
}); |
|
85 | 87 |
this.clearTimeouts(); |
86 | 88 |
} |
87 | 89 |
|
modules/uoa-graph-portal/trunk/src/app/about/about.component.ts | ||
---|---|---|
1 |
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; |
|
1 |
import {Component, ElementRef, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
|
2 | 2 |
import {ActivatedRoute, Router} from '@angular/router'; |
3 | 3 |
import {Meta, Title} from '@angular/platform-browser'; |
4 | 4 |
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component"; |
... | ... | |
15 | 15 |
templateUrl: 'about.component.html', |
16 | 16 |
styleUrls: ['about.component.css'], |
17 | 17 |
}) |
18 |
export class AboutComponent implements OnInit { |
|
18 |
export class AboutComponent implements OnInit, OnDestroy {
|
|
19 | 19 |
@ViewChild('tabs') tabs: ElementRef; |
20 | 20 |
public architectureImage: string = "gray.png"; |
21 | 21 |
public aggregationReadMore: boolean = false; |
... | ... | |
59 | 59 |
changeTab(index: number) { |
60 | 60 |
UIkit.switcher(this.tabs.nativeElement).show(index); |
61 | 61 |
} |
62 |
|
|
62 | 63 |
public ngOnDestroy() { |
63 |
for (let sub of this.subs) { |
|
64 |
sub.unsubscribe(); |
|
65 |
} |
|
64 |
this.subs.forEach(sub => { |
|
65 |
if(sub instanceof Subscription) { |
|
66 |
sub.unsubscribe(); |
|
67 |
} |
|
68 |
}); |
|
66 | 69 |
} |
67 |
|
|
68 | 70 |
} |
modules/uoa-graph-portal/trunk/src/app/about/team.component.ts | ||
---|---|---|
1 |
import {Component} from '@angular/core'; |
|
1 |
import {Component, OnDestroy, OnInit} from '@angular/core';
|
|
2 | 2 |
import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.component'; |
3 | 3 |
import {member, team} from './team'; |
4 |
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; |
|
5 |
import {Meta, Title} from '@angular/platform-browser'; |
|
6 |
import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; |
|
7 |
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; |
|
8 |
import {properties} from '../../environments/environment'; |
|
9 |
import {Subscription} from 'rxjs'; |
|
10 |
import {Router} from '@angular/router'; |
|
4 | 11 |
|
5 | 12 |
@Component({ |
6 | 13 |
selector: 'team', |
... | ... | |
67 | 74 |
`, |
68 | 75 |
styleUrls: ['team.component.css'] |
69 | 76 |
}) |
70 |
export class TeamComponent { |
|
77 |
export class TeamComponent implements OnInit, OnDestroy {
|
|
71 | 78 |
public team: member[] = team; |
79 |
properties: EnvProperties = properties |
|
80 |
description = "The OpenAIRE Research Graph Team"; |
|
81 |
title = "OpenAIRE - Research Graph | Team"; |
|
82 |
subs: Subscription[] = []; |
|
72 | 83 |
public breadcrumbs: Breadcrumb[] = [ |
73 | 84 |
{ |
74 | 85 |
name: 'home', |
... | ... | |
82 | 93 |
name: 'Team' |
83 | 94 |
} |
84 | 95 |
]; |
96 |
|
|
97 |
constructor(private _title: Title, private _piwikService:PiwikService, |
|
98 |
private _router: Router, private _meta: Meta, |
|
99 |
private seoService: SEOService) { |
|
100 |
} |
|
101 |
|
|
102 |
ngOnInit() { |
|
103 |
this._title.setTitle(this.title); |
|
104 |
this._meta.updateTag({content:this.description},"name='description'"); |
|
105 |
this._meta.updateTag({content:this.description},"property='og:description'"); |
|
106 |
this._meta.updateTag({content:this.title},"property='og:title'"); |
|
107 |
var url = this.properties.domain + this.properties.baseLink+this._router.url; |
|
108 |
this.seoService.createLinkForCanonicalURL(url, false); |
|
109 |
this._meta.updateTag({content:url},"property='og:url'"); |
|
110 |
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ |
|
111 |
this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe()); |
|
112 |
} |
|
113 |
} |
|
114 |
|
|
115 |
public ngOnDestroy() { |
|
116 |
this.subs.forEach(sub => { |
|
117 |
if(sub instanceof Subscription) { |
|
118 |
sub.unsubscribe(); |
|
119 |
} |
|
120 |
}); |
|
121 |
} |
|
85 | 122 |
} |
modules/uoa-graph-portal/trunk/src/app/resources/resources.component.ts | ||
---|---|---|
1 |
import {Component, OnInit} from '@angular/core'; |
|
1 |
import {Component, OnDestroy, OnInit} from '@angular/core';
|
|
2 | 2 |
import {Meta, Title} from '@angular/platform-browser'; |
3 | 3 |
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component"; |
4 | 4 |
import {ActivatedRoute, Router} from '@angular/router'; |
... | ... | |
13 | 13 |
templateUrl: 'resources.component.html', |
14 | 14 |
styleUrls: ['resources.component.css'], |
15 | 15 |
}) |
16 |
export class ResourcesComponent implements OnInit { |
|
16 |
export class ResourcesComponent implements OnInit, OnDestroy {
|
|
17 | 17 |
properties:EnvProperties; |
18 | 18 |
subs: Subscription[] = []; |
19 | 19 |
description = "Start building with OpenAIRE APIs. How to access the graph? XML Metadata schema and documentation."; |
... | ... | |
48 | 48 |
} |
49 | 49 |
|
50 | 50 |
public ngOnDestroy() { |
51 |
for (let sub of this.subs) { |
|
52 |
sub.unsubscribe(); |
|
53 |
} |
|
51 |
this.subs.forEach(sub => { |
|
52 |
if(sub instanceof Subscription) { |
|
53 |
sub.unsubscribe(); |
|
54 |
} |
|
55 |
}); |
|
54 | 56 |
} |
55 | 57 |
} |
modules/uoa-graph-portal/trunk/src/app/resources/references.component.ts | ||
---|---|---|
1 |
import {Component} from '@angular/core'; |
|
1 |
import {Component, OnDestroy, OnInit} from '@angular/core';
|
|
2 | 2 |
import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.component'; |
3 |
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; |
|
4 |
import {Subscription} from 'rxjs'; |
|
5 |
import {properties} from '../../environments/environment'; |
|
6 |
import {Meta, Title} from '@angular/platform-browser'; |
|
7 |
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; |
|
8 |
import {Router} from '@angular/router'; |
|
9 |
import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; |
|
3 | 10 |
|
4 | 11 |
@Component({ |
5 | 12 |
selector: 'references', |
... | ... | |
161 | 168 |
`, |
162 | 169 |
styleUrls: ['references.component.css'] |
163 | 170 |
}) |
164 |
export class ReferencesComponent { |
|
171 |
export class ReferencesComponent implements OnInit, OnDestroy { |
|
172 |
properties: EnvProperties = properties; |
|
173 |
description = "The OpenAIRE Research Graph references"; |
|
174 |
title = "OpenAIRE - Research Graph | References"; |
|
175 |
subs: Subscription[] = []; |
|
165 | 176 |
public breadcrumbs: Breadcrumb[] = [ |
166 | 177 |
{ |
167 | 178 |
name: 'home', |
... | ... | |
175 | 186 |
name: 'References' |
176 | 187 |
} |
177 | 188 |
]; |
189 |
|
|
190 |
constructor(private _title: Title, private _piwikService:PiwikService, |
|
191 |
private _router: Router, private _meta: Meta, |
|
192 |
private seoService: SEOService) { |
|
193 |
} |
|
194 |
|
|
195 |
ngOnInit() { |
|
196 |
this._title.setTitle(this.title); |
|
197 |
this._meta.updateTag({content:this.description},"name='description'"); |
|
198 |
this._meta.updateTag({content:this.description},"property='og:description'"); |
|
199 |
this._meta.updateTag({content:this.title},"property='og:title'"); |
|
200 |
var url = this.properties.domain + this.properties.baseLink+this._router.url; |
|
201 |
this.seoService.createLinkForCanonicalURL(url, false); |
|
202 |
this._meta.updateTag({content:url},"property='og:url'"); |
|
203 |
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ |
|
204 |
this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe()); |
|
205 |
} |
|
206 |
} |
|
207 |
|
|
208 |
public ngOnDestroy() { |
|
209 |
this.subs.forEach(sub => { |
|
210 |
if(sub instanceof Subscription) { |
|
211 |
sub.unsubscribe(); |
|
212 |
} |
|
213 |
}); |
|
214 |
} |
|
178 | 215 |
} |
modules/uoa-graph-portal/trunk/src/app/contact/contact.component.ts | ||
---|---|---|
1 |
import {Component, OnInit, ViewChild} from '@angular/core'; |
|
1 |
import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
|
2 | 2 |
import {ActivatedRoute, Router} from '@angular/router'; |
3 | 3 |
import {EmailService} from '../openaireLibrary/utils/email/email.service'; |
4 | 4 |
import {Email} from '../openaireLibrary/utils/email/email'; |
... | ... | |
20 | 20 |
styleUrls: ['contact.component.css'] |
21 | 21 |
}) |
22 | 22 |
|
23 |
export class ContactComponent implements OnInit { |
|
23 |
export class ContactComponent implements OnInit, OnDestroy {
|
|
24 | 24 |
public showLoading = true; |
25 | 25 |
public errorMessage = ''; |
26 | 26 |
public email: Email; |
... | ... | |
152 | 152 |
} |
153 | 153 |
|
154 | 154 |
public ngOnDestroy() { |
155 |
for (let sub of this.subs) { |
|
156 |
sub.unsubscribe(); |
|
157 |
} |
|
155 |
this.subs.forEach(sub => { |
|
156 |
if(sub instanceof Subscription) { |
|
157 |
sub.unsubscribe(); |
|
158 |
} |
|
159 |
}); |
|
158 | 160 |
} |
159 | 161 |
} |
Also available in: Unified diff
[Graph | Trunk]: Add meta data information to new pages