mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-08 00:21:31 +00:00
Show warning when no workflow uses the status in the workflows (#30916).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17903 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
5102a7e16b
commit
0f94768f09
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user