BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5fda2aad
Commit
5fda2aad
authored
Feb 24, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '28357-colon-search' into 'master'
This reverts commit
f948c2f4
.
parent
40d7c13d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
32 deletions
+2
-32
filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+1
-1
filtered_search_tokenizer.js.es6
...ascripts/filtered_search/filtered_search_tokenizer.js.es6
+1
-4
28357-colon-search.yml
changelogs/unreleased/28357-colon-search.yml
+0
-4
filtered_search_tokenizer_spec.js.es6
...pts/filtered_search/filtered_search_tokenizer_spec.js.es6
+0
-23
No files found.
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
5fda2aad
...
@@ -175,7 +175,7 @@
...
@@ -175,7 +175,7 @@
tokens.forEach((token) => {
tokens.forEach((token) => {
const condition = gl.FilteredSearchTokenKeys
const condition = gl.FilteredSearchTokenKeys
.searchByConditionKeyValue(token.key, token.value.toLowerCase());
.searchByConditionKeyValue(token.key, token.value.toLowerCase());
const { param } = gl.FilteredSearchTokenKeys.searchByKey(token.key)
|| {}
;
const { param } = gl.FilteredSearchTokenKeys.searchByKey(token.key);
const keyParam = param ? `${token.key}_${param}` : token.key;
const keyParam = param ? `${token.key}_${param}` : token.key;
let tokenPath = '';
let tokenPath = '';
...
...
app/assets/javascripts/filtered_search/filtered_search_tokenizer.js.es6
View file @
5fda2aad
require('./filtered_search_token_keys');
(() => {
(() => {
class FilteredSearchTokenizer {
class FilteredSearchTokenizer {
static processTokens(input) {
static processTokens(input) {
const allowedKeys = gl.FilteredSearchTokenKeys.get().map(i => i.key);
// Regex extracts `(token):(symbol)(value)`
// Regex extracts `(token):(symbol)(value)`
// Values that start with a double quote must end in a double quote (same for single)
// Values that start with a double quote must end in a double quote (same for single)
const tokenRegex =
new RegExp(`(${allowedKeys.join('|')}):([~%@]?)(?:('[^']*'{0,1})|("[^"]*"{0,1})|(\\S+))`, 'g')
;
const tokenRegex =
/(\w+):([~%@]?)(?:('[^']*'{0,1})|("[^"]*"{0,1})|(\S+))/g
;
const tokens = [];
const tokens = [];
let lastToken = null;
let lastToken = null;
const searchToken = input.replace(tokenRegex, (match, key, symbol, v1, v2, v3) => {
const searchToken = input.replace(tokenRegex, (match, key, symbol, v1, v2, v3) => {
...
...
changelogs/unreleased/28357-colon-search.yml
deleted
100644 → 0
View file @
40d7c13d
---
title
:
Allow searching issues for strings containing colons
merge_request
:
author
:
spec/javascripts/filtered_search/filtered_search_tokenizer_spec.js.es6
View file @
5fda2aad
...
@@ -99,29 +99,6 @@
...
@@ -99,29 +99,6 @@
expect(results.tokens[2].value).toBe('Doing');
expect(results.tokens[2].value).toBe('Doing');
expect(results.tokens[2].symbol).toBe('~');
expect(results.tokens[2].symbol).toBe('~');
});
});
it('returns search value for invalid tokens', () => {
const results = gl.FilteredSearchTokenizer.processTokens('fake:token');
expect(results.lastToken).toBe('fake:token');
expect(results.searchToken).toBe('fake:token');
expect(results.tokens.length).toEqual(0);
});
it('returns search value and token for mix of valid and invalid tokens', () => {
const results = gl.FilteredSearchTokenizer.processTokens('label:real fake:token');
expect(results.tokens.length).toEqual(1);
expect(results.tokens[0].key).toBe('label');
expect(results.tokens[0].value).toBe('real');
expect(results.tokens[0].symbol).toBe('');
expect(results.lastToken).toBe('fake:token');
expect(results.searchToken).toBe('fake:token');
});
it('returns search value for invalid symbols', () => {
const results = gl.FilteredSearchTokenizer.processTokens('std::includes');
expect(results.lastToken).toBe('std::includes');
expect(results.searchToken).toBe('std::includes');
});
});
});
});
});
})();
})();
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