If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Use the "required" attribute where appropriate

RESOLVED FIXED in Bugzilla 5.0

Status

()

Bugzilla
Bugzilla-General
--
enhancement
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Frédéric Buclin, Assigned: sjoshi)

Tracking

4.5.1
Bugzilla 5.0
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

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

Description

4 years ago
There are many fields which are required, e.g. when creating a new product, component, version, target milestone, flag, etc... The "name" field immediately comes to mind, but also the "description" field and some other fields such as the default assignee when creating a new component. For these fields, we should add the "required" HTML5 attribute so that the browser can notify the user before submission.
(Assignee)

Updated

4 years ago
Assignee: general → joshi_sunil
(Assignee)

Comment 1

4 years ago
Created attachment 8365222 [details] [diff] [review]
Patch-v1

Hope I have covered all of them. :).
Attachment #8365222 - Flags: review?(glob)
Comment on attachment 8365222 [details] [diff] [review]
Patch-v1

LpSolit said he's happy to review this.
Attachment #8365222 - Flags: review?(glob) → review?(LpSolit)
(Reporter)

Comment 3

4 years ago
Comment on attachment 8365222 [details] [diff] [review]
Patch-v1

>=== modified file 'template/en/default/account/prefs/account.html.tmpl'

>-        <input type="password" name="old_password">
>+        <input type="password" name="old_password" required>

The password is currently not required to change your real name. This may change in the future, but for now, it's optional.



>=== modified file 'template/en/default/admin/flag-type/edit.html.tmpl'

The sortkey is required too (that's silly, because it should fall back to 0, but it's required).



>=== modified file 'template/en/default/admin/keywords/create.html.tmpl'
>=== modified file 'template/en/default/admin/keywords/edit.html.tmpl'

The description is also required.



>=== modified file 'template/en/default/admin/users/userdata.html.tmpl'

>+             value="" autocomplete="off" [% 'required' IF !editform %] >

Remove the extra whitespace before >.



>=== modified file 'template/en/default/global/userselect.html.tmpl'

>+  # mandatory: optional, if its a mandatory

Write this: optional; if true, the field cannot be empty.


I didn't check if we fixed all the places, but this looks good. :)
Attachment #8365222 - Flags: review?(LpSolit) → review-
(Assignee)

Comment 4

4 years ago
Created attachment 8388074 [details] [diff] [review]
Patch-v2

Review comments incorporated.
Attachment #8365222 - Attachment is obsolete: true
Attachment #8388074 - Flags: review?(LpSolit)
(Reporter)

Comment 5

4 years ago
Comment on attachment 8388074 [details] [diff] [review]
Patch-v2

>=== modified file 'template/en/default/account/email/confirm-new.html.tmpl'

>-        <input type="password" id="passwd1" name="passwd1" value="">
>+        <input type="password" id="passwd1" name="passwd1" value="" required>

Nit: there are several places where the useless value="" is set. It could be safely removed, but leaving it alone is fine.



>=== modified file 'template/en/default/admin/keywords/create.html.tmpl'

>           wrap    = 'virtual'
>+          mandatory      = 1

The indentation of = 1 is a bit weird.


r=LpSolit
Attachment #8388074 - Flags: review?(LpSolit) → review+
(Reporter)

Updated

4 years ago
Status: NEW → ASSIGNED
Flags: approval?
Flags: approval? → approval+
(Reporter)

Comment 6

4 years ago
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   d9cd470..165689a  master -> master
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.