You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by mm...@apache.org on 2018/07/11 01:32:56 UTC

[40/50] [abbrv] metron git commit: METRON-1631 Alerts UI: Dash score does not show if only filtering by one group (sardell via merrimanr) closes apache/metron#1079

METRON-1631 Alerts UI: Dash score does not show if only filtering by one group (sardell via merrimanr) closes apache/metron#1079


Project: http://git-wip-us.apache.org/repos/asf/metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/be9a9219
Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/be9a9219
Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/be9a9219

Branch: refs/heads/feature/METRON-1554-pcap-query-panel
Commit: be9a9219875f8c6a2b0c07aa7b2d62484983d932
Parents: 55d46b0
Author: sardell <sa...@hortonworks.com>
Authored: Fri Jun 29 09:49:24 2018 -0500
Committer: rmerriman <me...@gmail.com>
Committed: Fri Jun 29 09:49:24 2018 -0500

----------------------------------------------------------------------
 .../src/app/alerts/alerts-list/alerts-list.component.html    | 5 +++--
 .../src/app/alerts/alerts-list/alerts-list.component.ts      | 2 ++
 .../app/alerts/alerts-list/tree-view/tree-view.component.ts  | 8 ++------
 3 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/metron/blob/be9a9219/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.html
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.html b/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.html
index 77f24d5..2a1802c 100644
--- a/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.html
+++ b/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.html
@@ -80,7 +80,7 @@
         </div>
         <div class="col-xs-12 px-0">
             <app-table-view #dataViewComponent
-                            [alerts]="alerts" *ngIf="getGroupRequest().groups.length === 0"
+                            [alerts]="alerts" *ngIf="groups.length === 0"
                             [queryBuilder]="queryBuilder"
                             [pagination]="pagination"
                             [alertsColumnsToDisplay]="alertsColumnsToDisplay"
@@ -90,11 +90,12 @@
                             (onRefreshData)="onRefreshData($event)"
                             (onShowDetails)="showDetails($event)"
                             (onSelectedAlertsChange)="onSelectedAlertsChange($event)"></app-table-view>
-            <app-tree-view #dataViewComponent *ngIf="getGroupRequest().groups.length !== 0"
+            <app-tree-view #dataViewComponent *ngIf="groups.length !== 0"
                            [alerts]="alerts"
                            [queryBuilder]="queryBuilder"
                            [alertsColumnsToDisplay]="alertsColumnsToDisplay"
                            [selectedAlerts]="selectedAlerts"
+                           [globalConfig]="globalConfig"
                            (onResize)="onResize()"
                            (onAddFilter)="onAddFilter($event)"
                            (onRefreshData)="onRefreshData($event)"

http://git-wip-us.apache.org/repos/asf/metron/blob/be9a9219/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts b/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
index ca1bd50..15a87a4 100644
--- a/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
+++ b/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
@@ -77,6 +77,7 @@ export class AlertsListComponent implements OnInit, OnDestroy {
   groupFacets: Facets;
   globalConfig: {} = {};
   configSubscription: Subscription;
+  groups = [];
 
   constructor(private router: Router,
               private searchService: SearchService,
@@ -239,6 +240,7 @@ export class AlertsListComponent implements OnInit, OnDestroy {
   }
 
   onGroupsChange(groups) {
+    this.groups = groups;
     this.queryBuilder.setGroupby(groups);
     this.search();
   }

http://git-wip-us.apache.org/repos/asf/metron/blob/be9a9219/metron-interface/metron-alerts/src/app/alerts/alerts-list/tree-view/tree-view.component.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/alerts/alerts-list/tree-view/tree-view.component.ts b/metron-interface/metron-alerts/src/app/alerts/alerts-list/tree-view/tree-view.component.ts
index 9a7c78c..7b2e62c 100644
--- a/metron-interface/metron-alerts/src/app/alerts/alerts-list/tree-view/tree-view.component.ts
+++ b/metron-interface/metron-alerts/src/app/alerts/alerts-list/tree-view/tree-view.component.ts
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-import { Component, OnInit, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
+import { Component, OnInit, OnChanges, SimpleChanges, OnDestroy, Input } from '@angular/core';
 import {Router} from '@angular/router';
 import {Subscription, Observable} from 'rxjs/Rx';
 
@@ -47,12 +47,12 @@ import { GlobalConfigService } from '../../../service/global-config.service';
 
 export class TreeViewComponent extends TableViewComponent implements OnInit, OnChanges, OnDestroy {
 
+  @Input() globalConfig: {} = {};
   groupByFields: string[] = [];
   topGroups: TreeGroupData[] = [];
   groupResponse: GroupResponse = new GroupResponse();
   treeGroupSubscriptionMap: {[key: string]: TreeAlertsSubscription } = {};
   alertsChangedSubscription: Subscription;
-  globalConfig: {} = {};
   configSubscription: Subscription;
 
   constructor(router: Router,
@@ -186,14 +186,10 @@ export class TreeViewComponent extends TableViewComponent implements OnInit, OnC
 
   ngOnInit() {
     this.addAlertChangedListner();
-    this.configSubscription = this.globalConfigService.get().subscribe((config: {}) => {
-      this.globalConfig = config;
-    });
   }
 
   ngOnDestroy(): void {
     this.removeAlertChangedLister();
-    this.configSubscription.unsubscribe();
   }
 
   searchGroup(selectedGroup: TreeGroupData, searchRequest: SearchRequest): Subscription {