Vote #67328
完了Grey out workflow checkboxes for transitions to the same status
0%
説明
In workflow settings, it is configurable whether the current status can transit to the same status or not, though it is self-evident that the current status can transit to the same status.
!Screenshot.png!
journals
+1
Is it possible to apply Yuki Kita's patch? It seems extremely simple, but improves greately the UI (removes confusion about why are there same issue transitions).
--------------------------------------------------------------------------------
It does look nice. But...
Sometimes we only allow users to create new issues, not change any state. Then we would check the new/new checkbox. How would we solve that?
--------------------------------------------------------------------------------
Thomas Pihl wrote:
> It does look nice. But...
>
> Sometimes we only allow users to create new issues, not change any state. Then we would check the new/new checkbox. How would we solve that?
You do not have to check the new/new checkbox to prohibit users from changing state.
Instead of doing it, uncheck all checkbox and set the default value of issue statuses to "new".
I think this solves your concern.
--------------------------------------------------------------------------------
+ 1
--------------------------------------------------------------------------------
+ 1
--------------------------------------------------------------------------------
To those interested: let's discuss #5816 (about the initial statuses).
--------------------------------------------------------------------------------
+1
Small but easy embeddable enhancement!
--------------------------------------------------------------------------------
+1
I have made Yuki Kita's patch compatible with current trunk(Redmine 2.5.2.devel.13306).
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Updated the patch for the current trunk.
*Before:*
!{width: 756px}.5593-before@2x.png!
*After:*
!{width: 756px}.5593-after@2x.png!
--------------------------------------------------------------------------------
+1
This patch also provides great reference points within the checkbox matrix.
--------------------------------------------------------------------------------
+1
Attached is a patch that fixes an existing failing test and adds a test for Go Maeda's patch.
--------------------------------------------------------------------------------
Reading the tickets and comments from the related issue (#16364) where some users request the "force status transition" feature, I'm wondering if is better to show a disabled checked checkbox instead of "-" in order to make more obvious for the users that the "transition" between the same status is allowed and it cannot be disabled.
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> I'm wondering if is better to show a disabled checked checkbox instead of "-" in order to make more obvious for the users that the "transition" between the same status is allowed and it cannot be disabled.
That makes sense. Do you mean like this?
!{width: 792px}.5593-note14@2x.png!
--------------------------------------------------------------------------------
Marius' suggestion is a neat additional improvement. It coherently presents the current implementation but lets room for future changes without changing parts of the UI.
So if #16364 gets a thing someday, all we have to do is activating the checkboxes again.
--------------------------------------------------------------------------------
Go MAEDA wrote:
> That makes sense. Do you mean like this?
Exactly.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
I think Marius' suggestion is good as well.
I updated the patch to add disabled checkbox instead of "-".
--------------------------------------------------------------------------------
Fixed disabled checkbox not to be affected by toggleCheckboxesBySelector.
--------------------------------------------------------------------------------
Mizuki, thank you for posting the patch.
But I found that transitions whose source status and destination status are the same are displayed in a different color under certain conditions. Could you look into this and update the patch?
Steps to reproduce:
# Before applying the patch, edit the workflow for "Manager" - "Bug", check all transitions and save. Every transition is displayed in green.
# Uncheck the checkbox for "New" -> "New" transition and save. "New" -> "New" transition should be displayed in white.
# Apply the patch attachment:5593-r17235-2.patch
# Check "Manager" - "Bug" workflow. Transitions like "New" -> "New" and "Assigned -> Assigned" are checked and disabled. Although checked statuses should displayed in green but "New" -> "New" status (unchecked in step 2) is displayed in white.
!{width: 754px;}.wrong-color@2x.png!
--------------------------------------------------------------------------------
I attached a patch that corrected the problem pointed out to Go MAEDA.
I mainly added the following changes.
<pre><code class="diff">
diff --git a/app/views/workflows/_form.html.erb b/app/views/workflows/_form.html.erb
index 3fc69c4f5..542db4e35 100644
--- a/app/views/workflows/_form.html.erb
+++ b/app/views/workflows/_form.html.erb
@@ -38,7 +38,7 @@
<% end %>
</td>
<% for new_status in @statuses -%>
- <% checked = workflows.detect {|w| w.old_status == old_status && w.new_status == new_status} %>
+ <% checked = (old_status == new_status) || workflows.detect {|w| w.old_status == old_status && w.new_status == new_status} %>
<td class="<%= checked ? 'enabled' : '' %>" title="<%= old_status_name %> » <%= new_status.name %>">
<%= transition_tag workflows, old_status, new_status, name %>
</td>
</code></pre>
But there is one problem with this patch.
The state of workflow is saved as WorkflowTransition. (Even when the source status and the destination status are the same)
When a patch is applied, the checkbox displayed will be checked, even if the data indicates that it is not checked the checkbox.
That is, the data and the displayed results are contradictory.
I think it is difficult to display a disabled checkbox while maintaining consistency with the data.
--------------------------------------------------------------------------------
Mizuki ISHIKAWA wrote:
> When a patch is applied, the checkbox displayed will be checked, even if the data indicates that it is not checked the checkbox.
> That is, the data and the displayed results are contradictory.
You're worried that the displayed results are not according with the data from the database? For ex: In the UI, the checkbox for New -> New is checked and disabled, but in the db there is no entry in the WorkflowTransition for the transition (I'm asking just to confirm that I understand correctly).
If yes, I don't see a real problem from the following reasons:
- is not a real inconsistency because you don't really need a transition to update a ticket without changing the status.
- only a few users can observe this inconsistency and they need to be quite technical to deep in Redmine code and database.
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Mizuki ISHIKAWA wrote:
> > When a patch is applied, the checkbox displayed will be checked, even if the data indicates that it is not checked the checkbox.
> > That is, the data and the displayed results are contradictory.
>
> You're worried that the displayed results are not according with the data from the database? For ex: In the UI, the checkbox for New -> New is checked and disabled, but in the db there is no entry in the WorkflowTransition for the transition (I'm asking just to confirm that I understand correctly).
Yes, I was worried about it.
> If yes, I don't see a real problem from the following reasons:
> - is not a real inconsistency because you don't really need a transition to update a ticket without changing the status.
> - only a few users can observe this inconsistency and they need to be quite technical to deep in Redmine code and database.
Certainly, I think that few people feel strange about this problem.
I seemed to be over-thinking about it problem.
Thank you for checking, Marius BALTEANU.
--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------
related_issues
relates,Closed,5816,New issue initial status should be settable in workflow
relates,New,16364,Issue workflow doesn't force status transition though workflow is defined so