buglist should have custom fields in the table row css classes

NEW
Assigned to

Status

()

Bugzilla
Query/Bug List
--
enhancement
11 years ago
6 months ago

People

(Reporter: Bill Barry, Assigned: dwheeler, Mentored)

Tracking

(Blocks: 1 bug, {good-first-bug})

2.23.4
Bugzilla 6.0
good-first-bug

Details

(Whiteboard: [good first bug] )

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

11 years ago
Created attachment 254299 [details] [diff] [review]
adds all custom fields to class attribute

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"

Comment 1

11 years ago
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.
(Reporter)

Comment 2

11 years ago
(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 3

11 years ago
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-
(Reporter)

Comment 4

11 years ago
Created attachment 254321 [details] [diff] [review]
closer to the framework model I am talking about

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

Comment 5

11 years ago
Request review if you want your patch to be reviewed. Or is it not ready yet?

Updated

10 years ago
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@mozilla.com
Flags: needinfo?(dkl)
No longer blocks: 1126453
(Assignee)

Comment 9

a year ago
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
Keywords: good-first-bug
You need to log in before you can comment on or make changes to this bug.