[Graph | Trunk]: Add meta data information to new pages
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-graph-portal/trunk@60872 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
12f9556a59
commit
8f245e4ddd
|
@ -1,4 +1,4 @@
|
|||
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
|
||||
import {Component, ElementRef, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
|
||||
|
@ -15,7 +15,7 @@ declare var UIkit: any;
|
|||
templateUrl: 'about.component.html',
|
||||
styleUrls: ['about.component.css'],
|
||||
})
|
||||
export class AboutComponent implements OnInit {
|
||||
export class AboutComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('tabs') tabs: ElementRef;
|
||||
public architectureImage: string = "gray.png";
|
||||
public aggregationReadMore: boolean = false;
|
||||
|
@ -59,10 +59,12 @@ export class AboutComponent implements OnInit {
|
|||
changeTab(index: number) {
|
||||
UIkit.switcher(this.tabs.nativeElement).show(index);
|
||||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
for (let sub of this.subs) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
this.subs.forEach(sub => {
|
||||
if(sub instanceof Subscription) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.component';
|
||||
import {member, team} from './team';
|
||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service';
|
||||
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||
import {properties} from '../../environments/environment';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {Router} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'team',
|
||||
|
@ -67,8 +74,12 @@ import {member, team} from './team';
|
|||
`,
|
||||
styleUrls: ['team.component.css']
|
||||
})
|
||||
export class TeamComponent {
|
||||
export class TeamComponent implements OnInit, OnDestroy {
|
||||
public team: member[] = team;
|
||||
properties: EnvProperties = properties
|
||||
description = "The OpenAIRE Research Graph Team";
|
||||
title = "OpenAIRE - Research Graph | Team";
|
||||
subs: Subscription[] = [];
|
||||
public breadcrumbs: Breadcrumb[] = [
|
||||
{
|
||||
name: 'home',
|
||||
|
@ -82,4 +93,30 @@ export class TeamComponent {
|
|||
name: 'Team'
|
||||
}
|
||||
];
|
||||
|
||||
constructor(private _title: Title, private _piwikService:PiwikService,
|
||||
private _router: Router, private _meta: Meta,
|
||||
private seoService: SEOService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._title.setTitle(this.title);
|
||||
this._meta.updateTag({content:this.description},"name='description'");
|
||||
this._meta.updateTag({content:this.description},"property='og:description'");
|
||||
this._meta.updateTag({content:this.title},"property='og:title'");
|
||||
var url = this.properties.domain + this.properties.baseLink+this._router.url;
|
||||
this.seoService.createLinkForCanonicalURL(url, false);
|
||||
this._meta.updateTag({content:url},"property='og:url'");
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe());
|
||||
}
|
||||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
this.subs.forEach(sub => {
|
||||
if(sub instanceof Subscription) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
import { TestBed, async } from '@angular/core/testing';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
it('should create the app', async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
}));
|
||||
|
||||
it(`should have as title 'app'`, async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app.title).toEqual('app');
|
||||
}));
|
||||
|
||||
it('should render title in a h1 tag', async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.debugElement.nativeElement;
|
||||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
|
||||
}));
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {EmailService} from '../openaireLibrary/utils/email/email.service';
|
||||
import {Email} from '../openaireLibrary/utils/email/email';
|
||||
|
@ -20,7 +20,7 @@ import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service';
|
|||
styleUrls: ['contact.component.css']
|
||||
})
|
||||
|
||||
export class ContactComponent implements OnInit {
|
||||
export class ContactComponent implements OnInit, OnDestroy {
|
||||
public showLoading = true;
|
||||
public errorMessage = '';
|
||||
public email: Email;
|
||||
|
@ -152,8 +152,10 @@ export class ContactComponent implements OnInit {
|
|||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
for (let sub of this.subs) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
this.subs.forEach(sub => {
|
||||
if(sub instanceof Subscription) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Location} from '@angular/common';
|
||||
|
@ -18,7 +18,7 @@ import {RouterHelper} from '../openaireLibrary/utils/routerHelper.class';
|
|||
templateUrl: 'home.component.html',
|
||||
styleUrls: ['home.component.css']
|
||||
})
|
||||
export class HomeComponent {
|
||||
export class HomeComponent implements OnInit, OnDestroy {
|
||||
public pageTitle = 'OpenAIRE - Research Graph';
|
||||
public portals: any[] = portals;
|
||||
public state: number = 0;
|
||||
|
@ -79,9 +79,11 @@ export class HomeComponent {
|
|||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
for (let sub of this.subs) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
this.subs.forEach(sub => {
|
||||
if(sub instanceof Subscription) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
});
|
||||
this.clearTimeouts();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.component';
|
||||
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {properties} from '../../environments/environment';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||
import {Router} from '@angular/router';
|
||||
import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service';
|
||||
|
||||
@Component({
|
||||
selector: 'references',
|
||||
|
@ -161,7 +168,11 @@ import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.compo
|
|||
`,
|
||||
styleUrls: ['references.component.css']
|
||||
})
|
||||
export class ReferencesComponent {
|
||||
export class ReferencesComponent implements OnInit, OnDestroy {
|
||||
properties: EnvProperties = properties;
|
||||
description = "The OpenAIRE Research Graph references";
|
||||
title = "OpenAIRE - Research Graph | References";
|
||||
subs: Subscription[] = [];
|
||||
public breadcrumbs: Breadcrumb[] = [
|
||||
{
|
||||
name: 'home',
|
||||
|
@ -175,4 +186,30 @@ export class ReferencesComponent {
|
|||
name: 'References'
|
||||
}
|
||||
];
|
||||
|
||||
constructor(private _title: Title, private _piwikService:PiwikService,
|
||||
private _router: Router, private _meta: Meta,
|
||||
private seoService: SEOService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._title.setTitle(this.title);
|
||||
this._meta.updateTag({content:this.description},"name='description'");
|
||||
this._meta.updateTag({content:this.description},"property='og:description'");
|
||||
this._meta.updateTag({content:this.title},"property='og:title'");
|
||||
var url = this.properties.domain + this.properties.baseLink+this._router.url;
|
||||
this.seoService.createLinkForCanonicalURL(url, false);
|
||||
this._meta.updateTag({content:url},"property='og:url'");
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe());
|
||||
}
|
||||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
this.subs.forEach(sub => {
|
||||
if(sub instanceof Subscription) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, OnInit} from '@angular/core';
|
||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
|
@ -13,7 +13,7 @@ import {Subscription} from 'rxjs';
|
|||
templateUrl: 'resources.component.html',
|
||||
styleUrls: ['resources.component.css'],
|
||||
})
|
||||
export class ResourcesComponent implements OnInit {
|
||||
export class ResourcesComponent implements OnInit, OnDestroy {
|
||||
properties:EnvProperties;
|
||||
subs: Subscription[] = [];
|
||||
description = "Start building with OpenAIRE APIs. How to access the graph? XML Metadata schema and documentation.";
|
||||
|
@ -48,8 +48,10 @@ export class ResourcesComponent implements OnInit {
|
|||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
for (let sub of this.subs) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
this.subs.forEach(sub => {
|
||||
if(sub instanceof Subscription) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue