[Maps] Handle cross cluster index _settings resp (#66797)
This commit is contained in:
parent
ab2600f823
commit
8dc8aa0c64
|
@ -29,5 +29,9 @@ export function getIndexPatternSettings(indicesSettingsResp) {
|
|||
maxInnerResultWindow = Math.min(indexMaxInnerResultWindow, indexMaxResultWindow);
|
||||
});
|
||||
|
||||
return { maxResultWindow, maxInnerResultWindow };
|
||||
return {
|
||||
maxResultWindow: maxResultWindow === Infinity ? DEFAULT_MAX_RESULT_WINDOW : maxResultWindow,
|
||||
maxInnerResultWindow:
|
||||
maxInnerResultWindow === Infinity ? DEFAULT_MAX_INNER_RESULT_WINDOW : maxInnerResultWindow,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -24,6 +24,14 @@ describe('max_result_window and max_inner_result_window are not set', () => {
|
|||
expect(maxInnerResultWindow).toBe(DEFAULT_MAX_INNER_RESULT_WINDOW);
|
||||
});
|
||||
|
||||
test('Should provide default values from cross cluster index response', () => {
|
||||
// _settings returns empty object for cross cluster index
|
||||
const indicesSettingsResp = {};
|
||||
const { maxResultWindow, maxInnerResultWindow } = getIndexPatternSettings(indicesSettingsResp);
|
||||
expect(maxResultWindow).toBe(DEFAULT_MAX_RESULT_WINDOW);
|
||||
expect(maxInnerResultWindow).toBe(DEFAULT_MAX_INNER_RESULT_WINDOW);
|
||||
});
|
||||
|
||||
test('Should include default values when providing minimum values for indices in index pattern', () => {
|
||||
const indicesSettingsResp = {
|
||||
kibana_sample_data_logs: {
|
||||
|
|
Loading…
Reference in a new issue