Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#5638 closed enhancement (fixed)

Hide fields when there are no supplied options

Reported by: Ryan J Ollos Owned by: Richard Liao
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 (0)

Change History (2)

comment:1 Changed 15 years ago by Richard Liao

Resolution: fixed
Status: newclosed

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.

comment:2 Changed 15 years ago by Ryan J Ollos

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Richard Liao.
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.