Commit 17806d76 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'issue-boards-label-filtering' into 'master'

Fixed issue boards not filtering when URL params are encoded

Closes #32084

See merge request !11320
parents fefd331c 45790564
...@@ -135,7 +135,10 @@ ...@@ -135,7 +135,10 @@
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) => {
const split = param.split('=');
return [decodeURI(split[0]), split[1]].join('=');
});
}; };
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