summaryrefslogtreecommitdiffstats
path: root/src/app/about-us
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/about-us')
-rw-r--r--src/app/about-us/aboutus.component.html42
-rw-r--r--src/app/about-us/aboutus.component.ts44
2 files changed, 42 insertions, 44 deletions
diff --git a/src/app/about-us/aboutus.component.html b/src/app/about-us/aboutus.component.html
index 3c2fb52..554fd4a 100644
--- a/src/app/about-us/aboutus.component.html
+++ b/src/app/about-us/aboutus.component.html
@@ -2,6 +2,8 @@
============LICENSE_START==========================================
===================================================================
Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
===================================================================
Unless otherwise specified, all software contained herein is licensed
@@ -19,7 +21,7 @@ limitations under the License.
============LICENSE_END============================================
-->
-
+<simple-notifications [options]="options"></simple-notifications>
<div class="text-center">
<div class="card">
<div class="mdl-dialog__content">
@@ -27,7 +29,8 @@ limitations under the License.
<div class="card-header" style="font-size: 20px">CONTACT DETAILS</div>
<div class="mdl-card__title">
<div class="text-center">
- Contact us @:<a href="mailto:{{contactUsMail.CONTACT_US_EMAIL}}?Subject={{contactUsMail.CONTACT_US_SUBJECT}}">APPC DEVELOPMENT TEAM</a>
+ Contact us @:
+ <a href="mailto:{{contactUsMail.CONTACT_US_EMAIL}}?Subject={{contactUsMail.CONTACT_US_SUBJECT}}">APPC DEVELOPMENT TEAM</a>
</div>
</div>
</div>&emsp;&emsp;&emsp;&emsp;
@@ -58,7 +61,7 @@ limitations under the License.
</div>
<div class="text-right">
<div class="mdl-dialog__content">
- <a class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary" (click)="open(content)" (click)="versionLogFile()">VIEW CHANGE LOG</a>
+ <a class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary" (click)="open(content)">VIEW CHANGE LOG</a>
</div>
</div>
@@ -66,35 +69,4 @@ limitations under the License.
</div>
</div>
-</div>
-
-<ng-template #content let-c="close" let-d="dismiss">
- <div class="modal-content" style="width:800px;vertical-align:auto;">
- <div class="modal-header">
- <h4 class="modal-title" style="text-align:center">VERSION CHANGE LOG</h4>
- <button type="button" class="close" aria-label="Close" (click)="d('Cross click')">
- <span aria-hidden="true">&times;</span>
- </button>
- </div>
- <div class="modal-body">
- <div class="form-group row">
- <html>
-
- <body>
- <textarea class="textarea">{{this.data}}</textarea>
- </body>
-
- </html>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" (click)="downloadLogFile()" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent
- " (click)="c('yes')">Download
- </button>
- <button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary
-
- " (click)="c('yes')">Cancel
- </button>
- </div>
- </div>
-</ng-template> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/src/app/about-us/aboutus.component.ts b/src/app/about-us/aboutus.component.ts
index c983c7b..fe75e41 100644
--- a/src/app/about-us/aboutus.component.ts
+++ b/src/app/about-us/aboutus.component.ts
@@ -25,8 +25,13 @@ limitations under the License.
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Http } from '@angular/http';
import { Subscription } from 'rxjs/Subscription';
+import { Observable } from 'rxjs/Observable';
+import { NotificationsService } from 'angular2-notifications';
import { saveAs } from 'file-saver';
import { ModalDismissReasons, NgbModal } from '@ng-bootstrap/ng-bootstrap';
+import { DialogService } from 'ng2-bootstrap-modal';
+import { ConfirmComponent } from '../shared/confirmModal/confirm.component';
+import { appConstants } from '../../constants/app-constants';
@Component({
selector: 'app-help',
@@ -41,8 +46,15 @@ export class AboutUsComponent implements OnInit, OnDestroy {
public data: any;
closeResult: string;
versionLogSubscription: Subscription;
-
- constructor(private http: Http, private modalService: NgbModal) {
+ options = {
+ timeOut: 1000,
+ showProgressBar: true,
+ pauseOnHover: true,
+ clickToClose: true,
+ maxLength: 200
+ };
+
+ constructor(private http: Http, private modalService: NgbModal, private dialogService: DialogService, private notificationsService: NotificationsService) {
}
ngOnInit() {
@@ -57,16 +69,30 @@ export class AboutUsComponent implements OnInit, OnDestroy {
}
}
- versionLogFile() {
- this.versionLogSubscription = this.http.get('app/about-us/versionLog.txt')
- .subscribe(res => this.data = res.text());
+ versionLogFile(): Observable<any> {
+ return this.http.get('app/about-us/versionLog.txt');
}
open(content) {
- this.modalService.open(content).result.then((result) => {
- this.closeResult = `Closed with: ${result}`;
- }, (reason) => {
- this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
+ this.versionLogSubscription = this.versionLogFile()
+ .subscribe((res) => {
+ this.data = res.text();
+ this.dialogService.addDialog(ConfirmComponent, {
+ title: 'VERSION CHANGE LOG',
+ message: this.data,
+ cancelButtonText: 'CLOSE',
+ confirmButtonText: 'DOWNLOAD'
+ }).subscribe(isConfirmed => {
+ if (isConfirmed) {
+ this.downloadLogFile()
+ } else {
+ // do nothing
+ }
+ });
+
+ },
+ (error)=>{
+ this.notificationsService.error(appConstants.errors.error, 'unable to fetch change log details');
});
}