[ 
https://issues.apache.org/jira/browse/METRON-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656585#comment-16656585
 ] 

ASF GitHub Bot commented on METRON-1830:
----------------------------------------

Github user tiborm commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1240#discussion_r226597603
  
    --- Diff: 
metron-interface/metron-alerts/src/app/alerts/alerts-list/table-view/table-view.component.ts
 ---
    @@ -259,19 +259,25 @@ export class TableViewComponent implements OnInit, 
OnChanges, OnDestroy {
       }
     
       deleteOneAlertFromMetaAlert($event, alert: Alert, metaAlertIndex: 
number) {
    -    this.metronDialogBox.showConfirmationMessage('Do you wish to remove 
the alert from the meta alert?').subscribe(response => {
    -      if (response) {
    +    let confirmedSubscription = this.dialogService.confirm('Do you wish to 
remove the alert from the meta alert?').subscribe(r => {
    +      if (r === 'Confirmed') {
             this.doDeleteOneAlertFromMetaAlert(alert, metaAlertIndex);
           }
    +      if (r !== 'Initial') {
    --- End diff --
    
    What if we remove the if statement and simply unsubscribe at the end of 
this function?
    With that, I think we could be able to remove 'Initial' value from 
ConfirmationType and the dispatching of 'Initial' from the first line of 
DialogService.confirm function. Could we keep the same functionality with this 
simplification?
    
    Also, we can call variable 'r' like 'action' if we remove the coco egg. 


> Re-implement Alerts dialog box without jQuery
> ---------------------------------------------
>
>                 Key: METRON-1830
>                 URL: https://issues.apache.org/jira/browse/METRON-1830
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Shane Ardell
>            Assignee: Shane Ardell
>            Priority: Minor
>
> Currently, the dialog box class in both UIs directly manipulates the DOM with 
> jQuery. This is problematic when using a framework like Angular because it 
> causes a disconnect with how Angular handles and tracks DOM changes. We also 
> don't take advantage of Angular's rendering engine.
> The dialog box can and should be implemented as a component and a singleton 
> service (since we would never want to launch more than one modal at a time).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to