Skip to content

Commit

Permalink
Timelion graph is not refreshing content after searching or filtering (
Browse files Browse the repository at this point in the history
…#67023) (#67106)

* Timelion graph is not refreshing content after searching or filtering in Kibana

Closes #66560

* Change test beforeEach configuration to match request body

* Remove unused TimelionRequestQuery
  • Loading branch information
DianaDerevyankina authored May 20, 2020
1 parent c3a7efd commit ad45d6a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
24 changes: 0 additions & 24 deletions src/plugins/timelion/server/routes/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,6 @@ import { ConfigManager } from '../lib/config_manager';

const timelionDefaults = getNamespacesSettings();

export interface TimelionRequestQuery {
payload: {
sheet: string[];
extended?: {
es: {
filter: {
bool: {
filter: string[] | object;
must: string[];
should: string[];
must_not: string[];
};
};
};
};
};
time?: {
from?: string;
interval: string;
timezone: string;
to?: string;
};
}

export function runRoute(
router: IRouter,
{
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/timelion/server/series_functions/es/es.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ describe('es', () => {
to: 5,
},
request: {
payload: {
body: {
extended: {
es: {
filter: {
Expand All @@ -258,7 +258,7 @@ describe('es', () => {
});
});

it('adds the contents of payload.extended.es.filter to a filter clause of the bool', () => {
it('adds the contents of body.extended.es.filter to a filter clause of the bool', () => {
config.kibana = true;
const request = fn(config, tlConfig, emptyScriptedFields);
const filter = request.body.query.bool.filter.bool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function buildRequest(config, tlConfig, scriptedFields, timeout)

// Use the kibana filter bar filters
if (config.kibana) {
bool.filter = _.get(tlConfig, 'request.payload.extended.es.filter');
bool.filter = _.get(tlConfig, 'request.body.extended.es.filter');
}

const aggs = {
Expand Down
1 change: 0 additions & 1 deletion src/plugins/timelion/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@
*/

export { TimelionFunctionInterface, TimelionFunctionConfig } from './lib/classes/timelion_function';
export { TimelionRequestQuery } from './routes/run';

0 comments on commit ad45d6a

Please sign in to comment.