Modify

Opened 7 years ago

Closed 7 years ago

#13156 closed enhancement (fixed)

Hide fields not only from the Properties box, but also from the Ticket and preview boxes

Reported by: Miklos Molnar Owned by: Jon Ashley
Priority: normal Component: KeepInterfaceSimplePlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

I suggest an improvement to provide an option to hide fields from the ticket box too. It can be useful in cases where there are a large number of custom fields and only small set of them are used in different type of tickets. I have implemented a solution which can be enabled in Trac.ini (see KisAssistant description). I have attached the patch to the ticket.

Attachments (2)

show_hide_ticket_box_fields.diff (4.8 KB) - added by Miklos Molnar 7 years ago.
Diff containing the improvements
alt_show_hide_ticket_box_fields.diff (8.8 KB) - added by Jon Ashley 7 years ago.
Modified approach to solving the same problem

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Miklos Molnar

Diff containing the improvements

Changed 7 years ago by Jon Ashley

Modified approach to solving the same problem

comment:1 Changed 7 years ago by Jon Ashley

I like the idea, and in fact have been considering something similar for a while without getting around to doing anything about it.

I have a couple of suggestions for changes:

  • I would like to be able to control this behaviour for individual fields. Sometimes I have fields that I want to remove from the ticket altogether, such as having a "stage introduced" field that only appears on "Fault" type tickets. At the same time, I want to remove some fields from only the user modification interface while still leaving the field displayed in the ticket box, such as hiding an "evaluation" field from a "Fault" type ticket once the evaluation has been approved and signed off. I am also trying to avoid introducing any general configuration options.
  • I'm not sure whether it's the right thing to hide the field changes in the comment preview window. The user could make a field visible, modify it, hide it again and submit - the underlying database would still have changed but with no preview indication. If a field is completely hidden on a ticket, it will never appear in the comment preview window anyway, as it will never be changed.

To get the first behaviour, I propose that there is an additional optional attribute on the .visible directives:

  • <field>.visible.ticket hides the field only in the ticket box (and possibly the comment preview);
  • <field>.visible.all hides the field everywhere;
  • <field>.visible and <field>.visible.property hide the field only in the Change Property box, as currently.

I have attached an as-yet untested patch to do all of this. Currently this does hide the fields in the comment preview as well as the ticket box. I'll have a think about whether to keep it like that over the next few days.

Thanks in particular for the ITemplateStreamFilter contribution. I don't really understand the mechanism by which Trac updates the automatic previews, and I think it would haven taken me a long time to figure that out.

Last edited 7 years ago by Jon Ashley (previous) (diff)

comment:2 Changed 7 years ago by Jon Ashley

In 16563:

Allow fields to behidden in either the ticket box or the property box, or in both boxes.
re #13156

comment:3 Changed 7 years ago by Jon Ashley

Status: newaccepted

comment:4 Changed 7 years ago by Jon Ashley

Resolution: fixed
Status: acceptedclosed

This has been applied in [16643].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jon Ashley.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.