Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
un33k committed Jul 5, 2018
2 parents e337927 + 26b11d7 commit bcfc7fa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@
"pkg:lint": "ng lint gtag",
"###----- CI -----###": "Continuous integration",
"app:test:ci": "ng test web --browsers ChromeHeadless --watch=false",
"app:e2e:ci":
"ng e2e web-e2e --port 5300 --protractor-config=apps/web/e2e/protractor.conf.ci.js",
"app:e2e:ci": "ng e2e web-e2e --port 5300 --protractor-config=apps/web/e2e/protractor.conf.ci.js",
"pkg:test:ci": "ng test gtag --browsers ChromeHeadless --watch=false --code-coverage",
"ci": "yarn pkg:lint && yarn pkg:test:ci",
"ci:all": "yarn ci && yarn app:lint && yarn app:test:ci && yarn app:e2e:ci",
"###----- Tools -----###": "Tool commands",
"format":
"node node_modules/.bin/prettier --single-quote --print-width 90 --write 'apps/**/src/*.{ts,css,scss,json}' 'pkgs/**/src/*.{ts,css,scss,json}'",
"format": "node node_modules/.bin/prettier --single-quote --print-width 90 --write 'apps/**/src/*.{ts,css,scss,json}' 'pkgs/**/src/*.{ts,css,scss,json}'",
"release": "ts-node ./tools/release.ts -- "
},
"private": true,
Expand Down Expand Up @@ -82,7 +80,7 @@
"prettier": "^1.12.1",
"protractor": "~5.3.0",
"semver": "^5.5.0",
"ts-node": "~5.0.1",
"ts-node": "^7.0.0",
"tsickle": ">=0.25.5",
"tslib": "^1.7.1",
"tslint": "~5.9.1",
Expand Down
14 changes: 7 additions & 7 deletions pkgs/gtag/src/gtag.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ export class GtagService {
this.router.events
.pipe(
filter(event => event instanceof NavigationEnd),
tap(event => {
this.trackPageView();
map(() => this.route),
map(route => route.firstChild),
switchMap(route => route.data),
map(data => get(data, 'title', this.options.appName)),
tap(title => {
this.trackPageView({ title });
})
)
.subscribe();
}

private getTitle() {
return get(this.route.snapshot.data, 'title', this.options.appName);
}

trackPageView(params?: GtagPageViewParams) {
params = {
...{
page_path: this.router.url,
page_location: window.location.href,
page_title: this.getTitle()
page_title: this.options.appName
},
...params
};
Expand Down
16 changes: 10 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,10 @@ buffer-from@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531"

buffer-from@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04"

buffer-indexof@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c"
Expand Down Expand Up @@ -5751,7 +5755,7 @@ source-map-resolve@^0.5.0:
source-map-url "^0.4.0"
urix "^0.1.0"

source-map-support@^0.5.0, source-map-support@^0.5.3, source-map-support@^0.5.5:
source-map-support@^0.5.0, source-map-support@^0.5.5, source-map-support@^0.5.6:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13"
dependencies:
Expand Down Expand Up @@ -6194,17 +6198,17 @@ trim-right@^1.0.1:
dependencies:
glob "^6.0.4"

ts-node@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-5.0.1.tgz#78e5d1cb3f704de1b641e43b76be2d4094f06f81"
ts-node@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.0.tgz#a94a13c75e5e1aa6b82814b84c68deb339ba7bff"
dependencies:
arrify "^1.0.0"
chalk "^2.3.0"
buffer-from "^1.1.0"
diff "^3.1.0"
make-error "^1.1.1"
minimist "^1.2.0"
mkdirp "^0.5.1"
source-map-support "^0.5.3"
source-map-support "^0.5.6"
yn "^2.0.0"

tsickle@>=0.25.5:
Expand Down

0 comments on commit bcfc7fa

Please sign in to comment.