read piwikId from API (portal) instead of PiwikHelper.ts, update submodules

This commit is contained in:
Alex Martzios 2022-11-09 10:28:19 +02:00
parent d2ad0ba20e
commit 9511e28157
4 changed files with 10 additions and 7 deletions

View File

@ -3,7 +3,6 @@ import {ActivatedRoute, Router} from '@angular/router';
import {DOCUMENT, Location} from '@angular/common'; import {DOCUMENT, Location} from '@angular/common';
import {Meta, Title} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {CommunityService} from "../openaireLibrary/connect/community/community.service"; import {CommunityService} from "../openaireLibrary/connect/community/community.service";
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';
@ -12,8 +11,6 @@ import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommuni
import {Session, User} from '../openaireLibrary/login/utils/helper.class'; import {Session, User} from '../openaireLibrary/login/utils/helper.class';
import {StatisticsForDashboardComponent} from '../statistics/statistics.component'; import {StatisticsForDashboardComponent} from '../statistics/statistics.component';
import {StringUtils} from '../openaireLibrary/utils/string-utils.class'; import {StringUtils} from '../openaireLibrary/utils/string-utils.class';
import {PiwikHelper} from '../utils/piwikHelper';
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service"; import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service";
import {SearchCommunityProjectsService} from "../openaireLibrary/connect/projects/searchProjects.service"; import {SearchCommunityProjectsService} from "../openaireLibrary/connect/projects/searchProjects.service";
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service"; import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service";
@ -140,6 +137,7 @@ export class CommunityComponent {
}; };
disableSelect: boolean = true; disableSelect: boolean = true;
openaireEntities= OpenaireEntities; openaireEntities= OpenaireEntities;
piwikSiteId;
constructor( constructor(
private element: ElementRef, private element: ElementRef,
@ -206,7 +204,12 @@ export class CommunityComponent {
this._meta.updateTag({content: community.title}, "property='og:title'"); this._meta.updateTag({content: community.title}, "property='og:title'");
this._title.setTitle(community.title); this._title.setTitle(community.title);
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subs.push(this._piwikService.trackView(this.properties, community.title, PiwikHelper.getSiteId(this.communityId)).subscribe()); 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());
}
}));
} }
if (this.community.zenodoCommunity) { if (this.community.zenodoCommunity) {
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe( this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe(

@ -1 +1 @@
Subproject commit c862be75613fa1cf08a3bf276b9f4e1b56a3321c Subproject commit cb57b78351af8ce08e178ff1bc69d73c43044cc2

@ -1 +1 @@
Subproject commit 050fcbce9343f849956800b4634f62fefee7e210 Subproject commit 99fab0671bee8251230599ef9bc3034aff39c141

@ -1 +1 @@
Subproject commit 35ab282e53ad5b7790bc431820a4400cfc36c977 Subproject commit e3e2a6ec11055f4d4352d0749bb1b484ddd711ae