Change piwik base on the new dynamic piwik.

This commit is contained in:
Konstantinos Triantafyllou 2023-07-13 12:22:07 +03:00
parent af937b8ee5
commit d25fcc6c04
9 changed files with 11 additions and 22 deletions

View File

@ -612,9 +612,7 @@ export class AboutComponent {
}
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);
this.updateUrl(this.url);

View File

@ -22,6 +22,7 @@ import {AlertModal} from "./openaireLibrary/utils/modal/alert";
import {StakeholderEntities} from './openaireLibrary/monitor/entities/stakeholder';
import {ResourcesService} from "./openaireLibrary/monitor/services/resources.service";
import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
@Component({
selector: 'app-root',
@ -101,6 +102,7 @@ export class AppComponent {
public stakeholderEntities = StakeholderEntities;
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
private configurationService: ConfigurationService,
private router: Router, private stakeholderService: StakeholderService, private smoothScroll: SmoothScroll,
private userManagementService: UserManagementService,
private quickContactService: QuickContactService,
@ -118,6 +120,7 @@ export class AppComponent {
}
ngOnInit() {
this.configurationService.initPortal(this.properties, "monitor");
this.userManagementService.fixRedirectURL = properties.afterLoginRedirectLink;
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;

View File

@ -57,9 +57,7 @@ export class ContactComponent 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);
this.updateUrl(this.url);

View File

@ -60,9 +60,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);
this.updateUrl(this.url);

View File

@ -107,9 +107,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit, IDeactiv
let url = this.properties.domain + this.properties.baseLink + this._router.url;
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 Monitor", this.properties.piwikSiteId).subscribe());
}
this.subscriptions.push(this._piwikService.trackView(this.properties, "OpenAIRE Monitor").subscribe());
this.getNumbers();
this.subscriptions.push(this.localStorageService.get().subscribe(value => {
this.directLink = value;

View File

@ -64,9 +64,7 @@ export class MyStakeholdersComponent {
var url = this.properties.domain + this.properties.baseLink + this._router.url;
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;
if (this.user) {

@ -1 +1 @@
Subproject commit 1785da3c45eab2438f014f6e5149c1e995bd7bff
Subproject commit 46b3e937bf7b01cd0593cb256c574fb7d21255f7

View File

@ -22,7 +22,7 @@ import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sideb
selector: 'search-stakeholders',
template: `
<new-search-page pageTitle="OpenAIRE-Monitor | Browse {{this.stakeholderEntities.STAKEHOLDERS}}"
[hasPrefix]=false [piwikSiteId]="piwikSiteId"
[hasPrefix]=false
[formPlaceholderText]="'Search ' + (!isMobile?'OpenAIRE Monitor ':'') + this.stakeholderEntities.STAKEHOLDERS"
[type]="(results.length > 1) ? this.stakeholderEntities.STAKEHOLDERS:this.stakeholderEntities.STAKEHOLDER"
entityType="stakeholder"
@ -39,7 +39,6 @@ import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sideb
`
})
export class SearchStakeholdersComponent {
public piwikSiteId = null;
private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent;
public results: StakeholderInfo[] = [];
@ -85,7 +84,6 @@ export class SearchStakeholdersComponent {
}
public ngOnInit() {
this.piwikSiteId = this.properties.piwikSiteId;
this.baseUrl = this.properties.searchLinkToStakeholders;
this.subscriptions.push(this.route.queryParams.subscribe(params => {
this.searchPage.resultsPerPage = 10;

View File

@ -36,9 +36,7 @@ export class SupportComponent {
}
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.domain + this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);