tiborm commented on a change in pull request #1375: METRON-2060 Improving 
Alerts table config pane
URL: https://github.com/apache/metron/pull/1375#discussion_r274316330
 
 

 ##########
 File path: 
metron-interface/metron-alerts/src/app/alerts/configure-table/configure-table.component.ts
 ##########
 @@ -165,21 +168,18 @@ export class ConfigureTableComponent implements OnInit, 
AfterViewInit {
   }
 
   save() {
-    let selectedColumns = this.allColumns.filter((mDataWrapper: 
ColumnMetadataWrapper) => mDataWrapper.selected)
-                          .map((mDataWrapper: ColumnMetadataWrapper) => 
mDataWrapper.columnMetadata);
-
-    
this.configureTableService.saveColumnMetaData(selectedColumns).subscribe(() => {
-      this.saveColumnNames();
-    }, error => {
-      console.log('Unable to save column preferences ...');
-      this.saveColumnNames();
-    });
-
-
+    this.configureTableService.saveColumnMetaData(
+      this.visibleColumns.map(columnMetaWrapper => 
columnMetaWrapper.columnMetadata))
+      .subscribe(() => {
+        this.saveColumnNames();
+      }, error => {
+        console.log('Unable to save column preferences ...');
 
 Review comment:
   I haven't touched this part of the code, only a few lines above. By theory, 
we could remove console.log statements or bind them to isDevMode(), but hence 
console.logs are everywhere in the code I think we just make it inconsistent.
   
   This code part hasn't used frequently so am not expecting any performance 
impact. But if you have other concerns let me know!

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to