Merge pull request #5723 from mistercrunch/fix_autocomplete_filters

[table editor] fix 'Autocomplete filters' checkbox doesn't stick
This commit is contained in:
Beto Dealmeida 2018-08-27 16:22:33 -07:00 committed by GitHub
commit 19062ed50e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 4 deletions

View File

@ -329,7 +329,7 @@ export class DatasourceEditor extends React.PureComponent {
control={<TextControl />} control={<TextControl />}
/> />
<Field <Field
fieldKey="filter_select" fieldKey="filter_select_enabled"
label={t('Autocomplete filters')} label={t('Autocomplete filters')}
descr={t('Whether to populate autocomplete filters options')} descr={t('Whether to populate autocomplete filters options')}
control={<CheckboxControl />} control={<CheckboxControl />}

View File

@ -188,7 +188,8 @@ class BaseDatasource(AuditMixinNullable, ImportMixin):
'description': self.description, 'description': self.description,
'database': self.database.data, # pylint: disable=no-member 'database': self.database.data, # pylint: disable=no-member
'default_endpoint': self.default_endpoint, 'default_endpoint': self.default_endpoint,
'filter_select': self.filter_select_enabled, 'filter_select': self.filter_select_enabled, # TODO deprecate
'filter_select_enabled': self.filter_select_enabled,
'name': self.name, 'name': self.name,
'datasource_name': self.datasource_name, 'datasource_name': self.datasource_name,
'type': self.type, 'type': self.type,

View File

@ -488,6 +488,7 @@ class DruidDatasource(Model, BaseDatasource):
export_fields = ( export_fields = (
'datasource_name', 'is_hidden', 'description', 'default_endpoint', 'datasource_name', 'is_hidden', 'description', 'default_endpoint',
'cluster_name', 'offset', 'cache_timeout', 'params', 'cluster_name', 'offset', 'cache_timeout', 'params',
'filter_select_enabled',
) )
update_from_object_fields = export_fields update_from_object_fields = export_fields

View File

@ -287,7 +287,7 @@ class SqlaTable(Model, BaseDatasource):
export_fields = ( export_fields = (
'table_name', 'main_dttm_col', 'description', 'default_endpoint', 'table_name', 'main_dttm_col', 'description', 'default_endpoint',
'database_id', 'offset', 'cache_timeout', 'schema', 'database_id', 'offset', 'cache_timeout', 'schema',
'sql', 'params', 'template_params') 'sql', 'params', 'template_params', 'filter_select_enabled')
update_from_object_fields = [ update_from_object_fields = [
f for f in export_fields if f not in ('table_name', 'database_id')] f for f in export_fields if f not in ('table_name', 'database_id')]
export_parent = 'database' export_parent = 'database'

View File

@ -10,7 +10,7 @@ datasource_post = {
'column_formats': {'ratio': '.2%'}, 'column_formats': {'ratio': '.2%'},
'description': 'Adding a DESCRip', 'description': 'Adding a DESCRip',
'default_endpoint': '', 'default_endpoint': '',
'filter_select': True, 'filter_select_enabled': True,
'name': 'birth_names', 'name': 'birth_names',
'datasource_name': 'birth_names', 'datasource_name': 'birth_names',
'type': 'table', 'type': 'table',