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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9c486814
Commit
9c486814
authored
Dec 16, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make changes to make it more flexible for new filters
parent
fd90a996
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
5 deletions
+23
-5
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
+1
-1
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+9
-3
app/assets/javascripts/filtered_search/filtered_search_token_keys.js.es6
...scripts/filtered_search/filtered_search_token_keys.js.es6
+9
-1
app/assets/stylesheets/framework/filters.scss
app/assets/stylesheets/framework/filters.scss
+4
-0
No files found.
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
View file @
9c486814
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
9c486814
...
@@ -101,7 +101,8 @@
...
@@ -101,7 +101,8 @@
const match = gl.FilteredSearchTokenKeys.searchByKeyParam(keyParam);
const match = gl.FilteredSearchTokenKeys.searchByKeyParam(keyParam);
if (match) {
if (match) {
const sanitizedKey = keyParam.slice(0, keyParam.indexOf('_'));
const indexOf = keyParam.indexOf('_');
const sanitizedKey = indexOf !== -1 ? keyParam.slice(0, keyParam.indexOf('_')) : keyParam;
const symbol = match.symbol;
const symbol = match.symbol;
let quotationsToUse = '';
let quotationsToUse = '';
...
@@ -137,14 +138,19 @@
...
@@ -137,14 +138,19 @@
const { param } = gl.FilteredSearchTokenKeys.searchByKey(token.key);
const { param } = gl.FilteredSearchTokenKeys.searchByKey(token.key);
let tokenPath = '';
let tokenPath = '';
let keyParam = token.key;
if (param) {
keyParam += `_${param}`;
}
if (token.wildcard && condition) {
if (token.wildcard && condition) {
tokenPath = condition.url;
tokenPath = condition.url;
} else if (token.wildcard) {
} else if (token.wildcard) {
// wildcard means that the token does not have a symbol
// wildcard means that the token does not have a symbol
tokenPath = `${
token.key}_${p
aram}=${encodeURIComponent(token.value)}`;
tokenPath = `${
keyP
aram}=${encodeURIComponent(token.value)}`;
} else {
} else {
// Remove the token symbol
// Remove the token symbol
tokenPath = `${
token.key}_${p
aram}=${encodeURIComponent(token.value.slice(1))}`;
tokenPath = `${
keyP
aram}=${encodeURIComponent(token.value.slice(1))}`;
}
}
paths.push(tokenPath);
paths.push(tokenPath);
...
...
app/assets/javascripts/filtered_search/filtered_search_token_keys.js.es6
View file @
9c486814
...
@@ -57,7 +57,15 @@
...
@@ -57,7 +57,15 @@
}
}
static searchByKeyParam(keyParam) {
static searchByKeyParam(keyParam) {
return tokenKeys.find(tokenKey => keyParam === `${tokenKey.key}_${tokenKey.param}`) || null;
return tokenKeys.find((tokenKey) => {
let tokenKeyParam = tokenKey.key;
if (tokenKey.param) {
tokenKeyParam += `_${tokenKey.param}`;
}
return keyParam === tokenKeyParam;
}) || null;
}
}
static searchByConditionUrl(url) {
static searchByConditionUrl(url) {
...
...
app/assets/stylesheets/framework/filters.scss
View file @
9c486814
...
@@ -89,6 +89,10 @@
...
@@ -89,6 +89,10 @@
overflow-y
:
hidden
;
overflow-y
:
hidden
;
border-radius
:
0
;
border-radius
:
0
;
.fa
{
width
:
15px
;
}
.dropdown-label-box
{
.dropdown-label-box
{
border-color
:
$white-light
;
border-color
:
$white-light
;
border-style
:
solid
;
border-style
:
solid
;
...
...
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