mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
The time granularity currently does not show up in table viz. Now defining a granularity will add an extra ISO-formatted time column in the table. The column will be added for both grouped by and not grouped by.
This commit is contained in:
@@ -4,6 +4,9 @@ import Select from 'react-select';
|
||||
import { Button, Row, Col } from 'react-bootstrap';
|
||||
import SelectControl from './SelectControl';
|
||||
|
||||
const arrayFilterOps = ['in', 'not in'];
|
||||
const strFilterOps = ['==', '!=', '>', '<', '>=', '<=', 'regex'];
|
||||
|
||||
const propTypes = {
|
||||
choices: PropTypes.array,
|
||||
changeFilter: PropTypes.func,
|
||||
@@ -55,6 +58,15 @@ export default class Filter extends React.Component {
|
||||
if (event && event.value) {
|
||||
value = event.value;
|
||||
}
|
||||
if (control === 'op') {
|
||||
if (arrayFilterOps.indexOf(this.props.filter.op) !== -1
|
||||
&& strFilterOps.indexOf(value) !== -1) {
|
||||
this.props.changeFilter('val', this.props.filter.val[0]);
|
||||
} else if (strFilterOps.indexOf(this.props.filter.op) !== -1
|
||||
&& arrayFilterOps.indexOf(value) !== -1) {
|
||||
this.props.changeFilter('val', [this.props.filter.val]);
|
||||
}
|
||||
}
|
||||
this.props.changeFilter(control, value);
|
||||
if (control === 'col' && value !== null && this.props.datasource.filter_select) {
|
||||
this.fetchFilterValues(value);
|
||||
@@ -70,13 +82,13 @@ export default class Filter extends React.Component {
|
||||
this.fetchFilterValues(filter.col);
|
||||
}
|
||||
}
|
||||
if (this.props.having) {
|
||||
// druid having filter
|
||||
if (this.props.having || StrFilterOps.indexOf(filter.op) !== -1) {
|
||||
// druid having filter or regex/==/!= filters
|
||||
return (
|
||||
<input
|
||||
type="text"
|
||||
onChange={this.changeFilter.bind(this, 'val')}
|
||||
value={filter.value}
|
||||
value={filter.val}
|
||||
className="form-control input-sm"
|
||||
placeholder="Filter value"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user