diff --git a/src/app/affiliations/affiliations.component.ts b/src/app/affiliations/affiliations.component.ts
index c980b4f..e5e043b 100644
--- a/src/app/affiliations/affiliations.component.ts
+++ b/src/app/affiliations/affiliations.component.ts
@@ -1,20 +1,16 @@
-import {Component, Input} from '@angular/core';
-import {ActivatedRoute, Router} from '@angular/router';
-import {Title, Meta} from '@angular/platform-browser';
-import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
-import {AffiliationService} from "../openaireLibrary/connect/affiliations/affiliation.service";
-import {Affiliation} from "../openaireLibrary/utils/entities/CuratorInfo";
-import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
-import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
-import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
-import {PiwikHelper} from "../utils/piwikHelper";
+import {Component, Input} from '@angular/core';
+import {ActivatedRoute} from '@angular/router';
+import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
+import {AffiliationService} from "../openaireLibrary/connect/affiliations/affiliation.service";
+import {Affiliation} from "../openaireLibrary/utils/entities/CuratorInfo";
+import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {Subscriber} from "rxjs";
import {properties} from "../../environments/environment";
@Component({
selector: 'affiliations',
templateUrl: './affiliations.component.html',
- styleUrls: ['./affiliations.component.less']
+ styleUrls: ['./affiliations.component.less']
})
export class AffiliationsComponent {
@Input() getAffiliationsFromAPI: boolean = false;
@@ -24,61 +20,33 @@ export class AffiliationsComponent {
@Input() affiliations: Affiliation[] = [];
@Input() sliderOptions = '';
@Input() arrows = true;
-
+
public showLoading: boolean = false;
-
- communityId: string;
- properties:EnvProperties;
-
- subscriptions = [];
- public url: string = null;
- public pageTitle: string = "Related Organizations";
-
- constructor ( private route: ActivatedRoute, private _router: Router,
- private _meta: Meta,
- private _title: Title,
- private seoService: SEOService,
- private _piwikService: PiwikService,
- private affiliationService: AffiliationService) {}
-
- public ngOnInit() {
-
- this.subscriptions.push(this.route.queryParams.subscribe(
- communityId => {
- this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
- if(!this.communityId) {
- this.communityId = communityId['communityId'];
- }
-
- this.properties = properties;
- if(this.longView) {
- if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId)).subscribe());
- }
- this.url = this.properties.domain + this._router.url;
- this.seoService.createLinkForCanonicalURL(this.url);
- this.updateUrl(this.url);
- this.updateTitle(this.pageTitle);
- this.updateDescription("OpenAIRE - Connect, Community Gateway, research community, organizations");
- }
- if(this.getAffiliationsFromAPI) {
- this.showLoading = true;
- this.affiliationService.initAffiliations(this.communityId);
- this.subscriptions.push(this.affiliationService.affiliations.subscribe(
- affiliations => {
- this.affiliations = affiliations.filter((affiliation) => this.longView || !!affiliation['logo_url']);
- this.showLoading = false;
- },
- error => {
- console.error("Affiliations Component: Error getting affiliations for community with id: " + this.communityId, error);
- this.showLoading = false;
- }
- ));
- }
- }));
-
+ public communityId: string;
+ public properties: EnvProperties = properties;
+ private subscriptions = [];
+
+ constructor(private route: ActivatedRoute, private affiliationService: AffiliationService) {
}
-
+
+ public ngOnInit() {
+ this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
+ if (this.getAffiliationsFromAPI) {
+ this.showLoading = true;
+ this.affiliationService.initAffiliations(this.communityId);
+ this.subscriptions.push(this.affiliationService.affiliations.subscribe(
+ affiliations => {
+ this.affiliations = affiliations.filter((affiliation) => this.longView || !!affiliation['logo_url']);
+ this.showLoading = false;
+ },
+ error => {
+ console.error("Affiliations Component: Error getting affiliations for community with id: " + this.communityId, error);
+ this.showLoading = false;
+ }
+ ));
+ }
+ }
+
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
@@ -87,19 +55,4 @@ export class AffiliationsComponent {
});
this.affiliationService.clearSubscriptions();
}
-
- private updateDescription(description: string) {
- this._meta.updateTag({content: description}, "name='description'");
- this._meta.updateTag({content: description}, "property='og:description'");
- }
-
- private updateTitle(title: string) {
- var _title = ((title.length > 50) ? title.substring(0, 50) : title);
- this._title.setTitle(_title);
- this._meta.updateTag({content: _title}, "property='og:title'");
- }
-
- private updateUrl(url: string) {
- this._meta.updateTag({content: url}, "property='og:url'");
- }
}
diff --git a/src/app/affiliations/affiliations.module.ts b/src/app/affiliations/affiliations.module.ts
index e3892a1..da768dd 100644
--- a/src/app/affiliations/affiliations.module.ts
+++ b/src/app/affiliations/affiliations.module.ts
@@ -1,4 +1,4 @@
-import { NgModule } from '@angular/core';
+import {NgModule} from '@angular/core';
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard'
@@ -7,15 +7,11 @@ import {RouterModule} from '@angular/router';
import {AffiliationsComponent} from './affiliations.component';
import {AffiliationService} from "../openaireLibrary/connect/affiliations/affiliation.service";
import {CommonModule} from "@angular/common";
-import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
-import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
-import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module";
import {UrlPrefixModule} from "../openaireLibrary/utils/pipes/url-prefix.module";
@NgModule({
imports: [
- CommonModule, RouterModule, Schema2jsonldModule, SEOServiceModule,
- PiwikServiceModule, UrlPrefixModule
+ CommonModule, RouterModule, UrlPrefixModule
],
declarations: [
AffiliationsComponent
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 5fd807d..58f675c 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -280,7 +280,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.initLayout('connect');
}
}
- this.configurationService.initCommunityInformation(this.properties, (communityId) ? communityId : this.properties.adminToolsPortalType);
+ this.configurationService.initPortal(this.properties, (communityId) ? communityId : this.properties.adminToolsPortalType);
}
getLayouts(){
@@ -407,7 +407,7 @@ export class AppComponent implements OnInit, OnDestroy {
} else {
this.communityId = null;
this.properties.adminToolsPortalType = "connect";
- this.configurationService.initCommunityInformation(this.properties, "connect");
+ this.configurationService.initPortal(this.properties, "connect");
this.initAdminToolCommunity(null);
this.buildConnectMenu(true);
if (this.community && this.community.status == "manager") {
diff --git a/src/app/communities/communities.component.ts b/src/app/communities/communities.component.ts
index 1a6c780..47adec0 100644
--- a/src/app/communities/communities.component.ts
+++ b/src/app/communities/communities.component.ts
@@ -77,7 +77,7 @@ export class CommunitiesComponent implements OnInit, OnDestroy, AfterViewInit {
this.seoService.createLinkForCanonicalURL(url, false);
this._meta.updateTag({content: url}, "property='og:url'");
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subscriptions.push(this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe());
+ this.subscriptions.push(this._piwikService.trackView(this.properties, "OpenAIRE Connect").subscribe());
}
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts
index cc9fccd..742a183 100644
--- a/src/app/community/community.component.ts
+++ b/src/app/community/community.component.ts
@@ -221,12 +221,7 @@ export class CommunityComponent {
this._meta.updateTag({content: community.title}, "property='og:title'");
this._title.setTitle(community.title);
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subs.push(this.config.communityInformationState.subscribe(portal => {
- if(portal && portal.piwik) {
- this.piwikSiteId = portal.piwik;
- this.subs.push(this._piwikService.trackView(this.properties, community.title, this.piwikSiteId).subscribe());
- }
- }));
+ this.subs.push(this._piwikService.trackView(this.properties, community.title).subscribe());
}
if (this.community.zenodoCommunity) {
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe(
@@ -281,7 +276,7 @@ export class CommunityComponent {
this.contentProvidersCalculated = true;
}
));
- this.subs.push(this.config.communityInformationState.subscribe(
+ this.subs.push(this.config.portalAsObservable.subscribe(
res => {
this.communityInfo = res;
@@ -300,7 +295,7 @@ export class CommunityComponent {
this.handleError("Error getting community with id: " + this.communityId, error);
}
));
- this.subs.push(this.config.communityInformationState.subscribe(data => {
+ this.subs.push(this.config.portalAsObservable.subscribe(data => {
if (data) {
var showEntity = {};
for (var i = 0; i < data['entities'].length; i++) {
diff --git a/src/app/contact/contact.component.ts b/src/app/contact/contact.component.ts
index ae6b944..45610ba 100644
--- a/src/app/contact/contact.component.ts
+++ b/src/app/contact/contact.component.ts
@@ -60,7 +60,7 @@ export class ContactComponent implements OnInit {
this.email = {body: '', subject: '', recipients: []};
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subscriptions.push( this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
+ this.subscriptions.push( this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
}
this.url = this.properties.domain + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
diff --git a/src/app/curators/curators.component.ts b/src/app/curators/curators.component.ts
index dfaf7d0..dcefcf7 100644
--- a/src/app/curators/curators.component.ts
+++ b/src/app/curators/curators.component.ts
@@ -79,7 +79,7 @@ export class CuratorsComponent {
if (community) {
this.community = community;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.community.communityId)).subscribe());
+ this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
}
this.url = this.properties.domain + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
diff --git a/src/app/deposit/zenodo/shareInZenodo.component.ts b/src/app/deposit/zenodo/shareInZenodo.component.ts
index 69ae24f..4c271b9 100644
--- a/src/app/deposit/zenodo/shareInZenodo.component.ts
+++ b/src/app/deposit/zenodo/shareInZenodo.component.ts
@@ -86,7 +86,7 @@ export class ShareInZenodoComponent {
this.communityId = community.communityId;
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subs.push(this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe());
+ this.subs.push(this._piwikService.trackView(this.properties, this.title).subscribe());
}
this.community = community;
this.masterZenodoCommunityId = this.community.zenodoCommunity;
diff --git a/src/app/get-started/get-started.component.ts b/src/app/get-started/get-started.component.ts
index 4591caa..9895e03 100644
--- a/src/app/get-started/get-started.component.ts
+++ b/src/app/get-started/get-started.component.ts
@@ -52,7 +52,7 @@ export class GetStartedComponent implements OnInit {
ngOnInit() {
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
+ this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
}
this.url = this.properties.domain + this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
diff --git a/src/app/htmlPages/featured/featuredPage.component.ts b/src/app/htmlPages/featured/featuredPage.component.ts
index 984a666..ba8c255 100644
--- a/src/app/htmlPages/featured/featuredPage.component.ts
+++ b/src/app/htmlPages/featured/featuredPage.component.ts
@@ -25,7 +25,7 @@ export class FeaturedPageComponent {
}
ngOnInit() {
- this.subs.push(this.config.communityInformationState.subscribe((portal: Portal) => {
+ this.subs.push(this.config.portalAsObservable.subscribe((portal: Portal) => {
if (portal) {
let pages: Page[] =
portal.pages;
this.page = pages.find(page => (page.route == this._router.url));
diff --git a/src/app/htmlPages/htmlPage.component.ts b/src/app/htmlPages/htmlPage.component.ts
index 8461032..313db86 100644
--- a/src/app/htmlPages/htmlPage.component.ts
+++ b/src/app/htmlPages/htmlPage.component.ts
@@ -8,6 +8,7 @@ import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {Subscriber} from "rxjs";
import {properties} from "../../environments/environment";
+import {ConfigurationService} from "../openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'html-page',
@@ -33,16 +34,16 @@ export class HtmlPageComponent {
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService,
+ private configurationService: ConfigurationService,
private helper: HelperService) {
}
public ngOnInit() {
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
+ this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
}
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
- //TODO set the proper URL
- this.url = this.properties.domain + this._router.url;
+ this.url = this.properties.domain + this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
diff --git a/src/app/htmlPages/organizations/organizationsPage.component.ts b/src/app/htmlPages/organizations/organizationsPage.component.ts
index e026e02..7d134fc 100644
--- a/src/app/htmlPages/organizations/organizationsPage.component.ts
+++ b/src/app/htmlPages/organizations/organizationsPage.component.ts
@@ -11,7 +11,7 @@ import {Breadcrumb} from "../../openaireLibrary/utils/breadcrumbs/breadcrumbs.co
`
diff --git a/src/app/learn-how/faqs/faqs.component.ts b/src/app/learn-how/faqs/faqs.component.ts
index 35e3552..142015f 100644
--- a/src/app/learn-how/faqs/faqs.component.ts
+++ b/src/app/learn-how/faqs/faqs.component.ts
@@ -222,7 +222,7 @@ export class FaqsComponent {
this.properties = properties;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
+ this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
diff --git a/src/app/learn-how/learn-how.component.ts b/src/app/learn-how/learn-how.component.ts
index 8a2032c..7def084 100644
--- a/src/app/learn-how/learn-how.component.ts
+++ b/src/app/learn-how/learn-how.component.ts
@@ -249,7 +249,7 @@ export class LearnHowComponent implements OnInit {
public ngOnInit() {
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
+ this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle).subscribe());
}
this.url = this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
diff --git a/src/app/my-communities/my-communities.component.ts b/src/app/my-communities/my-communities.component.ts
index 80fea74..b995c80 100644
--- a/src/app/my-communities/my-communities.component.ts
+++ b/src/app/my-communities/my-communities.component.ts
@@ -73,7 +73,7 @@ export class MyCommunitiesComponent {
this.seoService.createLinkForCanonicalURL(url, false);
this._meta.updateTag({content: url}, "property='og:url'");
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subscriptions.push(this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe());
+ this.subscriptions.push(this._piwikService.trackView(this.properties, "OpenAIRE Connect").subscribe());
}
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary
index c547dfa..49e2edf 160000
--- a/src/app/openaireLibrary
+++ b/src/app/openaireLibrary
@@ -1 +1 @@
-Subproject commit c547dfa9453b9a68befb41f447d8c410eb7aea2c
+Subproject commit 49e2edfe84d441bf1b5bf4bbfb7f94f98d88cb7a
diff --git a/src/app/statistics/statistics.component.ts b/src/app/statistics/statistics.component.ts
index edcc6fe..b070a6f 100644
--- a/src/app/statistics/statistics.component.ts
+++ b/src/app/statistics/statistics.component.ts
@@ -91,7 +91,7 @@ export class StatisticsComponent {
if(community) {
this.communityId = community.communityId;
if (this.currentMode == "showInMonitor" && this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.subs.push(this._piwikService.trackView(this.properties, "Monitor " + this.communityId, PiwikHelper.siteIDs[this.communityId]).subscribe());
+ this.subs.push(this._piwikService.trackView(this.properties, "Monitor " + this.communityId).subscribe());
}
this.communityName = community.shortTitle;
this.createChartUrlMap();
@@ -157,7 +157,7 @@ export class StatisticsComponent {
getCommunityInfo() {
// console.log(`calling ${this.properties.adminToolsAPIURL}/communityFull/${this.communityId}`);
- this.subs.push(this._configService.communityInformationState.subscribe(
+ this.subs.push(this._configService.portalAsObservable.subscribe(
res => {
this.communityInfo = res;
/*for(let i=0; i