Skip to content

Commit

Permalink
[SIEM] Fixes map global refresh when time filter is set to an absolut…
Browse files Browse the repository at this point in the history
…e value (#47426) (#48351)

## Summary

Fixes #47410, where the map would not respond to the global refresh button when time filter is set to an absolute value.

Before Fix:
<img src="https://user-images.githubusercontent.com/2946766/66272255-83403280-e824-11e9-9525-5e8fdc5f9879.gif" width=300/>


##### After Fix:
<img src="https://user-images.githubusercontent.com/2946766/66272238-4116f100-e824-11e9-9606-62d270c4862e.gif" width=300/>




### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

- [x] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)
- [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~
- [ ] ~[Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
- [ ] ~This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~

### For maintainers

- [ ] ~This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
  • Loading branch information
XavierM authored and spong committed Oct 16, 2019
1 parent d5117ed commit 40c73a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,13 @@ describe('embedded_map_helpers', () => {
await createEmbeddable([], '', 0, 0, setQueryMock);
expect(setQueryMock).toHaveBeenCalledTimes(1);
});

test('attaches refresh action with correct reference', async () => {
const setQueryMock = jest.fn(({ id, inspect, loading, refetch }) => refetch);
const embeddable = await createEmbeddable([], '', 0, 0, setQueryMock);
expect(setQueryMock.mock.calls[0][0].refetch).not.toBe(embeddable.reload);
setQueryMock.mock.results[0].value();
expect(embeddable.reload).toHaveBeenCalledTimes(1);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const createEmbeddable = async (
id: 'embeddedMap', // Scope to page type if using map elsewhere
inspect: null,
loading: false,
refetch: embeddableObject.reload,
refetch: () => embeddableObject.reload(),
});

return embeddableObject;
Expand Down

0 comments on commit 40c73a8

Please sign in to comment.