diff --git a/package-lock.json b/package-lock.json index 92ce583..6327b5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12299,9 +12299,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sartography-workflow-lib": { - "version": "0.0.234", - "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.234.tgz", - "integrity": "sha512-v0IznXGlVaznpIE5jLVNqNWeIr4I22oU2E1yyayAc4eCYC5P8+KnvJYKdW/sUBfH9jKRKUlseMK3jSX7Tt/IPw==" + "version": "0.0.235", + "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.235.tgz", + "integrity": "sha512-1M646LRHpyyLoH+QKvtP40Tp+KMwYtlwIpyr5vllin20+zRAAzEj4FMuI/aBGnwpBVcNuLfhql4NMqvgfxIggQ==" }, "sass": { "version": "1.23.3", diff --git a/package.json b/package.json index 23c450c..2e0f458 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "ngx-file-drop": "^8.0.8", "ngx-markdown": "^9.0.0", "rxjs": "~6.5.4", - "sartography-workflow-lib": "0.0.234", + "sartography-workflow-lib": "0.0.235", "tslib": "^1.11.1", "uuid": "^7.0.2", "zone.js": "^0.10.3" diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 2f759e1..0e19b29 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -15,6 +15,7 @@ export class ThisEnvironment implements AppEnvironment { api = environment.api; irbUrl = environment.irbUrl; title = environment.title; + googleAnalyticsKey = environment.googleAnalyticsKey; } const routes: Routes = [ diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 8503dc1..0d1947f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,5 @@ import {Component} from '@angular/core'; -import {ApiService} from 'sartography-workflow-lib'; -import {GoogleAnalyticsService} from 'sartography-workflow-lib/lib/services/google-analytics.service'; +import {ApiService, GoogleAnalyticsService} from 'sartography-workflow-lib'; @Component({ selector: 'app-root', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7521467..dd3b0d5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -59,6 +59,7 @@ export class ThisEnvironment implements AppEnvironment { api = environment.api; irbUrl = environment.irbUrl; title = environment.title; + googleAnalyticsKey = environment.googleAnalyticsKey; } /** diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index 03219a6..4ad7cff 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -1,7 +1,6 @@ -import {Component, Inject, OnInit} from '@angular/core'; +import {Component, Inject} from '@angular/core'; import {Router} from '@angular/router'; -import {ApiService, AppEnvironment, isSignedIn, User, UserParams} from 'sartography-workflow-lib'; -import {GoogleAnalyticsService} from 'sartography-workflow-lib/lib/services/google-analytics.service'; +import {ApiService, AppEnvironment, GoogleAnalyticsService, isSignedIn, User} from 'sartography-workflow-lib'; interface NavItem { path?: string; @@ -39,8 +38,8 @@ export class NavbarComponent { private _loadUser() { if (isSignedIn()) { this.api.getUser().subscribe(u => { - this.googleAnalyticsService.setUser(u.uid); this.user = u; + this.googleAnalyticsService.setUser(this.user.uid); this._loadNavLinks(); }, error => { localStorage.removeItem('token'); diff --git a/src/environments/environment.runtime.ts b/src/environments/environment.runtime.ts index c40401d..e38110c 100644 --- a/src/environments/environment.runtime.ts +++ b/src/environments/environment.runtime.ts @@ -10,4 +10,5 @@ export const environment: AppEnvironment = { api: _has(ENV, 'api', '$API_URL') ? ENV.api : 'http://localhost:5000/v1.0', irbUrl: _has(ENV, 'irbUrl', '$IRB_URL') ? ENV.irbUrl : 'http://localhost:5001', title: _has(ENV, 'title', '$TITLE') ? ENV.title : 'Research Ramp-Up Toolkit Configurator', + googleAnalyticsKey: _has(ENV, 'googleAnalyticsKey', '$GOOGLE_ANALYTICS_KEY') ? ENV.title : 'AIzaSyD-m_e_Ilm7CHA9gY9nqp56vp2drz4VTy4', }; diff --git a/src/index.html b/src/index.html index 124a135..e33289a 100644 --- a/src/index.html +++ b/src/index.html @@ -11,9 +11,11 @@ api: '$API_URL', irbUrl: '$IRB_URL', baseHref: '$BASE_HREF', + googleAnalyticsKey: '$GOOGLE_ANALYTICS_KEY', }; +