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
9cc7d936
Commit
9cc7d936
authored
Feb 08, 2017
by
George Andrinopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide issue info when project issues are disabled
parent
c5b29ed6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
25 deletions
+106
-25
app/views/projects/milestones/show.html.haml
app/views/projects/milestones/show.html.haml
+1
-1
app/views/shared/milestones/_summary.html.haml
app/views/shared/milestones/_summary.html.haml
+15
-12
app/views/shared/milestones/_tabs.html.haml
app/views/shared/milestones/_tabs.html.haml
+22
-12
changelogs/unreleased/19497-hide-relevant-info-when-project-issues-are-disabled.yml
...7-hide-relevant-info-when-project-issues-are-disabled.yml
+4
-0
spec/features/projects/milestones/milestone_spec.rb
spec/features/projects/milestones/milestone_spec.rb
+64
-0
No files found.
app/views/projects/milestones/show.html.haml
View file @
9cc7d936
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
=
preserve
do
=
preserve
do
=
markdown_field
(
@milestone
,
:description
)
=
markdown_field
(
@milestone
,
:description
)
-
if
@milestone
.
total_items_count
(
current_user
).
zero?
-
if
can?
(
current_user
,
:read_issue
,
@project
)
&&
@milestone
.
total_items_count
(
current_user
).
zero?
.alert.alert-success.prepend-top-default
.alert.alert-success.prepend-top-default
%span
Assign some issues to this milestone.
%span
Assign some issues to this milestone.
-
elsif
@milestone
.
complete?
(
current_user
)
&&
@milestone
.
active?
-
elsif
@milestone
.
complete?
(
current_user
)
&&
@milestone
.
active?
...
...
app/views/shared/milestones/_summary.html.haml
View file @
9cc7d936
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
.milestone-stats-and-buttons
.milestone-stats-and-buttons
.milestone-stats
.milestone-stats
-
if
!
project
||
can?
(
current_user
,
:read_issue
,
project
)
%span
.milestone-stat.with-drilldown
%span
.milestone-stat.with-drilldown
%strong
=
milestone
.
issues_visible_to_user
(
current_user
).
size
%strong
=
milestone
.
issues_visible_to_user
(
current_user
).
size
issues:
issues:
...
@@ -32,9 +33,11 @@
...
@@ -32,9 +33,11 @@
.milestone-progress-buttons
.milestone-progress-buttons
%span
.tab-issues-buttons
%span
.tab-issues-buttons
-
if
project
&&
can?
(
current_user
,
:create_issue
,
project
)
-
if
project
-
if
can?
(
current_user
,
:create_issue
,
project
)
=
link_to
new_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue:
{
milestone_id:
milestone
.
id
}),
class:
"btn"
,
title:
"New Issue"
do
=
link_to
new_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue:
{
milestone_id:
milestone
.
id
}),
class:
"btn"
,
title:
"New Issue"
do
New Issue
New Issue
-
if
can?
(
current_user
,
:read_issue
,
project
)
=
link_to
'Browse Issues'
,
milestones_browse_issuables_path
(
milestone
,
type: :issues
),
class:
"btn"
=
link_to
'Browse Issues'
,
milestones_browse_issuables_path
(
milestone
,
type: :issues
),
class:
"btn"
%span
.tab-merge-requests-buttons.hidden
%span
.tab-merge-requests-buttons.hidden
=
link_to
'Browse Merge Requests'
,
milestones_browse_issuables_path
(
milestone
,
type: :merge_requests
),
class:
"btn"
=
link_to
'Browse Merge Requests'
,
milestones_browse_issuables_path
(
milestone
,
type: :merge_requests
),
class:
"btn"
...
...
app/views/shared/milestones/_tabs.html.haml
View file @
9cc7d936
%ul
.nav-links.no-top.no-bottom
%ul
.nav-links.no-top.no-bottom
-
if
milestone
.
is_a?
(
GlobalMilestone
)
||
can?
(
current_user
,
:read_issue
,
@project
)
%li
.active
%li
.active
=
link_to
'#tab-issues'
,
'data-toggle'
=>
'tab'
,
'data-show'
=>
'.tab-issues-buttons'
do
=
link_to
'#tab-issues'
,
'data-toggle'
=>
'tab'
,
'data-show'
=>
'.tab-issues-buttons'
do
Issues
Issues
...
@@ -7,6 +8,11 @@
...
@@ -7,6 +8,11 @@
=
link_to
'#tab-merge-requests'
,
'data-toggle'
=>
'tab'
,
'data-show'
=>
'.tab-merge-requests-buttons'
do
=
link_to
'#tab-merge-requests'
,
'data-toggle'
=>
'tab'
,
'data-show'
=>
'.tab-merge-requests-buttons'
do
Merge Requests
Merge Requests
%span
.badge
=
milestone
.
merge_requests
.
size
%span
.badge
=
milestone
.
merge_requests
.
size
-
else
%li
.active
=
link_to
'#tab-merge-requests'
,
'data-toggle'
=>
'tab'
,
'data-show'
=>
'.tab-merge-requests-buttons'
do
Merge Requests
%span
.badge
=
milestone
.
merge_requests
.
size
%li
%li
=
link_to
'#tab-participants'
,
'data-toggle'
=>
'tab'
do
=
link_to
'#tab-participants'
,
'data-toggle'
=>
'tab'
do
Participants
Participants
...
@@ -20,10 +26,14 @@
...
@@ -20,10 +26,14 @@
-
show_full_project_name
=
local_assigns
.
fetch
(
:show_full_project_name
,
false
)
-
show_full_project_name
=
local_assigns
.
fetch
(
:show_full_project_name
,
false
)
.tab-content.milestone-content
.tab-content.milestone-content
-
if
milestone
.
is_a?
(
GlobalMilestone
)
||
can?
(
current_user
,
:read_issue
,
@project
)
.tab-pane.active
#tab-issues
.tab-pane.active
#tab-issues
=
render
'shared/milestones/issues_tab'
,
issues:
milestone
.
issues_visible_to_user
(
current_user
).
include_associations
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
=
render
'shared/milestones/issues_tab'
,
issues:
milestone
.
issues_visible_to_user
(
current_user
).
include_associations
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
.tab-pane
#tab-merge-requests
.tab-pane
#tab-merge-requests
=
render
'shared/milestones/merge_requests_tab'
,
merge_requests:
milestone
.
merge_requests
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
=
render
'shared/milestones/merge_requests_tab'
,
merge_requests:
milestone
.
merge_requests
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
-
else
.tab-pane.active
#tab-merge-requests
=
render
'shared/milestones/merge_requests_tab'
,
merge_requests:
milestone
.
merge_requests
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
.tab-pane
#tab-participants
.tab-pane
#tab-participants
=
render
'shared/milestones/participants_tab'
,
users:
milestone
.
participants
=
render
'shared/milestones/participants_tab'
,
users:
milestone
.
participants
.tab-pane
#tab-labels
.tab-pane
#tab-labels
...
...
changelogs/unreleased/19497-hide-relevant-info-when-project-issues-are-disabled.yml
0 → 100644
View file @
9cc7d936
---
title
:
Hide issue info when project issues are disabled
merge_request
:
author
:
George Andrinopoulos
spec/features/projects/milestones/milestone_spec.rb
0 → 100644
View file @
9cc7d936
require
'spec_helper'
feature
'Project milestone'
,
:feature
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
name:
'test'
,
namespace:
user
.
namespace
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
before
do
login_as
(
user
)
end
context
'when project has enabled issues'
do
before
do
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
milestone
)
end
it
'shows issues tab'
do
within
(
'#content-body'
)
do
expect
(
page
).
to
have_link
'Issues'
,
href:
'#tab-issues'
expect
(
page
).
to
have_selector
'.nav-links li.active'
,
count:
1
expect
(
find
(
'.nav-links li.active'
)).
to
have_content
'Issues'
end
end
it
'shows issues stats'
do
expect
(
page
).
to
have_content
'issues:'
end
it
'shows Browse Issues button'
do
within
(
'#content-body'
)
do
expect
(
page
).
to
have_link
'Browse Issues'
end
end
end
context
'when project has disabled issues'
do
before
do
project
.
project_feature
.
update_attribute
(
:issues_access_level
,
ProjectFeature
::
DISABLED
)
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
milestone
)
end
it
'hides issues tab'
do
within
(
'#content-body'
)
do
expect
(
page
).
not_to
have_link
'Issues'
,
href:
'#tab-issues'
expect
(
page
).
to
have_selector
'.nav-links li.active'
,
count:
1
expect
(
find
(
'.nav-links li.active'
)).
to
have_content
'Merge Requests'
end
end
it
'hides issues stats'
do
expect
(
page
).
to
have_no_content
'issues:'
end
it
'hides Browse Issues button'
do
within
(
'#content-body'
)
do
expect
(
page
).
not_to
have_link
'Browse Issues'
end
end
it
'does not show an informative message'
do
expect
(
page
).
not_to
have_content
(
'Assign some issues to this milestone.'
)
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