#11300 closed enhancement (fixed)
Allow default values for a ticket to be cleared through the ticket admin pages
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.2 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Ryan J Ollos | Branch: | |
Release Notes: |
The |
||
API Changes: | |||
Internal 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)
Change History (13)
comment:1 by , 11 years ago
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 |
follow-ups: 5 10 12 comment:3 by , 11 years ago
Milestone: | next-stable-1.0.x → next-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 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
by , 11 years ago
Attachment: | ManageMilestones.png added |
---|
comment:5 by , 11 years ago
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.
comment:6 by , 11 years ago
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.
comment:7 by , 11 years ago
I think it's fine to have the "Clear default" button only on some of the pages.
comment:8 by , 11 years ago
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 option
s 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 by , 11 years ago
Milestone: | next-dev-1.1.x → 1.1.2 |
---|---|
Release Notes: | modified (diff) |
comment:10 by , 11 years ago
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 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in [12214].
comment:12 by , 11 years ago
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.
The ticket default values can be set in trac.ini (see TracIni#ticket-section). For example, to set the Component field to blank/null:
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.