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