Replace meta service import and use with meta and title from angular/platform-browser for communities
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51750 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
3433b73f2c
commit
3b4a925203
|
@ -3,18 +3,19 @@ import {ViewChild, ChangeDetectionStrategy} from '@angular/core';
|
||||||
import {ViewEncapsulation} from '@angular/core';
|
import {ViewEncapsulation} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
|
import {Title, Meta} from '@angular/platform-browser';
|
||||||
|
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
|
||||||
import "rxjs/add/observable/zip";
|
import "rxjs/add/observable/zip";
|
||||||
|
|
||||||
|
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
|
||||||
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||||
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
|
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
|
||||||
|
|
||||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
|
||||||
import {Meta} from '../openaireLibrary/sharedComponents/metaService';
|
|
||||||
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||||
import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service';
|
import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service';
|
||||||
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
|
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'communities',
|
selector: 'communities',
|
||||||
|
@ -26,25 +27,28 @@ export class CommunitiesComponent {
|
||||||
public subfunders: any;
|
public subfunders: any;
|
||||||
|
|
||||||
public pageTitle = "OpenAIRE"
|
public pageTitle = "OpenAIRE"
|
||||||
properties:EnvProperties;
|
|
||||||
|
|
||||||
public communitiesResults = null;
|
public communitiesResults = null;
|
||||||
|
|
||||||
|
properties:EnvProperties;
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private location: Location, private _meta: Meta,
|
private location: Location,
|
||||||
|
private _meta: Meta,
|
||||||
|
private _title: Title,
|
||||||
private _piwikService:PiwikService,
|
private _piwikService:PiwikService,
|
||||||
private _communitiesService:CommunitiesService,
|
private _communitiesService:CommunitiesService,
|
||||||
private config: ConfigurationService
|
private config: ConfigurationService) {
|
||||||
) {
|
|
||||||
var description = "Community Dashboard";
|
var description = "Community Dashboard";
|
||||||
var title = "Community Dashboard";
|
var title = "Community Dashboard";
|
||||||
|
|
||||||
this._meta.setTitle(title);
|
this._meta.updateTag({content:description},"name='description'");
|
||||||
this._meta.updateMeta("description", description);
|
this._meta.updateTag({content:description},"property='og:description'");
|
||||||
this._meta.updateProperty("og:description", description);
|
this._meta.updateTag({content:title},"property='og:title'");
|
||||||
this._meta.updateProperty("og:title", title);
|
this._title.setTitle(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
|
@ -52,7 +56,7 @@ export class CommunitiesComponent {
|
||||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||||
this.properties = data.envSpecific;
|
this.properties = data.envSpecific;
|
||||||
var url = data.envSpecific.baseLink+this._router.url
|
var url = data.envSpecific.baseLink+this._router.url
|
||||||
this._meta.updateProperty("og:url", url);
|
this._meta.updateTag({content:url},"property='og:url'");
|
||||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||||
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe();
|
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,13 @@ import {RouterModule} from '@angular/router';
|
||||||
// import {CommunitiesRoutingModule} from './communities-routing.module';
|
// import {CommunitiesRoutingModule} from './communities-routing.module';
|
||||||
import {SubscribeModule} from '../utils/subscribe/subscribe.module';
|
import {SubscribeModule} from '../utils/subscribe/subscribe.module';
|
||||||
import {ManageModule} from '../utils/manage/manage.module';
|
import {ManageModule} from '../utils/manage/manage.module';
|
||||||
|
|
||||||
import {CommunitiesComponent} from './communities.component';
|
import {CommunitiesComponent} from './communities.component';
|
||||||
|
|
||||||
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
|
import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard';
|
||||||
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||||
|
|
||||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||||
import {Meta} from '../openaireLibrary/sharedComponents/metaService';
|
|
||||||
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||||
import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service';
|
import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service';
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import {CommunitiesService} from '../openaireLibrary/connect/communities/c
|
||||||
],
|
],
|
||||||
providers:[
|
providers:[
|
||||||
FreeGuard, PreviousRouteRecorder, ConfigurationService,
|
FreeGuard, PreviousRouteRecorder, ConfigurationService,
|
||||||
Meta, PiwikService, CommunitiesService
|
PiwikService, CommunitiesService
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
CommunitiesComponent
|
CommunitiesComponent
|
||||||
|
|
|
@ -1,8 +1,15 @@
|
||||||
import {Component, Input, Output, EventEmitter, ViewChild, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
|
import {Component, Input, Output} from '@angular/core';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {EventEmitter, ViewChild} from '@angular/core';
|
||||||
|
import {ChangeDetectionStrategy} from '@angular/core';
|
||||||
|
import {ViewEncapsulation} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
|
import {Title, Meta} from '@angular/platform-browser';
|
||||||
|
|
||||||
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
|
||||||
import "rxjs/add/observable/zip";
|
import "rxjs/add/observable/zip";
|
||||||
|
|
||||||
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
||||||
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
|
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
|
||||||
|
|
||||||
|
@ -10,7 +17,8 @@ import {CommunityService} from "../openaireLibrary/connect/community
|
||||||
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||||
import {SearchEntriesService} from '../searchEntries/searchEntries.service';
|
import {SearchEntriesService} from '../searchEntries/searchEntries.service';
|
||||||
import {Title, Meta} from '@angular/platform-browser';
|
|
||||||
|
|
||||||
import {PiwikHelper} from '../utils/piwikHelper';
|
import {PiwikHelper} from '../utils/piwikHelper';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'community',
|
selector: 'community',
|
||||||
|
|
Loading…
Reference in New Issue