Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Migrate unique FilterBox controls from controls.jsx #9566

Merged
merged 2 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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