X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=webapp%2Fsrc%2Fapp%2Fpages%2Fconfirm%2Fconfirm-modal%2Fconfirm-modal.component.ts;h=3de903525724dbe07439a97616ce314861cb986c;hb=refs%2Ftags%2F6.99.4;hp=3282d6bc06efa4645be2b0ed86c8b7408d0a510d;hpb=265469335019c494c1d61da9a0acea3ab7504ae8;p=src%2Fxds%2Fxds-agent.git diff --git a/webapp/src/app/pages/confirm/confirm-modal/confirm-modal.component.ts b/webapp/src/app/pages/confirm/confirm-modal/confirm-modal.component.ts index 3282d6b..3de9035 100644 --- a/webapp/src/app/pages/confirm/confirm-modal/confirm-modal.component.ts +++ b/webapp/src/app/pages/confirm/confirm-modal/confirm-modal.component.ts @@ -1,6 +1,6 @@ /** * @license -* Copyright (C) 2017 "IoT.bzh" +* Copyright (C) 2017-2018 "IoT.bzh" * Author Sebastien Douheret * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,13 +17,13 @@ */ import { Component, OnInit, Input } from '@angular/core'; -import { DomSanitizer } from '@angular/platform-browser'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; export enum EType { YesNo = 1, OKCancel, OK, + Cancel, } @Component({ @@ -39,12 +39,19 @@ export enum EType {
- - - + + +
@@ -64,26 +71,30 @@ export class ConfirmModalComponent implements OnInit { @Input() question; bodyQuestion = ''; - textBtn: Array = ['', '', '']; + textBtn: Array = ['', '']; constructor( private modalRef: NgbActiveModal, - private sanitizer: DomSanitizer, ) { } + ngOnInit() { switch (this.type) { case EType.OK: - this.textBtn = [ 'OK', '', '' ]; + this.textBtn = [ 'OK', '' ]; break; + case EType.Cancel: + this.textBtn = [ '', 'Cancel' ]; + break; + case EType.OKCancel: - this.textBtn = [ 'OK', 'Cancel', '' ]; + this.textBtn = [ 'OK', 'Cancel' ]; break; default: case EType.YesNo: - this.textBtn = [ 'Yes', 'No', '' ]; + this.textBtn = [ 'Yes', 'No' ]; break; } }