Project

General

Profile

Patch #33329 » 0003-Show-an-warning-message-for-watchers-who-cannot-view.patch

Marius BĂLTEANU, 2020-04-20 14:48

View differences:

app/helpers/watchers_helper.rb
s = ''.html_safe
s << avatar(user, :size => "16").to_s
s << link_to_user(user, :class => 'user')
if object.respond_to?(:visible?) && user.is_a?(User) && !object.visible?(user)
s << content_tag('span', l(:notice_invalid_watcher), class: 'icon-only icon-warning', title: l(:notice_invalid_watcher))
end
if remove_allowed
url = {:controller => 'watchers',
:action => 'destroy',
config/locales/en.yml
notice_issue_not_closable_by_open_tasks: "This issue cannot be closed because it has at least one open subtask."
notice_issue_not_closable_by_blocking_issue: "This issue cannot be closed because it is blocked by at least one open issue."
notice_issue_not_reopenable_by_closed_parent_issue: "This issue cannot be reopened because its parent issue is closed."
notice_invalid_watcher: "Invalid watcher: User will not receive any notifications because it does not have access to view this object."
error_can_t_load_default_data: "Default configuration could not be loaded: %{value}"
error_scm_not_found: "The entry or revision was not found in the repository."
public/stylesheets/application.css
#sidebar div.wiki ul li {list-style-type:inherit;}
#sidebar a.icon-only {opacity: 0.4; margin-left: 5px;}
#sidebar a.icon-only:hover {opacity: 1;}
#sidebar span.icon-warning {margin-left: 5px;}
#sidebar li input[type=checkbox] {height: 20px;}
#content { flex-grow: 1; background-color: #fff; margin: 0px; padding: 6px 10px 10px 10px; overflow-x: auto;}
test/functional/issues_controller_test.rb
end
end
def test_show_should_mark_invalid_watchers
@request.session[:user_id] = 2
issue = Issue.find(4)
issue.add_watcher User.find(4)
get :show, :params => {:id => issue.id}
assert_response :success
assert_select 'div#watchers ul' do
assert_select 'li.user-4' do
assert_select 'span.icon-warning[title=?]', l(:notice_invalid_watcher), text: l(:notice_invalid_watcher)
end
end
end
def test_show_with_thumbnails_enabled_should_display_thumbnails
skip unless convert_installed?
@request.session[:user_id] = 2
(2-2/5)