summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/footer/footer.component.ts
blob: 7aae6d0b80aa025433cf3c7ee168519426b7c8cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { Component, OnInit } from '@angular/core';
import { ManifestService } from 'src/app/shared/services';
import { environment } from 'src/environments/environment';

 
declare var runAnalytics: any
@Component({
  selector: 'app-footer',
  templateUrl: './footer.component.html',
  styleUrls: ['./footer.component.scss']
})
export class FooterComponent implements OnInit {

buildVersion: string;
	api = environment;
	brandName: string;
	footerLink: string;
	footerLinkText: string;
	footerMessage: string;
	footerLogoImagePath: string;
	footerLogoText: string;

 constructor(private manifest: ManifestService) { }
  
	ngOnInit() {
		this.buildVersion =  '';
		this.manifestDetails();
	
		this.brandName = "ONAP Portal SDK";
		if(this.api.brandName != ''){
			this.brandName = this.api.brandName;
		}
		this.footerLink = this.api.footerLink;
		this.footerLinkText = this.api.footerLinkText;
		this.footerMessage= this.api.footerMessage;
		if(this.api.footerLogoImagePath !=''){
		  this.footerLogoImagePath= this.api.footerLogoImagePath;
		}
		this.footerLogoText= this.api.footerLogoText;
		this.portalHook();
	  
	} 
	
	manifestDetails() {
		this.manifest.getManifest().subscribe((_res: any) => {
		  this.buildVersion = _res['Build-Number'];
		}, (_err) => {
	
		});
	}
  
	portalHook() {
		
		let done = false;
		let script = document.createElement('script');	
		script.src = "api/v3/analytics"
		script.async = true;			
		script.onload = ()=> {
			runAnalytics();
		}

		document.head.appendChild(script);

	  }
	}