2 ============LICENSE_START==========================================
3 ===================================================================
4 Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
6 Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
7 ===================================================================
9 Unless otherwise specified, all software contained herein is licensed
10 under the Apache License, Version 2.0 (the License);
11 you may not use this software except in compliance with the License.
12 You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21 ============LICENSE_END============================================
25 import { Component, OnInit, OnDestroy } from '@angular/core';
26 import { Http } from '@angular/http';
27 import { Subscription } from 'rxjs/Subscription';
28 import { Observable } from 'rxjs/Observable';
29 import { NotificationsService } from 'angular2-notifications';
30 import { saveAs } from 'file-saver';
31 import { DialogService } from 'ng2-bootstrap-modal';
32 import { ConfirmComponent } from '../shared/confirmModal/confirm.component';
33 import { appConstants } from '../../constants/app-constants';
34 import {UtilityService} from '../shared/services/utilityService/utility.service';
38 templateUrl: './aboutus.component.html',
39 styleUrls: ['./aboutus.component.css']
41 export class AboutUsComponent implements OnInit, OnDestroy {
42 clName= "AboutUsComponent";
43 public releaseName: any;
44 public versionNo: any;
45 public contactUsMail: any;
48 versionLogSubscription: Subscription;
51 showProgressBar: true,
58 private http: Http, private dialogService: DialogService, private notificationsService: NotificationsService,
59 private utilSvc: UtilityService ) {
63 this.versionNo = require('./appVersion.json').versionNo;
64 this.releaseName = require('./appVersion.json').releaseName;
65 this.contactUsMail = require('../cdt.application.properties.json').CONTACT_US;
69 if (this.versionLogSubscription) {
70 this.versionLogSubscription.unsubscribe();
74 versionLogFile(): Observable<any> {
75 return this.http.get('app/about-us/versionLog.txt');
79 this.versionLogSubscription = this.versionLogFile()
81 this.data = res.text();
82 this.dialogService.addDialog(ConfirmComponent, {
83 title: 'VERSION CHANGE LOG',
85 cancelButtonText: 'CLOSE',
86 confirmButtonText: 'DOWNLOAD'
87 }).subscribe(isConfirmed => {
89 this.downloadLogFile()
97 this.notificationsService.error(appConstants.errors.error, 'unable to fetch change log details');
102 var blob = new Blob([this.data], {
103 type: 'text/plain;charset=utf-8'
105 saveAs(blob, 'versionLog.txt');
108 tlPlus() { //.. increase tracelvl - more tracing in console
109 let tracelvl= this.utilSvc.getTracelvl();
111 tracelvl++; this.utilSvc.setTracelvl( tracelvl);
113 console.log( this.clName+": tlPlus: tracelvl="+this.utilSvc.getTracelvl() );
116 tlMinus() { //.. decrease tracelvl - less tracing in console
117 let tracelvl= this.utilSvc.getTracelvl();
119 tracelvl--; this.utilSvc.setTracelvl( tracelvl);
121 console.log( this.clName+": tlMinus: tracelvl="+this.utilSvc.getTracelvl() );