X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=rulemgt-frontend%2Fsrc%2Fapp%2Fcorrelation-modal%2Fmodal.component.ts;h=1d458b0bf025822a018316c122695bb54277e79f;hb=6e26bf0b71a8b8493fbd1575717a2c5e539f93ee;hp=cafb8e55961b25dcb88fa001b2a8238e759a009c;hpb=0a6e32dbdb5d505536d33a3539f7b9fcfba1cffe;p=holmes%2Frule-management.git diff --git a/rulemgt-frontend/src/app/correlation-modal/modal.component.ts b/rulemgt-frontend/src/app/correlation-modal/modal.component.ts index cafb8e5..1d458b0 100644 --- a/rulemgt-frontend/src/app/correlation-modal/modal.component.ts +++ b/rulemgt-frontend/src/app/correlation-modal/modal.component.ts @@ -13,31 +13,38 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Component, Input, OnInit } from '@angular/core'; -import { ModalService } from './modal.service'; -import { Msg } from './msg'; -declare var $: any; -@Component({ - - selector: 'sif-modal', - templateUrl: './modal.component.html', +import {Component, OnInit} from '@angular/core'; +import {ModalService} from './modal.service'; +import {Msg} from './msg'; +@Component({ + selector: 'sif-modal', + templateUrl: './modal.component.html', + styleUrls: ['./modal.component.css'] }) export class SifModalComponent implements OnInit { - constructor(private modalServer: ModalService) { }; - modalTitle = 'modalTitleDefault'; - modalBodyMessage = 'modalBodyMessageDefault'; - closeBtnTitle = 'closeBtnTitleDefault'; - - ngOnInit(): void { - this.modalServer.getmodalObservable.subscribe((msg: Msg) => { - console.log('receive ' + msg); - this.modalTitle = msg.title || this.modalTitle; - this.modalBodyMessage = msg.message || this.modalBodyMessage; - this.closeBtnTitle = msg.btn || this.closeBtnTitle; - $('#myModal').modal('show'); - }); - } + modalTitle = 'modalTitleDefault'; + modalBodyMessage = 'modalBodyMessageDefault'; + closeBtnTitle = 'closeBtnTitleDefault'; + + showModal = false; + + constructor(private modalServer: ModalService) { + this.modalServer.openModalAnnounced$.subscribe((msg: Msg) => { + console.log('receive ', msg); + this.modalTitle = msg.title || this.modalTitle; + this.modalBodyMessage = msg.message || this.modalBodyMessage; + this.closeBtnTitle = msg.btn || this.closeBtnTitle; + this.showModal = true; + }); + }; + + ngOnInit(): void { + } + + cancelModal(): void { + this.showModal = false; + } }