New dashboard look & feel
[src/xds/xds-agent.git] / webapp / src / app / app.component.ts
index b644ecd..f858b0c 100644 (file)
@@ -1,44 +1,21 @@
-import { Component, OnInit, OnDestroy } from '@angular/core';
-import { TranslateService } from '@ngx-translate/core';
-import { ConfigService, IConfig } from './services/config.service';
+/**
+ * @license
+ * Copyright Akveo. All Rights Reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ */
+import { Component, OnInit } from '@angular/core';
+import { AnalyticsService } from './@core/utils/analytics.service';
 
 @Component({
-    selector: 'app-root',
-    templateUrl: 'app.component.html'
+  selector: 'ngx-app',
+  template: '<router-outlet></router-outlet>',
 })
+export class AppComponent implements OnInit {
 
-export class AppComponent implements OnInit, OnDestroy {
-    private defaultLanguage = 'en';
-    public isCollapsed = true;
+  constructor(private analytics: AnalyticsService) {
+  }
 
-    constructor(private translate: TranslateService, private configSvr: ConfigService) {
-    }
-
-    ngOnInit() {
-        this.translate.addLangs(['en', 'fr']);
-        this.translate.setDefaultLang(this.defaultLanguage);
-
-        const browserLang = this.translate.getBrowserLang();
-        this.translate.use(browserLang.match(/en|fr/) ? browserLang : this.defaultLanguage);
-
-        this.configSvr.Conf$.subscribe((cfg: IConfig) => {
-            let lang: string;
-            switch (cfg.language) {
-                case 'ENG':
-                    lang = 'en';
-                    break;
-                case 'FRA':
-                    lang = 'fr';
-                    break;
-                default:
-                    lang = this.defaultLanguage;
-            }
-            this.translate.use(lang);
-        });
-    }
-
-    ngOnDestroy(): void {
-        // this.aglIdentityService.loginResponse.unsubscribe();
-        // this.aglIdentityService.logoutResponse.unsubscribe();
-    }
+  ngOnInit(): void {
+    this.analytics.trackPageViews();
+  }
 }