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
8ea34ca3
Commit
8ea34ca3
authored
Jul 09, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
9e4103c1
7301cd14
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
64 deletions
+69
-64
app/assets/javascripts/repository/components/table/index.vue
app/assets/javascripts/repository/components/table/index.vue
+1
-1
app/views/layouts/_search.html.haml
app/views/layouts/_search.html.haml
+1
-1
changelogs/unreleased/fj-fix-subgroup-search-url.yml
changelogs/unreleased/fj-fix-subgroup-search-url.yml
+5
-0
spec/features/search/user_uses_header_search_field_spec.rb
spec/features/search/user_uses_header_search_field_spec.rb
+62
-62
No files found.
app/assets/javascripts/repository/components/table/index.vue
View file @
8ea34ca3
...
@@ -76,7 +76,7 @@ export default {
...
@@ -76,7 +76,7 @@ export default {
variables
:
{
variables
:
{
projectPath
:
this
.
projectPath
,
projectPath
:
this
.
projectPath
,
ref
:
this
.
ref
,
ref
:
this
.
ref
,
path
:
this
.
path
,
path
:
this
.
path
||
'
/
'
,
nextPageCursor
:
this
.
nextPageCursor
,
nextPageCursor
:
this
.
nextPageCursor
,
pageSize
:
PAGE_SIZE
,
pageSize
:
PAGE_SIZE
,
},
},
...
...
app/views/layouts/_search.html.haml
View file @
8ea34ca3
-
if
@group
&&
@group
.
persisted?
&&
@group
.
path
-
if
@group
&&
@group
.
persisted?
&&
@group
.
path
-
group_data_attrs
=
{
group_path:
j
(
@group
.
path
),
name:
@group
.
name
,
issues_path:
issues_group_path
(
j
(
@group
.
path
)),
mr_path:
merge_requests_group_path
(
j
(
@group
.
path
)
)
}
-
group_data_attrs
=
{
group_path:
j
(
@group
.
path
),
name:
j
(
@group
.
name
),
issues_path:
issues_group_path
(
@group
),
mr_path:
merge_requests_group_path
(
@group
)
}
-
if
@project
&&
@project
.
persisted?
-
if
@project
&&
@project
.
persisted?
-
project_data_attrs
=
{
project_path:
j
(
@project
.
path
),
name:
j
(
@project
.
name
),
issues_path:
project_issues_path
(
@project
),
mr_path:
project_merge_requests_path
(
@project
),
issues_disabled:
!
@project
.
issues_enabled?
}
-
project_data_attrs
=
{
project_path:
j
(
@project
.
path
),
name:
j
(
@project
.
name
),
issues_path:
project_issues_path
(
@project
),
mr_path:
project_merge_requests_path
(
@project
),
issues_disabled:
!
@project
.
issues_enabled?
}
.search.search-form
{
data:
{
track_label:
"navbar_search"
,
track_event:
"activate_form_input"
}
}
.search.search-form
{
data:
{
track_label:
"navbar_search"
,
track_event:
"activate_form_input"
}
}
...
...
changelogs/unreleased/fj-fix-subgroup-search-url.yml
0 → 100644
View file @
8ea34ca3
---
title
:
Fix subgroup url in search drop down
merge_request
:
30457
author
:
type
:
fixed
spec/features/search/user_uses_header_search_field_spec.rb
View file @
8ea34ca3
require
'spec_helper'
require
'spec_helper'
describe
'User uses header search field'
do
describe
'User uses header search field'
,
:js
do
include
FilteredSearchHelpers
include
FilteredSearchHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
...
@@ -11,57 +11,12 @@ describe 'User uses header search field' do
...
@@ -11,57 +11,12 @@ describe 'User uses header search field' do
sign_in
(
user
)
sign_in
(
user
)
end
end
context
'when user is in a global scope'
,
:js
do
shared_examples
'search field examples'
do
before
do
before
do
visit
(
root_path
)
visit
(
url
)
page
.
find
(
'#search'
).
click
end
end
context
'when clicking issues'
do
it
'starts searching by pressing the enter key'
do
it
'shows assigned issues'
do
find
(
'.search-input-container .dropdown-menu'
).
click_link
(
'Issues assigned to me'
)
expect
(
page
).
to
have_selector
(
'.filtered-search'
)
expect_tokens
([
assignee_token
(
user
.
name
)])
expect_filtered_search_input_empty
end
it
'shows created issues'
do
find
(
'.search-input-container .dropdown-menu'
).
click_link
(
"Issues I've created"
)
expect
(
page
).
to
have_selector
(
'.filtered-search'
)
expect_tokens
([
author_token
(
user
.
name
)])
expect_filtered_search_input_empty
end
end
context
'when clicking merge requests'
do
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
author:
user
,
assignees:
[
user
])
}
it
'shows assigned merge requests'
do
find
(
'.search-input-container .dropdown-menu'
).
click_link
(
'Merge requests assigned to me'
)
expect
(
page
).
to
have_selector
(
'.filtered-search'
)
expect_tokens
([
assignee_token
(
user
.
name
)])
expect_filtered_search_input_empty
end
it
'shows created merge requests'
do
find
(
'.search-input-container .dropdown-menu'
).
click_link
(
"Merge requests I've created"
)
expect
(
page
).
to
have_selector
(
'.filtered-search'
)
expect_tokens
([
author_token
(
user
.
name
)])
expect_filtered_search_input_empty
end
end
end
context
'when user is in a project scope'
do
before
do
visit
(
project_path
(
project
))
end
it
'starts searching by pressing the enter key'
,
:js
do
fill_in
(
'search'
,
with:
'gitlab'
)
fill_in
(
'search'
,
with:
'gitlab'
)
find
(
'#search'
).
native
.
send_keys
(
:enter
)
find
(
'#search'
).
native
.
send_keys
(
:enter
)
...
@@ -70,30 +25,31 @@ describe 'User uses header search field' do
...
@@ -70,30 +25,31 @@ describe 'User uses header search field' do
end
end
end
end
context
'when clicking the search field'
,
:js
do
context
'when clicking the search field'
do
before
do
before
do
page
.
find
(
'#search'
).
click
page
.
find
(
'#search'
).
click
wait_for_all_requests
end
end
it
'shows category search dropdown'
do
it
'shows category search dropdown'
do
expect
(
page
).
to
have_selector
(
'.dropdown-header'
,
text:
/
#{
project
.
name
}
/i
)
expect
(
page
).
to
have_selector
(
'.dropdown-header'
,
text:
/
#{
scope_
name
}
/i
)
end
end
context
'when clicking issues'
do
context
'when clicking issues'
do
let!
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
,
assignees:
[
user
])
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
,
assignees:
[
user
])
}
it
'shows assigned issues'
do
it
'shows assigned issues'
do
find
(
'.dropdown-menu'
).
click_link
(
'Issues assigned to me'
)
find
(
'.
search-input-container .
dropdown-menu'
).
click_link
(
'Issues assigned to me'
)
expect
(
page
).
to
have_selector
(
'.
filtered-search
'
)
expect
(
page
).
to
have_selector
(
'.
issues-list .issue
'
)
expect_tokens
([
assignee_token
(
user
.
name
)])
expect_tokens
([
assignee_token
(
user
.
name
)])
expect_filtered_search_input_empty
expect_filtered_search_input_empty
end
end
it
'shows created issues'
do
it
'shows created issues'
do
find
(
'.dropdown-menu'
).
click_link
(
"Issues I've created"
)
find
(
'.
search-input-container .
dropdown-menu'
).
click_link
(
"Issues I've created"
)
expect
(
page
).
to
have_selector
(
'.
filtered-search
'
)
expect
(
page
).
to
have_selector
(
'.
issues-list .issue
'
)
expect_tokens
([
author_token
(
user
.
name
)])
expect_tokens
([
author_token
(
user
.
name
)])
expect_filtered_search_input_empty
expect_filtered_search_input_empty
end
end
...
@@ -103,33 +59,77 @@ describe 'User uses header search field' do
...
@@ -103,33 +59,77 @@ describe 'User uses header search field' do
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
author:
user
,
assignees:
[
user
])
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
author:
user
,
assignees:
[
user
])
}
it
'shows assigned merge requests'
do
it
'shows assigned merge requests'
do
find
(
'.dropdown-menu'
).
click_link
(
'Merge requests assigned to me'
)
find
(
'.
search-input-container .
dropdown-menu'
).
click_link
(
'Merge requests assigned to me'
)
expect
(
page
).
to
have_selector
(
'.m
erge-requests-holder
'
)
expect
(
page
).
to
have_selector
(
'.m
r-list .merge-request
'
)
expect_tokens
([
assignee_token
(
user
.
name
)])
expect_tokens
([
assignee_token
(
user
.
name
)])
expect_filtered_search_input_empty
expect_filtered_search_input_empty
end
end
it
'shows created merge requests'
do
it
'shows created merge requests'
do
find
(
'.dropdown-menu'
).
click_link
(
"Merge requests I've created"
)
find
(
'.
search-input-container .
dropdown-menu'
).
click_link
(
"Merge requests I've created"
)
expect
(
page
).
to
have_selector
(
'.m
erge-requests-holder
'
)
expect
(
page
).
to
have_selector
(
'.m
r-list .merge-request
'
)
expect_tokens
([
author_token
(
user
.
name
)])
expect_tokens
([
author_token
(
user
.
name
)])
expect_filtered_search_input_empty
expect_filtered_search_input_empty
end
end
end
end
end
end
context
'when entering text into the search field'
,
:js
do
context
'when entering text into the search field'
do
before
do
before
do
page
.
within
(
'.search-input-wrap'
)
do
page
.
within
(
'.search-input-wrap'
)
do
fill_in
(
'search'
,
with:
project
.
name
[
0
..
3
]
)
fill_in
(
'search'
,
with:
scope_name
.
first
(
4
)
)
end
end
end
end
it
'does not display the category search dropdown'
do
it
'does not display the category search dropdown'
do
expect
(
page
).
not_to
have_selector
(
'.dropdown-header'
,
text:
/
#{
project
.
name
}
/i
)
expect
(
page
).
not_to
have_selector
(
'.dropdown-header'
,
text:
/
#{
scope_
name
}
/i
)
end
end
end
end
end
end
context
'when user is in a global scope'
do
include_examples
'search field examples'
do
let
(
:url
)
{
root_path
}
let
(
:scope_name
)
{
'All GitLab'
}
end
end
context
'when user is in a project scope'
do
include_examples
'search field examples'
do
let
(
:url
)
{
project_path
(
project
)
}
let
(
:scope_name
)
{
project
.
name
}
end
end
context
'when user is in a group scope'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
before
do
group
.
add_maintainer
(
user
)
end
include_examples
'search field examples'
do
let
(
:url
)
{
group_path
(
group
)
}
let
(
:scope_name
)
{
group
.
name
}
end
end
context
'when user is in a subgroup scope'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:subgroup
)
{
create
(
:group
,
:public
,
parent:
group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
subgroup
)
}
before
do
group
.
add_owner
(
user
)
subgroup
.
add_owner
(
user
)
end
include_examples
'search field examples'
do
let
(
:url
)
{
group_path
(
subgroup
)
}
let
(
:scope_name
)
{
subgroup
.
name
}
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