piwik helper clean up unused parameter

This commit is contained in:
argirok 2022-06-08 14:21:09 +03:00
parent 7f604d68dd
commit 278f7582e4
30 changed files with 32 additions and 43 deletions

View File

@ -8,7 +8,6 @@ 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 {StringUtils} from '../openaireLibrary/utils/string-utils.class';
import {Subscriber} from "rxjs";
import {properties} from "../../environments/environment";
@ -53,7 +52,7 @@ export class AffiliationsComponent {
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, this.properties.environment)).subscribe());
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);

View File

@ -31,7 +31,7 @@ export class OpenaireDirectLinkingComponent {
if (!this.communityId) {
this.communityId = communityId['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
});
}

View File

@ -27,7 +27,7 @@ export class OpenaireLinkingComponent {
if(!this.communityId) {
this.communityId = communityId['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
});
}
}

View File

@ -35,7 +35,7 @@ import {properties} from "../../../environments/environment";
if(!this.communityId) {
this.communityId = communityId['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
});
}

View File

@ -168,7 +168,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._piwikService.trackView(this.properties, community.title, PiwikHelper.getSiteId(this.communityId, this.properties.environment)).subscribe());
this.subs.push(this._piwikService.trackView(this.properties, community.title, PiwikHelper.getSiteId(this.communityId)).subscribe());
}
if (this.community.zenodoCommunity) {
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe(

View File

@ -4,15 +4,12 @@ import {CuratorService} from "../openaireLibrary/connect/curators/curator.servic
import {Curator} from "../openaireLibrary/utils/entities/CuratorInfo";
import {ActivatedRoute, Router} from "@angular/router";
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {Meta, Title} from "@angular/platform-browser";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {PiwikHelper} from "../utils/piwikHelper";
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
import {Subscription} from "rxjs";
import {properties} from "../../environments/environment";
import {UserRegistryService} from "../openaireLibrary/services/user-registry.service";
@ -76,7 +73,7 @@ export class CuratorsComponent {
if (community) {
this.communityId = community.communityId;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId, this.properties.environment)).subscribe());
this.subs.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);

View File

@ -2,7 +2,6 @@ import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
import {ZenodoInformationClass} from "../openaireLibrary/deposit/utils/zenodoInformation.class";
import {FetchZenodoInformation} from "./utils/fetchZenodoInformation.class";
import {ZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service";
@ -43,7 +42,7 @@ export class OpenaireDepositComponent {
this.subs.push(this._communityService.getCommunityAsObservable().subscribe(
community => {
if(community) {
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, this.properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
this.communityId = community.communityId
let masterZenodoCommunityId = community.zenodoCommunity;
if (masterZenodoCommunityId) {

View File

@ -1,8 +1,7 @@
import {Component, Input} from '@angular/core';
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PiwikHelper} from '../utils/piwikHelper';
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
@ -43,7 +42,7 @@ export class OpenaireSearchDataprovidersToDepositComponent {
community => {
if(community) {
this.communityId = community.communityId;
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, this.properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
let masterZenodoCommunityId = community.zenodoCommunity;
if (masterZenodoCommunityId) {
this.zenodoInformation.shareInZenodoUrl = this.properties.shareInZenodoPage;

View File

@ -1,16 +1,13 @@
import {Component, Input} from '@angular/core';
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo';
import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class';
import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes';
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {HelperService} from "../../openaireLibrary/utils/helper/helper.service";
import {RouterHelper} from "../../openaireLibrary/utils/routerHelper.class";
import {SEOService} from "../../openaireLibrary/sharedComponents/SEO/SEO.service";
@ -87,7 +84,7 @@ export class ShareInZenodoComponent {
community => {
if (community) {
this.communityId = community.communityId;
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, this.properties.environment);
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());
}

View File

@ -17,6 +17,6 @@ export class OpenaireDataProviderComponent implements OnInit {
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -18,6 +18,6 @@ export class OpenaireDatasetComponent implements OnInit {
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -17,6 +17,6 @@ export class OpenaireHtmlProjectReportComponent {
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -17,6 +17,6 @@ export class OpenaireOrganizationComponent {
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -1,8 +1,6 @@
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
@ -20,6 +18,6 @@ export class OpenaireOrpComponent implements OnInit {
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -17,6 +17,6 @@ export class OpenaireProjectComponent implements OnInit {
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -17,6 +17,6 @@ export class OpenairePublicationComponent {
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -16,6 +16,6 @@ export class OpenaireResultComponent implements OnInit{
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -18,6 +18,6 @@ export class OpenaireSoftwareComponent implements OnInit {
ngOnInit() {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
}
}

View File

@ -27,7 +27,7 @@ export class OpenaireMyOrcidLinksComponent {
this.subs.push(this._communityService.getCommunityAsObservable().subscribe(
community => {
if(community) {
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, this.properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
this.communityId = community.communityId;
}
}));

View File

@ -23,7 +23,7 @@ export class OpenaireAdvancedSearchDataProvidersComponent implements OnInit {
ngOnInit() {
let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (communityId) {
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(communityId);
this.communityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
this.customFilter.isHiddenFilter = false;

View File

@ -24,7 +24,7 @@ export class OpenaireAdvancedSearchOrganizationsComponent implements OnInit {
ngOnInit() {
let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(communityId);
if(communityId){
this.communityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");

View File

@ -26,7 +26,7 @@ export class OpenaireAdvancedSearchProjectsComponent implements OnInit {
let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (communityId) {
this.communityId = communityId;
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(communityId);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
this.customFilter.isHiddenFilter = false;
}

View File

@ -41,7 +41,7 @@ export class OpenaireSearchResearchResultsComponent implements OnInit, OnDestro
this.sub = this._communityService.getCommunityAsObservable().subscribe(community => {
if (community != null) {
this.connectCommunityId = community.communityId;
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, community.shortTitle);
}
});

View File

@ -25,7 +25,7 @@ export class OpenaireSearchComponent {
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
if (communityId) {
this.communityId = communityId;
this.piwikSiteId = PiwikHelper.getSiteId(communityId, this.properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(communityId);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
}
}

View File

@ -89,7 +89,7 @@ export class OpenaireSearchDataprovidersComponent {
if(community != null) {
this.communityId = community.communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, community.shortTitle);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, this.properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
this.subscriptions.push(this.route.queryParams.subscribe(params => {
let page = (params['page'] === undefined) ? 1 : +params['page'];
this.searchUtils.page = (page <= 0) ? 1 : page;

View File

@ -19,7 +19,7 @@ export class OpenaireSearchOrganizationsComponent implements OnInit {
ngOnInit() {
let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (communityId) {
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(communityId);
}
}
}

View File

@ -88,7 +88,7 @@ export class OpenaireSearchProjectsComponent {
if(community != null){
this.communityId = community.communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, community.shortTitle);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId,this.properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
this.subscriptions.push(this.route.queryParams.subscribe(params => {
let page = (params['page'] === undefined) ? 1 : +params['page'];
this.searchUtils.page = (page <= 0) ? 1 : page;

View File

@ -43,7 +43,7 @@ export class OpenaireSearchResearchResultsComponent implements OnInit, OnDestroy
this.sub = this._communityService.getCommunityAsObservable().subscribe(community =>{
if(community != null){
this.connectCommunityId = community.communityId;
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,properties.environment);
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, community.shortTitle);
}
});

View File

@ -90,7 +90,7 @@ export class SubjectsComponent {
if (community) {
this.communityId = community.communityId;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId, this.properties.environment)).subscribe());
this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId)).subscribe());
}
//this.getDivContents();
this.getPageContents();

View File

@ -30,7 +30,7 @@ export class PiwikHelper{
"ebrains": 592,
"neanias-space":null
};
public static getSiteId(communityId:string, environment:string){
public static getSiteId(communityId:string){
return this.siteIDs[communityId];
}