1818 */
1919
2020import { find , template } from 'lodash' ;
21+ import { stringify } from 'query-string' ;
2122import $ from 'jquery' ;
2223import rison from 'rison-node' ;
2324import '../../doc_viewer' ;
2425
2526import openRowHtml from './table_row/open.html' ;
2627import detailsHtml from './table_row/details.html' ;
2728
28- import { dispatchRenderComplete } from '../../../../../../kibana_utils/public' ;
29+ import { dispatchRenderComplete , url } from '../../../../../../kibana_utils/public' ;
2930import { DOC_HIDE_TIME_COLUMN_SETTING } from '../../../../../common' ;
3031import cellTemplateHtml from '../components/table_row/cell.html' ;
3132import truncateByHeightTemplateHtml from '../components/table_row/truncate_by_height.html' ;
@@ -49,7 +50,7 @@ interface LazyScope extends ng.IScope {
4950 [ key : string ] : any ;
5051}
5152
52- export function createTableRowDirective ( $compile : ng . ICompileService , $httpParamSerializer : any ) {
53+ export function createTableRowDirective ( $compile : ng . ICompileService ) {
5354 const cellTemplate = template ( noWhiteSpace ( cellTemplateHtml ) ) ;
5455 const truncateByHeightTemplate = template ( noWhiteSpace ( truncateByHeightTemplateHtml ) ) ;
5556
@@ -114,26 +115,25 @@ export function createTableRowDirective($compile: ng.ICompileService, $httpParam
114115 } ;
115116
116117 $scope . getContextAppHref = ( ) => {
117- const path = `#/context/${ encodeURIComponent ( $scope . indexPattern . id ) } /${ encodeURIComponent (
118- $scope . row . _id
119- ) } `;
120118 const globalFilters : any = getServices ( ) . filterManager . getGlobalFilters ( ) ;
121119 const appFilters : any = getServices ( ) . filterManager . getAppFilters ( ) ;
122- const hash = $httpParamSerializer ( {
123- _g : encodeURI (
124- rison . encode ( {
120+
121+ const hash = stringify (
122+ url . encodeQuery ( {
123+ _g : rison . encode ( {
125124 filters : globalFilters || [ ] ,
126- } )
127- ) ,
128- _a : encodeURI (
129- rison . encode ( {
125+ } ) ,
126+ _a : rison . encode ( {
130127 columns : $scope . columns ,
131128 filters : ( appFilters || [ ] ) . map ( esFilters . disableFilter ) ,
132- } )
133- ) ,
134- } ) ;
129+ } ) ,
130+ } ) ,
131+ { encode : false , sort : false }
132+ ) ;
135133
136- return `${ path } ?${ hash } ` ;
134+ return `#/context/${ encodeURIComponent ( $scope . indexPattern . id ) } /${ encodeURIComponent (
135+ $scope . row . _id
136+ ) } ?${ hash } `;
137137 } ;
138138
139139 // create a tr element that lists the value for each *column*
0 commit comments