diff options
author | Stone, Avi (as206k) <as206k@att.com> | 2018-06-03 13:12:12 +0300 |
---|---|---|
committer | Avi Stone <as206k@att.com> | 2018-06-03 11:56:49 +0000 |
commit | 548c5a220333c7cd666b861e737bff0b45461f18 (patch) | |
tree | 13c60b67291bd8bada498ad73c02a9e35afb5c9e /public/src/app/sdc-notify-dialog | |
parent | 193095b01daf094c78f7fafacdf1c1cc31f290fe (diff) |
Update FE project
Update FE to latest version so that fe can run on docker
Change-Id: I9c5dee756b567dbe64fac6d3d6fd89362813bdcc
Issue-ID: SDC-1359
Signed-off-by: Stone, Avi (as206k) <as206k@att.com>
Diffstat (limited to 'public/src/app/sdc-notify-dialog')
3 files changed, 128 insertions, 0 deletions
diff --git a/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.html b/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.html new file mode 100644 index 0000000..f8d51fe --- /dev/null +++ b/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.html @@ -0,0 +1,39 @@ +<p-dialog [style]="{'border-top-color':'#ffb81c'}" [closable]="false" [(visible)]="store.displaySDCDialog" modal="modal" styleClass="dcae-notify" + width="500" [responsive]="true" data-tests-id="sdc-dialog"> + <p-header> + <div style="display: flex;"> + <span style="color: #ffb81c; + padding-right: 15px; + height: 100%; + display: flex; + justify-content: center; + align-items: center;" [innerHTML]="'alert-triangle' | feather:28"></span> + <span style="font-family: 'Open Sans', sans-serif; + font-size: 24px; width: 100%;"> + Exit from DCAE + </span> + <span style=" + height: 100%; + display: flex; + justify-content: center; + color:rgb(90, 90, 90); + align-items: center;" [innerHTML]="'x' | feather:20 + " (click)="closeforChange()"></span> + </div> + </p-header> + + <div style="padding: 0 0 20px 43px; font-family: 'Open Sans', sans-serif; + font-size: 14px;"> + Do you want to save? + </div> + + <p-footer> + <button mat-raised-button color="primary" style="background-color: #FFB81C; margin-right: 10px; font-size: 14px; font-family: 'Open Sans', sans-serif; height: 36px;" (click)="closeDialog()" data-tests-id="error-cancel"> + SAVE + </button> + <button mat-raised-button class="btn-secondry" style="border-color: #FFB81C !important; color:#FFB81C !important; font-size: 14px; font-family: 'Open Sans', sans-serif;text-align: center; height: 36px;" (click)="closeforChange()" + data-tests-id="error-cancel"> + DISCARD + </button> + </p-footer> +</p-dialog> diff --git a/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.scss b/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.scss new file mode 100644 index 0000000..a775398 --- /dev/null +++ b/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.scss @@ -0,0 +1,17 @@ +:host /deep/ .dcae-notify { + border-top: solid 6px #ffb81c; +} +:host /deep/ .ui-dialog .ui-dialog-titlebar { + padding-top: 15px; + padding-left: 20px; + padding-right: 12px; + padding-bottom: 0; +} + +:host /deep/ .ui-dialog-footer { + padding: 10px; +} + +:host /deep/ .ui-dialog.ui-widget .ui-dialog-content { + padding-top: 10px; +} diff --git a/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.ts b/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.ts new file mode 100644 index 0000000..7572012 --- /dev/null +++ b/public/src/app/sdc-notify-dialog/sdc-notify-dialog.component.ts @@ -0,0 +1,72 @@ +import { Component, ElementRef, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { RestApiService } from '../api/rest-api.service'; +import { MainComponent } from '../main/main.component'; +import { Store } from '../store/store'; + +@Component({ + selector: 'app-sdc-notify-dialog', + templateUrl: './sdc-notify-dialog.component.html', + styleUrls: ['./sdc-notify-dialog.component.scss'] +}) +export class SdcNotifyDialogComponent { + @ViewChild(MainComponent) mainComponent: ElementRef; + + constructor( + public store: Store, + private router: Router, + private _restApi: RestApiService + ) {} + + closeDialog() { + const currentUrl = this.router.url; + if (currentUrl.includes('main')) { + if (this.store.cdumpIsDirty) { + this.saveCDUMP(); + } else { + this.completeAndClose(); + } + } else { + this.completeAndClose(); + } + } + + saveCDUMP() { + this.store.loader = true; + this._restApi + .saveMonitoringComponent({ + contextType: this.store.sdcParmas.contextType, + serviceUuid: this.store.sdcParmas.uuid, + vfiName: this.store.vfiName, + vfcmtUuid: this.store.mcUuid, + flowType: this.store.flowType, + cdump: this.store.cdump + }) + .subscribe( + success => { + this.store.loader = false; + this.store.mcUuid = success.uuid; + this.store.ifrmaeMessenger.notify('ACTION_COMPLETED'); + }, + error => { + this.store.loader = false; + console.log(error.notes); + this.store.ifrmaeMessenger.notify('ACTION_COMPLETED'); + this.store.ErrorContent = Object.values(error.requestError); + this.store.displayErrorDialog = true; + }, + () => { + this.store.ifrmaeMessenger.notify('ACTION_COMPLETED'); + } + ); + } + + private completeAndClose() { + this.store.ifrmaeMessenger.notify('ACTION_COMPLETED'); + this.store.displaySDCDialog = false; + } + + closeforChange() { + this.completeAndClose(); + } +} |