Compare commits

...

4 Commits

Author SHA1 Message Date
Yongjie Zhao
8a94d26e03 fix: timerange in filter box error (#14890)
(cherry picked from commit acbbced20b)
2021-06-01 12:52:40 -07:00
AAfghahi
d053db07a7 margin style (#14849)
(cherry picked from commit 877201f1e0)
2021-06-01 12:52:40 -07:00
Yongjie Zhao
f40604f94c fix: filterbox apply single value (#14841)
* fix: filterbox apply single value

* fix ci

* fix e2e

(cherry picked from commit 9f54231af1)
2021-06-01 12:52:40 -07:00
Hugh A. Miles II
3c16d6fcff fix merge conflict 2021-06-01 15:48:25 -04:00
7 changed files with 19 additions and 16 deletions

View File

@@ -70,8 +70,8 @@ describe('Dashboard filter', () => {
}
expect(requestFilter).deep.eq({
col: 'region',
op: '==',
val: 'South Asia',
op: 'IN',
val: ['South Asia'],
});
});
});

View File

@@ -121,8 +121,8 @@ describe('Dashboard tabs', () => {
const requestParams = JSON.parse(requestBody.form_data as string);
expect(requestParams.extra_filters[0]).deep.eq({
col: 'region',
op: '==',
val: 'South Asia',
op: 'IN',
val: ['South Asia'],
});
});
});
@@ -136,8 +136,8 @@ describe('Dashboard tabs', () => {
const requestParams = JSON.parse(requestBody.form_data as string);
expect(requestParams.extra_filters[0]).deep.eq({
col: 'region',
op: '==',
val: 'South Asia',
op: 'IN',
val: ['South Asia'],
});
expect(requestParams.viz_type).eq(LINE_CHART.viz);
});
@@ -150,8 +150,8 @@ describe('Dashboard tabs', () => {
cy.wait('@v1ChartData').then(({ request }) => {
expect(request.body.queries[0].filters[0]).deep.eq({
col: 'region',
op: '==',
val: 'South Asia',
op: 'IN',
val: ['South Asia'],
});
});

View File

@@ -81,7 +81,6 @@ export const antDModalNoPaddingStyles = css`
.ant-modal-body {
padding-left: 0;
padding-right: 0;
margin-bottom: 110px;
}
`;

View File

@@ -22,7 +22,7 @@ import { debounce } from 'lodash';
import { max as d3Max } from 'd3-array';
import { AsyncCreatableSelect, CreatableSelect } from 'src/components/Select';
import Button from 'src/components/Button';
import { t, SupersetClient } from '@superset-ui/core';
import { t, SupersetClient, ensureIsArray } from '@superset-ui/core';
import {
BOOL_FALSE_DISPLAY,
@@ -158,10 +158,11 @@ class FilterBox extends React.PureComponent {
if (options !== null) {
if (Array.isArray(options)) {
vals = options.map(opt => (typeof opt === 'string' ? opt : opt.value));
} else if (options.value) {
vals = options.value;
} else if (Object.values(TIME_FILTER_MAP).includes(fltr)) {
vals = options.value ?? options;
} else {
vals = options;
// must use array member for legacy extra_filters's value
vals = ensureIsArray(options.value ?? options);
}
}

View File

@@ -1372,7 +1372,9 @@ class BasicParametersMixin:
)
@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)
encryption = all(
item in url.query.items() for item in cls.encryption_parameters.items()

View File

@@ -49,7 +49,7 @@ ma_plugin = MarshmallowPlugin()
class BigQueryParametersSchema(Schema):
credentials_info = EncryptedField(
description="Contents of BigQuery JSON credentials.",
required=True, description="Contents of BigQuery JSON credentials.",
)

View File

@@ -246,7 +246,8 @@ class Database(
self.db_engine_spec, "get_parameters_from_uri"
):
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