Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Updated analytics tracked decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamazaki93 committed Nov 6, 2018
1 parent 59edc31 commit 3c29f0b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { AnalyticsService } from 'src/app/infrastructure/services/analytics.serv
'./folder-browser.component.scss'
]
})
@AnalyticsTracked()
@AnalyticsTracked("FolderBrowserComponent")
export class FolderBrowserComponent extends SubscriptionComponent implements OnInit {

busy = false;
Expand Down
4 changes: 2 additions & 2 deletions app/frontend/src/app/infrastructure/analytics-tracked.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AnalyticsService } from "./services/analytics.service";

export function AnalyticsTracked(): ClassDecorator {
export function AnalyticsTracked(screen: string): ClassDecorator {
return function (constructor: any) {
// You can add/remove events for your needs
const LIFECYCLE_HOOKS = [
Expand All @@ -14,7 +14,7 @@ export function AnalyticsTracked(): ClassDecorator {
constructor.prototype[hook] = function (...args) {
original && original.apply(this, args);
if(this.analytics instanceof AnalyticsService) {
(this.analytics as AnalyticsService).screenView(component);
(this.analytics as AnalyticsService).screenView(screen);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { AnalyticsTracked } from '../infrastructure/analytics-tracked';
'./settings-page.component.scss'
]
})
@AnalyticsTracked()
@AnalyticsTracked("SettingsPageComponent")
export class SettingsPageComponent extends SubscriptionComponent implements OnInit {

private requestCounts: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AnalyticsService } from 'src/app/infrastructure/services/analytics.serv
templateUrl: './tree-view.component.html',
styleUrls: ['./tree-view.component.scss']
})
@AnalyticsTracked()
@AnalyticsTracked("TreeViewComponent")
export class TreeViewComponent extends SubscriptionComponent implements OnInit {

rootNodes: TreeNode[] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { AnalyticsTracked } from '../infrastructure/analytics-tracked';
'./welcome-page.component.scss'
]
})
@AnalyticsTracked()
@AnalyticsTracked("WelcomePageComponent")
export class WelcomePageComponent extends SubscriptionComponent implements OnInit {

private updateAvailable = false;
Expand Down

0 comments on commit 3c29f0b

Please sign in to comment.