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
fad89f37
Commit
fad89f37
authored
Jan 16, 2017
by
Alfredo Sumaran
Committed by
James Lopez
Jan 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '26616-fix-search-group-project-filters' into 'master'
Fix search group/project filtering to show results Closes #26616 See merge request !8565
parent
9c399c6e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+1
-1
search.js
app/assets/javascripts/search.js
+6
-0
26616-fix-search-group-project-filters.yml
...ogs/unreleased/26616-fix-search-group-project-filters.yml
+4
-0
gl_dropdown_spec.js.es6
spec/javascripts/gl_dropdown_spec.js.es6
+19
-0
No files found.
app/assets/javascripts/gl_dropdown.js
View file @
fad89f37
...
...
@@ -476,7 +476,7 @@
this
.
removeArrayKeyEvent
();
$input
=
this
.
dropdown
.
find
(
".dropdown-input-field"
);
if
(
this
.
options
.
filterable
)
{
$input
.
blur
()
.
val
(
""
)
;
$input
.
blur
();
}
if
(
this
.
dropdown
.
find
(
".dropdown-toggle-page"
).
length
)
{
$
(
'.dropdown-menu'
,
this
.
dropdown
).
removeClass
(
PAGE_TWO_CLASS
);
...
...
app/assets/javascripts/search.js
View file @
fad89f37
...
...
@@ -12,6 +12,9 @@
selectable
:
true
,
filterable
:
true
,
fieldName
:
'group_id'
,
search
:
{
fields
:
[
'name'
]
},
data
:
function
(
term
,
callback
)
{
return
Api
.
groups
(
term
,
{},
function
(
data
)
{
data
.
unshift
({
...
...
@@ -40,6 +43,9 @@
selectable
:
true
,
filterable
:
true
,
fieldName
:
'project_id'
,
search
:
{
fields
:
[
'name'
]
},
data
:
function
(
term
,
callback
)
{
return
Api
.
projects
(
term
,
'id'
,
function
(
data
)
{
data
.
unshift
({
...
...
changelogs/unreleased/26616-fix-search-group-project-filters.yml
0 → 100644
View file @
fad89f37
---
title
:
Fix search group/project filtering to show results
merge_request
:
author
:
spec/javascripts/gl_dropdown_spec.js.es6
View file @
fad89f37
...
...
@@ -50,6 +50,9 @@
selectable: true,
filterable: isFilterable,
data: hasRemote ? remoteMock.bind({}, this.projectsData) : this.projectsData,
search: {
fields: ['name']
},
text: (project) => {
(project.name_with_namespace || project.name);
},
...
...
@@ -167,5 +170,21 @@
expect($(document.activeElement)).toEqual($(SEARCH_INPUT_SELECTOR));
});
});
it('should still have input value on close and restore', () => {
let $searchInput = $(SEARCH_INPUT_SELECTOR);
initDropDown.call(this, false, true);
$searchInput
.trigger('focus')
.val('g')
.trigger('input');
expect($searchInput.val()).toEqual('g');
this.dropdownButtonElement.trigger('hidden.bs.dropdown');
$searchInput
.trigger('blur')
.trigger('focus');
expect($searchInput.val()).toEqual('g');
});
});
})();
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