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
358efac2
Commit
358efac2
authored
Feb 08, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '27756-ce-port-to-ee' into 'master'
Port changes from CE !9010 to EE See merge request !1196
parents
709d9b75
2a5cd88b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
5 deletions
+28
-5
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js.es6
...s/filtered_search/filtered_search_dropdown_manager.js.es6
+4
-3
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+1
-1
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+1
-1
spec/features/issues/filtered_search/filter_issues_spec.rb
spec/features/issues/filtered_search/filter_issues_spec.rb
+22
-0
No files found.
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js.es6
View file @
358efac2
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
(() => {
(() => {
class FilteredSearchDropdownManager {
class FilteredSearchDropdownManager {
constructor() {
constructor(baseEndpoint = '') {
this.baseEndpoint = baseEndpoint.replace(/\/$/, '');
this.tokenizer = gl.FilteredSearchTokenizer;
this.tokenizer = gl.FilteredSearchTokenizer;
this.filteredSearchInput = document.querySelector('.filtered-search');
this.filteredSearchInput = document.querySelector('.filtered-search');
...
@@ -38,13 +39,13 @@
...
@@ -38,13 +39,13 @@
milestone: {
milestone: {
reference: null,
reference: null,
gl: 'DropdownNonUser',
gl: 'DropdownNonUser',
extraArguments: [
'milestones.json'
, '%'],
extraArguments: [
`${this.baseEndpoint}/milestones.json`
, '%'],
element: document.querySelector('#js-dropdown-milestone'),
element: document.querySelector('#js-dropdown-milestone'),
},
},
label: {
label: {
reference: null,
reference: null,
gl: 'DropdownNonUser',
gl: 'DropdownNonUser',
extraArguments: [
'labels.json'
, '~'],
extraArguments: [
`${this.baseEndpoint}/labels.json`
, '~'],
element: document.querySelector('#js-dropdown-label'),
element: document.querySelector('#js-dropdown-label'),
},
},
weight: {
weight: {
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
358efac2
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
if (this.filteredSearchInput) {
if (this.filteredSearchInput) {
this.tokenizer = gl.FilteredSearchTokenizer;
this.tokenizer = gl.FilteredSearchTokenizer;
this.dropdownManager = new gl.FilteredSearchDropdownManager();
this.dropdownManager = new gl.FilteredSearchDropdownManager(
this.filteredSearchInput.getAttribute('data-base-endpoint') || ''
);
this.bindEvents();
this.bindEvents();
this.loadSearchParamsFromURL();
this.loadSearchParamsFromURL();
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
358efac2
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
class:
"check_all_issues left"
class:
"check_all_issues left"
.issues-other-filters.filtered-search-container
.issues-other-filters.filtered-search-container
.filtered-search-input-container
.filtered-search-input-container
%input
.form-control.filtered-search
{
placeholder:
'Search or filter results...'
,
'data-id'
=>
'filtered-search'
,
'data-project-id'
=>
@project
.
id
,
'data-username-params'
=>
@users
.
to_json
(
only:
[
:id
,
:username
])
}
%input
.form-control.filtered-search
{
placeholder:
'Search or filter results...'
,
'data-id'
=>
'filtered-search'
,
'data-project-id'
=>
@project
.
id
,
'data-username-params'
=>
@users
.
to_json
(
only:
[
:id
,
:username
])
,
'data-base-endpoint'
=>
namespace_project_path
(
@project
.
namespace
,
@project
)
}
=
icon
(
'filter'
)
=
icon
(
'filter'
)
%button
.clear-search.hidden
{
type:
'button'
}
%button
.clear-search.hidden
{
type:
'button'
}
=
icon
(
'times'
)
=
icon
(
'times'
)
...
...
spec/features/issues/filtered_search/filter_issues_spec.rb
View file @
358efac2
...
@@ -801,4 +801,26 @@ describe 'Filter issues', js: true, feature: true do
...
@@ -801,4 +801,26 @@ describe 'Filter issues', js: true, feature: true do
expect
(
auto_discovery_params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
expect
(
auto_discovery_params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
end
end
end
end
context
'URL has a trailing slash'
do
before
do
visit
"
#{
namespace_project_issues_path
(
project
.
namespace
,
project
)
}
/"
end
it
'milestone dropdown loads milestones'
do
input_filtered_search
(
"milestone:"
,
submit:
false
)
within
(
'#js-dropdown-milestone'
)
do
expect
(
page
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
2
)
end
end
it
'label dropdown load labels'
do
input_filtered_search
(
"label:"
,
submit:
false
)
within
(
'#js-dropdown-label'
)
do
expect
(
page
).
to
have_selector
(
'.filter-dropdown .filter-dropdown-item'
,
count:
5
)
end
end
end
end
end
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