Skip to content

Commit

Permalink
[Maps] fix term join not updating when editing right field
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Sep 2, 2021
1 parent f21731f commit 3fe851b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,20 @@ describe('extractPropertiesMap', () => {
expect(properties[minPropName]).toBe(0);
});
});

describe('getSyncMeta', () => {
it('should contain meta requiring source re-fetch when changed', () => {
const source = new ESTermSource({
id: '1234',
indexPatternTitle: indexPatternTitle,
term: termFieldName,
indexPatternId: 'foobar',
size: 10,
});
expect(source.getSyncMeta()).toEqual({
indexPatternId: 'foobar',
size: 10,
term: 'myTermField',
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ export class ESTermSource extends AbstractESAggSource implements ITermJoinSource
}

getSyncMeta(): VectorSourceSyncMeta | null {
return this._descriptor.size !== undefined
? {
size: this._descriptor.size,
}
: null;
return {
indexPatternId: this._descriptor.indexPatternId,
term: this._descriptor.term,
size: this._descriptor.size,
};
}

getRightFields(): IField[] {
Expand Down

0 comments on commit 3fe851b

Please sign in to comment.