mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
refactor: Migrate react-select to Antd Select in Metrics and Filters popovers (#12042)
* Migrate react-select to Antd select in Metrics popover * Fix tests * Migrate react-select to Antd select in Filters popover * Migrate SelectControl to Antd Select * Add label with number of options left
This commit is contained in:
committed by
GitHub
parent
8bda6b0bd9
commit
794d318989
@@ -28,9 +28,9 @@ import AdhocMetricEditPopover from 'src/explore/components/AdhocMetricEditPopove
|
||||
import { AGGREGATES } from 'src/explore/constants';
|
||||
|
||||
const columns = [
|
||||
{ type: 'VARCHAR(255)', column_name: 'source' },
|
||||
{ type: 'VARCHAR(255)', column_name: 'target' },
|
||||
{ type: 'DOUBLE', column_name: 'value' },
|
||||
{ type: 'VARCHAR(255)', column_name: 'source', id: 1 },
|
||||
{ type: 'VARCHAR(255)', column_name: 'target', id: 2 },
|
||||
{ type: 'DOUBLE', column_name: 'value', id: 3 },
|
||||
];
|
||||
|
||||
const sumValueAdhocMetric = new AdhocMetric({
|
||||
@@ -68,7 +68,7 @@ describe('AdhocMetricEditPopover', () => {
|
||||
|
||||
it('overwrites the adhocMetric in state with onColumnChange', () => {
|
||||
const { wrapper } = setup();
|
||||
wrapper.instance().onColumnChange(columns[0]);
|
||||
wrapper.instance().onColumnChange(columns[0].id);
|
||||
expect(wrapper.state('adhocMetric')).toEqual(
|
||||
sumValueAdhocMetric.duplicateWith({ column: columns[0] }),
|
||||
);
|
||||
@@ -95,7 +95,7 @@ describe('AdhocMetricEditPopover', () => {
|
||||
expect(wrapper.find(Button).find({ disabled: true })).not.toExist();
|
||||
wrapper.instance().onColumnChange(null);
|
||||
expect(wrapper.find(Button).find({ disabled: true })).toExist();
|
||||
wrapper.instance().onColumnChange({ column: columns[0] });
|
||||
wrapper.instance().onColumnChange(columns[0].id);
|
||||
expect(wrapper.find(Button).find({ disabled: true })).not.toExist();
|
||||
wrapper.instance().onAggregateChange(null);
|
||||
expect(wrapper.find(Button).find({ disabled: true })).toExist();
|
||||
@@ -104,7 +104,7 @@ describe('AdhocMetricEditPopover', () => {
|
||||
it('highlights save if changes are present', () => {
|
||||
const { wrapper } = setup();
|
||||
expect(wrapper.find(Button).find({ buttonStyle: 'primary' })).not.toExist();
|
||||
wrapper.instance().onColumnChange({ column: columns[1] });
|
||||
wrapper.instance().onColumnChange(columns[1].id);
|
||||
expect(wrapper.find(Button).find({ buttonStyle: 'primary' })).toExist();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user