merrimanr commented on a change in pull request #1344: METRON-1654: findOne 
request after an alert patch returns with the original state of the alert item
URL: https://github.com/apache/metron/pull/1344#discussion_r263065186
 
 

 ##########
 File path: 
metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
 ##########
 @@ -456,20 +460,17 @@ export class AlertsListComponent implements OnInit, 
OnDestroy {
     this.searchService.interval = this.refreshInterval;
   }
 
-  updateAlert(sensorType: string, guid: string, isDelete: boolean) {
-    if (isDelete) {
-      let alertIndex = -1;
-      this.alerts.forEach((alert, index) => {
-        alertIndex = (alert.source.guid === guid) ? index : alertIndex;
-      });
-      this.alerts.splice(alertIndex, 1);
-      return;
-    }
+  updateAlert(alertSource: AlertSource) {
+    this.alerts.filter(alert => alert.source.guid === alertSource.guid)
+            .map(alert => alert.source = alertSource);
+  }
 
-    this.searchService.getAlert(sensorType, guid).subscribe(alertSource => {
-      this.alerts.filter(alert => alert.source.guid === guid)
-      .map(alert => alert.source = alertSource);
+  removeAlert(alertSource: AlertSource) {
+    let alertIndex = -1;
+    this.alerts.forEach((alert, index) => {
+      alertIndex = (alert.source.guid === alertSource.guid) ? index : 
alertIndex;
     });
+    this.alerts.splice(alertIndex, 1);
 
 Review comment:
   Done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to