mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
fix merge conflicts (#31778)
This commit is contained in:
parent
6c4f23c8c0
commit
91aaf97ede
5 changed files with 30 additions and 17 deletions
|
@ -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({})
|
||||
},
|
||||
|
|
|
@ -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 = () => {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 = () => {
|
||||
|
|
|
@ -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}/>);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue