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
d4b2f5d0
Commit
d4b2f5d0
authored
Jun 10, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render only issues/mr in subnav depends on context
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
1976a446
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
17 deletions
+21
-17
_project.html.haml
app/views/layouts/nav/_project.html.haml
+1
-1
_head.html.haml
app/views/projects/issues/_head.html.haml
+2
-2
active_tab.feature
features/project/active_tab.feature
+8
-4
active_tab.rb
features/steps/project/active_tab.rb
+8
-8
active_tab.rb
features/steps/shared/active_tab.rb
+2
-2
No files found.
app/views/layouts/nav/_project.html.haml
View file @
d4b2f5d0
...
...
@@ -63,7 +63,7 @@
Graphs
-
if
project_nav_tab?
:issues
=
nav_link
(
controller:
:issues
)
do
=
nav_link
(
controller:
[
:issues
,
:labels
,
:milestones
]
)
do
=
link_to
url_for_project_issues
(
@project
,
only_path:
true
),
title:
'Issues'
,
class:
'shortcuts-issues'
do
=
navbar_icon
(
'issues'
)
%span
...
...
app/views/projects/issues/_head.html.haml
View file @
d4b2f5d0
%ul
.nav-links.sub-nav
%div
{
class:
(
container_class
)
}
-
if
project_nav_tab?
(
:issues
)
-
if
project_nav_tab?
(
:issues
)
&&
current_controller?
(
:issues
)
=
nav_link
(
controller: :issues
)
do
=
link_to
url_for_project_issues
(
@project
,
only_path:
true
),
title:
'Issues'
do
%span
Issues
-
if
project_nav_tab?
(
:merge_requests
)
-
if
project_nav_tab?
(
:merge_requests
)
&&
current_controller?
(
:merge_requests
)
=
nav_link
(
controller: :merge_requests
)
do
=
link_to
namespace_project_merge_requests_path
(
@project
.
namespace
,
@project
),
title:
'Merge Requests'
do
%span
...
...
features/project/active_tab.feature
View file @
d4b2f5d0
...
...
@@ -107,12 +107,16 @@ Feature: Project Active Tab
Scenario
:
On Project Issues/Milestones
Given
I visit my project's issues page
And
I click the
"Milestones"
tab
Then
the active main tab should be Milestones
And
I click the
"Milestones"
sub tab
Then
the active main tab should be Issues
Then
the active sub tab should be Milestones
And
no other main tabs should be active
And
no other sub tabs should be active
Scenario
:
On Project Issues/Labels
Given
I visit my project's issues page
And
I click the
"Labels"
tab
Then
the active main tab should be Labels
And
I click the
"Labels"
sub tab
Then
the active main tab should be Issues
Then
the active sub tab should be Labels
And
no other main tabs should be active
And
no other sub tabs should be active
features/steps/project/active_tab.rb
View file @
d4b2f5d0
...
...
@@ -77,14 +77,14 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
# Sub Tabs: Issues
step
'I click the "Milestones" tab'
do
page
.
within
(
'.
layout
-nav'
)
do
step
'I click the "Milestones"
sub
tab'
do
page
.
within
(
'.
sub
-nav'
)
do
click_link
(
'Milestones'
)
end
end
step
'I click the "Labels" tab'
do
page
.
within
(
'.
layout
-nav'
)
do
step
'I click the "Labels"
sub
tab'
do
page
.
within
(
'.
sub
-nav'
)
do
click_link
(
'Labels'
)
end
end
...
...
@@ -93,11 +93,11 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
ensure_active_sub_tab
(
'Issues'
)
end
step
'the active
main
tab should be Milestones'
do
ensure_active_
main
_tab
(
'Milestones'
)
step
'the active
sub
tab should be Milestones'
do
ensure_active_
sub
_tab
(
'Milestones'
)
end
step
'the active
main
tab should be Labels'
do
ensure_active_
main
_tab
(
'Labels'
)
step
'the active
sub
tab should be Labels'
do
ensure_active_
sub
_tab
(
'Labels'
)
end
end
features/steps/shared/active_tab.rb
View file @
d4b2f5d0
...
...
@@ -6,7 +6,7 @@ module SharedActiveTab
end
def
ensure_active_sub_tab
(
content
)
expect
(
find
(
'
div.content ul.nav-links
li.active'
)).
to
have_content
(
content
)
expect
(
find
(
'
.sub-nav
li.active'
)).
to
have_content
(
content
)
end
def
ensure_active_sub_nav
(
content
)
...
...
@@ -18,7 +18,7 @@ module SharedActiveTab
end
step
'no other sub tabs should be active'
do
expect
(
page
).
to
have_selector
(
'
div.content ul.nav-links
li.active'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'
.sub-nav
li.active'
,
count:
1
)
end
step
'no other sub navs should be active'
do
...
...
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