Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11300 closed enhancement (fixed)

Allow default values for a ticket to be cleared through the ticket admin pages

Reported by: ivanelsonnunes@… Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.2
Component: ticket system Version:
Severity: normal Keywords:
Cc: Ryan J Ollos
Release Notes:

The default_milestone and default_version can be set to empty using the Clear default buttons on the corresponding Ticket System admin panels.

API Changes:

Description

Show some fields already selected the user can lead to error in filling out the ticket. For example the field "component" and "type" comes with a selected value.

This field should be loaded with blank or null, but should also be required.

I'm looking for native fields on the default interface of Trac.

  • type
  • component
  • priority

Of course this could be an option in trac.ini customized by the user.

Attachments (1)

ManageMilestones.png (51.5 KB ) - added by Ryan J Ollos 5 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 5 years ago by Ryan J Ollos

Milestone: next-stable-1.0.x
Summary: Not show the field "Component" and other fields already selected.Allow default values for a ticket to be cleared through the ticket admin pages

The ticket default values can be set in trac.ini (see TracIni#ticket-section). For example, to set the Component field to blank/null:

[ticket]
default_component = 

It was suggested on the mailing list that it should be possible to clear the default through the ticket admin pages, so that is the feature that can be handled in this ticket.

comment:2 Changed 5 years ago by Ryan J Ollos

#11340 was closed as a duplicate, but proposes a way to fix this.

comment:3 in reply to:  description ; Changed 5 years ago by Ryan J Ollos

Milestone: next-stable-1.0.xnext-dev-1.1.x

Replying to ivanelsonnunes@…:

Show some fields already selected the user can lead to error in filling out the ticket. For example the field "component" and "type" comes with a selected value.

This field should be loaded with blank or null, but should also be required.

Okay, I'm understanding this a bit more. Type, Component and Priority default to the first item in the list when the default_ value is empty or invalid. There is no "empty" value, like for milestones.

Perhaps all fields should behave the same, if a default value is not set, then the field will default to the "empty" value. The existing behavior for a default installation would easily be preserved, since for example default_component = component1 with the default Trac data.

The alternative, and much simpler than #11340, way to fix the inability to "unset" the default from the Web admin interface would be to just add a Clear default button to the page.

The above suggestions would lead to two fairly simple changes for this ticket:

  • Ticket select fields default to an empty value if the default value is not set.
  • A Clear default button would allow unsetting the radio button.

As for requiring fields be filled out, that would be a major extension to Trac that is currently handled by plugins such as th:DynamicFieldsPlugin, and it is a large-scope feature that probably won't be implemented soon.

comment:4 Changed 5 years ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newassigned

Changed 5 years ago by Ryan J Ollos

Attachment: ManageMilestones.png added

comment:5 in reply to:  3 Changed 5 years ago by Ryan J Ollos

Replying to rjollos:

The alternative, and much simpler than #11340, way to fix the inability to "unset" the default from the Web admin interface would be to just add a Clear default button to the page.

I've implemented the ability to clear the default value for the cases that an empty value is allowed for the select: default_milestone and default_version.

Proposed changes can be found in log:rjollos.git:t11300. I plan to add functional tests before pushing the changes.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:6 Changed 5 years ago by Ryan J Ollos

Thinking about it some more, my biggest concern is that users will find it odd to have a Clear default on some of the Ticket System admin pages, but not others. However, I still think it only makes sense to have a Clear default when an empty value is allowed, and while an empty value might make sense for Component, Priority and Severity, I'm less confident that everyone will agree it makes sense for Type and Resolution.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:7 Changed 5 years ago by Remy Blank

I think it's fine to have the "Clear default" button only on some of the pages.

comment:8 Changed 5 years ago by Ryan J Ollos

Thanks Remy. I added some functional tests to log:rjollos.git:t11300.

I couldn't come up with a good regex to check that the select was set to the empty option <option></option>. I guess that would require checking that the none of the options in the select had the selected=selected attribute. In the test I opted to just create a ticket and check what the milestone was set to.

comment:9 Changed 5 years ago by Ryan J Ollos

Milestone: next-dev-1.1.x1.1.2
Release Notes: modified (diff)

comment:10 in reply to:  3 Changed 5 years ago by Ryan J Ollos

Replying to rjollos:

Perhaps all fields should behave the same, if a default value is not set, then the field will default to the "empty" value. The existing behavior for a default installation would easily be preserved, since for example default_component = component1 with the default Trac data.

This was also requested in #10772, and I'll handle that ticket in a future release.

comment:11 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

Committed to trunk in [12214].

comment:12 in reply to:  3 Changed 5 years ago by Ryan J Ollos

Replying to rjollos:

The above suggestions would lead to two fairly simple changes for this ticket:

  • Ticket select fields default to an empty value if the default value is not set.

On further review while working on #10772, this proposed change would not work well because the user may want to set a default but still allow an empty value.

Also, with the changes proposed in #10772, the Clear default button will be added to additional admin pages.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.