Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
cd13d5dc
Commit
cd13d5dc
authored
Jan 24, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix filtered search so that labels selected from discussion notes display correctly
parent
b55c1bc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
app/assets/javascripts/filtered_search/filtered_search_token_keys.js.es6
...scripts/filtered_search/filtered_search_token_keys.js.es6
+14
-1
spec/javascripts/filtered_search/filtered_search_token_keys_spec.js.es6
...ts/filtered_search/filtered_search_token_keys_spec.js.es6
+6
-0
No files found.
app/assets/javascripts/filtered_search/filtered_search_token_keys.js.es6
View file @
cd13d5dc
...
@@ -21,6 +21,15 @@
...
@@ -21,6 +21,15 @@
symbol: '~',
symbol: '~',
}];
}];
const alternativeTokenKeys = [{
key: 'label',
type: 'string',
param: 'name',
symbol: '~',
}];
const tokenKeysWithAlternative = tokenKeys.concat(alternativeTokenKeys);
const conditions = [{
const conditions = [{
url: 'assignee_id=0',
url: 'assignee_id=0',
tokenKey: 'assignee',
tokenKey: 'assignee',
...
@@ -44,6 +53,10 @@
...
@@ -44,6 +53,10 @@
return tokenKeys;
return tokenKeys;
}
}
static getAlternatives() {
return alternativeTokenKeys;
}
static getConditions() {
static getConditions() {
return conditions;
return conditions;
}
}
...
@@ -57,7 +70,7 @@
...
@@ -57,7 +70,7 @@
}
}
static searchByKeyParam(keyParam) {
static searchByKeyParam(keyParam) {
return tokenKeys.find((tokenKey) => {
return tokenKeys
WithAlternative
.find((tokenKey) => {
let tokenKeyParam = tokenKey.key;
let tokenKeyParam = tokenKey.key;
if (tokenKey.param) {
if (tokenKey.param) {
...
...
spec/javascripts/filtered_search/filtered_search_token_keys_spec.js.es6
View file @
cd13d5dc
...
@@ -72,6 +72,12 @@
...
@@ -72,6 +72,12 @@
const result = gl.FilteredSearchTokenKeys.searchByKeyParam(`${tokenKeys[0].key}_${tokenKeys[0].param}`);
const result = gl.FilteredSearchTokenKeys.searchByKeyParam(`${tokenKeys[0].key}_${tokenKeys[0].param}`);
expect(result).toEqual(tokenKeys[0]);
expect(result).toEqual(tokenKeys[0]);
});
});
it('should return alternative tokenKey when found by key param', () => {
const tokenKeys = gl.FilteredSearchTokenKeys.getAlternatives();
const result = gl.FilteredSearchTokenKeys.searchByKeyParam(`${tokenKeys[0].key}_${tokenKeys[0].param}`);
expect(result).toEqual(tokenKeys[0]);
});
});
});
describe('searchByConditionUrl', () => {
describe('searchByConditionUrl', () => {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment