metron-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject metron git commit: METRON-1586 Defaulting for the source type field in alerts UI does not work (merrimanr via justinleet) closes apache/metron#1038
Date Thu, 31 May 2018 12:58:18 GMT
Repository: metron
Updated Branches:
  refs/heads/master 3a3bba47c -> 63cd41433


METRON-1586 Defaulting for the source type field in alerts UI does not work (merrimanr via
justinleet) closes apache/metron#1038


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

Branch: refs/heads/master
Commit: 63cd4143345002e152b731e533a689eb6d308f5d
Parents: 3a3bba4
Author: merrimanr <merrimanr@gmail.com>
Authored: Thu May 31 08:57:21 2018 -0400
Committer: leet <leet@apache.org>
Committed: Thu May 31 08:57:21 2018 -0400

----------------------------------------------------------------------
 .../src/app/service/global-config.service.ts              | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/metron/blob/63cd4143/metron-interface/metron-alerts/src/app/service/global-config.service.ts
----------------------------------------------------------------------
diff --git a/metron-interface/metron-alerts/src/app/service/global-config.service.ts b/metron-interface/metron-alerts/src/app/service/global-config.service.ts
index cdb8b34..b84cd42 100644
--- a/metron-interface/metron-alerts/src/app/service/global-config.service.ts
+++ b/metron-interface/metron-alerts/src/app/service/global-config.service.ts
@@ -33,17 +33,17 @@ export class GlobalConfigService {
     return this.http.get(this.url , new RequestOptions({headers: new Headers(this.defaultHeaders)}))
       .map((res: Response): any => {
         let body = res.json();
-        this.setDefaultSourceType(body);
-        return body || {};
+        let globalConfig = this.setDefaultSourceType(body);
+        return globalConfig || {};
       })
       .catch(HttpUtil.handleError);
   }
 
   private setDefaultSourceType(globalConfig) {
-    let sourceType: {} = {};
     if(!globalConfig['source.type.field']) {
-      sourceType = Object.assign({}, globalConfig, {'source.type.field': 'source:type'});
-      return sourceType;
+      return Object.assign({}, globalConfig, {'source.type.field': 'source:type'});
+    } else {
+      return globalConfig;
     }
   }
 


Mime
View raw message