Commit 477be056 authored by Phil Hughes's avatar Phil Hughes

Fixed issue boards not filtering when URL params are encoded

Closes #32084
parent 2ac27a96
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
gl.utils.getUrlParamsArray = function () { gl.utils.getUrlParamsArray = function () {
// We can trust that each param has one & since values containing & will be encoded // We can trust that each param has one & since values containing & will be encoded
// Remove the first character of search as it is always ? // Remove the first character of search as it is always ?
return window.location.search.slice(1).split('&'); return window.location.search.slice(1).split('&').map(param => decodeURI(param));
}; };
gl.utils.isMetaKey = function(e) { gl.utils.isMetaKey = function(e) {
......
...@@ -41,6 +41,16 @@ require('~/lib/utils/common_utils'); ...@@ -41,6 +41,16 @@ require('~/lib/utils/common_utils');
const paramsArray = gl.utils.getUrlParamsArray(); const paramsArray = gl.utils.getUrlParamsArray();
expect(paramsArray[0][0] !== '?').toBe(true); expect(paramsArray[0][0] !== '?').toBe(true);
}); });
it('should decode params', () => {
history.pushState('', '', '?label_name%5B%5D=test');
expect(
gl.utils.getUrlParamsArray()[0],
).toBe('label_name[]=test');
history.pushState('', '', '?');
});
}); });
describe('gl.utils.handleLocationHash', () => { describe('gl.utils.handleLocationHash', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment