]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/modal/modal.component.ts
import ceph 16.2.7
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / components / modal / modal.component.ts
index 730da6d62527b811a1056cdd79fc8351506d212a..25e06e62af188470e62f81ccc5f2e99ea924e21d 100644 (file)
@@ -1,4 +1,5 @@
 import { Component, EventEmitter, Input, Output } from '@angular/core';
+import { Router } from '@angular/router';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
@@ -10,6 +11,8 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 export class ModalComponent {
   @Input()
   modalRef: NgbActiveModal;
+  @Input()
+  pageURL: string;
 
   /**
    * Should be a function that is triggered when the modal is hidden.
@@ -17,8 +20,12 @@ export class ModalComponent {
   @Output()
   hide = new EventEmitter();
 
+  constructor(private router: Router) {}
+
   close() {
-    this.modalRef?.close();
+    this.pageURL
+      ? this.router.navigate([this.pageURL, { outlets: { modal: null } }])
+      : this.modalRef?.close();
     this.hide.emit();
   }
 }