From: Ricardo Marques Date: Mon, 2 Jul 2018 10:54:42 +0000 (+0100) Subject: mgr/dashboard: Add 'onCancel' output for 'ConfirmationModal' X-Git-Tag: v14.0.1~771^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9edff075c5b70ac5580ad6324f902fa88ad16231;p=ceph.git mgr/dashboard: Add 'onCancel' output for 'ConfirmationModal' Signed-off-by: Ricardo Marques --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.html index c8a49017b0bc..c710cbf6b8cd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.html @@ -19,7 +19,7 @@ + (click)="cancel()">Cancel diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.ts index bbb155bc011f..92660376fa89 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/confirmation-modal/confirmation-modal.component.ts @@ -13,6 +13,7 @@ export class ConfirmationModalComponent implements OnInit { bodyTpl: TemplateRef; buttonText: string; onSubmit: Function; + onCancel: Function; titleText: string; bodyContext: object; @@ -32,6 +33,13 @@ export class ConfirmationModalComponent implements OnInit { this.onSubmit(); } + cancel() { + this.modalRef.hide(); + if (this.onCancel) { + this.onCancel(); + } + } + stopLoadingSpinner() { this.confirmationForm.setErrors({ cdSubmitButton: true }); }