From 40d9646682e48e1f699c04874bed9076b1d66203 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Thu, 16 Jan 2020 11:14:06 +0100 Subject: [PATCH] [ML] add export, fix typo --- .../legacy/plugins/ml/public/application/util/url_state.test.ts | 2 +- x-pack/legacy/plugins/ml/public/application/util/url_state.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/ml/public/application/util/url_state.test.ts b/x-pack/legacy/plugins/ml/public/application/util/url_state.test.ts index 07b43892db75e..b39ece61beeb1 100644 --- a/x-pack/legacy/plugins/ml/public/application/util/url_state.test.ts +++ b/x-pack/legacy/plugins/ml/public/application/util/url_state.test.ts @@ -7,7 +7,7 @@ import { getUrlState } from './url_state'; describe('getUrlState', () => { - test('properly docode url with _g and _a', () => { + test('properly decode url with _g and _a', () => { expect( getUrlState( "?_a=(mlExplorerFilter:(),mlExplorerSwimlane:(viewByFieldName:action),query:(query_string:(analyze_wildcard:!t,query:'*')))&_g=(ml:(jobIds:!(dec-2)),refreshInterval:(display:Off,pause:!f,value:0),time:(from:'2019-01-01T00:03:40.000Z',mode:absolute,to:'2019-08-30T11:55:07.000Z'))&savedSearchId=571aaf70-4c88-11e8-b3d7-01146121b73d" diff --git a/x-pack/legacy/plugins/ml/public/application/util/url_state.ts b/x-pack/legacy/plugins/ml/public/application/util/url_state.ts index 1438303ba1d2a..546944b1a33bf 100644 --- a/x-pack/legacy/plugins/ml/public/application/util/url_state.ts +++ b/x-pack/legacy/plugins/ml/public/application/util/url_state.ts @@ -19,7 +19,7 @@ export type SetUrlState = (attribute: string | Dictionary, value?: any) => export type UrlState = [Dictionary, SetUrlState]; const decodedParams = new Set(['_a', '_g']); -function getUrlState(search: string) { +export function getUrlState(search: string): Dictionary { const urlState: Dictionary = {}; const parsedQueryString = queryString.parse(search);