Open Bug 369612 Opened 18 years ago Updated 4 years ago

buglist should have custom fields in the table row css classes

Categories

(Bugzilla :: Query/Bug List, enhancement)

2.23.4
enhancement
Not set
normal

Tracking

()

Bugzilla 6.0

People

(Reporter: after.fallout, Assigned: dwheeler, Mentored)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Buglists should get custom fields in the class attribute of the <tr> tag for each row, so people can more easily style buglists to help identify bugs with certain attributes.

Ideally, not all custom field values should get shoved in this section, that would be up to the administrator of the bugzilla (or perhaps the skin author?). 

This patch just puts them all there, because my local bugzilla will only have one custom field and we want to change the color of the row text based on this value (instead of severity), and because I don't have a good idea how this should be done. It puts them in in the format:
"bz_" + fieldname + "_" + fieldvalue
for example: "bz_cf_type_defect"
We should stop adding classes to buglists. Then someone will ask to have classes for each attribute of bugs. I know an installation which has > 100 custom fields. This "feature" would be terrific in this case.
(In reply to comment #1)
> We should stop adding classes to buglists. 
Not exactly; we should not add classes like we have in the past (bz_P3, bz_enhancement), but instead work them into an extensible framework that supports molding a particular installation of bugzilla around aspects of pre-existing models an installation is intended to support. 

Another bug (bug 287335) puts forth the idea that all select fields should become custom fields (without the cf_ prefix though). In line with fixing that bug, the css classes originally in buglist rows should be worked into a framework provided by this bug (instead of having bz_critical, we would get bz_severity_critical) and the initial list of custom fields that would be put into the css classes would be ["priority", "severity"]. Before fixing that bug, this list would be empty on a default installation.

Obviously this patch isn't ready to go anywhere, it is merely an idea of a first step on the path of how to do it. Any method that does get in should not complicate the existing codebase; preferably it would simplify it.
Comment on attachment 254299 [details] [diff] [review]
adds all custom fields to class attribute

>Index: template/en/default/list/table.html.tmpl

>+             [% fields = Bugzilla.get_fields({ obsolete => 0, custom => 1 }) %]

get_fields is not cached. You are executing an SQL per row, which will be a performance problem.

Further, I think we should stop adding loads of classes as well.
Attachment #254299 - Flags: review-
Thanks for the tip about querying every time. I fixed that, made it cleaner and brought it closer to this framework idea I am talking about.
Attachment #254299 - Attachment is obsolete: true
Request review if you want your patch to be reviewed. Or is it not ready yet?
Blocks: 284914
Bill, I came across this during a bug triage. I'm sorry your patch never got reviewed. Is this something you'd be interested either in re-submitting, or in mentoring, since I've marked it as a good first bug?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(after.fallout)
Whiteboard: [good first bug]
:dll, what are your thoughts on this bug?  Is it something that we should have?  It is getting older and we could make it a mentored bug- but we need a mentor!
Flags: needinfo?(after.fallout) → needinfo?(dkl)
(In reply to Joel Maher (:jmaher) from comment #7)
> :dll, what are your thoughts on this bug?  Is it something that we should
> have?  It is getting older and we could make it a mentored bug- but we need
> a mentor!

I think this is still a very useful change and will mentor this if someone else wants to finish the patch that was originally submitted.

dkl
Mentor: dkl
Flags: needinfo?(dkl)
No longer blocks: 1126453
Hello, I am interested in taking this on as my first open source contribution :). Is this ticket still open/needed?
(In reply to dwheeler from comment #9)
> Hello, I am interested in taking this on as my first open source
> contribution :). Is this ticket still open/needed?

Think that is a great idea. I am happy to help you as well should you need any assistance. Assigning to you.

dkl
Assignee: query-and-buglist → dwheeler
Target Milestone: --- → Bugzilla 6.0

Removing good-first-bug keyword because team does not have bandwidth to mentor at the moment.

Keywords: good-first-bug
Whiteboard: [good first bug]
See Also: → 329649
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: