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/06/29 15:18:30 UTC

[GitHub] [superset] amitmiran137 commented on a change in pull request #15454: feat: group by - add ability to exclude columns

amitmiran137 commented on a change in pull request #15454:
URL: https://github.com/apache/superset/pull/15454#discussion_r660719333



##########
File path: superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx
##########
@@ -68,7 +68,15 @@ export default function PluginFilterGroupBy(props: PluginFilterGroupByProps) {
     // so we can process it like this `JSON.stringify` or start to use `Immer`
   }, [JSON.stringify(defaultValue), multiSelect]);
 
-  const columns = data || [];
+  const columns = data
+    ? formData.groupby

Review comment:
       ```suggestion
       ? formData.columnsToShow
   ```
   

##########
File path: superset-frontend/src/filters/components/GroupBy/controlPanel.ts
##########
@@ -26,6 +27,24 @@ const config: ControlPanelConfig = {
   controlPanelSections: [
     // @ts-ignore
     sections.legacyRegularTime,
+    {
+      label: t('Query'),
+      expanded: true,
+      controlSetRows: [
+        [
+          {
+            name: 'groupby',

Review comment:
       ```suggestion
               name: 'columnsToShow',
   ```
   

##########
File path: superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx
##########
@@ -68,7 +68,15 @@ export default function PluginFilterGroupBy(props: PluginFilterGroupByProps) {
     // so we can process it like this `JSON.stringify` or start to use `Immer`
   }, [JSON.stringify(defaultValue), multiSelect]);
 
-  const columns = data || [];
+  const columns = data
+    ? formData.groupby
+      ? data.filter(dataItem =>
+          // @ts-ignore
+          formData.groupby[0]?.includes(dataItem.column_name),

Review comment:
       ```suggestion
             formData.columnsToShow[0]?.includes(dataItem.column_name),
   ```
   

##########
File path: superset-frontend/src/filters/components/GroupBy/controlPanel.ts
##########
@@ -26,6 +27,24 @@ const config: ControlPanelConfig = {
   controlPanelSections: [
     // @ts-ignore
     sections.legacyRegularTime,
+    {
+      label: t('Query'),
+      expanded: true,
+      controlSetRows: [
+        [
+          {
+            name: 'groupby',
+            config: {
+              ...sharedControls.groupby,
+              label: 'Column',

Review comment:
       ```suggestion
                 label: 'Columns to show',
   ```
   




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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