Skip to content

Commit

Permalink
fix: multiple issues with FilterPopover (apache#11412)
Browse files Browse the repository at this point in the history
* fix: Custom SQL in FilterPopover

* Also fix apache#11394

* linting

* fix tests
  • Loading branch information
mistercrunch authored and auxten committed Nov 20, 2020
1 parent 94d9de0 commit ae2d349
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('Annotations', () => {
.within(() => {
cy.get('input').type('y=1400000');
});
cy.get('button').contains('OK').click();
cy.get('button').contains('OK').click({ force: true });
});

cy.get('button[data-test="run-query-button"]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Tab, Tabs } from 'react-bootstrap';
import Button from 'src/components/Button';
import { t } from '@superset-ui/core';

import columnType from '../propTypes/columnType';
import adhocMetricType from '../propTypes/adhocMetricType';
Expand Down Expand Up @@ -178,6 +179,9 @@ export default class AdhocFilterEditPopover extends React.Component {
</Tab>
</Tabs>
<div>
<Button buttonSize="small" onClick={this.props.onClose} cta>
{t('Close')}
</Button>
<Button
data-test="adhoc-filter-edit-popover-save-button"
disabled={!stateIsValid}
Expand All @@ -189,10 +193,7 @@ export default class AdhocFilterEditPopover extends React.Component {
onClick={this.onSave}
cta
>
Save
</Button>
<Button buttonSize="small" onClick={this.props.onClose} cta>
Close
{t('Save')}
</Button>
<i
role="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class AdhocFilterEditPopoverSqlTabContent extends React.Component
onSqlExpressionClauseChange(clause) {
this.props.onChange(
this.props.adhocFilter.duplicateWith({
clause: clause && clause.clause,
clause,
expressionType: EXPRESSION_TYPES.SQL,
}),
);
Expand Down Expand Up @@ -123,9 +123,9 @@ export default class AdhocFilterEditPopoverSqlTabContent extends React.Component
className="filter-edit-clause-dropdown"
/>
<span className="filter-edit-clause-info">
<strong>Where</strong> filters by columns.
<strong>WHERE</strong> {t('filters by columns')}
<br />
<strong>Having</strong> filters by metrics.
<strong>HAVING</strong> {t('filters by metrics')}
</span>
</FormGroup>
<FormGroup>
Expand Down

0 comments on commit ae2d349

Please sign in to comment.