Project

General

Profile

Feature #39529 » feature-39529-v2.patch

Mizuki ISHIKAWA, 2024-01-04 07:59

View differences:

app/helpers/application_helper.rb
name = remove_double_quotes(identifier)
u = User.visible.find_by("LOWER(login) = :s AND type = 'User'", :s => name.downcase)
link = link_to_user(u, :only_path => only_path, :class => 'user-mention', :mention => true) if u
link += content_tag('span', l(:notice_mention_watcher), class: 'icon-only icon-warning', title: l(:notice_invalid_mention)) if u && obj && !obj.visible?(u)
end
end
(leading + (link || "#{project_prefix}#{prefix}#{repo_prefix}#{sep}#{identifier}#{comment_suffix}"))
config/locales/en.yml
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."
notice_invalid_mention: "Invalid mention: User will not receive mention 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."
test/helpers/application_helper_test.rb
end
end
def test_mention_link_to_users_who_are_not_authorised_to_view_the_object
set_language_if_valid 'en'
with_settings :text_formatting => 'textile' do
issue = Issue.find(4)
assert_not issue.visible?(User.find(3))
assert_equal "<p>#{link_to_user(User.find(3), only_path: true, class: 'user-mention', mention: true)}#{content_tag('span', l(:notice_mention_watcher), class: 'icon-only icon-warning', title: l(:notice_invalid_mention))}</p>", textilizable("@#{User.find(3).login}", :object => issue)
journal = Journal.find(2)
assert_equal '<p><a href="#note-2">#note-2</a></p>', textilizable('#note-2', :object => journal)
end
end
def test_link_to_note_within_the_same_page
with_settings :text_formatting => 'textile' do
issue = Issue.find(1)
(4-4/7)