mirror of
https://github.com/apache/superset.git
synced 2026-05-21 15:55:10 +00:00
Compare commits
6 Commits
fix/playwr
...
v2021.21.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7298a70c18 | ||
|
|
d91f69690a | ||
|
|
8a94d26e03 | ||
|
|
d053db07a7 | ||
|
|
f40604f94c | ||
|
|
3c16d6fcff |
@@ -70,8 +70,8 @@ describe('Dashboard filter', () => {
|
|||||||
}
|
}
|
||||||
expect(requestFilter).deep.eq({
|
expect(requestFilter).deep.eq({
|
||||||
col: 'region',
|
col: 'region',
|
||||||
op: '==',
|
op: 'IN',
|
||||||
val: 'South Asia',
|
val: ['South Asia'],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -121,8 +121,8 @@ describe('Dashboard tabs', () => {
|
|||||||
const requestParams = JSON.parse(requestBody.form_data as string);
|
const requestParams = JSON.parse(requestBody.form_data as string);
|
||||||
expect(requestParams.extra_filters[0]).deep.eq({
|
expect(requestParams.extra_filters[0]).deep.eq({
|
||||||
col: 'region',
|
col: 'region',
|
||||||
op: '==',
|
op: 'IN',
|
||||||
val: 'South Asia',
|
val: ['South Asia'],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -136,8 +136,8 @@ describe('Dashboard tabs', () => {
|
|||||||
const requestParams = JSON.parse(requestBody.form_data as string);
|
const requestParams = JSON.parse(requestBody.form_data as string);
|
||||||
expect(requestParams.extra_filters[0]).deep.eq({
|
expect(requestParams.extra_filters[0]).deep.eq({
|
||||||
col: 'region',
|
col: 'region',
|
||||||
op: '==',
|
op: 'IN',
|
||||||
val: 'South Asia',
|
val: ['South Asia'],
|
||||||
});
|
});
|
||||||
expect(requestParams.viz_type).eq(LINE_CHART.viz);
|
expect(requestParams.viz_type).eq(LINE_CHART.viz);
|
||||||
});
|
});
|
||||||
@@ -150,8 +150,8 @@ describe('Dashboard tabs', () => {
|
|||||||
cy.wait('@v1ChartData').then(({ request }) => {
|
cy.wait('@v1ChartData').then(({ request }) => {
|
||||||
expect(request.body.queries[0].filters[0]).deep.eq({
|
expect(request.body.queries[0].filters[0]).deep.eq({
|
||||||
col: 'region',
|
col: 'region',
|
||||||
op: '==',
|
op: 'IN',
|
||||||
val: 'South Asia',
|
val: ['South Asia'],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ export const antDModalNoPaddingStyles = css`
|
|||||||
.ant-modal-body {
|
.ant-modal-body {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
margin-bottom: 110px;
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import { debounce } from 'lodash';
|
|||||||
import { max as d3Max } from 'd3-array';
|
import { max as d3Max } from 'd3-array';
|
||||||
import { AsyncCreatableSelect, CreatableSelect } from 'src/components/Select';
|
import { AsyncCreatableSelect, CreatableSelect } from 'src/components/Select';
|
||||||
import Button from 'src/components/Button';
|
import Button from 'src/components/Button';
|
||||||
import { t, SupersetClient } from '@superset-ui/core';
|
import { t, SupersetClient, ensureIsArray } from '@superset-ui/core';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BOOL_FALSE_DISPLAY,
|
BOOL_FALSE_DISPLAY,
|
||||||
@@ -158,10 +158,11 @@ class FilterBox extends React.PureComponent {
|
|||||||
if (options !== null) {
|
if (options !== null) {
|
||||||
if (Array.isArray(options)) {
|
if (Array.isArray(options)) {
|
||||||
vals = options.map(opt => (typeof opt === 'string' ? opt : opt.value));
|
vals = options.map(opt => (typeof opt === 'string' ? opt : opt.value));
|
||||||
} else if (options.value) {
|
} else if (Object.values(TIME_FILTER_MAP).includes(fltr)) {
|
||||||
vals = options.value;
|
vals = options.value ?? options;
|
||||||
} else {
|
} else {
|
||||||
vals = options;
|
// must use array member for legacy extra_filters's value
|
||||||
|
vals = ensureIsArray(options.value ?? options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,36 @@ import React from 'react';
|
|||||||
import { t } from '@superset-ui/core';
|
import { t } from '@superset-ui/core';
|
||||||
import { sections } from '@superset-ui/chart-controls';
|
import { sections } from '@superset-ui/chart-controls';
|
||||||
|
|
||||||
|
const appContainer = document.getElementById('app');
|
||||||
|
const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
|
||||||
|
const druidIsActive = !!bootstrapData?.common?.conf?.DRUID_IS_ACTIVE;
|
||||||
|
const druidSection = druidIsActive
|
||||||
|
? [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
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'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
controlPanelSections: [
|
controlPanelSections: [
|
||||||
sections.legacyTimeseriesTime,
|
sections.legacyTimeseriesTime,
|
||||||
@@ -51,6 +81,8 @@ export default {
|
|||||||
description: t('Whether to include a time filter'),
|
description: t('Whether to include a time filter'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
{
|
{
|
||||||
name: 'instant_filtering',
|
name: 'instant_filtering',
|
||||||
config: {
|
config: {
|
||||||
@@ -69,41 +101,30 @@ export default {
|
|||||||
name: 'show_sqla_time_granularity',
|
name: 'show_sqla_time_granularity',
|
||||||
config: {
|
config: {
|
||||||
type: 'CheckboxControl',
|
type: 'CheckboxControl',
|
||||||
label: t('Show SQL granularity dropdown'),
|
label: druidIsActive
|
||||||
|
? t('Show SQL time grain dropdown')
|
||||||
|
: t('Show time grain dropdown'),
|
||||||
default: false,
|
default: false,
|
||||||
description: t('Check to include SQL granularity dropdown'),
|
description: druidIsActive
|
||||||
},
|
? t('Check to include SQL time grain dropdown')
|
||||||
},
|
: t('Check to include time grain 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',
|
name: 'show_sqla_time_column',
|
||||||
config: {
|
config: {
|
||||||
type: 'CheckboxControl',
|
type: 'CheckboxControl',
|
||||||
label: t('Show Druid granularity dropdown'),
|
label: druidIsActive
|
||||||
|
? t('Show SQL time column')
|
||||||
|
: t('Show time column'),
|
||||||
default: false,
|
default: false,
|
||||||
description: t('Check to include Druid granularity dropdown'),
|
description: t('Check to include time column 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'),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
...druidSection,
|
||||||
['adhoc_filters'],
|
['adhoc_filters'],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1372,7 +1372,9 @@ class BasicParametersMixin:
|
|||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_parameters_from_uri(cls, uri: str) -> BasicParametersType:
|
def get_parameters_from_uri(
|
||||||
|
cls, uri: str, encrypted_extra: Optional[Dict[str, Any]] = None
|
||||||
|
) -> BasicParametersType:
|
||||||
url = make_url(uri)
|
url = make_url(uri)
|
||||||
encryption = all(
|
encryption = all(
|
||||||
item in url.query.items() for item in cls.encryption_parameters.items()
|
item in url.query.items() for item in cls.encryption_parameters.items()
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ ma_plugin = MarshmallowPlugin()
|
|||||||
|
|
||||||
class BigQueryParametersSchema(Schema):
|
class BigQueryParametersSchema(Schema):
|
||||||
credentials_info = EncryptedField(
|
credentials_info = EncryptedField(
|
||||||
description="Contents of BigQuery JSON credentials.",
|
required=True, description="Contents of BigQuery JSON credentials.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,12 @@ class HiveEngineSpec(PrestoEngineSpec):
|
|||||||
cursor.cancel()
|
cursor.cancel()
|
||||||
break
|
break
|
||||||
|
|
||||||
log = cursor.fetch_logs() or ""
|
try:
|
||||||
|
log = cursor.fetch_logs() or ""
|
||||||
|
except Exception: # pylint: disable=broad-except
|
||||||
|
logger.warning("Call to GetLog() failed")
|
||||||
|
log = ""
|
||||||
|
|
||||||
if log:
|
if log:
|
||||||
log_lines = log.splitlines()
|
log_lines = log.splitlines()
|
||||||
progress = cls.progress(log_lines)
|
progress = cls.progress(log_lines)
|
||||||
|
|||||||
@@ -246,7 +246,8 @@ class Database(
|
|||||||
self.db_engine_spec, "get_parameters_from_uri"
|
self.db_engine_spec, "get_parameters_from_uri"
|
||||||
):
|
):
|
||||||
uri = make_url(self.sqlalchemy_uri_decrypted)
|
uri = make_url(self.sqlalchemy_uri_decrypted)
|
||||||
return {**parameters, **self.db_engine_spec.get_parameters_from_uri(uri)} # type: ignore
|
encrypted_extra = self.get_encrypted_extra()
|
||||||
|
return {**parameters, **self.db_engine_spec.get_parameters_from_uri(uri, encrypted_extra=encrypted_extra)} # type: ignore
|
||||||
|
|
||||||
return parameters
|
return parameters
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ FRONTEND_CONF_KEYS = (
|
|||||||
"SUPERSET_DASHBOARD_PERIODICAL_REFRESH_LIMIT",
|
"SUPERSET_DASHBOARD_PERIODICAL_REFRESH_LIMIT",
|
||||||
"SUPERSET_DASHBOARD_PERIODICAL_REFRESH_WARNING_MESSAGE",
|
"SUPERSET_DASHBOARD_PERIODICAL_REFRESH_WARNING_MESSAGE",
|
||||||
"DISABLE_DATASET_SOURCE_EDIT",
|
"DISABLE_DATASET_SOURCE_EDIT",
|
||||||
|
"DRUID_IS_ACTIVE",
|
||||||
"ENABLE_JAVASCRIPT_CONTROLS",
|
"ENABLE_JAVASCRIPT_CONTROLS",
|
||||||
"DEFAULT_SQLLAB_LIMIT",
|
"DEFAULT_SQLLAB_LIMIT",
|
||||||
"DEFAULT_VIZ_TYPE",
|
"DEFAULT_VIZ_TYPE",
|
||||||
|
|||||||
Reference in New Issue
Block a user