Skip to content

Commit

Permalink
feat(app-insights-step): upgrade app insights
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximBalaganskiy committed Jul 29, 2019
1 parent 02fb604 commit 486204b
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 23 deletions.
89 changes: 73 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"peerDependencies": {
"@types/numeral": ">=0.0.25",
"applicationinsights-js": ">=1.0.20",
"@microsoft/applicationinsights-web": "^2.1.1",
"aurelia-authentication": ">=3.8.2",
"aurelia-event-aggregator": ">=1.0.1",
"aurelia-framework": ">=1.3.0",
Expand All @@ -60,11 +60,10 @@
"numeral": ">=2.0.6"
},
"devDependencies": {
"@types/applicationinsights-js": ">=1.0.7",
"@microsoft/applicationinsights-web": "^2.1.1",
"@types/lodash": ">=4.14.118",
"@types/node": ">=10.12.10",
"@types/numeral": ">=0.0.25",
"applicationinsights-js": ">=1.0.20",
"aurelia-authentication": ">=3.8.2",
"aurelia-event-aggregator": ">=1.0.1",
"aurelia-framework": ">=1.3.0",
Expand All @@ -77,7 +76,7 @@
"concurrently": "^3.6.0",
"copyfiles": ">=2.1.0",
"inputmask": ">=4.0.3",
"lodash": ">=4.17.11",
"lodash": "^4.17.15",
"materialize-css": ">=1.0.0",
"moment": ">=2.22.2",
"numeral": ">=2.0.6",
Expand Down
6 changes: 3 additions & 3 deletions src/services/app-insights-step.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as au from "../aurelia";
import { AppInsights } from "applicationinsights-js";
import { ApplicationInsights } from "@microsoft/applicationinsights-web";

@au.autoinject
export class AppInsightsStep implements au.PipelineStep {
constructor() {
constructor(private appInsights: ApplicationInsights) {
this.logger = au.getLogger("AppInsightsStep");
this.logger.debug("Created");
}
Expand All @@ -14,7 +14,7 @@ export class AppInsightsStep implements au.PipelineStep {
let origin = window.location.pathname + window.location.hash;
let path = origin.replace("/#/", "/").replace("#", "");
this.logger.debug(`Tracking for ${path}`);
AppInsights.trackPageView(navigationInstruction.config.name, path, navigationInstruction.params);
this.appInsights.trackPageView({ name: navigationInstruction.config.name, uri: path, properties: navigationInstruction.params });
return next();
}
}

0 comments on commit 486204b

Please sign in to comment.