Fix Bug 2336: Manual Healing option in Ui
[osm/NG-UI.git] / src / app / utilities / ns-instances-action / NSInstancesActionComponent.ts
index ea7fa61..08e5e97 100644 (file)
@@ -27,6 +27,7 @@ import { NotifierService } from 'angular-notifier';
 import { ERRORDATA, MODALCLOSERESPONSEDATA } from 'CommonModel';
 import { DeleteComponent } from 'DeleteComponent';
 import { environment } from 'environment';
+import { HealingComponent } from 'HealingComponent';
 import { NSDDetails } from 'NSDModel';
 import { NSDInstanceData } from 'NSInstanceModel';
 import { NSPrimitiveComponent } from 'NSPrimitiveComponent';
@@ -170,7 +171,7 @@ export class NSInstancesActionComponent {
       }
     }).catch((): void => {
       // Catch Navigation Error
-  });
+    });
   }
 
   /** History of operations for an Instanace @public */
@@ -285,7 +286,7 @@ export class NSInstancesActionComponent {
       }
     }).catch((): void => {
       // Catch Navigation Error
-  });
+    });
   }
 
   /** To open VM Migration in NS Instances */
@@ -301,7 +302,7 @@ export class NSInstancesActionComponent {
       }
     }).catch((): void => {
       // Catch Navigation Error
-  });
+    });
   }
 
   /** To open the Ns Update pop-up */
@@ -317,7 +318,7 @@ export class NSInstancesActionComponent {
       }
     }).catch((): void => {
       // Catch Navigation Error
-  });
+    });
   }
 
   /** To open the Start, Stop & Rebuild pop-up */
@@ -341,7 +342,7 @@ export class NSInstancesActionComponent {
       }
     }).catch((): void => {
       // Catch Navigation Error
-  });
+    });
   }
 
   /** To open the vertical Scaling pop-up */
@@ -357,7 +358,23 @@ export class NSInstancesActionComponent {
       }
     }).catch((): void => {
       // Catch Navigation Error
-  });
+    });
+  }
+
+  /** Open the Healing pop-up @public */
+  public openHealing(): void {
+    // eslint-disable-next-line security/detect-non-literal-fs-filename
+    const modalRef: NgbModalRef = this.modalService.open(HealingComponent, { backdrop: 'static' });
+    modalRef.componentInstance.params = {
+      id: this.instanceID
+    };
+    modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => {
+      if (result) {
+        this.sharedService.callData();
+      }
+    }).catch((): void => {
+      // Catch Navigation Error
+    });
   }
 
   /**