Skip to content

Commit

Permalink
[Discover] Encode context link filter part (#63831) (#66371)
Browse files Browse the repository at this point in the history
* Encode filter part of the URI for context

* Add functional test agent filter with whitespace
  • Loading branch information
kertal authored May 13, 2020
1 parent b937c66 commit ef94e02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,17 @@ export function createTableRowDirective($compile: ng.ICompileService, $httpParam
const globalFilters: any = getServices().filterManager.getGlobalFilters();
const appFilters: any = getServices().filterManager.getAppFilters();
const hash = $httpParamSerializer({
_g: rison.encode({
filters: globalFilters || [],
}),
_a: rison.encode({
columns: $scope.columns,
filters: (appFilters || []).map(esFilters.disableFilter),
}),
_g: encodeURI(
rison.encode({
filters: globalFilters || [],
})
),
_a: encodeURI(
rison.encode({
columns: $scope.columns,
filters: (appFilters || []).map(esFilters.disableFilter),
})
),
});

return `${path}?${hash}`;
Expand Down
6 changes: 5 additions & 1 deletion test/functional/apps/context/_context_navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const TEST_COLUMN_NAMES = ['@message'];
const TEST_FILTER_COLUMN_NAMES = [
['extension', 'jpg'],
['geo.src', 'IN'],
[
'agent',
'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24',
],
];

export default function({ getService, getPageObjects }) {
Expand Down Expand Up @@ -56,7 +60,7 @@ export default function({ getService, getPageObjects }) {
await browser.goBack();
await PageObjects.discover.waitForDocTableLoadingComplete();
const hitCount = await PageObjects.discover.getHitCount();
expect(hitCount).to.be('1,556');
expect(hitCount).to.be('522');
});
});
}

0 comments on commit ef94e02

Please sign in to comment.