#1064 closed defect (fixed)
sort version combo descending in new ticket form
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.9.4 |
Component: | ticket system | Version: | 0.8 |
Severity: | normal | Keywords: | |
Cc: | manuzhai@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
It be more natural to sort the versions combo box descending for the new ticket and ticket view?
Most bugs are filed against the jungest version of a software. If you have lots of versions you have to scroll down evertime. This change has also the side effect that the default version is set to unspecified for new issues if not specified in the trac.ini file.
A similar change would be interesting for the milestone field, as long as the milestones are related to the version number. Bugzilla has a sort order key for this to be able to sort also non numeric and non alphabetical orderd milestones correctly.
Attachments (1)
Change History (10)
by , 20 years ago
Attachment: | version_order.patch added |
---|
comment:2 by , 20 years ago
Cc: | added |
---|
comment:3 by , 19 years ago
i agree that a DESC order is good, but it should be ordered by the date/time attribute of a version, not its string sort order.
those without times specified should sort before those that do, imo
comment:4 by , 19 years ago
Cc: | added |
---|
comment:5 by , 19 years ago
Milestone: | → 0.9.4 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:6 by , 19 years ago
e.g.
-
trac/ticket/model.py
724 724 if not db: 725 725 db = env.get_db_cnx() 726 726 cursor = db.cursor() 727 cursor.execute("SELECT name,time,description FROM version "728 "ORDER BY COALESCE(time,0),name")727 cursor.execute("SELECT name,time,description FROM version") 728 versions = [] 729 729 for name, time, description in cursor: 730 component = cls(env) 731 component.name = name 732 component.time = time and int(time) or None 733 component.description = description or '' 734 yield component 730 version = cls(env) 731 version.name = name 732 version.time = time and int(time) or None 733 version.description = description or '' 734 versions.append(version) 735 def version_order(v): 736 return (v.time or sys.maxint, embedded_numbers(v.name)) 737 return sorted(versions, key=version_order, reverse=True) 735 738 select = classmethod(select)
comment:7 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 by , 18 years ago
Cc: | removed |
---|
patch for descending sort order of the version number field