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
Jérome Perrin
gitlab-ce
Commits
13f6dc1a
Commit
13f6dc1a
authored
Aug 27, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save search options when switch between filter
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
c3ad51a0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
28 deletions
+39
-28
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+1
-4
app/views/search/_filter.html.haml
app/views/search/_filter.html.haml
+4
-4
app/views/search/_global_results.html.haml
app/views/search/_global_results.html.haml
+1
-1
app/views/search/_project_results.html.haml
app/views/search/_project_results.html.haml
+1
-1
app/views/search/results/_merge_request.html.haml
app/views/search/results/_merge_request.html.haml
+11
-13
app/views/search/show.html.haml
app/views/search/show.html.haml
+1
-1
features/search.feature
features/search.feature
+19
-2
features/steps/project/search_code.rb
features/steps/project/search_code.rb
+1
-2
No files found.
app/helpers/search_helper.rb
View file @
13f6dc1a
...
...
@@ -101,9 +101,6 @@ module SearchHelper
}
options
=
exist_opts
.
merge
(
options
)
path
=
request
.
path
path
<<
"?
#{
options
.
to_param
}
"
path
search_path
(
options
)
end
end
app/views/search/_filter.html.haml
View file @
13f6dc1a
...
...
@@ -9,11 +9,11 @@
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
search_
path
(
group_id:
nil
,
search:
params
[
:search
]
)
do
=
link_to
search_
filter_path
(
group_id:
nil
)
do
Any
-
current_user
.
authorized_groups
.
sort_by
(
&
:name
).
each
do
|
group
|
%li
=
link_to
search_
path
(
group_id:
group
.
id
,
search:
params
[
:search
]
)
do
=
link_to
search_
filter_path
(
group_id:
group
.
id
,
project_id:
nil
)
do
=
group
.
name
.dropdown.inline.prepend-left-10.project-filter
...
...
@@ -27,9 +27,9 @@
%b
.caret
%ul
.dropdown-menu
%li
=
link_to
search_
path
(
project_id:
nil
,
search:
params
[
:search
]
)
do
=
link_to
search_
filter_path
(
project_id:
nil
)
do
Any
-
current_user
.
authorized_projects
.
sort_by
(
&
:name_with_namespace
).
each
do
|
project
|
%li
=
link_to
search_
path
(
project_id:
project
.
id
,
search:
params
[
:search
]
)
do
=
link_to
search_
filter_path
(
project_id:
project
.
id
,
group_id:
nil
)
do
=
project
.
name_with_namespace
app/views/search/_global_results.html.haml
View file @
13f6dc1a
...
...
@@ -20,7 +20,7 @@
.col-sm-9
.search_results
-
if
@search_results
.
empty?
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matchin
d
results"
}
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matchin
g
results"
}
%ul
.bordered-list
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@objects
...
...
app/views/search/_project_results.html.haml
View file @
13f6dc1a
...
...
@@ -29,7 +29,7 @@
.col-sm-9
.search_results
-
if
@search_results
.
empty?
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matchin
d
results"
}
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matchin
g
results"
}
%ul
.bordered-list
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@objects
...
...
app/views/search/results/_merge_request.html.haml
View file @
13f6dc1a
%li
merge request:
=
link_to
[
merge_request
.
target_project
,
merge_request
]
do
%span
##{merge_request.iid}
%strong
.term
=
truncate
merge_request
.
title
,
length:
50
-
if
merge_request
.
for_fork?
%span
.light
(
#{
merge_request
.
source_project
.
name_with_namespace
}
:
#{
merge_request
.
source_branch
}
→
#{
merge_request
.
target_project
.
name_with_namespace
}
:
#{
merge_request
.
target_branch
}
)
-
else
%span
.light
(
#{
merge_request
.
source_branch
}
→
#{
merge_request
.
target_branch
}
)
-
if
merge_request
.
merged?
%span
.label.label-primary
Merged
-
elsif
merge_request
.
closed?
%span
.label.label-danger
Closed
%h4
=
link_to
[
merge_request
.
target_project
,
merge_request
]
do
%span
.term.str-truncated
=
merge_request
.
title
.pull-right
##{merge_request.iid}
%span
.light
#{
merge_request
.
project
.
name_with_namespace
}
.pull-right
-
if
merge_request
.
merged?
%span
.label.label-primary
Merged
-
elsif
merge_request
.
closed?
%span
.label.label-danger
Closed
app/views/search/show.html.haml
View file @
13f6dc1a
...
...
@@ -13,7 +13,7 @@
=
render
'filter'
,
f:
f
=
hidden_field_tag
:project_id
,
params
[
:project_id
]
=
hidden_field_tag
:group_id
,
params
[
:group_id
]
=
hidden_field_tag
:s
earch_code
,
params
[
:search_cod
e
]
=
hidden_field_tag
:s
cope
,
params
[
:scop
e
]
.results.prepend-top-10
-
if
params
[
:search
].
present?
...
...
features/search.feature
View file @
13f6dc1a
...
...
@@ -24,6 +24,23 @@ Feature: Search
And
I should not see
"Bar"
link
Scenario
:
I
should see project code I am looking for
When
I
search for
"rspec"
And
I
click project
"Shop"
link
When
I
click project
"Shop"
link
And
I
search for
"rspec"
Then
I should see code results for project
"Shop"
Scenario
:
I
should see project issues
And
project has issues
When
I click project
"Shop"
link
And
I search for
"Foo"
And
I click
"Issues"
link
Then
I should see
"Foo"
link
And
I should not see
"Bar"
link
Scenario
:
I
should see project merge requests
And
project has merge requests
When
I click project
"Shop"
link
And
I search for
"Foo"
And
I click
"Merge requests"
link
Then
I should see
"Foo"
link
And
I should not see
"Bar"
link
features/steps/project/search_code.rb
View file @
13f6dc1a
...
...
@@ -6,7 +6,6 @@ class ProjectSearchCode < Spinach::FeatureSteps
step
'I search for term "coffee"'
do
fill_in
"search"
,
with:
"coffee"
click_button
"Go"
click_link
'Repository Code'
end
step
'I should see files from repository containing "coffee"'
do
...
...
@@ -15,6 +14,6 @@ class ProjectSearchCode < Spinach::FeatureSteps
end
step
'I should see empty result'
do
page
.
should
have_content
"We couldn't find any matching
code
"
page
.
should
have_content
"We couldn't find any matching"
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