Commit 6ae15ca8 authored by maeda's avatar maeda

Show warning when no workflow uses the status in the workflows (#30916).

Patch by Go MAEDA.


git-svn-id: https://svn.redmine.org/redmine/trunk@17903 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 5a023262
......@@ -13,6 +13,7 @@
<% end %>
<th><%=l(:field_is_closed)%></th>
<th></th>
<th></th>
</tr></thead>
<tbody>
<% for status in @issue_statuses %>
......@@ -22,6 +23,13 @@
<td><%= status.default_done_ratio %></td>
<% end %>
<td><%= checked_image status.is_closed? %></td>
<td>
<% unless WorkflowTransition.where('old_status_id = ? OR new_status_id = ?', status.id, status.id).exists? %>
<span class="icon icon-warning">
<%= l(:text_status_no_workflow) %> (<%= link_to l(:button_edit), workflows_edit_path(:used_statuses_only => 0) %>)
</span>
<% end %>
</td>
<td class="buttons">
<%= reorder_handle(status) %>
<%= delete_link issue_status_path(status) %>
......
......@@ -1131,6 +1131,7 @@ en:
text_length_between: "Length between %{min} and %{max} characters."
text_tracker_no_workflow: No workflow defined for this tracker
text_role_no_workflow: No workflow defined for this role
text_status_no_workflow: No tracker uses this status in the workflows
text_unallowed_characters: Unallowed characters
text_comma_separated: Multiple values allowed (comma separated).
text_line_separated: Multiple values allowed (one line for each value).
......
......@@ -43,6 +43,21 @@ class IssueStatusesControllerTest < Redmine::ControllerTest
assert_response 406
end
def test_index_should_show_warning_when_no_workflow_is_defined
status = IssueStatus.new :name => "No workflow"
status.save!
get :index
assert_response :success
assert_select 'table.issue_statuses tbody' do
assert_select 'tr:not(:last-of-type) span.icon-warning', :count => 0
assert_select 'tr:last-of-type' do
assert_select 'td.name', :text => status.name
assert_select 'td:nth-of-type(3) span.icon-warning', :text => /#{I18n.t(:text_status_no_workflow)}/
end
end
end
def test_new
get :new
assert_response :success
......
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