Opened 8 years ago
Closed 8 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)
Change History (6)
Changed 8 years ago by
Attachment: | show_hide_ticket_box_fields.diff added |
---|
Changed 8 years ago by
Attachment: | alt_show_hide_ticket_box_fields.diff added |
---|
Modified approach to solving the same problem
comment:1 Changed 8 years ago by
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.
comment:3 Changed 8 years ago by
Status: | new → accepted |
---|
comment:4 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
This has been applied in [16643].
Diff containing the improvements