From bf0fa84bbcebda9f964fb1d11f3db23cd3720d4d Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Thu, 26 Mar 2020 09:28:09 -0700 Subject: [PATCH] =?UTF-8?q?migrating=20controls=20=F0=9F=8E=9B=20(#9386)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 3 -- .../src/explore/controlPanels/PivotTable.js | 42 +++++++++++++++++-- superset-frontend/src/explore/controls.jsx | 25 ----------- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14308c806266..8ebb3239f203 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1097,7 +1097,6 @@ Note the `y_axis_format` is defined under various section for some charts. | `collapsed_fieldsets` | _N/A_ | | | `color_pn` | _N/A_ | | | `column_collection` | _N/A_ | | -| `combine_metric` | _N/A_ | | | `comparison type` | _N/A_ | | | `contribution` | _N/A_ | | | `country_fieldtype` | _N/A_ | | @@ -1166,7 +1165,6 @@ Note the `y_axis_format` is defined under various section for some charts. | `partition_threshold` | _N/A_ | | | `period_ratio_type` | _N/A_ | | | `perm` | _N/A_ | | -| `pivot_margins` | _N/A_ | | | `point_radius` | _N/A_ | | | `point_radius_fixed` | _N/A_ | | | `point_radius_unit` | _N/A_ | | @@ -1217,7 +1215,6 @@ Note the `y_axis_format` is defined under various section for some charts. | `time_series_option` | _N/A_ | | | `timed_refresh_immune_slices` | _N/A_ | | | `toggle_polygons` | _N/A_ | | -| `transpose_pivot` | _N/A_ | | | `url` | _N/A_ | | | `userid` | _N/A_ | | | `viewport` | _N/A_ | | diff --git a/superset-frontend/src/explore/controlPanels/PivotTable.js b/superset-frontend/src/explore/controlPanels/PivotTable.js index 4ed26fa330e1..5451f0cce809 100644 --- a/superset-frontend/src/explore/controlPanels/PivotTable.js +++ b/superset-frontend/src/explore/controlPanels/PivotTable.js @@ -34,9 +34,45 @@ export default { { label: t('Pivot Options'), controlSetRows: [ - ['pandas_aggfunc', 'pivot_margins'], - ['number_format', 'combine_metric'], - ['transpose_pivot'], + [ + 'pandas_aggfunc', + { + name: 'pivot_margins', + config: { + type: 'CheckboxControl', + label: t('Show totals'), + renderTrigger: false, + default: true, + description: t('Display total row/column'), + }, + }, + ], + [ + 'number_format', + { + name: 'combine_metric', + config: { + type: 'CheckboxControl', + label: t('Combine Metrics'), + default: false, + description: t( + 'Display metrics side by side within each column, as ' + + 'opposed to each column being displayed side by side for each metric.', + ), + }, + }, + ], + [ + { + name: 'transpose_pivot', + config: { + type: 'CheckboxControl', + label: t('Transpose Pivot'), + default: false, + description: t('Swap Groups and Columns'), + }, + }, + ], ], }, ], diff --git a/superset-frontend/src/explore/controls.jsx b/superset-frontend/src/explore/controls.jsx index 18a90cff373f..15c54a0dcadf 100644 --- a/superset-frontend/src/explore/controls.jsx +++ b/superset-frontend/src/explore/controls.jsx @@ -442,21 +442,6 @@ export const controls = { description: null, }, - pivot_margins: { - type: 'CheckboxControl', - label: t('Show totals'), - renderTrigger: false, - default: true, - description: t('Display total row/column'), - }, - - transpose_pivot: { - type: 'CheckboxControl', - label: t('Transpose Pivot'), - default: false, - description: t('Swap Groups and Columns'), - }, - show_markers: { type: 'CheckboxControl', label: t('Show Markers'), @@ -481,16 +466,6 @@ export const controls = { description: t('Sort bars by x labels.'), }, - combine_metric: { - type: 'CheckboxControl', - label: t('Combine Metrics'), - default: false, - description: t( - 'Display metrics side by side within each column, as ' + - 'opposed to each column being displayed side by side for each metric.', - ), - }, - show_controls: { type: 'CheckboxControl', label: t('Extra Controls'),