diff --git a/src/app/communities/communities.component.ts b/src/app/communities/communities.component.ts index f349da1..72d91b2 100644 --- a/src/app/communities/communities.component.ts +++ b/src/app/communities/communities.component.ts @@ -3,18 +3,19 @@ import {ViewChild, ChangeDetectionStrategy} from '@angular/core'; import {ViewEncapsulation} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Location} from '@angular/common'; +import {Title, Meta} from '@angular/platform-browser'; import {Observable} from 'rxjs/Observable'; + import "rxjs/add/observable/zip"; +import {ConnectHelper} from '../openaireLibrary/connect/connectHelper'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; 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 {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service'; -import {ConnectHelper} from '../openaireLibrary/connect/connectHelper'; +import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; @Component({ selector: 'communities', @@ -26,33 +27,36 @@ export class CommunitiesComponent { public subfunders: any; public pageTitle = "OpenAIRE" - properties:EnvProperties; public communitiesResults = null; + properties:EnvProperties; + constructor ( private route: ActivatedRoute, private _router: Router, - private location: Location, private _meta: Meta, + private location: Location, + private _meta: Meta, + private _title: Title, private _piwikService:PiwikService, private _communitiesService:CommunitiesService, - private config: ConfigurationService - ) { + private config: ConfigurationService) { + var description = "Community Dashboard"; var title = "Community Dashboard"; - this._meta.setTitle(title); - this._meta.updateMeta("description", description); - this._meta.updateProperty("og:description", description); - this._meta.updateProperty("og:title", title); - } + this._meta.updateTag({content:description},"name='description'"); + this._meta.updateTag({content:description},"property='og:description'"); + this._meta.updateTag({content:title},"property='og:title'"); + this._title.setTitle(title); + } public ngOnInit() { this.route.data .subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; 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')){ this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe(); } diff --git a/src/app/communities/communities.module.ts b/src/app/communities/communities.module.ts index 50233de..1d90d8b 100644 --- a/src/app/communities/communities.module.ts +++ b/src/app/communities/communities.module.ts @@ -4,15 +4,15 @@ import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; // import {CommunitiesRoutingModule} from './communities-routing.module'; -import {SubscribeModule} from '../utils/subscribe/subscribe.module'; -import {ManageModule} from '../utils/manage/manage.module'; +import {SubscribeModule} from '../utils/subscribe/subscribe.module'; +import {ManageModule} from '../utils/manage/manage.module'; + import {CommunitiesComponent} from './communities.component'; import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {Meta} from '../openaireLibrary/sharedComponents/metaService'; import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service'; import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service'; @@ -24,13 +24,13 @@ import {CommunitiesService} from '../openaireLibrary/connect/communities/c ], declarations: [ CommunitiesComponent - ], + ], providers:[ FreeGuard, PreviousRouteRecorder, ConfigurationService, - Meta, PiwikService, CommunitiesService - ], + PiwikService, CommunitiesService + ], exports: [ CommunitiesComponent - ] + ] }) export class CommunitiesModule { } diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 35b3e13..2a7ba18 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -1,16 +1,24 @@ -import {Component, Input, Output, EventEmitter, ViewChild, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; +import {Component, Input, Output} from '@angular/core'; +import {EventEmitter, ViewChild} from '@angular/core'; +import {ChangeDetectionStrategy} from '@angular/core'; +import {ViewEncapsulation} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Location} from '@angular/common'; +import {Title, Meta} from '@angular/platform-browser'; + +import {Observable} from 'rxjs/Observable'; + import "rxjs/add/observable/zip"; -import { EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; -import { ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; + +import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; +import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; import {CommunityService} from "../openaireLibrary/connect/community/community.service"; import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service'; import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; import {SearchEntriesService} from '../searchEntries/searchEntries.service'; -import {Title, Meta} from '@angular/platform-browser'; + + import {PiwikHelper} from '../utils/piwikHelper'; @Component({ selector: 'community',