fix board filter parsing - don't replace encoded + symbols with spaces
This commit is contained in:
parent
5abdcf1be9
commit
aaa239686c
|
@ -5,7 +5,7 @@ export default (path, extraData) => path.split('&').reduce((dataParam, filterPar
|
||||||
const paramSplit = filterParam.split('=');
|
const paramSplit = filterParam.split('=');
|
||||||
const paramKeyNormalized = paramSplit[0].replace('[]', '');
|
const paramKeyNormalized = paramSplit[0].replace('[]', '');
|
||||||
const isArray = paramSplit[0].indexOf('[]');
|
const isArray = paramSplit[0].indexOf('[]');
|
||||||
const value = decodeURIComponent(paramSplit[1]).replace(/\+/g, ' ');
|
const value = decodeURIComponent(paramSplit[1].replace(/\+/g, ' '));
|
||||||
|
|
||||||
if (isArray !== -1) {
|
if (isArray !== -1) {
|
||||||
if (!data[paramKeyNormalized]) {
|
if (!data[paramKeyNormalized]) {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: allow trailing + on labels in board filters
|
||||||
|
merge_request:
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -0,0 +1,21 @@
|
||||||
|
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+',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue