Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: multiple issues with FilterPopover #11412

Merged
merged 4 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2020-10-23 at 6 34 01 PM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bycatch, random cypress/CI failure

});

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>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n, flip button (Save to the right and primary)

{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