Ticket #5638 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Hide fields when there are no supplied options

Reported by: rjollos Assigned to: richard
Priority: normal Component: TracTicketChainedFieldsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I contacted Richard requesting the enhancement that a field could be hidden when there where no options supplied for that field. Suppose FieldA has several options, one being OptionA1. When OptionA1 is selected, suppose there are no options supplied for FieldB. In that case, FieldB should be hidden. However, when OptionA2 is selected, FieldB is populated with a number of possible values. Another example follows in my email below.


From: Richard Sent: Friday, August 07, 2009 2:42 AM To: Ryan J Ollos Subject: Re: TracTicketChainedFieldsPlugin

On Fri, Aug 7, 2009 at 3:02 PM, Ryan J Ollos wrote:

Hello, I was just looking at the plug-in that you recently uploaded. This looks like a nice addition to the Trac functionality. Quick question: does it have the ability to hide a ticket field when there are no options specified for that field? Or would it be easy to extend to have this feature?

It can't do that currently. It's not very hard to add this feature, I will make it soon.

For instance, suppose I had the following example: { "domain": { "software": { "component": { "acquisition layer": {}, "processing layer": {}, "driver layer": {} } } "hardware": { "component": { } } } I'd want the "component" field to be hidden if "hardware" was selected from the "domain" field. I've been thinking about working on something like that, but if your plug-in could do the trick as is or with a little bit of modification, that would be excellent! Thanks, - Ryan

Attachments

Change History

08/10/09 04:09:09 changed by richard

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [6352]. Usage:

  • trac.ini
    [tcf]
    hide_empty_fields = true
    
  • Please note:

if no options for some fields, like "SE" in example, you still need supply the full structure, with empty string as keys.

08/10/09 05:44:18 changed by rjollos

Thanks for adding this! It will be very helpful for my Trac installation.


Add/Change #5638 (Hide fields when there are no supplied options)




Change Properties
Action