From 7ae0427c9ee891820954dfbd72c129d65989b3e8 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Wed, 11 Dec 2024 06:37:58 +0000 Subject: Replaces warning icon with SVG in watcher list and workflow warnings (#41918). Patch by Takenori TAKAKI (user:takenory). git-svn-id: https://svn.redmine.org/redmine/trunk@23388 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/assets/stylesheets/application.css | 2 +- app/helpers/watchers_helper.rb | 2 +- app/views/issue_statuses/index.html.erb | 2 +- app/views/issues/_attributes.html.erb | 2 +- app/views/trackers/index.html.erb | 2 +- test/functional/issues_controller_test.rb | 5 ++++- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 8590db99a..e385964fb 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1763,7 +1763,7 @@ svg.icon-ok { stroke: #c61a1a } -.icon-warning svg { +.icon-warning svg.icon-svg { stroke: #e4bc4b; } diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 00afd30ae..882325c18 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -52,7 +52,7 @@ module WatchersHelper s << avatar(user, :size => "16").to_s if user.is_a?(User) s << link_to_principal(user, class: user.class.to_s.downcase) 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)) + s << content_tag('span', sprite_icon('warning', l(:notice_invalid_watcher)), class: 'icon-only icon-warning', title: l(:notice_invalid_watcher)) end if remove_allowed url = {:controller => 'watchers', diff --git a/app/views/issue_statuses/index.html.erb b/app/views/issue_statuses/index.html.erb index a8f7a055f..c38e3b88b 100644 --- a/app/views/issue_statuses/index.html.erb +++ b/app/views/issue_statuses/index.html.erb @@ -28,7 +28,7 @@ <% unless WorkflowTransition.where('old_status_id = ? OR new_status_id = ?', status.id, status.id).exists? %> - <%= l(:text_status_no_workflow) %> (<%= link_to l(:button_edit), edit_workflows_path(:used_statuses_only => 0) %>) + <%= sprite_icon('warning', l(:text_status_no_workflow)) %> (<%= link_to l(:button_edit), edit_workflows_path(:used_statuses_only => 0) %>) <% end %> diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 65637e51f..970767460 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -9,7 +9,7 @@ :title => @issue.status.description %> <%= content_tag 'a', sprite_icon('help', l(:label_open_issue_statuses_description)), :class => 'icon-only icon-help', :title => l(:label_open_issue_statuses_description), :onclick => "showModal('issue_statuses_description', '500px'); return false;", :href => '#' if @allowed_statuses.any? {|s| s.description.present? } %> <% if @issue.transition_warning %> - <%= @issue.transition_warning %> + <%= sprite_icon('warning', l(:notice_issue_not_closable_by_open_tasks)) %> <% end %>

<%= render partial: 'issues/issue_status_description', locals: { issue_statuses: @allowed_statuses } %> diff --git a/app/views/trackers/index.html.erb b/app/views/trackers/index.html.erb index 5896f5388..12dc0aa4c 100644 --- a/app/views/trackers/index.html.erb +++ b/app/views/trackers/index.html.erb @@ -22,7 +22,7 @@ <% unless tracker.workflow_rules.exists? %> - <%= l(:text_tracker_no_workflow) %> (<%= link_to l(:button_edit), edit_workflows_path(:tracker_id => tracker) %>) + <%= sprite_icon('warning', l(:text_tracker_no_workflow)) %> (<%= link_to l(:button_edit), edit_workflows_path(:tracker_id => tracker) %>) <% end %> diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index fbe512122..643345eac 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -5993,7 +5993,10 @@ class IssuesControllerTest < Redmine::ControllerTest assert_response :success reason = l(:notice_issue_not_closable_by_blocking_issue) - assert_select 'span.icon-warning[title=?]', reason, :text => reason + assert_select 'span.icon-warning[title=?]', reason do + assert_select "svg.icon-svg use:match('href', ?)", /assets\/icons-\w+.svg#icon--warning/ + assert_select 'span.icon-label', test: reason + end end def test_get_edit_should_display_visible_spent_time_custom_field -- cgit v1.2.3