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
b026e8cd
Commit
b026e8cd
authored
Dec 09, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '25272_fix_comments_tab_disappearing' into 'master'
Fix comments tab disappearing Fixes #25272 See merge request !7913
parents
1f9d688f
4af62042
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
1 deletion
+49
-1
events_helper.rb
app/helpers/events_helper.rb
+6
-0
_event_filter.html.haml
app/views/shared/_event_filter.html.haml
+1
-1
25272_fix_comments_tab_disappearing.yml
...gelogs/unreleased/25272_fix_comments_tab_disappearing.yml
+4
-0
features_visibility_spec.rb
spec/features/projects/features_visibility_spec.rb
+38
-0
No files found.
app/helpers/events_helper.rb
View file @
b026e8cd
...
...
@@ -45,6 +45,12 @@ module EventsHelper
@project
.
feature_available?
(
feature_key
,
current_user
)
end
def
comments_visible?
event_filter_visible
(
:repository
)
||
event_filter_visible
(
:merge_requests
)
||
event_filter_visible
(
:issues
)
end
def
event_preposition
(
event
)
if
event
.
push?
||
event
.
commented?
||
event
.
target
"at"
...
...
app/views/shared/_event_filter.html.haml
View file @
b026e8cd
...
...
@@ -6,6 +6,6 @@
=
event_filter_link
EventFilter
.
merged
,
'Merge events'
-
if
event_filter_visible
(
:issues
)
=
event_filter_link
EventFilter
.
issue
,
'Issue events'
-
if
event_filter_visible
(
:issues
)
-
if
comments_visible?
=
event_filter_link
EventFilter
.
comments
,
'Comments'
=
event_filter_link
EventFilter
.
team
,
'Team'
changelogs/unreleased/25272_fix_comments_tab_disappearing.yml
0 → 100644
View file @
b026e8cd
---
title
:
'
Fix
comments
activity
tab
visibility
condition'
merge_request
:
7913
author
:
Rydkin Maxim
spec/features/projects/features_visibility_spec.rb
View file @
b026e8cd
...
...
@@ -182,6 +182,44 @@ describe 'Edit Project Settings', feature: true do
expect
(
page
).
not_to
have_content
(
"Comments"
)
end
end
# Regression spec for https://gitlab.com/gitlab-org/gitlab-ce/issues/25272
it
"hides comments activity tab only on disabled issues, merge requests and repository"
do
select
"Disabled"
,
from:
"project_project_feature_attributes_issues_access_level"
save_changes_and_check_activity_tab
do
expect
(
page
).
to
have_content
(
"Comments"
)
end
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
select
"Disabled"
,
from:
"project_project_feature_attributes_merge_requests_access_level"
save_changes_and_check_activity_tab
do
expect
(
page
).
to
have_content
(
"Comments"
)
end
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
select
"Disabled"
,
from:
"project_project_feature_attributes_repository_access_level"
save_changes_and_check_activity_tab
do
expect
(
page
).
not_to
have_content
(
"Comments"
)
end
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
end
def
save_changes_and_check_activity_tab
click_button
"Save changes"
wait_for_ajax
visit
activity_namespace_project_path
(
project
.
namespace
,
project
)
page
.
within
(
".event-filter"
)
do
yield
end
end
end
# Regression spec for https://gitlab.com/gitlab-org/gitlab-ce/issues/24056
...
...
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