You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/07 23:29:01 UTC

[GitHub] [superset] junlincc commented on a change in pull request #12319: fix: update search in datasource panel to use matchSorter

junlincc commented on a change in pull request #12319:
URL: https://github.com/apache/superset/pull/12319#discussion_r553652564



##########
File path: superset-frontend/src/explore/components/DatasourcePanel.tsx
##########
@@ -154,13 +155,10 @@ const DataSourcePanel = ({
       setList({ columns, metrics });
       return;
     }
-    const filteredColumns = lists.columns.filter(
-      column => column.column_name.indexOf(value) !== -1,
-    );
-    const filteredMetrics = lists.metrics.filter(
-      metric => metric.metric_name.indexOf(value) !== -1,
-    );
-    setList({ columns: filteredColumns, metrics: filteredMetrics });
+    setList({
+      columns: matchSorter(columns, value, { keys: ['column_name'] }),
+      metrics: matchSorter(metrics, value, { keys: ['metric_name'] }),

Review comment:
       do you mean searching metrics and columns properties, which users can't really see? 




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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org