Closed Bug 238352 Opened 22 years ago Closed 22 years ago

Sorting in reports makes them unclear

Categories

(Bugzilla :: Reporting/Charting, defect)

2.17.7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: gerv, Assigned: gerv)

Details

Attachments

(1 file, 1 obsolete file)

Reports currently display rows and columns in sorted order. This rather sucks. For example, you get: blocker critical enhancement major minor normal trivial when you should get: enhancement trivial minor normal major critical blocker Gerv
Attached patch Patch v.1 (obsolete) — Splinter Review
This change preserves the standard ordering for priority, severity, platform, OS, status and resolution. Gerv
Comment on attachment 144614 [details] [diff] [review] Patch v.1 Joel: you've reviewed reporting fixes in the past. Any chance you could take a stab at this one? Thanks, Gerv
Attachment #144614 - Flags: review?(bugreport)
Comment on attachment 144614 [details] [diff] [review] Patch v.1 >Index: report.cgi >+my @col_names = @{get_names($names{"col"}, $col_isnumeric, $col_field)}; I am curious; why do we need the @{...} around get_names? Doesn't get_names return a reference to a new array (produced by keps or lsearch) anyway? >+sub get_names { >+ my ($names, $isnumeric, $field) = @_; >+ >+ my @unsorted = keys %{$names}; >+ my @sorted; nits: - move unsorted into the branch where it's used (it's only used in the first branch) - move sorted to right before the if () statement >+ @sorted = map {lsearch(\@unsorted, $_) == -1 ? () : $_} @{$field_list}; Hmmm, I wonder if there isn't a simpler way to check if an item is in an array?
(In reply to comment #3) > (From update of attachment 144614 [details] [diff] [review]) > >Index: report.cgi > >+my @col_names = @{get_names($names{"col"}, $col_isnumeric, $col_field)}; > > I am curious; why do we need the @{...} around get_names? Doesn't get_names > return a reference to a new array (produced by keps or lsearch) anyway? Exactly, which is why it needs the @{} to dereference it, since the variable you're sticking it in is actually an array and not an array reference.
Attached patch Patch v.2Splinter Review
Fixed Kiko's points. Gerv
Attachment #144614 - Attachment is obsolete: true
Attachment #144907 - Flags: review?(kiko)
Comment on attachment 144907 [details] [diff] [review] Patch v.2 Looks good.
Attachment #144907 - Flags: review?(kiko) → review+
Attachment #144614 - Flags: review?(bugreport)
Flags: approval?
Flags: approval? → approval+
Target Milestone: --- → Bugzilla 2.18
Fixed. Thanks to kiko for reviewing :-) Checking in report.cgi; /cvsroot/mozilla/webtools/bugzilla/report.cgi,v <-- report.cgi new revision: 1.23; previous revision: 1.22 done Gerv
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: