You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2023/07/08 00:01:18 UTC

[superset] branch 2.1 updated: fix(plugin-chart-handlebars): Fix TypeError when using handlebars columns raw mode (#23801)

This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new b4b1a60d51 fix(plugin-chart-handlebars): Fix TypeError when using handlebars columns raw mode (#23801)
b4b1a60d51 is described below

commit b4b1a60d514e6bf6143794a2581f03177fa3cfd9
Author: Felix <fm...@users.noreply.github.com>
AuthorDate: Mon May 15 18:01:31 2023 +0200

    fix(plugin-chart-handlebars): Fix TypeError when using handlebars columns raw mode (#23801)
    
    (cherry picked from commit 422e21eb16bfbadc02b15d751b0357c729b55da2)
---
 .../plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx  | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx
index 3c2434ac40..447494714c 100644
--- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx
+++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx
@@ -66,9 +66,8 @@ const dndAllColumns: typeof sharedControls.groupby = {
     const newState: ExtraControlProps = {};
     if (datasource) {
       if (datasource?.columns[0]?.hasOwnProperty('filterable')) {
-        const options = (datasource as Dataset).columns;
-        newState.options = Object.fromEntries(
-          options.map((option: ColumnMeta) => [option.column_name, option]),
+        newState.options = (datasource as Dataset)?.columns?.filter(
+          (c: ColumnMeta) => c.filterable,
         );
       } else newState.options = datasource.columns;
     }