Edgewall Software
Modify

Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#5984 closed defect (fixed)

ticket reassign dropdown should show who it is assigned to currently

Reported by: thomas@… Owned by: osimons
Priority: normal Milestone: 0.11.2
Component: ticket system Version: 0.10.4
Severity: normal Keywords: review
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I am annoyed every time when I'm reviewing a bug report, get to the bottom, then don't know anymore who the bug was assigned to when I reach the "reassign to" dropdown box. Is it mine already ? Did I assign it to the right person ? Who knows!

The following one-liner changes the "reassign to (dropdownbox)" line to "reassign from (owner) to (dropdownbox) and is a simple one-line patch.

Also I assure you that your assessment of my ticket as 59% spam probability is 100% FALSE!

Attachments (6)

ticket.patch (479 bytes ) - added by anonymous 17 years ago.
t5984-r6259-a-reassign_info.diff (2.3 KB ) - added by osimons 17 years ago.
Using 0.11 workflow action hints to show the 'from' information.
5984-reassign-info-r7522.patch (2.4 KB ) - added by Remy Blank 16 years ago.
Updated patch for 0.11-stable [7522]
5984-reassign-info-r7524.patch (2.3 KB ) - added by osimons 16 years ago.
Further fix that fetches the true ticket owner instead of using the current preview owner.
5984-reassign-info-r7524-b.patch (2.4 KB ) - added by osimons 16 years ago.
Gah. Identing error with 'accept' status.
5984-reassign-info-r7527.patch (3.4 KB ) - added by Remy Blank 16 years ago.
Get pre-change field values from ticket._old

Download all attachments as: .zip

Change History (16)

by anonymous, 17 years ago

Attachment: ticket.patch added

comment:1 by osimons, 17 years ago

Keywords: review added
Milestone: 0.10.50.11.1
Owner: changed from Jonas Borgström to osimons

I was ready to follow your approach that seemed intuitive at first. Testing my first patch made me change standpoint:

  • by far the most common reassign action is reassigning to oneself.
  • restrict_owner (dropdown) or text field should have the same default value - and you should not have to type in your authname to change it from current owner.

So, I've made a slightly different approach by appending a (*) next to the current owner if it exists in the list. That gives a very useful visual indication in line with how we use it in related contexts.

  • trac/ticket/default_workflow.py

     
    223223                control.append(tag('to %s' % owners[0]))
    224224                hints.append(_("The owner will change to %s") % owners[0])
    225225            else:
     226                current_owner = ticket.values.get('owner', '')
    226227                control.append(tag([_("to "), tag.select(
    227                     [tag.option(x, selected=(x == selected_owner or None))
     228                    [tag.option(
     229                            x + (current_owner == x and ' (*)' or ''),
     230                            value=x,
     231                            selected=(x == selected_owner or None))
    228232                     for x in owners],
    229233                    id=id, name=id)]))
    230234                hints.append(_("The owner will change"))

Comments on this approach - and patch review - most welcome.

comment:2 by Thomas Vander Stichele <thomas@…>, 17 years ago

Hi,

Thanks for looking at this. I'm confused by your comments. I do not disagree with them, but I don't see why they invalidate my approach.

It sounds and looks like you were thinking that my patch is selecting by default in the drop down box who the ticket currently is assigned to. Is that what you are thinking ?

This is not the case. My patch adds a bit of text, like it says above: changes the "reassign to (dropdownbox)" line to "reassign from (owner) to (dropdownbox)"

ie, it adds "from (current owner)" inbetween "reassign" and the dropdown box/edit field, not touching the dropdown box/edit field at all.

I think it's not a good idea to just put an asterisk after the owner name in the dropdown box, because I have seen some huge dropdown boxes, and if it's a text entry field instead of a dropdown box, I'm not even sure what your patch does in that case ?

Let me know what you think.

by osimons, 17 years ago

Using 0.11 workflow action hints to show the 'from' information.

comment:3 by osimons, 17 years ago

You're right. I was reading the summary about 'dropdown should show…' and just into my approach too quickly.

With 0.11 this is completely different as you might know, but one of the new things is that it allows 'hints' next to the actions giving more information. Discreetly in low-key grey by default.

I've made the patch to show the information there instead - see t5984-r6259-a-reassign_info.diff

A better and cleaner approach. Thanks for keeping a watchful eye on things :-)

by Remy Blank, 16 years ago

Updated patch for 0.11-stable [7522]

comment:4 by Remy Blank, 16 years ago

The second patch doesn't apply to 0.11-stable anymore, so I have updated it by hand. All unit tests pass, and I have done some limited functionality testing. A very useful addition.

comment:5 by Christian Boos, 16 years ago

Looks good to me as well.

by osimons, 16 years ago

Further fix that fetches the true ticket owner instead of using the current preview owner.

comment:6 by osimons, 16 years ago

Turned out the previous patches got things mixed up when using 'Preview' before further edits - it would use the future owner as current owner in hint text.

Could someone please test the latest patch? It's been so long since i made the first patch, that I'm not quite sure I've covered all use cases…

by osimons, 16 years ago

Gah. Identing error with 'accept' status.

comment:7 by Remy Blank, 16 years ago

Right, I didn't notice this problem.

But I'm not sure about the solution. It feels like a hack to have to query the DB to get the original fields, when you had them a few lines up. Am I correct in assuming the problem originates with these two lines, which update ticket.values before render_ticket_action_control() is run?

Does this even make sense? I think this is the source of another preview problem: if you select "resolve as fixed" on a ticket in state "new", and click "Preview", on the next page the first proposed action is "leave as closed" instead of "leave as new".

Maybe we can just move the ticket.values update after the action box rendering?

comment:8 by Remy Blank, 16 years ago

My assumption above was wrong, it seems that the update to ticket.values is there by design (it is still a bit strange, as the same two lines appear a second time further down).

However, the pre-change values of the ticket fields can be retrieved from ticket._old, and this is already done in several places in default_workflow.py. This also allows fixing the state display problem mentioned above.

Here's an updated patch that works for me in all cases I could test.

by Remy Blank, 16 years ago

Get pre-change field values from ticket._old

comment:9 by osimons, 16 years ago

Milestone: 0.11.30.11.2
Resolution: fixed
Status: newclosed

Thanks Remy - I knew I had seen references to old values somewhere before, but just didn't spot it when I needed it.

I think it works well now too, and applied the latest to 0.11 in [7529].

comment:10 by osimons, 16 years ago

(and [7530] for trunk…)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from osimons to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.