Commit 4af62042 authored by Rydkin Maxim's avatar Rydkin Maxim

remove unnecessary issues event filter on comments tab

fix features_visibility_spec.rb

remove strange part of spec

fix conditions of comments tab disappearing and fix spec

generate changelog

rewrite spec for more coplex check step-by-step

move conditional logic into helper and fix changelog

fix indentation in helper
parent 6992ac11
...@@ -45,6 +45,12 @@ module EventsHelper ...@@ -45,6 +45,12 @@ module EventsHelper
@project.feature_available?(feature_key, current_user) @project.feature_available?(feature_key, current_user)
end end
def comments_visible?
event_filter_visible(:repository) ||
event_filter_visible(:merge_requests) ||
event_filter_visible(:issues)
end
def event_preposition(event) def event_preposition(event)
if event.push? || event.commented? || event.target if event.push? || event.commented? || event.target
"at" "at"
......
...@@ -6,6 +6,6 @@ ...@@ -6,6 +6,6 @@
= event_filter_link EventFilter.merged, 'Merge events' = event_filter_link EventFilter.merged, 'Merge events'
- if event_filter_visible(:issues) - if event_filter_visible(:issues)
= event_filter_link EventFilter.issue, 'Issue events' = 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.comments, 'Comments'
= event_filter_link EventFilter.team, 'Team' = event_filter_link EventFilter.team, 'Team'
---
title: 'Fix comments activity tab visibility condition'
merge_request: 7913
author: Rydkin Maxim
...@@ -182,6 +182,44 @@ describe 'Edit Project Settings', feature: true do ...@@ -182,6 +182,44 @@ describe 'Edit Project Settings', feature: true do
expect(page).not_to have_content("Comments") expect(page).not_to have_content("Comments")
end end
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 end
# Regression spec for https://gitlab.com/gitlab-org/gitlab-ce/issues/24056 # Regression spec for https://gitlab.com/gitlab-org/gitlab-ce/issues/24056
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment