fix merge conflicts (#31778)

This commit is contained in:
Nathan Reese 2019-02-22 06:18:22 -07:00 committed by GitHub
parent 6c4f23c8c0
commit 91aaf97ede
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 17 deletions

View file

@ -31,6 +31,12 @@ export class AddLayerPanel extends Component {
}
_previewLayer = (source) => {
if (!source) {
this.setState({ layer: null });
this.props.removeTransientLayer();
return;
}
this.setState({
layer: source.createDefaultLayer({})
},

View file

@ -129,13 +129,11 @@ export class CreateSourceEditor extends Component {
geoField,
requestType
} = this.state;
if (indexPatternId && geoField) {
this.props.onSelect({
indexPatternId,
geoField,
requestType: requestType.value
});
}
const sourceConfig = (indexPatternId && geoField)
? { indexPatternId, geoField, requestType: requestType.value }
: null;
this.props.onSelect(sourceConfig);
};
_onNoIndexPatterns = () => {

View file

@ -67,6 +67,11 @@ export class ESGeoGridSource extends AbstractESSource {
static renderEditor({ onPreviewSource }) {
const onSelect = (sourceConfig) => {
if (!sourceConfig) {
onPreviewSource(null);
return;
}
const sourceDescriptor = ESGeoGridSource.createDescriptor(sourceConfig);
const source = new ESGeoGridSource(sourceDescriptor);
onPreviewSource(source);

View file

@ -108,12 +108,11 @@ export class CreateSourceEditor extends Component {
indexPatternId,
geoField,
} = this.state;
if (indexPatternId && geoField) {
this.props.onSelect({
indexPatternId,
geoField,
});
}
const sourceConfig = (indexPatternId && geoField)
? { indexPatternId, geoField }
: null;
this.props.onSelect(sourceConfig);
}
_onNoIndexPatterns = () => {

View file

@ -22,12 +22,17 @@ export class ESSearchSource extends AbstractESSource {
static description = 'Geospatial data from a Kibana index pattern';
static renderEditor({ onPreviewSource }) {
const onSelect = (layerConfig) => {
const layerSource = new ESSearchSource({
const onSelect = (sourceConfig) => {
if (!sourceConfig) {
onPreviewSource(null);
return;
}
const source = new ESSearchSource({
id: uuid(),
...layerConfig
...sourceConfig
});
onPreviewSource(layerSource);
onPreviewSource(source);
};
return (<CreateSourceEditor onSelect={onSelect}/>);
}