+
-
- {this.props.choices.map((c) => )}
-
-
+ {selectWrap}
+
);
}
}
diff --git a/superset/assets/javascripts/explorev2/stores/store.js b/superset/assets/javascripts/explorev2/stores/store.js
index 353e12bc2a..df2c97714c 100644
--- a/superset/assets/javascripts/explorev2/stores/store.js
+++ b/superset/assets/javascripts/explorev2/stores/store.js
@@ -1278,7 +1278,7 @@ export const fields = {
},
series_height: {
- type: 'SelectCustomMultiField',
+ type: 'FreeFormSelectField',
label: 'Series Height',
default: 25,
choices: formatSelectOptions([10, 25, 40, 50, 75, 100, 150, 200]),
@@ -1286,7 +1286,7 @@ export const fields = {
},
x_axis_format: {
- type: 'SelectCustomMultiField',
+ type: 'FreeFormSelectField',
label: 'X axis format',
default: 'smart_date',
choices: TIME_STAMP_OPTIONS,
@@ -1294,7 +1294,7 @@ export const fields = {
},
y_axis_format: {
- type: 'SelectCustomMultiField',
+ type: 'FreeFormSelectField',
label: 'Y axis format',
default: '.3s',
choices: D3_TIME_FORMAT_OPTIONS,
diff --git a/superset/assets/spec/javascripts/explorev2/components/SelectField_spec.js b/superset/assets/spec/javascripts/explorev2/components/SelectField_spec.js
index 29af23f1bf..ff4ad56de2 100644
--- a/superset/assets/spec/javascripts/explorev2/components/SelectField_spec.js
+++ b/superset/assets/spec/javascripts/explorev2/components/SelectField_spec.js
@@ -1,6 +1,6 @@
/* eslint-disable no-unused-expressions */
import React from 'react';
-import { FormControl } from 'react-bootstrap';
+import Select, { Creatable } from 'react-select';
import sinon from 'sinon';
import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
@@ -21,13 +21,18 @@ describe('SelectField', () => {
wrapper = shallow();
});
- it('renders a FormControl', () => {
- expect(wrapper.find(FormControl)).to.have.lengthOf(1);
+ it('renders a Select', () => {
+ expect(wrapper.find(Select)).to.have.lengthOf(1);
});
it('calls onChange when toggled', () => {
- const select = wrapper.find(FormControl);
- select.simulate('change', { target: { value: 50 } });
+ const select = wrapper.find(Select);
+ select.simulate('change', { value: 50 });
expect(defaultProps.onChange.calledWith('row_limit', 50)).to.be.true;
});
+
+ it('renders a Creatable for freeform', () => {
+ wrapper = shallow();
+ expect(wrapper.find(Creatable)).to.have.lengthOf(1);
+ });
});