Skip to content

Commit

Permalink
chore: Migrate unique FilterBox controls from controls.jsx (#9566)
Browse files Browse the repository at this point in the history
* Migrate FilterBox controls from controls.jsx

* Linting
  • Loading branch information
villebro authored Apr 17, 2020
1 parent d8de540 commit 427d2a0
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 55 deletions.
7 changes: 0 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,6 @@ Note not all fields are correctly catagorized. The fields vary based on visualiz

| Field | Type | Notes |
| ---------------------- | --------------- | ------------------------------------- |
| `date_filter` | _N/A_ | _Deprecated?_ |
| `date_time_format` | _N/A_ | _Deprecated?_ |
| `druid_time_origin` | _string_ | The Druid **Origin** widget |
| `granularity` | _string_ | The Druid **Time Granularity** widget |
Expand Down Expand Up @@ -1101,7 +1100,6 @@ Note the `y_axis_format` is defined under various section for some charts.
| `comparison type` | _N/A_ | |
| `contribution` | _N/A_ | |
| `country_fieldtype` | _N/A_ | |
| `date_filter` | _N/A_ | |
| `default_filters` | _N/A_ | |
| `entity` | _N/A_ | |
| `expanded_slices` | _N/A_ | |
Expand All @@ -1116,7 +1114,6 @@ Note the `y_axis_format` is defined under various section for some charts.
| `flt_op_1` | _N/A_ | |
| `goto_dash` | _N/A_ | |
| `import_time` | _N/A_ | |
| `instant_filtering` | _N/A_ | |
| `label` | _N/A_ | |
| `linear_color_scheme` | _N/A_ | |
| `log_scale` | _N/A_ | |
Expand Down Expand Up @@ -1150,11 +1147,7 @@ Note the `y_axis_format` is defined under various section for some charts.
| `show_brush` | _N/A_ | |
| `show_bubbles` | _N/A_ | |
| `show_controls` | _N/A_ | |
| `show_druid_time_granularity` | _N/A_ | |
| `show_druid_time_origin` | _N/A_ | |
| `show_labels` | _N/A_ | |
| `show_sqla_time_column` | _N/A_ | |
| `show_sqla_time_granularity` | _N/A_ | |
| `show_values` | _N/A_ | |
| `slice_name` | _N/A_ | |
| `table_filter` | _N/A_ | |
Expand Down
66 changes: 63 additions & 3 deletions superset-frontend/src/explore/controlPanels/FilterBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,69 @@ export default {
controlSetRows: [
['filter_configs'],
[<hr />],
['date_filter', 'instant_filtering'],
['show_sqla_time_granularity', 'show_sqla_time_column'],
['show_druid_time_granularity', 'show_druid_time_origin'],
[
{
name: 'date_filter',
config: {
type: 'CheckboxControl',
label: t('Date Filter'),
default: true,
description: t('Whether to include a time filter'),
},
},
{
name: 'instant_filtering',
config: {
type: 'CheckboxControl',
label: t('Instant Filtering'),
renderTrigger: true,
default: true,
description:
'Whether to apply filters as they change, or wait for ' +
'users to hit an [Apply] button',
},
},
],
[
{
name: 'show_sqla_time_granularity',
config: {
type: 'CheckboxControl',
label: t('Show SQL Granularity Dropdown'),
default: false,
description: t('Check to include SQL Granularity dropdown'),
},
},
{
name: 'show_sqla_time_column',
config: {
type: 'CheckboxControl',
label: t('Show SQL Time Column'),
default: false,
description: t('Check to include Time Column dropdown'),
},
},
],
[
{
name: 'show_druid_time_granularity',
config: {
type: 'CheckboxControl',
label: t('Show Druid Granularity Dropdown'),
default: false,
description: t('Check to include Druid Granularity dropdown'),
},
},
{
name: 'show_druid_time_origin',
config: {
type: 'CheckboxControl',
label: t('Show Druid Time Origin'),
default: false,
description: t('Check to include Time Origin dropdown'),
},
},
],
['adhoc_filters'],
],
},
Expand Down
45 changes: 0 additions & 45 deletions superset-frontend/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -922,16 +922,6 @@ export const controls = {
),
},

instant_filtering: {
type: 'CheckboxControl',
label: t('Instant Filtering'),
renderTrigger: true,
default: true,
description:
'Whether to apply filters as they change, or wait for ' +
'users to hit an [Apply] button',
},

show_brush: {
type: 'SelectControl',
label: t('Show Range Filter'),
Expand All @@ -946,41 +936,6 @@ export const controls = {
description: t('Whether to display the time range interactive selector'),
},

date_filter: {
type: 'CheckboxControl',
label: t('Date Filter'),
default: true,
description: t('Whether to include a time filter'),
},

show_sqla_time_granularity: {
type: 'CheckboxControl',
label: t('Show SQL Granularity Dropdown'),
default: false,
description: t('Check to include SQL Granularity dropdown'),
},

show_sqla_time_column: {
type: 'CheckboxControl',
label: t('Show SQL Time Column'),
default: false,
description: t('Check to include Time Column dropdown'),
},

show_druid_time_granularity: {
type: 'CheckboxControl',
label: t('Show Druid Granularity Dropdown'),
default: false,
description: t('Check to include Druid Granularity dropdown'),
},

show_druid_time_origin: {
type: 'CheckboxControl',
label: t('Show Druid Time Origin'),
default: false,
description: t('Check to include Time Origin dropdown'),
},

table_filter: {
type: 'CheckboxControl',
label: t('Emit Filter Events'),
Expand Down

0 comments on commit 427d2a0

Please sign in to comment.