[TSVB] fix not populating fields list if "Auto apply" is off (#96298)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
1a7095365a
commit
198be4cb8c
|
@ -97,19 +97,6 @@ export class VisEditor extends Component<TimeseriesEditorProps, TimeseriesEditor
|
|||
this.props.eventEmitter.emit('dirtyStateChange', {
|
||||
isDirty: false,
|
||||
});
|
||||
|
||||
const extractedIndexPatterns = extractIndexPatternValues(
|
||||
this.state.model,
|
||||
this.state.defaultIndex
|
||||
);
|
||||
if (!isEqual(this.state.extractedIndexPatterns, extractedIndexPatterns)) {
|
||||
this.abortableFetchFields(extractedIndexPatterns).then((visFields) => {
|
||||
this.setState({
|
||||
visFields,
|
||||
extractedIndexPatterns,
|
||||
});
|
||||
});
|
||||
}
|
||||
}, VIS_STATE_DEBOUNCE_DELAY);
|
||||
|
||||
abortableFetchFields = (extractedIndexPatterns: IndexPatternValue[]) => {
|
||||
|
@ -124,10 +111,6 @@ export class VisEditor extends Component<TimeseriesEditorProps, TimeseriesEditor
|
|||
return;
|
||||
}
|
||||
const hasTypeChanged = partialModel.type && this.state.model.type !== partialModel.type;
|
||||
const nextModel = {
|
||||
...this.state.model,
|
||||
...partialModel,
|
||||
};
|
||||
let dirty = true;
|
||||
if (this.state.autoApply || hasTypeChanged) {
|
||||
this.updateVisState();
|
||||
|
@ -135,6 +118,20 @@ export class VisEditor extends Component<TimeseriesEditorProps, TimeseriesEditor
|
|||
dirty = false;
|
||||
}
|
||||
|
||||
const nextModel = {
|
||||
...this.state.model,
|
||||
...partialModel,
|
||||
};
|
||||
const extractedIndexPatterns = extractIndexPatternValues(nextModel, this.state.defaultIndex);
|
||||
if (!isEqual(this.state.extractedIndexPatterns, extractedIndexPatterns)) {
|
||||
this.abortableFetchFields(extractedIndexPatterns).then((visFields) => {
|
||||
this.setState({
|
||||
visFields,
|
||||
extractedIndexPatterns,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.setState({
|
||||
dirty,
|
||||
model: nextModel,
|
||||
|
|
Loading…
Reference in a new issue