From fe0ced0f735db96a1d17ca3e8b75a00fb59a0ab1 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Fri, 11 Mar 2016 14:16:15 -0800 Subject: [PATCH 1/2] Closes #6516. Fixes issue with query string not being added to base path. --- src/ui/public/chrome/api/nav.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/public/chrome/api/nav.js b/src/ui/public/chrome/api/nav.js index 297df1543be3a..0b630a2eccd14 100644 --- a/src/ui/public/chrome/api/nav.js +++ b/src/ui/public/chrome/api/nav.js @@ -18,7 +18,7 @@ export default function (chrome, internals) { var isUrl = url && isString(url); if (!isUrl) return url; - var parsed = parse(url); + var parsed = parse(url, true); if (!parsed.host && parsed.pathname) { if (parsed.pathname[0] === '/') { parsed.pathname = chrome.getBasePath() + parsed.pathname; From f85d0a5cefe93f72fcbf803f5bd45ee8a177d240 Mon Sep 17 00:00:00 2001 From: spalger Date: Tue, 15 Mar 2016 14:18:44 -0700 Subject: [PATCH 2/2] [chrome/nav] test that chrome.addBasePath() keeps querystring --- src/ui/public/chrome/api/__tests__/nav.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui/public/chrome/api/__tests__/nav.js b/src/ui/public/chrome/api/__tests__/nav.js index e3c89deedd60b..2161c63d6ce7a 100644 --- a/src/ui/public/chrome/api/__tests__/nav.js +++ b/src/ui/public/chrome/api/__tests__/nav.js @@ -36,5 +36,10 @@ describe('chrome nav apis', function () { const chrome = getChrome(); expect(chrome.addBasePath('http://github.com/elastic/kibana')).to.be('http://github.com/elastic/kibana'); }); + + it('includes the query string', function () { + const chrome = getChrome(); + expect(chrome.addBasePath('/app/kibana?a=b')).to.be(`${basePath}/app/kibana?a=b`); + }); }); });