From 3a65c945cb5019222eb0c40de83cc16beffb1bdd Mon Sep 17 00:00:00 2001 From: David Newswanger Date: Thu, 2 Aug 2018 11:41:10 -0400 Subject: [PATCH] Add basic link and button tracking to the most common links. --- galaxyui/src/app/app.component.html | 5 +++-- galaxyui/src/app/app.component.ts | 12 ++++-------- galaxyui/src/app/authors/authors.component.html | 2 +- .../app/authors/detail/author-detail.component.html | 10 +++++----- .../detail-actions/detail-actions.component.ts | 12 +++++++++--- .../src/app/home/carousel/carousel.component.html | 2 +- .../src/app/home/carousel/carousel.component.ts | 7 +++++-- galaxyui/src/app/home/popular/popular.component.ts | 8 +++++++- galaxyui/src/app/login/login.component.html | 2 +- galaxyui/src/app/login/login.module.ts | 5 ++++- .../namespace-list/action/action.component.ts | 10 +++++++--- .../repositories-content/action/action.component.ts | 6 +++++- .../repositories-content.component.html | 8 ++++---- .../namespace-list/namespace-list.component.html | 2 +- .../import-detail/import-detail.component.html | 2 +- .../src/app/search/popular/popular.component.ts | 13 +++++++------ galaxyui/src/app/search/search.component.html | 4 ++-- .../components/clipboard/clipboard.component.html | 2 +- .../page-header/page-header.component.html | 2 +- .../app/shared/directives/log-event.directive.ts | 3 ++- .../src/app/vendors/card/vendor-card.component.ts | 7 +++++-- 21 files changed, 76 insertions(+), 48 deletions(-) diff --git a/galaxyui/src/app/app.component.html b/galaxyui/src/app/app.component.html index 559ff5c78..5b588a631 100644 --- a/galaxyui/src/app/app.component.html +++ b/galaxyui/src/app/app.component.html @@ -8,7 +8,8 @@ [pinnableMenus]="true" [showBadges]="true" [showIcons]="true" - [updateActiveItemsOnClick]="false"> + [updateActiveItemsOnClick]="false" + (onItemClickEvent)='onItemClickEvent($event)'>
  • - +
  • diff --git a/galaxyui/src/app/shared/directives/log-event.directive.ts b/galaxyui/src/app/shared/directives/log-event.directive.ts index b5f7c356e..c837fbe94 100644 --- a/galaxyui/src/app/shared/directives/log-event.directive.ts +++ b/galaxyui/src/app/shared/directives/log-event.directive.ts @@ -23,7 +23,8 @@ export class LogEventDirective { const name = this.appLogEvent || this.el.nativeElement.text || this.el.nativeElement.innerText; if (this.el.nativeElement.nodeName === 'A') { - this.eventLoggerService.logLink(name, this.el.nativeElement.href); + // TODO Add logic to use href when link not on our site + this.eventLoggerService.logLink(name, this.el.nativeElement.pathname); } else if (this.el.nativeElement.nodeName === 'BUTTON') { this.eventLoggerService.logButton(name); } diff --git a/galaxyui/src/app/vendors/card/vendor-card.component.ts b/galaxyui/src/app/vendors/card/vendor-card.component.ts index b4d2e7167..b33a669ec 100644 --- a/galaxyui/src/app/vendors/card/vendor-card.component.ts +++ b/galaxyui/src/app/vendors/card/vendor-card.component.ts @@ -8,7 +8,8 @@ import { Router } from '@angular/router'; -import { Namespace } from '../../resources/namespaces/namespace'; +import { EventLoggerService} from '../../resources/logger/event-logger.service'; +import { Namespace } from '../../resources/namespaces/namespace'; @Component({ selector: 'vendor-card', @@ -18,7 +19,8 @@ import { Namespace } from '../../resources/namespaces/namespace'; export class VendorCardComponent implements OnInit { constructor( - private router: Router + private router: Router, + private eventLoggerService: EventLoggerService, ) {} _vendor: Namespace; @@ -52,6 +54,7 @@ export class VendorCardComponent implements OnInit { } handleCardClick() { + this.eventLoggerService.logLink(this.vendor.name, '/' + this.vendor.name); this.router.navigate(['/', this.vendor.name]); } }