Add flag for source indexing

This commit is contained in:
Aaron Caldwell 2019-04-01 08:18:40 -06:00
parent 8b2e7c84f8
commit 0e131b1c05
3 changed files with 16 additions and 1 deletions

View file

@ -21,6 +21,7 @@ import {
EuiFlyoutFooter,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { triggerIndexing } from '../../../../file_upload/public/';
import _ from 'lodash';
export class AddLayerPanel extends Component {
@ -67,8 +68,14 @@ export class AddLayerPanel extends Component {
iconSide="right"
iconType={'sortRight'}
onClick={() => {
const layerSource = this.state.layer.getSource();
const boolIndexLayer = layerSource.shouldBeIndexed();
this.setState({ layer: null });
selectLayerAndAdd();
if (boolIndexLayer) {
triggerIndexing();
} else {
selectLayerAndAdd();
}
}}
fill
>

View file

@ -63,4 +63,8 @@ export class GeojsonFileSource extends AbstractVectorSource {
return true;
}
shouldBeIndexed() {
return true;
}
}

View file

@ -102,6 +102,10 @@ export class AbstractSource {
isJoinable() {
return false;
}
shouldBeIndexed() {
return false;
}
}