mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Preserve rawData to fix filtering on split tables. (#33886)
When the legacy response handler was created specifically for table vis, `rawData` was no longer attached to the `AggConfigResult`s returned from the handler. This caused filtering on individual table cells to fail when using split rows/tables, because `vis_filters` could not find the `rawData` it needed to generate the filter. This issue only affects 6.6/6.7, as the response handler was removed in subsequent versions. Fixes #32529.
This commit is contained in:
parent
20c9530e39
commit
03d92314d5
2 changed files with 15 additions and 0 deletions
|
@ -128,6 +128,16 @@ describe('Table Vis Legacy Response Handler', () => {
|
|||
expect(actual.map(i => i.title)).to.eql(expected);
|
||||
});
|
||||
|
||||
it('should return the correct rawData', () => {
|
||||
const expected = {
|
||||
table: { columns, rows },
|
||||
column: 0,
|
||||
row: -1,
|
||||
};
|
||||
const actual = splitTable(columns, rows, null);
|
||||
expect(actual.map(i => i.$parent.rawData)).to.eql([expected, expected, expected]);
|
||||
});
|
||||
|
||||
it('should return nested split tables with the correct number of entries', () => {
|
||||
const expected = [2, 1, 3];
|
||||
const actual = splitTable(columns, rows, null);
|
||||
|
|
|
@ -89,6 +89,11 @@ export function splitTable(columns, rows, $parent) {
|
|||
|
||||
return splitRows.results.map(splitValue => {
|
||||
const $newParent = new AggConfigResult(splitColumn.aggConfig, $parent, splitValue, splitValue);
|
||||
$newParent.rawData = {
|
||||
table: { columns, rows },
|
||||
column: splitColumnIndex,
|
||||
row: -1, // For split buckets, we don't need the actual row for filters, just the provided value.
|
||||
};
|
||||
return {
|
||||
$parent: $newParent,
|
||||
aggConfig: splitColumn.aggConfig,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue