Commit aaa23968 authored by Simon Knox's avatar Simon Knox

fix board filter parsing - don't replace encoded + symbols with spaces

parent 5abdcf1b
......@@ -5,7 +5,7 @@ export default (path, extraData) => path.split('&').reduce((dataParam, filterPar
const paramSplit = filterParam.split('=');
const paramKeyNormalized = paramSplit[0].replace('[]', '');
const isArray = paramSplit[0].indexOf('[]');
const value = decodeURIComponent(paramSplit[1]).replace(/\+/g, ' ');
const value = decodeURIComponent(paramSplit[1].replace(/\+/g, ' '));
if (isArray !== -1) {
if (!data[paramKeyNormalized]) {
......
---
title: allow trailing + on labels in board filters
merge_request:
author:
type: fixed
import queryData from '~/boards/utils/query_data';
describe('queryData', () => {
it('parses path for label with trailing +', () => {
const path = 'label_name[]=label%2B';
expect(
queryData(path, {}),
).toEqual({
label_name: ['label+'],
});
});
it('parses path for milestone with trailing +', () => {
const path = 'milestone_title=A%2B';
expect(
queryData(path, {}),
).toEqual({
milestone_title: 'A+',
});
});
});
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