Large Text Box should have maxlength and wrap => 1 in buglists

RESOLVED FIXED in Bugzilla 5.0

Status

()

Bugzilla
Query/Bug List
P3
enhancement
RESOLVED FIXED
9 years ago
4 years ago

People

(Reporter: Christian Höltje, Assigned: Lalit Khattar)

Tracking

3.4.3
Bugzilla 5.0
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

1.32 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Reporter)

Description

9 years ago
Large Text Box custom fields should have a maxlength, similar to "Summary (first 60 characters)".  Or at least have an option to choose a short version instead.

Otherwise, adding these columns to your buglist makes the buglist unusable.

Updated

9 years ago
Severity: normal → enhancement
Priority: -- → P3
Whiteboard: [Good Intro Bug]

Comment 1

8 years ago
This can be solved by changing template

list/table.html.tmpl

you need to add your custom field name (e.g. cf_xxx) to abbrev, and specify limits the same way as for other fields.

In my case this gives:

[% abbrev = 
  {
   .....
  "cf_global_status"  => { maxlength => 200 , ellipsis => "..." , wrap => 1 } ,
  }
(Assignee)

Comment 2

5 years ago
I want to work on this bug. Can anyone please tell me how to proceed?

Updated

4 years ago
Assignee: query-and-buglist → luckyk1592
Status: NEW → ASSIGNED
Summary: Large Text Box should have maxlength on buglist → Large Text Box should have maxlength and wrap => 1 in buglists
(Assignee)

Comment 3

4 years ago
Created attachment 8382461 [details] [diff] [review]
patch_v1.diff

Basically, 'nowrap' class should be used when all the following conditions are met:
1. col_abbrev.wrap attribute is undefined or zero(already present)
2. bug_field.$column.type is not FIELD_TYPE_FREETEXT(added in patch)
3. bug_field.$column.type is not FIELD_TYPE_TEXTAREA(added in patch)

Feel free to suggest any changes in patch.

Thanks,
Lalit
Attachment #8382461 - Flags: review?

Comment 4

4 years ago
Comment on attachment 8382461 [details] [diff] [review]
patch_v1.diff

>-    <td [% 'class="nowrap"' IF NOT col_abbrev.wrap %]
>+    <td [% 'class="nowrap"' IF NOT col_abbrev.wrap &&
>+          bug_fields.$column.type != constants.FIELD_TYPE_FREETEXT &&
>+          bug_fields.$column.type != constants.FIELD_TYPE_TEXTAREA %]
>         class="bz_[% column FILTER css_class_quote %]_column">

I just realized that <td> has two class="", which is not legal. Please merge them.


Your patch looks good, though, just need to merge both classes. :)
Attachment #8382461 - Flags: review? → review-
(Assignee)

Comment 5

4 years ago
Created attachment 8382548 [details] [diff] [review]
patch_v2.diff

Merged the two classes and also trucated the TEXTAREA field value with maxlength=>256
Attachment #8382461 - Attachment is obsolete: true
Attachment #8382548 - Flags: review?(LpSolit)

Comment 6

4 years ago
Comment on attachment 8382548 [details] [diff] [review]
patch_v2.diff

>+    <td class="bz_[% column FILTER css_class_quote %]_column [% 'nowrap' UNLESS

You should move [% 'nowrap' to its own line. This can be fixed on checkin.


Ideally, the full text should be in title="..." as we do with other truncated fields, but as the text can be quite huge, maybe that's not needed. So r=LpSolit
Attachment #8382548 - Flags: review?(LpSolit) → review+

Updated

4 years ago
Flags: approval?
Whiteboard: [Good Intro Bug]
Target Milestone: --- → Bugzilla 5.0
Flags: approval? → approval+

Comment 7

4 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified template/en/default/list/table.html.tmpl
Committed revision 8938.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.