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';
37 templateUrl: './aboutus.component.html',
38 styleUrls: ['./aboutus.component.css']
40 export class AboutUsComponent implements OnInit, OnDestroy {
42 public releaseName: any;
43 public versionNo: any;
44 public contactUsMail: any;
47 versionLogSubscription: Subscription;
50 showProgressBar: true,
56 constructor(private http: Http, private dialogService: DialogService, private notificationsService: NotificationsService) {
60 this.versionNo = require('./appVersion.json').versionNo;
61 this.releaseName = require('./appVersion.json').releaseName;
62 this.contactUsMail = require('../cdt.application.properties.json').CONTACT_US;
66 if (this.versionLogSubscription) {
67 this.versionLogSubscription.unsubscribe();
71 versionLogFile(): Observable<any> {
72 return this.http.get('app/about-us/versionLog.txt');
76 this.versionLogSubscription = this.versionLogFile()
78 this.data = res.text();
79 this.dialogService.addDialog(ConfirmComponent, {
80 title: 'VERSION CHANGE LOG',
82 cancelButtonText: 'CLOSE',
83 confirmButtonText: 'DOWNLOAD'
84 }).subscribe(isConfirmed => {
86 this.downloadLogFile()
94 this.notificationsService.error(appConstants.errors.error, 'unable to fetch change log details');
99 var blob = new Blob([this.data], {
100 type: 'text/plain;charset=utf-8'
102 saveAs(blob, 'versionLog.txt');