Opened 7 years ago

Closed 7 years ago

# Hide fields when there are no supplied options

Reported by: Owned by: rjollos richard normal TracTicketChainedFieldsPlugin normal 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

### comment:1 Changed 7 years ago by richard

• Resolution set to fixed
• Status changed from new to closed

Fixed in [6352]. Usage:

• trac.ini
[tcf]
hide_empty_fields = true


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

### comment:2 Changed 7 years ago by rjollos

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