]> source.dussan.org Git - redmine.git/commitdiff
"Required" and "Read-only" rules on "Fields Permissions" screen are not colored ...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 11 Apr 2015 07:54:20 +0000 (07:54 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 11 Apr 2015 07:54:20 +0000 (07:54 +0000)
Patch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@14160 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/workflows/permissions.html.erb
test/functional/workflows_controller_test.rb

index 7b4b3f840f689241065a0a1aeb8026051a10d272..03740214d9f22e182721f9067458828d79462ff8 100644 (file)
@@ -65,7 +65,7 @@
           <%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
         </td>
         <% for status in @statuses -%>
-        <td class="<%= @permissions[status.id][field] %>">
+        <td class="<%= @permissions[status.id][field].try(:join, ' ') %>">
           <%= field_permission_tag(@permissions, status, field, @roles) %>
           <% unless status == @statuses.last %><a href="#" class="repeat-value">&#187;</a><% end %>
         </td>
index 85e0a1cf5eb3ed7beeb16faaaff75e37270ebc16..d59614aea4681392ed069cafb1c1be0ec491b4e1 100644 (file)
@@ -257,6 +257,15 @@ class WorkflowsControllerTest < ActionController::TestCase
     assert_equal IssueStatus.sorted.to_a, assigns(:statuses)
   end
 
+  def test_get_permissions_should_set_css_class
+    WorkflowPermission.delete_all
+    WorkflowPermission.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :field_name => 'assigned_to_id', :rule => 'required')
+
+    get :permissions, :role_id => 1, :tracker_id => 2
+    assert_response :success
+    assert_select 'td.required > select[name=?]', 'permissions[1][assigned_to_id]'
+  end
+
   def test_post_permissions
     WorkflowPermission.delete_all