Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: initialize pendo on app start #1535

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/dsp-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Router } from '@angular/router';
import { GrafanaFaroService } from '@dasch-swiss/vre/shared/app-analytics';
import { GrafanaFaroService, PendoAnalyticsService } from '@dasch-swiss/vre/shared/app-analytics';
import { RouteConstants } from '@dasch-swiss/vre/shared/app-config';
import { AutoLoginService, LocalStorageWatcherService } from '@dasch-swiss/vre/shared/app-session';

Expand All @@ -18,10 +18,12 @@ export class AppComponent implements OnInit {
private _router: Router,
private _titleService: Title,
private _autoLoginService: AutoLoginService,
private _pendo: PendoAnalyticsService,
private _localStorageWatcher: LocalStorageWatcherService,
private _grafana: GrafanaFaroService
) {
this._grafana.setup();
this._pendo.setup();
this._autoLoginService.setup();
this._localStorageWatcher.watchAccessToken();
this._titleService.setTitle('DaSCH Service Platform');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class PendoAnalyticsService {
private _accessTokenService: AccessTokenService = inject(AccessTokenService);
private environment: string = this.config.environment;

constructor() {
setup() {
this.authService
.isCredentialsValid$()
.pipe(takeUntilDestroyed())
Expand All @@ -32,7 +32,6 @@ export class PendoAnalyticsService {
* set active user
*/
setActiveUser(id: string): void {
console.log('setActiveUser', id);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
pendo.initialize({
Expand Down Expand Up @@ -67,7 +66,6 @@ export class PendoAnalyticsService {
* remove active user
*/
removeActiveUser(): void {
console.log('removeActiveUser');
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
pendo.initialize({
Expand Down