Commit 64cbe0a2 authored by Clement Ho's avatar Clement Ho Committed by Valery Sizov

Add frontend support for parsing assignee_username[] parameters

parent 5d0ddc94
......@@ -18,6 +18,13 @@ const weightConditions = [{
value: 'any',
}];
const alternativeTokenKeys = [{
key: 'assignee',
type: 'string',
param: 'username',
symbol: '@',
}];
class FilteredSearchTokenKeysIssuesEE extends gl.FilteredSearchTokenKeys {
static init(availableFeatures) {
this.availableFeatures = availableFeatures;
......@@ -30,6 +37,7 @@ class FilteredSearchTokenKeysIssuesEE extends gl.FilteredSearchTokenKeys {
if (this.availableFeatures && this.availableFeatures.multipleAssignees) {
const assigneeTokenKey = tokenKeys.find(tk => tk.key === 'assignee');
assigneeTokenKey.type = 'array';
assigneeTokenKey.param = 'username[]';
}
tokenKeys.push(weightTokenKey);
......@@ -42,7 +50,7 @@ class FilteredSearchTokenKeysIssuesEE extends gl.FilteredSearchTokenKeys {
}
static getAlternatives() {
return super.getAlternatives();
return alternativeTokenKeys.concat(super.getAlternatives());
}
static getConditions() {
......@@ -62,8 +70,8 @@ class FilteredSearchTokenKeysIssuesEE extends gl.FilteredSearchTokenKeys {
static searchByKeyParam(keyParam) {
const tokenKeys = FilteredSearchTokenKeysIssuesEE.get();
const alternativeTokenKeys = FilteredSearchTokenKeysIssuesEE.getAlternatives();
const tokenKeysWithAlternative = tokenKeys.concat(alternativeTokenKeys);
const alternatives = FilteredSearchTokenKeysIssuesEE.getAlternatives();
const tokenKeysWithAlternative = tokenKeys.concat(alternatives);
return tokenKeysWithAlternative.find((tokenKey) => {
let tokenKeyParam = tokenKey.key;
......
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